1window.org=window.org||{};org.apache=org.apache||{};org.apache.myfaces=org.apache.myfaces||{};if(!org.apache.myfaces.Popup){org.apache.myfaces.popupFrameUnder=null;org.apache.myfaces.popupCurrentlyOpenedPopup=null;org.apache.myfaces.Popup=function(A,C,B){this.popupId=A;this.displayAtDistanceX=C;this.displayAtDistanceY=B;this.isIE6=document.all&&!window.opera&&!window.XMLHttpRequest;};org.apache.myfaces.Popup.prototype.display=function(B){if(org.apache.myfaces.popupCurrentlyOpenedPopup!=null){org.apache.myfaces.popupCurrentlyOpenedPopup.style.display="none";}var A;var D;if(window.event){if(org.apache.myfaces.popupFrameUnder!=null){org.apache.myfaces.popupFrameUnder.style.display="none";}A=window.event.clientX;A+=this.popupGetScrollingX();D=window.event.clientY;D+=this.popupGetScrollingY();}else{A=B.pageX;D=B.pageY;}A+=this.displayAtDistanceX;D+=this.displayAtDistanceY;var C=document.getElementById(this.popupId);if(C.style.display!="block"){C.style.display="block";C.style.left=""+A+"px";C.style.top=""+D+"px";org.apache.myfaces.popupCurrentlyOpenedPopup=C;}this.ieIFrameFix();};org.apache.myfaces.Popup.prototype.hide=function(){var A=document.getElementById(this.popupId);A.style.display="none";if(document.all&&(org.apache.myfaces.popupFrameUnder!=null)){org.apache.myfaces.popupFrameUnder.style.display="none";}this.ieIFrameFix();};org.apache.myfaces.Popup.prototype.redisplay=function(){var A=document.getElementById(this.popupId);A.style.display="block";org.apache.myfaces.popupCurrentlyOpenedPopup=A;this.ieIFrameFix();};org.apache.myfaces.Popup.prototype.popupGetScrollingX=function(){if(self.pageXOffset){return self.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft;}else{if(document.body){return document.body.scrollLeft;}else{return 0;}}}};org.apache.myfaces.Popup.prototype.popupGetScrollingY=function(){if(self.pageYOffset){return self.pageYOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else{if(document.body){return document.body.scrollTop;}else{return 0;}}}};org.apache.myfaces.Popup.prototype.ieIFrameFix=function(){if(this.isIE6){if(org.apache.myfaces.popupCurrentlyOpenedPopup==null){return false;}var B=document.getElementById(org.apache.myfaces.popupCurrentlyOpenedPopup.id+"_IFRAME");if(B==null){org.apache.myfaces.popupFrameUnder=document.createElement("<iframe src='javascript:false;' id='"+org.apache.myfaces.popupCurrentlyOpenedPopup.id+"_IFRAME' style='visibility:hidden; position: absolute; top:0px;left:0px; filter:alpha(Opacity=0);' frameborder='0' scroll='none' />");document.body.insertBefore(org.apache.myfaces.popupFrameUnder);}else{org.apache.myfaces.popupFrameUnder=B;}var A=org.apache.myfaces.popupCurrentlyOpenedPopup;B=org.apache.myfaces.popupFrameUnder;if(A!=null&&(A.style.display=="block")){A.style.zIndex=99;B.style.zIndex=A.style.zIndex-1;B.style.width=A.offsetWidth;B.style.height=A.offsetHeight;B.style.top=A.style.top;B.style.left=A.style.left;B.style.marginTop=A.style.marginTop;B.style.marginLeft=A.style.marginLeft;B.style.marginRight=A.style.marginRight;B.style.marginBottem=A.style.marginBottom;B.style.display="block";B.style.visibility="visible";}else{B.style.display="none";}}return false;};}/*! jQuery UI - v1.13.0 - 2021-09-05 2* http://jqueryui.com 3* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js 4* Copyright jQuery Foundation and other contributors; Licensed MIT */
5(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}})(function(ax){ax.ui=ax.ui||{};var F=ax.ui.version="1.13.0"; 6/*! 7 * jQuery UI Widget 1.13.0 8 * http://jqueryui.com 9 * 10 * Copyright jQuery Foundation and other contributors 11 * Released under the MIT license. 12 * http://jquery.org/license 13 */ 14var P=0;var av=Array.prototype.hasOwnProperty;var ay=Array.prototype.slice;ax.cleanData=(function(aK){return function(aL){var aN,aO,aM;for(aM=0;(aO=aL[aM])!=null;aM++){aN=ax._data(aO,"events");if(aN&&aN.remove){ax(aO).triggerHandler("remove")}}aK(aL)}})(ax.cleanData);ax.widget=function(aK,aL,aS){var aQ,aN,aR;var aM={};var aP=aK.split(".")[0];aK=aK.split(".")[1];var aO=aP+"-"+aK;if(!aS){aS=aL;aL=ax.Widget}if(Array.isArray(aS)){aS=ax.extend.apply(null,[{}].concat(aS))}ax.expr.pseudos[aO.toLowerCase()]=function(aT){return !!ax.data(aT,aO)};ax[aP]=ax[aP]||{};aQ=ax[aP][aK];aN=ax[aP][aK]=function(aT,aU){if(!this._createWidget){return new aN(aT,aU)}if(arguments.length){this._createWidget(aT,aU)}};ax.extend(aN,aQ,{version:aS.version,_proto:ax.extend({},aS),_childConstructors:[]});aR=new aL();aR.options=ax.widget.extend({},aR.options);ax.each(aS,function(aU,aT){if(typeof aT!=="function"){aM[aU]=aT;return}aM[aU]=(function(){function aV(){return aL.prototype[aU].apply(this,arguments)}function aW(aX){return aL.prototype[aU].apply(this,aX)}return function(){var aZ=this._super;var aX=this._superApply;var aY;this._super=aV;this._superApply=aW;aY=aT.apply(this,arguments);this._super=aZ;this._superApply=aX;return aY}})()});aN.prototype=ax.widget.extend(aR,{widgetEventPrefix:aQ?(aR.widgetEventPrefix||aK):aK},aM,{constructor:aN,namespace:aP,widgetName:aK,widgetFullName:aO});if(aQ){ax.each(aQ._childConstructors,function(aU,aV){var aT=aV.prototype;ax.widget(aT.namespace+"."+aT.widgetName,aN,aV._proto)});delete aQ._childConstructors}else{aL._childConstructors.push(aN)}ax.widget.bridge(aK,aN);return aN};ax.widget.extend=function(aP){var aL=ay.call(arguments,1);var aO=0;var aK=aL.length;var aM;var aN;for(;aO<aK;aO++){for(aM in aL[aO]){aN=aL[aO][aM];if(av.call(aL[aO],aM)&&aN!==undefined){if(ax.isPlainObject(aN)){aP[aM]=ax.isPlainObject(aP[aM])?ax.widget.extend({},aP[aM],aN):ax.widget.extend({},aN)}else{aP[aM]=aN}}}}return aP};ax.widget.bridge=function(aL,aK){var aM=aK.prototype.widgetFullName||aL;ax.fn[aL]=function(aP){var aN=typeof aP==="string";var aO=ay.call(arguments,1);var aQ=this;if(aN){if(!this.length&&aP==="instance"){aQ=undefined}else{this.each(function(){var aS;var aR=ax.data(this,aM);if(aP==="instance"){aQ=aR;return false}if(!aR){return ax.error("cannot call methods on "+aL+" prior to initialization; attempted to call method '"+aP+"'")}if(typeof aR[aP]!=="function"||aP.charAt(0)==="_"){return ax.error("no such method '"+aP+"' for "+aL+" widget instance")}aS=aR[aP].apply(aR,aO);if(aS!==aR&&aS!==undefined){aQ=aS&&aS.jquery?aQ.pushStack(aS.get()):aS;return false}})}}else{if(aO.length){aP=ax.widget.extend.apply(null,[aP].concat(aO))}this.each(function(){var aR=ax.data(this,aM);if(aR){aR.option(aP||{});if(aR._init){aR._init()}}else{ax.data(this,aM,new aK(aP,this))}})}return aQ}};ax.Widget=function(){};ax.Widget._childConstructors=[];ax.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(aK,aL){aL=ax(aL||this.defaultElement||this)[0];this.element=ax(aL);this.uuid=P++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=ax();this.hoverable=ax();this.focusable=ax();this.classesElementLookup={};if(aL!==this){ax.data(aL,this.widgetFullName,this);this._on(true,this.element,{remove:function(aM){if(aM.target===aL){this.destroy()}}});this.document=ax(aL.style?aL.ownerDocument:aL.document||aL);this.window=ax(this.document[0].defaultView||this.document[0].parentWindow)}this.options=ax.widget.extend({},this.options,this._getCreateOptions(),aK);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:ax.noop,_create:ax.noop,_init:ax.noop,destroy:function(){var aK=this;this._destroy();ax.each(this.classesElementLookup,function(aL,aM){aK._removeClass(aM,aL)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:ax.noop,widget:function(){return this.element},option:function(aN,aO){var aK=aN;var aP;var aM;var aL;
14if(arguments.length===0){return ax.widget.extend({},this.options)}if(typeof aN==="string"){aK={};aP=aN.split(".");aN=aP.shift();if(aP.length){aM=aK[aN]=ax.widget.extend({},this.options[aN]);for(aL=0;aL<aP.length-1;aL++){aM[aP[aL]]=aM[aP[aL]]||{};aM=aM[aP[aL]]}aN=aP.pop();if(arguments.length===1){return aM[aN]===undefined?null:aM[aN]}aM[aN]=aO}else{if(arguments.length===1){return this.options[aN]===undefined?null:this.options[aN]}aK[aN]=aO}}this._setOptions(aK);return this},_setOptions:function(aK){var aL;for(aL in aK){this._setOption(aL,aK[aL])}return this},_setOption:function(aK,aL){if(aK==="classes"){this._setOptionClasses(aL)}this.options[aK]=aL;if(aK==="disabled"){this._setOptionDisabled(aL)}return this},_setOptionClasses:function(aN){var aK,aM,aL;for(aK in aN){aL=this.classesElementLookup[aK];if(aN[aK]===this.options.classes[aK]||!aL||!aL.length){continue}aM=ax(aL.get());this._removeClass(aL,aK);aM.addClass(this._classes({element:aM,keys:aK,classes:aN,add:true}))}},_setOptionDisabled:function(aK){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!aK);if(aK){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_classes:function(aL){var aM=[];var aN=this;aL=ax.extend({element:this.element,classes:this.options.classes||{}},aL);function aK(){aL.element.each(function(aQ,aR){var aP=ax.map(aN.classesElementLookup,function(aS){return aS}).some(function(aS){return aS.is(aR)});if(!aP){aN._on(ax(aR),{remove:"_untrackClassesElement"})}})}function aO(aQ,aS){var aR,aP;for(aP=0;aP<aQ.length;aP++){aR=aN.classesElementLookup[aQ[aP]]||ax();if(aL.add){aK();aR=ax(ax.uniqueSort(aR.get().concat(aL.element.get())))}else{aR=ax(aR.not(aL.element).get())}aN.classesElementLookup[aQ[aP]]=aR;aM.push(aQ[aP]);if(aS&&aL.classes[aQ[aP]]){aM.push(aL.classes[aQ[aP]])}}}if(aL.keys){aO(aL.keys.match(/\S+/g)||[],true)}if(aL.extra){aO(aL.extra.match(/\S+/g)||[])}return aM.join(" ")},_untrackClassesElement:function(aL){var aK=this;ax.each(aK.classesElementLookup,function(aM,aN){if(ax.inArray(aL.target,aN)!==-1){aK.classesElementLookup[aM]=ax(aN.not(aL.target).get())}});this._off(ax(aL.target))},_removeClass:function(aL,aM,aK){return this._toggleClass(aL,aM,aK,false)},_addClass:function(aL,aM,aK){return this._toggleClass(aL,aM,aK,true)},_toggleClass:function(aN,aO,aK,aP){aP=(typeof aP==="boolean")?aP:aK;var aL=(typeof aN==="string"||aN===null),aM={extra:aL?aO:aK,keys:aL?aN:aO,element:aL?this.element:aN,add:aP};aM.element.toggleClass(this._classes(aM),aP);return this},_on:function(aN,aM,aL){var aO;var aK=this;if(typeof aN!=="boolean"){aL=aM;aM=aN;aN=false}if(!aL){aL=aM;aM=this.element;aO=this.widget()}else{aM=aO=ax(aM);this.bindings=this.bindings.add(aM)}ax.each(aL,function(aU,aT){function aR(){if(!aN&&(aK.options.disabled===true||ax(this).hasClass("ui-state-disabled"))){return}return(typeof aT==="string"?aK[aT]:aT).apply(aK,arguments)}if(typeof aT!=="string"){aR.guid=aT.guid=aT.guid||aR.guid||ax.guid++}var aS=aU.match(/^([\w:-]*)\s*(.*)$/);var aQ=aS[1]+aK.eventNamespace;var aP=aS[2];if(aP){aO.on(aQ,aP,aR)}else{aM.on(aQ,aR)}})},_off:function(aL,aK){aK=(aK||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;aL.off(aK);this.bindings=ax(this.bindings.not(aL).get());this.focusable=ax(this.focusable.not(aL).get());this.hoverable=ax(this.hoverable.not(aL).get())},_delay:function(aN,aM){function aL(){return(typeof aN==="string"?aK[aN]:aN).apply(aK,arguments)}var aK=this;return setTimeout(aL,aM||0)},_hoverable:function(aK){this.hoverable=this.hoverable.add(aK);this._on(aK,{mouseenter:function(aL){this._addClass(ax(aL.currentTarget),null,"ui-state-hover")},mouseleave:function(aL){this._removeClass(ax(aL.currentTarget),null,"ui-state-hover")}})},_focusable:function(aK){this.focusable=this.focusable.add(aK);this._on(aK,{focusin:function(aL){this._addClass(ax(aL.currentTarget),null,"ui-state-focus")},focusout:function(aL){this._removeClass(ax(aL.currentTarget),null,"ui-state-focus")}})},_trigger:function(aK,aL,aM){var aP,aO;var aN=this.options[aK];aM=aM||{};aL=ax.Event(aL);aL.type=(aK===this.widgetEventPrefix?aK:this.widgetEventPrefix+aK).toLowerCase();aL.target=this.element[0];aO=aL.originalEvent;if(aO){for(aP in aO){if(!(aP in aL)){aL[aP]=aO[aP]}}}this.element.trigger(aL,aM);return !(typeof aN==="function"&&aN.apply(this.element[0],[aL].concat(aM))===false||aL.isDefaultPrevented())}};ax.each({show:"fadeIn",hide:"fadeOut"},function(aL,aK){ax.Widget.prototype["_"+aL]=function(aO,aN,aQ){if(typeof aN==="string"){aN={effect:aN}}var aP;var aM=!aN?aL:aN===true||typeof aN==="number"?aK:aN.effect||aK;aN=aN||{};if(typeof aN==="number"){aN={duration:aN}}else{if(aN===true){aN={}}}aP=!ax.isEmptyObject(aN);aN.complete=aQ;if(aN.delay){aO.delay(aN.delay)}
14if(aP&&ax.effects&&ax.effects.effect[aM]){aO[aL](aN)}else{if(aM!==aL&&aO[aM]){aO[aM](aN.duration,aN.easing,aQ)}else{aO.queue(function(aR){ax(this)[aL]();if(aQ){aQ.call(aO[0])}aR()})}}}});var l=ax.widget; 15/*! 16 * jQuery UI Position 1.13.0 17 * http://jqueryui.com 18 * 19 * Copyright jQuery Foundation and other contributors 20 * Released under the MIT license. 21 * http://jquery.org/license 22 * 23 * http://api.jqueryui.com/position/ 24 */ 25(function(){var aS,aT=Math.max,aW=Math.abs,aN=/left|center|right/,aQ=/top|center|bottom/,aL=/[\+\-]\d+(\.[\d]+)?%?/,aU=/^\w+/,aM=/%$/,aP=ax.fn.position;function aV(aZ,aY,aX){return[parseFloat(aZ[0])*(aM.test(aZ[0])?aY/100:1),parseFloat(aZ[1])*(aM.test(aZ[1])?aX/100:1)]}function aR(aX,aY){return parseInt(ax.css(aX,aY),10)||0}function aK(aX){return aX!=null&&aX===aX.window}function aO(aY){var aX=aY[0];if(aX.nodeType===9){return{width:aY.width(),height:aY.height(),offset:{top:0,left:0}}}if(aK(aX)){return{width:aY.width(),height:aY.height(),offset:{top:aY.scrollTop(),left:aY.scrollLeft()}}}if(aX.preventDefault){return{width:0,height:0,offset:{top:aX.pageY,left:aX.pageX}}}return{width:aY.outerWidth(),height:aY.outerHeight(),offset:aY.offset()}}ax.position={scrollbarWidth:function(){if(aS!==undefined){return aS}var aY,aX,a0=ax("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),aZ=a0.children()[0];ax("body").append(a0);aY=aZ.offsetWidth;a0.css("overflow","scroll");aX=aZ.offsetWidth;if(aY===aX){aX=a0[0].clientWidth}a0.remove();return(aS=aY-aX)},getScrollInfo:function(a1){var a0=a1.isWindow||a1.isDocument?"":a1.element.css("overflow-x"),aZ=a1.isWindow||a1.isDocument?"":a1.element.css("overflow-y"),aY=a0==="scroll"||(a0==="auto"&&a1.width<a1.element[0].scrollWidth),aX=aZ==="scroll"||(aZ==="auto"&&a1.height<a1.element[0].scrollHeight);return{width:aX?ax.position.scrollbarWidth():0,height:aY?ax.position.scrollbarWidth():0}},getWithinInfo:function(aY){var a0=ax(aY||window),aZ=aK(a0[0]),a1=!!a0[0]&&a0[0].nodeType===9,aX=!aZ&&!a1;return{element:a0,isWindow:aZ,isDocument:a1,offset:aX?ax(aY).offset():{left:0,top:0},scrollLeft:a0.scrollLeft(),scrollTop:a0.scrollTop(),width:a0.outerWidth(),height:a0.outerHeight()}}};ax.fn.position=function(a7){if(!a7||!a7.of){return aP.apply(this,arguments)}a7=ax.extend({},a7);var a8,a4,a2,a6,a1,aX,a3=typeof a7.of==="string"?ax(document).find(a7.of):ax(a7.of),a0=ax.position.getWithinInfo(a7.within),aY=ax.position.getScrollInfo(a0),a5=(a7.collision||"flip").split(" "),aZ={};aX=aO(a3);if(a3[0].preventDefault){a7.at="left top"}a4=aX.width;a2=aX.height;a6=aX.offset;a1=ax.extend({},a6);ax.each(["my","at"],function(){var bb=(a7[this]||"").split(" "),ba,a9;if(bb.length===1){bb=aN.test(bb[0])?bb.concat(["center"]):aQ.test(bb[0])?["center"].concat(bb):["center","center"]}bb[0]=aN.test(bb[0])?bb[0]:"center";bb[1]=aQ.test(bb[1])?bb[1]:"center";ba=aL.exec(bb[0]);a9=aL.exec(bb[1]);aZ[this]=[ba?ba[0]:0,a9?a9[0]:0];a7[this]=[aU.exec(bb[0])[0],aU.exec(bb[1])[0]]});if(a5.length===1){a5[1]=a5[0]}if(a7.at[0]==="right"){a1.left+=a4}else{if(a7.at[0]==="center"){a1.left+=a4/2}}if(a7.at[1]==="bottom"){a1.top+=a2}else{if(a7.at[1]==="center"){a1.top+=a2/2}}a8=aV(aZ.at,a4,a2);a1.left+=a8[0];a1.top+=a8[1];return this.each(function(){var ba,bj,bc=ax(this),be=bc.outerWidth(),bb=bc.outerHeight(),bd=aR(this,"marginLeft"),a9=aR(this,"marginTop"),bi=be+bd+aR(this,"marginRight")+aY.width,bh=bb+a9+aR(this,"marginBottom")+aY.height,bf=ax.extend({},a1),bg=aV(aZ.my,bc.outerWidth(),bc.outerHeight());if(a7.my[0]==="right"){bf.left-=be}else{if(a7.my[0]==="center"){bf.left-=be/2}}if(a7.my[1]==="bottom"){bf.top-=bb}else{if(a7.my[1]==="center"){bf.top-=bb/2}}bf.left+=bg[0];bf.top+=bg[1];ba={marginLeft:bd,marginTop:a9};ax.each(["left","top"],function(bl,bk){if(ax.ui.position[a5[bl]]){ax.ui.position[a5[bl]][bk](bf,{targetWidth:a4,targetHeight:a2,elemWidth:be,elemHeight:bb,collisionPosition:ba,collisionWidth:bi,collisionHeight:bh,offset:[a8[0]+bg[0],a8[1]+bg[1]],my:a7.my,at:a7.at,within:a0,elem:bc})}});if(a7.using){bj=function(bn){var bp=a6.left-bf.left,bm=bp+a4-be,bo=a6.top-bf.top,bl=bo+a2-bb,bk={target:{element:a3,left:a6.left,top:a6.top,width:a4,height:a2}
25,element:{element:bc,left:bf.left,top:bf.top,width:be,height:bb},horizontal:bm<0?"left":bp>0?"right":"center",vertical:bl<0?"top":bo>0?"bottom":"middle"};if(a4<be&&aW(bp+bm)<a4){bk.horizontal="center"}if(a2<bb&&aW(bo+bl)<a2){bk.vertical="middle"}if(aT(aW(bp),aW(bm))>aT(aW(bo),aW(bl))){bk.important="horizontal"}else{bk.important="vertical"}a7.using.call(this,bn,bk)}}bc.offset(ax.extend(bf,{using:bj}))})};ax.ui.position={fit:{left:function(a1,a0){var aZ=a0.within,a3=aZ.isWindow?aZ.scrollLeft:aZ.offset.left,a5=aZ.width,a2=a1.left-a0.collisionPosition.marginLeft,a4=a3-a2,aY=a2+a0.collisionWidth-a5-a3,aX;if(a0.collisionWidth>a5){if(a4>0&&aY<=0){aX=a1.left+a4+a0.collisionWidth-a5-a3;a1.left+=a4-aX}else{if(aY>0&&a4<=0){a1.left=a3}else{if(a4>aY){a1.left=a3+a5-a0.collisionWidth}else{a1.left=a3}}}}else{if(a4>0){a1.left+=a4}else{if(aY>0){a1.left-=aY}else{a1.left=aT(a1.left-a2,a1.left)}}}},top:function(a0,aZ){var aY=aZ.within,a4=aY.isWindow?aY.scrollTop:aY.offset.top,a5=aZ.within.height,a2=a0.top-aZ.collisionPosition.marginTop,a3=a4-a2,a1=a2+aZ.collisionHeight-a5-a4,aX;if(aZ.collisionHeight>a5){if(a3>0&&a1<=0){aX=a0.top+a3+aZ.collisionHeight-a5-a4;a0.top+=a3-aX}else{if(a1>0&&a3<=0){a0.top=a4}else{if(a3>a1){a0.top=a4+a5-aZ.collisionHeight}else{a0.top=a4}}}}else{if(a3>0){a0.top+=a3}else{if(a1>0){a0.top-=a1}else{a0.top=aT(a0.top-a2,a0.top)}}}}},flip:{left:function(a3,a2){var a1=a2.within,a7=a1.offset.left+a1.scrollLeft,ba=a1.width,aZ=a1.isWindow?a1.scrollLeft:a1.offset.left,a4=a3.left-a2.collisionPosition.marginLeft,a8=a4-aZ,aY=a4+a2.collisionWidth-ba-aZ,a6=a2.my[0]==="left"?-a2.elemWidth:a2.my[0]==="right"?a2.elemWidth:0,a9=a2.at[0]==="left"?a2.targetWidth:a2.at[0]==="right"?-a2.targetWidth:0,a0=-2*a2.offset[0],aX,a5;if(a8<0){aX=a3.left+a6+a9+a0+a2.collisionWidth-ba-a7;if(aX<0||aX<aW(a8)){a3.left+=a6+a9+a0}}else{if(aY>0){a5=a3.left-a2.collisionPosition.marginLeft+a6+a9+a0-aZ;if(a5>0||aW(a5)<aY){a3.left+=a6+a9+a0}}}},top:function(a2,a1){var a0=a1.within,a9=a0.offset.top+a0.scrollTop,ba=a0.height,aX=a0.isWindow?a0.scrollTop:a0.offset.top,a4=a2.top-a1.collisionPosition.marginTop,a6=a4-aX,a3=a4+a1.collisionHeight-ba-aX,a7=a1.my[1]==="top",a5=a7?-a1.elemHeight:a1.my[1]==="bottom"?a1.elemHeight:0,bb=a1.at[1]==="top"?a1.targetHeight:a1.at[1]==="bottom"?-a1.targetHeight:0,aZ=-2*a1.offset[1],a8,aY;if(a6<0){aY=a2.top+a5+bb+aZ+a1.collisionHeight-ba-a9;if(aY<0||aY<aW(a6)){a2.top+=a5+bb+aZ}}else{if(a3>0){a8=a2.top-a1.collisionPosition.marginTop+a5+bb+aZ-aX;if(a8>0||aW(a8)<a3){a2.top+=a5+bb+aZ}}}}},flipfit:{left:function(){ax.ui.position.flip.left.apply(this,arguments);ax.ui.position.fit.left.apply(this,arguments)},top:function(){ax.ui.position.flip.top.apply(this,arguments);ax.ui.position.fit.top.apply(this,arguments)}}}})();var ar=ax.ui.position; 26/*! 27 * jQuery UI :data 1.13.0 28 * http://jqueryui.com 29 * 30 * Copyright jQuery Foundation and other contributors 31 * Released under the MIT license. 32 * http://jquery.org/license 33 */ 34var s=ax.extend(ax.expr.pseudos,{data:ax.expr.createPseudo?ax.expr.createPseudo(function(aK){return function(aL){return !!ax.data(aL,aK)}}):function(aM,aL,aK){return !!ax.data(aM,aK[3])}}); 35/*! 36 * jQuery UI Disable Selection 1.13.0 37 * http://jqueryui.com 38 * 39 * Copyright jQuery Foundation and other contributors 40 * Released under the MIT license. 41 * http://jquery.org/license 42 */ 43var o=ax.fn.extend({disableSelection:(function(){var aK="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(aK+".ui-disableSelection",function(aL){aL.preventDefault()})}})(),enableSelection:function(){return this.off(".ui-disableSelection")}}); 44/*! 45 * jQuery UI Focusable 1.13.0 46 * http://jqueryui.com 47 * 48 * Copyright jQuery Foundation and other contributors 49 * Released under the MIT license. 50 * http://jquery.org/license 51 */ 52ax.ui.focusable=function(aN,aL){var aQ,aO,aM,aP,aK,aR=aN.nodeName.toLowerCase();if("area"===aR){aQ=aN.parentNode;aO=aQ.name;if(!aN.href||!aO||aQ.nodeName.toLowerCase()!=="map"){return false}aM=ax("img[usemap='#"+aO+"']");return aM.length>0&&aM.is(":visible")}if(/^(input|select|textarea|button|object)$/.test(aR)){aP=!aN.disabled;if(aP){aK=ax(aN).closest("fieldset")[0];if(aK){aP=!aK.disabled}}}else{if("a"===aR){aP=aN.href||aL}else{aP=aL}}return aP&&ax(aN).is(":visible")&&q(ax(aN))};function q(aL){var aK=aL.css("visibility");while(aK==="inherit"){aL=aL.parent();aK=aL.css("visibility")}return aK==="visible"}ax.extend(ax.expr.pseudos,{focusable:function(aK){return ax.ui.focusable(aK,ax.attr(aK,"tabindex")!=null)}});var aG=ax.ui.focusable;var h=ax.fn._form=function(){return typeof this[0].form==="string"?this.closest("form"):ax(this[0].form)}; 53/*! 54 * jQuery UI Form Reset Mixin 1.13.0 55 * http://jqueryui.com 56 * 57 * Copyright jQuery Foundation and other contributors 58 * Released under the MIT license. 59 * http://jquery.org/license 60 */ 61var V=ax.ui.formResetMixin={_formResetHandler:function(){var aK=ax(this);setTimeout(function(){var aL=aK.data("ui-form-reset-instances");ax.each(aL,function(){this.refresh()})})},_bindFormResetHandler:function(){this.form=this.element._form();if(!this.form.length){return}var aK=this.form.data("ui-form-reset-instances")||[];if(!aK.length){this.form.on("reset.ui-form-reset",this._formResetHandler)}aK.push(this);this.form.data("ui-form-reset-instances",aK)},_unbindFormResetHandler:function(){if(!this.form.length){return}var aK=this.form.data("ui-form-reset-instances");aK.splice(ax.inArray(this,aK),1);if(aK.length){this.form.data("ui-form-reset-instances",aK)}else{this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}; 62/*!
63 * jQuery UI Keycode 1.13.0 64 * http://jqueryui.com 65 * 66 * Copyright jQuery Foundation and other contributors 67 * Released under the MIT license. 68 * http://jquery.org/license 69 */ 70var p=ax.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}; 71/*! 72 * jQuery UI Labels 1.13.0 73 * http://jqueryui.com 74 * 75 * Copyright jQuery Foundation and other contributors 76 * Released under the MIT license. 77 * http://jquery.org/license 78 */ 79var az=ax.fn.labels=function(){var aL,aK,aO,aN,aM;if(!this.length){return this.pushStack([])}if(this[0].labels&&this[0].labels.length){return this.pushStack(this[0].labels)}aN=this.eq(0).parents("label");aO=this.attr("id");if(aO){aL=this.eq(0).parents().last();aM=aL.add(aL.length?aL.siblings():this.siblings());aK="label[for='"+ax.escapeSelector(aO)+"']";aN=aN.add(aM.find(aK).addBack(aK))}return this.pushStack(aN)}; 80/*! 81 * jQuery UI Scroll Parent 1.13.0 82 * http://jqueryui.com 83 * 84 * Copyright jQuery Foundation and other contributors 85 * Released under the MIT license. 86 * http://jquery.org/license 87 */ 88var ah=ax.fn.scrollParent=function(aM){var aL=this.css("position"),aK=aL==="absolute",aN=aM?/(auto|scroll|hidden)/:/(auto|scroll)/,aO=this.parents().filter(function(){var aP=ax(this);if(aK&&aP.css("position")==="static"){return false}return aN.test(aP.css("overflow")+aP.css("overflow-y")+aP.css("overflow-x"))}).eq(0);return aL==="fixed"||!aO.length?ax(this[0].ownerDocument||document):aO}; 89/*! 90 * jQuery UI Tabbable 1.13.0 91 * http://jqueryui.com 92 * 93 * Copyright jQuery Foundation and other contributors 94 * Released under the MIT license. 95 * http://jquery.org/license 96 */ 97var f=ax.extend(ax.expr.pseudos,{tabbable:function(aM){var aL=ax.attr(aM,"tabindex"),aK=aL!=null;return(!aK||aL>=0)&&ax.ui.focusable(aM,aK)}}); 98/*! 99 * jQuery UI Unique ID 1.13.0 100 * http://jqueryui.com 101 * 102 * Copyright jQuery Foundation and other contributors 103 * Released under the MIT license. 104 * http://jquery.org/license 105 */ 106var ai=ax.fn.extend({uniqueId:(function(){var aK=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++aK)}})}})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){ax(this).removeAttr("id")}})}});var T=ax.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); 107/*! 108 * jQuery UI Mouse 1.13.0 109 * http://jqueryui.com 110 * 111 * Copyright jQuery Foundation and other contributors 112 * Released under the MIT license. 113 * http://jquery.org/license 114 */ 115var aj=false;ax(document).on("mouseup",function(){aj=false});var a=ax.widget("ui.mouse",{version:"1.13.0",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var aK=this;this.element.on("mousedown."+this.widgetName,function(aL){return aK._mouseDown(aL)}).on("click."+this.widgetName,function(aL){if(true===ax.data(aL.target,aK.widgetName+".preventClickEvent")){ax.removeData(aL.target,aK.widgetName+".preventClickEvent");aL.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(aM){if(aj){return}this._mouseMoved=false;if(this._mouseStarted){this._mouseUp(aM)}this._mouseDownEvent=aM;var aL=this,aN=(aM.which===1),aK=(typeof this.options.cancel==="string"&&aM.target.nodeName?ax(aM.target).closest(this.options.cancel).length:false);if(!aN||aK||!this._mouseCapture(aM)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){aL.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(aM)&&this._mouseDelayMet(aM)){this._mouseStarted=(this._mouseStart(aM)!==false);if(!this._mouseStarted){aM.preventDefault();return true}}if(true===ax.data(aM.target,this.widgetName+".preventClickEvent")){ax.removeData(aM.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(aO){return aL._mouseMove(aO)};this._mouseUpDelegate=function(aO){return aL._mouseUp(aO)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);aM.preventDefault();aj=true;return true},_mouseMove:function(aK){if(this._mouseMoved){if(ax.ui.ie&&(!document.documentMode||document.documentMode<9)&&!aK.button){return this._mouseUp(aK)}else{if(!aK.which){if(aK.originalEvent.altKey||aK.originalEvent.ctrlKey||aK.originalEvent.metaKey||aK.originalEvent.shiftKey){this.ignoreMissingWhich=true}else{if(!this.ignoreMissingWhich){return this._mouseUp(aK)}}}}}if(aK.which||aK.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(aK);return aK.preventDefault()}if(this._mouseDistanceMet(aK)&&this._mouseDelayMet(aK)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,aK)!==false);
115if(this._mouseStarted){this._mouseDrag(aK)}else{this._mouseUp(aK)}}return !this._mouseStarted},_mouseUp:function(aK){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(aK.target===this._mouseDownEvent.target){ax.data(aK.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(aK)}if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;aj=false;aK.preventDefault()},_mouseDistanceMet:function(aK){return(Math.max(Math.abs(this._mouseDownEvent.pageX-aK.pageX),Math.abs(this._mouseDownEvent.pageY-aK.pageY))>=this.options.distance)},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});var M=ax.ui.plugin={add:function(aL,aM,aO){var aK,aN=ax.ui[aL].prototype;for(aK in aO){aN.plugins[aK]=aN.plugins[aK]||[];aN.plugins[aK].push([aM,aO[aK]])}},call:function(aK,aN,aM,aL){var aO,aP=aK.plugins[aN];if(!aP){return}if(!aL&&(!aK.element[0].parentNode||aK.element[0].parentNode.nodeType===11)){return}for(aO=0;aO<aP.length;aO++){if(aK.options[aP[aO][0]]){aP[aO][1].apply(aK.element,aM)}}}};var i=ax.ui.safeActiveElement=function(aK){var aM;try{aM=aK.activeElement}catch(aL){aM=aK.body}if(!aM){aM=aK.body}if(!aM.nodeName){aM=aK.body}return aM};var c=ax.ui.safeBlur=function(aK){if(aK&&aK.nodeName.toLowerCase()!=="body"){ax(aK).trigger("blur")}}; 116/*! 117 * jQuery UI Draggable 1.13.0 118 * http://jqueryui.com 119 * 120 * Copyright jQuery Foundation and other contributors 121 * Released under the MIT license. 122 * http://jquery.org/license 123 */ 124ax.widget("ui.draggable",ax.ui.mouse,{version:"1.13.0",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this._addClass("ui-draggable")}this._setHandleClassName();this._mouseInit()},_setOption:function(aK,aL){this._super(aK,aL);if(aK==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(aK){var aL=this.options;if(this.helper||aL.disabled||ax(aK.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(aK);if(!this.handle){return false}this._blurActiveElement(aK);this._blockFrames(aL.iframeFix===true?"iframe":aL.iframeFix);return true},_blockFrames:function(aK){this.iframeBlocks=this.document.find(aK).map(function(){var aL=ax(this);return ax("<div>").css("position","absolute").appendTo(aL.parent()).outerWidth(aL.outerWidth()).outerHeight(aL.outerHeight()).offset(aL.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(aL){var aK=ax.ui.safeActiveElement(this.document[0]),aM=ax(aL.target);if(aM.closest(aK).length){return}ax.ui.safeBlur(aK)},_mouseStart:function(aK){var aL=this.options;this.helper=this._createHelper(aK);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(ax.ui.ddmanager){ax.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return ax(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(aK);this.originalPosition=this.position=this._generatePosition(aK,false);this.originalPageX=aK.pageX;this.originalPageY=aK.pageY;if(aL.cursorAt){this._adjustOffsetFromHelper(aL.cursorAt)}this._setContainment();if(this._trigger("start",aK)===false){this._clear();return false}this._cacheHelperProportions();if(ax.ui.ddmanager&&!aL.dropBehaviour){ax.ui.ddmanager.prepareOffsets(this,aK)}this._mouseDrag(aK,true);if(ax.ui.ddmanager){ax.ui.ddmanager.dragStart(this,aK)}return true},_refreshOffsets:function(aK){this.offset={top:this.positionAbs.top-this.margins.top,left
124:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:aK.pageX-this.offset.left,top:aK.pageY-this.offset.top}},_mouseDrag:function(aK,aM){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(aK,true);this.positionAbs=this._convertPositionTo("absolute");if(!aM){var aL=this._uiHash();if(this._trigger("drag",aK,aL)===false){this._mouseUp(new ax.Event("mouseup",aK));return false}this.position=aL.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(ax.ui.ddmanager){ax.ui.ddmanager.drag(this,aK)}return false},_mouseStop:function(aL){var aK=this,aM=false;if(ax.ui.ddmanager&&!this.options.dropBehaviour){aM=ax.ui.ddmanager.drop(this,aL)}if(this.dropped){aM=this.dropped;this.dropped=false}if((this.options.revert==="invalid"&&!aM)||(this.options.revert==="valid"&&aM)||this.options.revert===true||(typeof this.options.revert==="function"&&this.options.revert.call(this.element,aM))){ax(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(aK._trigger("stop",aL)!==false){aK._clear()}})}else{if(this._trigger("stop",aL)!==false){this._clear()}}return false},_mouseUp:function(aK){this._unblockFrames();if(ax.ui.ddmanager){ax.ui.ddmanager.dragStop(this,aK)}if(this.handleElement.is(aK.target)){this.element.trigger("focus")}return ax.ui.mouse.prototype._mouseUp.call(this,aK)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new ax.Event("mouseup",{target:this.element[0]}))}else{this._clear()}return this},_getHandle:function(aK){return this.options.handle?!!ax(aK.target).closest(this.element.find(this.options.handle)).length:true},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(aL){var aN=this.options,aM=typeof aN.helper==="function",aK=aM?ax(aN.helper.apply(this.element[0],[aL])):(aN.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!aK.parents("body").length){aK.appendTo((aN.appendTo==="parent"?this.element[0].parentNode:aN.appendTo))}if(aM&&aK[0]===this.element[0]){this._setPositionRelative()}if(aK[0]!==this.element[0]&&!(/(fixed|absolute)/).test(aK.css("position"))){aK.css("position","absolute")}return aK},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(aK){if(typeof aK==="string"){aK=aK.split(" ")}if(Array.isArray(aK)){aK={left:+aK[0],top:+aK[1]||0}}if("left" in aK){this.offset.click.left=aK.left+this.margins.left}if("right" in aK){this.offset.click.left=this.helperProportions.width-aK.right+this.margins.left}if("top" in aK){this.offset.click.top=aK.top+this.margins.top}if("bottom" in aK){this.offset.click.top=this.helperProportions.height-aK.bottom+this.margins.top}},_isRootNode:function(aK){return(/(html|body)/i).test(aK.tagName)||aK===this.document[0]},_getParentOffset:function(){var aL=this.offsetParent.offset(),aK=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==aK&&ax.contains(this.scrollParent[0],this.offsetParent[0])){aL.left+=this.scrollParent.scrollLeft();aL.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){aL={top:0,left:0}}return{top:aL.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:aL.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var aK=this.element.position(),aL=this._isRootNode(this.scrollParent[0]);return{top:aK.top-(parseInt(this.helper.css("top"),10)||0)+(!aL?this.scrollParent.scrollTop():0),left:aK.left-(parseInt(this.helper.css("left"),10)||0)+(!aL?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var aL,aO,aM,aN=this.options,aK=this.document[0];this.relativeContainer=null;if(!aN.containment){this.containment=null;return}if(aN.containment==="window"){this.containment=[ax(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,ax(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,ax(window).scrollLeft()+ax(window).width()-this.helperProportions.width-this.margins.left,ax(window).scrollTop()+(ax(window).height()||aK.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(aN.containment==="document"){this.containment=[0,0,ax(aK).width()-this.helperProportions.width-this.margins.left,(ax(aK).height()||aK.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(aN.containment.constructor===Array){this.containment=aN.containment;return}if(aN.containment==="parent"){aN.containment=this.helper[0].parentNode}aO=ax(aN.containment);aM=aO[0];if(!aM){return}aL=/(scroll|auto)/.test(aO.css("overflow"));this.containment=[(parseInt(aO.css("borderLeftWidth"),10)||0)+(parseInt(aO.css("paddingLeft"),10)||0),(parseInt(aO.css("borderTopWidth"),
12410)||0)+(parseInt(aO.css("paddingTop"),10)||0),(aL?Math.max(aM.scrollWidth,aM.offsetWidth):aM.offsetWidth)-(parseInt(aO.css("borderRightWidth"),10)||0)-(parseInt(aO.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(aL?Math.max(aM.scrollHeight,aM.offsetHeight):aM.offsetHeight)-(parseInt(aO.css("borderBottomWidth"),10)||0)-(parseInt(aO.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=aO},_convertPositionTo:function(aL,aN){if(!aN){aN=this.position}var aK=aL==="absolute"?1:-1,aM=this._isRootNode(this.scrollParent[0]);return{top:(aN.top+this.offset.relative.top*aK+this.offset.parent.top*aK-((this.cssPosition==="fixed"?-this.offset.scroll.top:(aM?0:this.offset.scroll.top))*aK)),left:(aN.left+this.offset.relative.left*aK+this.offset.parent.left*aK-((this.cssPosition==="fixed"?-this.offset.scroll.left:(aM?0:this.offset.scroll.left))*aK))}},_generatePosition:function(aL,aR){var aK,aS,aT,aN,aM=this.options,aQ=this._isRootNode(this.scrollParent[0]),aP=aL.pageX,aO=aL.pageY;if(!aQ||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(aR){if(this.containment){if(this.relativeContainer){aS=this.relativeContainer.offset();aK=[this.containment[0]+aS.left,this.containment[1]+aS.top,this.containment[2]+aS.left,this.containment[3]+aS.top]}else{aK=this.containment}if(aL.pageX-this.offset.click.left<aK[0]){aP=aK[0]+this.offset.click.left}if(aL.pageY-this.offset.click.top<aK[1]){aO=aK[1]+this.offset.click.top}if(aL.pageX-this.offset.click.left>aK[2]){aP=aK[2]+this.offset.click.left}if(aL.pageY-this.offset.click.top>aK[3]){aO=aK[3]+this.offset.click.top}}if(aM.grid){aT=aM.grid[1]?this.originalPageY+Math.round((aO-this.originalPageY)/aM.grid[1])*aM.grid[1]:this.originalPageY;aO=aK?((aT-this.offset.click.top>=aK[1]||aT-this.offset.click.top>aK[3])?aT:((aT-this.offset.click.top>=aK[1])?aT-aM.grid[1]:aT+aM.grid[1])):aT;aN=aM.grid[0]?this.originalPageX+Math.round((aP-this.originalPageX)/aM.grid[0])*aM.grid[0]:this.originalPageX;aP=aK?((aN-this.offset.click.left>=aK[0]||aN-this.offset.click.left>aK[2])?aN:((aN-this.offset.click.left>=aK[0])?aN-aM.grid[0]:aN+aM.grid[0])):aN}if(aM.axis==="y"){aP=this.originalPageX}if(aM.axis==="x"){aO=this.originalPageY}}return{top:(aO-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(aQ?0:this.offset.scroll.top))),left:(aP-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(aQ?0:this.offset.scroll.left)))}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_trigger:function(aK,aL,aM){aM=aM||this._uiHash();ax.ui.plugin.call(this,aK,[aL,aM,this],true);
124if(/^(drag|start|stop)/.test(aK)){this.positionAbs=this._convertPositionTo("absolute");aM.offset=this.positionAbs}return ax.Widget.prototype._trigger.call(this,aK,aL,aM)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});ax.ui.plugin.add("draggable","connectToSortable",{start:function(aM,aN,aK){var aL=ax.extend({},aN,{item:aK.element});aK.sortables=[];ax(aK.options.connectToSortable).each(function(){var aO=ax(this).sortable("instance");if(aO&&!aO.options.disabled){aK.sortables.push(aO);aO.refreshPositions();aO._trigger("activate",aM,aL)}})},stop:function(aM,aN,aK){var aL=ax.extend({},aN,{item:aK.element});aK.cancelHelperRemoval=false;ax.each(aK.sortables,function(){var aO=this;if(aO.isOver){aO.isOver=0;aK.cancelHelperRemoval=true;aO.cancelHelperRemoval=false;aO._storedCSS={position:aO.placeholder.css("position"),top:aO.placeholder.css("top"),left:aO.placeholder.css("left")};aO._mouseStop(aM);aO.options.helper=aO.options._helper}else{aO.cancelHelperRemoval=true;aO._trigger("deactivate",aM,aL)}})},drag:function(aL,aM,aK){ax.each(aK.sortables,function(){var aN=false,aO=this;aO.positionAbs=aK.positionAbs;aO.helperProportions=aK.helperProportions;aO.offset.click=aK.offset.click;if(aO._intersectsWith(aO.containerCache)){aN=true;ax.each(aK.sortables,function(){this.positionAbs=aK.positionAbs;this.helperProportions=aK.helperProportions;this.offset.click=aK.offset.click;if(this!==aO&&this._intersectsWith(this.containerCache)&&ax.contains(aO.element[0],this.element[0])){aN=false}return aN})}if(aN){if(!aO.isOver){aO.isOver=1;aK._parent=aM.helper.parent();aO.currentItem=aM.helper.appendTo(aO.element).data("ui-sortable-item",true);aO.options._helper=aO.options.helper;aO.options.helper=function(){return aM.helper[0]};aL.target=aO.currentItem[0];aO._mouseCapture(aL,true);aO._mouseStart(aL,true,true);aO.offset.click.top=aK.offset.click.top;aO.offset.click.left=aK.offset.click.left;aO.offset.parent.left-=aK.offset.parent.left-aO.offset.parent.left;aO.offset.parent.top-=aK.offset.parent.top-aO.offset.parent.top;aK._trigger("toSortable",aL);aK.dropped=aO.element;ax.each(aK.sortables,function(){this.refreshPositions()});aK.currentItem=aK.element;aO.fromOutside=aK}if(aO.currentItem){aO._mouseDrag(aL);aM.position=aO.position}}else{if(aO.isOver){aO.isOver=0;aO.cancelHelperRemoval=true;aO.options._revert=aO.options.revert;aO.options.revert=false;aO._trigger("out",aL,aO._uiHash(aO));aO._mouseStop(aL,true);aO.options.revert=aO.options._revert;aO.options.helper=aO.options._helper;if(aO.placeholder){aO.placeholder.remove()}aM.helper.appendTo(aK._parent);aK._refreshOffsets(aL);aM.position=aK._generatePosition(aL,true);aK._trigger("fromSortable",aL);aK.dropped=false;ax.each(aK.sortables,function(){this.refreshPositions()})}}})}});ax.ui.plugin.add("draggable","cursor",{start:function(aM,aN,aK){var aL=ax("body"),aO=aK.options;if(aL.css("cursor")){aO._cursor=aL.css("cursor")}aL.css("cursor",aO.cursor)},stop:function(aL,aM,aK){var aN=aK.options;if(aN._cursor){ax("body").css("cursor",aN._cursor)}}});ax.ui.plugin.add("draggable","opacity",{start:function(aM,aN,aK){var aL=ax(aN.helper),aO=aK.options;if(aL.css("opacity")){aO._opacity=aL.css("opacity")}aL.css("opacity",aO.opacity)},stop:function(aL,aM,aK){var aN=aK.options;if(aN._opacity){ax(aM.helper).css("opacity",aN._opacity)}}});ax.ui.plugin.add("draggable","scroll",{start:function(aL,aM,aK){if(!aK.scrollParentNotHidden){aK.scrollParentNotHidden=aK.helper.scrollParent(false)}if(aK.scrollParentNotHidden[0]!==aK.document[0]&&aK.scrollParentNotHidden[0].tagName!=="HTML"){aK.overflowOffset=aK.scrollParentNotHidden.offset()}},drag:function(aN,aO,aM){var aP=aM.options,aL=false,aQ=aM.scrollParentNotHidden[0],aK=aM.document[0];if(aQ!==aK&&aQ.tagName!=="HTML"){if(!aP.axis||aP.axis!=="x"){if((aM.overflowOffset.top+aQ.offsetHeight)-aN.pageY<aP.scrollSensitivity){aQ.scrollTop=aL=aQ.scrollTop+aP.scrollSpeed}else{if(aN.pageY-aM.overflowOffset.top<aP.scrollSensitivity){aQ.scrollTop=aL=aQ.scrollTop-aP.scrollSpeed}}}if(!aP.axis||aP.axis!=="y"){if((aM.overflowOffset.left+aQ.offsetWidth)-aN.pageX<aP.scrollSensitivity){aQ.scrollLeft=aL=aQ.scrollLeft+aP.scrollSpeed}else{if(aN.pageX-aM.overflowOffset.left<aP.scrollSensitivity){aQ.scrollLeft=aL=aQ.scrollLeft-aP.scrollSpeed}}}}else{if(!aP.axis||aP.axis!=="x"){if(aN.pageY-ax(aK).scrollTop()<aP.scrollSensitivity){aL=ax(aK).scrollTop(ax(aK).scrollTop()-aP.scrollSpeed)}else{if(ax(window).height()-(aN.pageY-ax(aK).scrollTop())<aP.scrollSensitivity){aL=ax(aK).scrollTop(ax(aK).scrollTop()+aP.scrollSpeed)}}}if(!aP.axis||aP.axis!=="y"){if(aN.pageX-ax(aK).scrollLeft()<aP.scrollSensitivity){aL=ax(aK).scrollLeft(ax(aK).scrollLeft()-aP.scrollSpeed)}else{if(ax(window).width()-(aN.pageX-ax(aK).scrollLeft())<aP.scrollSensitivity){aL=ax(aK).scrollLeft(ax(aK).scrollLeft()+aP.scrollSpeed)}}}}if(aL!==false&&ax.ui.ddmanager&&!aP.dropBehaviour){ax.ui.ddmanager.prepareOffsets(aM,aN)}}});ax.ui.plugin.add("draggable","snap",{start:function(aL,aM,aK){var aN=aK.options;aK.snapElements=[];ax(aN.snap.constructor!==String?(aN.snap.items||":data(ui-draggable)"):aN.snap).each(function(){var aP=ax(this),aO=aP.offset();if(this!==aK.element[0]){aK.snapElements.push({item:this,width:aP.outerWidth(),height:aP.outerHeight(),top:aO.top,left
vendor: 13,955 bytes, lines 124-142
124:aO.left})}})},drag:function(aW,aT,aN){var aK,a1,aP,aQ,aV,aS,aR,a2,aX,aO,aU=aN.options,a0=aU.snapTolerance,aZ=aT.offset.left,aY=aZ+aN.helperProportions.width,aM=aT.offset.top,aL=aM+aN.helperProportions.height;for(aX=aN.snapElements.length-1;aX>=0;aX--){aV=aN.snapElements[aX].left-aN.margins.left;aS=aV+aN.snapElements[aX].width;aR=aN.snapElements[aX].top-aN.margins.top;a2=aR+aN.snapElements[aX].height;if(aY<aV-a0||aZ>aS+a0||aL<aR-a0||aM>a2+a0||!ax.contains(aN.snapElements[aX].item.ownerDocument,aN.snapElements[aX].item)){if(aN.snapElements[aX].snapping){if(aN.options.snap.release){aN.options.snap.release.call(aN.element,aW,ax.extend(aN._uiHash(),{snapItem:aN.snapElements[aX].item}))}}aN.snapElements[aX].snapping=false;continue}if(aU.snapMode!=="inner"){aK=Math.abs(aR-aL)<=a0;a1=Math.abs(a2-aM)<=a0;aP=Math.abs(aV-aY)<=a0;aQ=Math.abs(aS-aZ)<=a0;if(aK){aT.position.top=aN._convertPositionTo("relative",{top:aR-aN.helperProportions.height,left:0}).top}if(a1){aT.position.top=aN._convertPositionTo("relative",{top:a2,left:0}).top}if(aP){aT.position.left=aN._convertPositionTo("relative",{top:0,left:aV-aN.helperProportions.width}).left}if(aQ){aT.position.left=aN._convertPositionTo("relative",{top:0,left:aS}).left}}aO=(aK||a1||aP||aQ);if(aU.snapMode!=="outer"){aK=Math.abs(aR-aM)<=a0;a1=Math.abs(a2-aL)<=a0;aP=Math.abs(aV-aZ)<=a0;aQ=Math.abs(aS-aY)<=a0;if(aK){aT.position.top=aN._convertPositionTo("relative",{top:aR,left:0}).top}if(a1){aT.position.top=aN._convertPositionTo("relative",{top:a2-aN.helperProportions.height,left:0}).top}if(aP){aT.position.left=aN._convertPositionTo("relative",{top:0,left:aV}).left}if(aQ){aT.position.left=aN._convertPositionTo("relative",{top:0,left:aS-aN.helperProportions.width}).left}}if(!aN.snapElements[aX].snapping&&(aK||a1||aP||aQ||aO)){if(aN.options.snap.snap){aN.options.snap.snap.call(aN.element,aW,ax.extend(aN._uiHash(),{snapItem:aN.snapElements[aX].item}))}}aN.snapElements[aX].snapping=(aK||a1||aP||aQ||aO)}}});ax.ui.plugin.add("draggable","stack",{start:function(aM,aN,aK){var aL,aP=aK.options,aO=ax.makeArray(ax(aP.stack)).sort(function(aR,aQ){return(parseInt(ax(aR).css("zIndex"),10)||0)-(parseInt(ax(aQ).css("zIndex"),10)||0)});if(!aO.length){return}aL=parseInt(ax(aO[0]).css("zIndex"),10)||0;ax(aO).each(function(aQ){ax(this).css("zIndex",aL+aQ)});this.css("zIndex",(aL+aO.length))}});ax.ui.plugin.add("draggable","zIndex",{start:function(aM,aN,aK){var aL=ax(aN.helper),aO=aK.options;if(aL.css("zIndex")){aO._zIndex=aL.css("zIndex")}aL.css("zIndex",aO.zIndex)},stop:function(aL,aM,aK){var aN=aK.options;if(aN._zIndex){ax(aM.helper).css("zIndex",aN._zIndex)}}});var C=ax.ui.draggable; 125/*! 126 * jQuery UI Droppable 1.13.0 127 * http://jqueryui.com 128 * 129 * Copyright jQuery Foundation and other contributors 130 * Released under the MIT license. 131 * http://jquery.org/license 132 */ 133ax.widget("ui.droppable",{version:"1.13.0",widgetEventPrefix:"drop",options:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var aL,aM=this.options,aK=aM.accept;this.isover=false;this.isout=true;this.accept=typeof aK==="function"?aK:function(aN){return aN.is(aK)};this.proportions=function(){if(arguments.length){aL=arguments[0]}else{return aL?aL:aL={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(aM.scope);if(aM.addClasses){this._addClass("ui-droppable")}},_addToManager:function(aK){ax.ui.ddmanager.droppables[aK]=ax.ui.ddmanager.droppables[aK]||[];ax.ui.ddmanager.droppables[aK].push(this)},_splice:function(aK){var aL=0;for(;aL<aK.length;aL++){if(aK[aL]===this){aK.splice(aL,1)}}},_destroy:function(){var aK=ax.ui.ddmanager.droppables[this.options.scope];this._splice(aK)},_setOption:function(aL,aM){if(aL==="accept"){this.accept=typeof aM==="function"?aM:function(aN){return aN.is(aM)}}else{if(aL==="scope"){var aK=ax.ui.ddmanager.droppables[this.options.scope];this._splice(aK);this._addToManager(aM)}}this._super(aL,aM)},_activate:function(aL){var aK=ax.ui.ddmanager.current;this._addActiveClass();if(aK){this._trigger("activate",aL,this.ui(aK))}},_deactivate:function(aL){var aK=ax.ui.ddmanager.current;this._removeActiveClass();if(aK){this._trigger("deactivate",aL,this.ui(aK))}},_over:function(aL){var aK=ax.ui.ddmanager.current;if(!aK||(aK.currentItem||aK.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],(aK.currentItem||aK.element))){this._addHoverClass();this._trigger("over",aL,this.ui(aK))}},_out:function(aL){var aK=ax.ui.ddmanager.current;if(!aK||(aK.currentItem||aK.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],(aK.currentItem||aK.element))){this._removeHoverClass();this._trigger("out",aL,this.ui(aK))}},_drop:function(aL,aM){var aK=aM||ax.ui.ddmanager.current,aN=false;if(!aK||(aK.currentItem||aK.element)[0]===this.element[0]){return false}this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var aO=ax(this).droppable("instance");if(aO.options.greedy&&!aO.options.disabled&&aO.options.scope===aK.options.scope&&aO.accept.call(aO.element[0],(aK.currentItem||aK.element))&&ax.ui.intersect(aK,ax.extend(aO,{offset:aO.element.offset()}),aO.options.tolerance,aL)){aN=true;return false}});if(aN){return false}if(this.accept.call(this.element[0],(aK.currentItem||aK.element))){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",aL,this.ui(aK));return this.element}return false},ui:function(aK){return{draggable:(aK.currentItem||aK.element),helper:aK.helper,position:aK.position,offset:aK.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});ax.ui.intersect=(function(){function aK(aM,aL,aN){return(aM>=aL)&&(aM<(aL+aN))}return function(aW,aQ,aU,aM){if(!aQ.offset){return false}var aO=(aW.positionAbs||aW.position.absolute).left+aW.margins.left,aT=(aW.positionAbs||aW.position.absolute).top+aW.margins.top,aN=aO+aW.helperProportions.width,aS=aT+aW.helperProportions.height,aP=aQ.offset.left,aV=aQ.offset.top,aL=aP+aQ.proportions().width,aR=aV+aQ.proportions().height;switch(aU){case"fit":return(aP<=aO&&aN<=aL&&aV<=aT&&aS<=aR);case"intersect":return(aP<aO+(aW.helperProportions.width/2)&&aN-(aW.helperProportions.width/2)<aL&&aV<aT+(aW.helperProportions.height/2)&&aS-(aW.helperProportions.height/2)<aR);case"pointer":return aK(aM.pageY,aV,aQ.proportions().height)&&aK(aM.pageX,aP,aQ.proportions().width);case"touch":return((aT>=aV&&aT<=aR)||(aS>=aV&&aS<=aR)||(aT<aV&&aS>aR))&&((aO>=aP&&aO<=aL)||(aN>=aP&&aN<=aL)||(aO<aP&&aN>aL));default:return false}}})();ax.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(aN,aP){var aM,aL,aK=ax.ui.ddmanager.droppables[aN.options.scope]||[],aO=aP?aP.type:null,aQ=(aN.currentItem||aN.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(aM=0;aM<aK.length;aM++){if(aK[aM].options.disabled||(aN&&!aK[aM].accept.call(aK[aM].element[0],(aN.currentItem||aN.element)))){continue}for(aL=0;aL<aQ.length;aL++){if(aQ[aL]===aK[aM].element[0]){aK[aM].proportions().height=0;continue droppablesLoop}}aK[aM].visible=aK[aM].element.css("display")!=="none";if(!aK[aM].visible){continue}if(aO==="mousedown"){aK[aM]._activate.call(aK[aM],aP)}aK[aM].offset=aK[aM].element.offset();aK[aM].proportions({width:aK[aM].element[0].offsetWidth,height:aK[aM].element[0].offsetHeight})}},drop:function(aK,aL){var aM=false;ax.each((ax.ui.ddmanager.droppables[aK.options.scope]||[]).slice(),function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&ax.ui.intersect(aK,this,this.options.tolerance,aL)){aM=this._drop.call(this,aL)||aM}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(aK.currentItem||aK.element))){this.isout=true;this.isover=false;this._deactivate.call(this,aL)}});return aM},dragStart:function(aK,aL){aK.element.parentsUntil("body").on("scroll.droppable",function(){if(!aK.options.refreshPositions){ax.ui.ddmanager.prepareOffsets(aK,aL)}})},drag:function(aK,aL){if(aK.options.refreshPositions){ax.ui.ddmanager.prepareOffsets(aK,aL)}ax.each(ax.ui.ddmanager.droppables[aK.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var aP,aN,aM,aO=ax.ui.intersect(aK,this,this.options.tolerance,aL),aQ=!aO&&this.isover?"isout":(aO&&!this.isover?"isover":null);if(!aQ){return}if(this.options.greedy){aN=this.options.scope;aM=this.element.parents(":data(ui-droppable)").filter(function(){return ax(this).droppable("instance").options.scope===aN});if(aM.length){aP=ax(aM[0]).droppable("instance");aP.greedyChild=(aQ==="isover")}}if(aP&&aQ==="isover"){aP.isover=false;aP.isout=true;aP._out.call(aP,aL)}this[aQ]=true;this[aQ==="isout"?"isover":"isout"]=false;this[aQ==="isover"?"_over":"_out"].call(this,aL);if(aP&&aQ==="isout"){aP.isout=false;aP.isover=true;aP._over.call(aP,aL)}})},dragStop:function(aK,aL){aK.element.parentsUntil("body").off("scroll.droppable");if(!aK.options.refreshPositions){ax.ui.ddmanager.prepareOffsets(aK,aL)}}};if(ax.uiBackCompat!==false){ax.widget("ui.droppable",ax.ui.droppable,{options:{hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})}var ad=ax.ui.droppable; 134/*! 135 * jQuery UI Resizable 1.13.0 136 * http://jqueryui.com 137 * 138 * Copyright jQuery Foundation and other contributors 139 * Released under the MIT license. 140 * http://jquery.org/license 141 */ 142ax.widget("ui.resizable",ax.ui.mouse,{version:"1.13.0",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(aK){return parseFloat(aK)||0},_isNumber:function(aK){return !isNaN(parseFloat(aK))},_hasScroll:function(aN,aL){if(ax(aN).css("overflow")==="hidden"){return false}var aK=(aL&&aL==="left")?"scrollLeft":"scrollTop",aM=false;if(aN[aK]>0){return true}try{aN[aK]=1;aM=(aN[aK]>0);aN[aK]=0}catch(aO){}return aM},_create:function(){var aL,aM=this.options,aK=this;this._addClass("ui-resizable");ax.extend(this,{_aspectRatio:!!(aM.aspectRatio),aspectRatio:aM.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:aM.helper||aM.ghost||aM.animate?aM.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(ax("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;aL={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(aL);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(aL);this._proportionallyResize()}this._setupHandles();if(aM.autoHide){ax(this.element).on("mouseenter",function(){if(aM.disabled){return}aK._removeClass("ui-resizable-autohide");aK._handles.show()}).on("mouseleave",function(){if(aM.disabled){return}if(!aK.resizing){aK._addClass("ui-resizable-autohide");aK._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();this._addedHandles.remove();var aL,aK=function(aM){ax(aM).removeData("resizable").removeData("ui-resizable").off(".resizable")};if(this.elementIsWrapper){aK(this.element);aL=this.element;this.originalElement.css({position:aL.css("position"),width:aL.outerWidth(),height:aL.outerHeight(),top:aL.css("top"),left:aL.css("left")}).insertAfter(aL);aL.remove()}this.originalElement.css("resize",this.originalResizeStyle);aK(this.originalElement);return this},_setOption:function(aK,aL){this._super(aK,aL);switch(aK){case"handles":this._removeHandles();this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!aL;break;default:break}},_setupHandles:function(){var aP=this.options,aO,aL,aQ,aK,aM,aN=this;this.handles=aP.handles||(!ax(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=ax();this._addedHandles=ax();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}aQ=this.handles.split(",");this.handles={};for(aL=0;aL<aQ.length;aL++){aO=String.prototype.trim.call(aQ[aL]);aK="ui-resizable-"+aO;aM=ax("<div>");this._addClass(aM,"ui-resizable-handle "+aK);aM.css({zIndex:aP.zIndex});this.handles[aO]=".ui-resizable-"+aO;if(!this.element.children(this.handles[aO]).length){this.element.append(aM);this._addedHandles=this._addedHandles.add(aM)}}}this._renderAxis=function(aV){var aS,aT,aR,aU;aV=aV||this.element;
142for(aS in this.handles){if(this.handles[aS].constructor===String){this.handles[aS]=this.element.children(this.handles[aS]).first().show()}else{if(this.handles[aS].jquery||this.handles[aS].nodeType){this.handles[aS]=ax(this.handles[aS]);this._on(this.handles[aS],{mousedown:aN._mouseDown})}}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){aT=ax(this.handles[aS],this.element);aU=/sw|ne|nw|se|n|s/.test(aS)?aT.outerHeight():aT.outerWidth();aR=["padding",/ne|nw|n/.test(aS)?"Top":/se|sw|s/.test(aS)?"Bottom":/^e$/.test(aS)?"Right":"Left"].join("");aV.css(aR,aU);this._proportionallyResize()}this._handles=this._handles.add(this.handles[aS])}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!aN.resizing){if(this.className){aM=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}aN.axis=aM&&aM[1]?aM[1]:"se"}});if(aP.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(aM){var aL,aN,aK=false;for(aL in this.handles){aN=ax(this.handles[aL])[0];if(aN===aM.target||ax.contains(aN,aM.target)){aK=true}}return !this.options.disabled&&aK},_mouseStart:function(aL){var aP,aM,aO,aN=this.options,aK=this.element;this.resizing=true;this._renderProxy();aP=this._num(this.helper.css("left"));aM=this._num(this.helper.css("top"));if(aN.containment){aP+=ax(aN.containment).scrollLeft()||0;aM+=ax(aN.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:aP,top:aM};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:aK.width(),height:aK.height()};this.originalSize=this._helper?{width:aK.outerWidth(),height:aK.outerHeight()}:{width:aK.width(),height:aK.height()};this.sizeDiff={width:aK.outerWidth()-aK.width(),height:aK.outerHeight()-aK.height()};this.originalPosition={left:aP,top:aM};this.originalMousePosition={left:aL.pageX,top:aL.pageY};this.aspectRatio=(typeof aN.aspectRatio==="number")?aN.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);aO=ax(".ui-resizable-"+this.axis).css("cursor");ax("body").css("cursor",aO==="auto"?this.axis+"-resize":aO);this._addClass("ui-resizable-resizing");this._propagate("start",aL);return true},_mouseDrag:function(aP){var aQ,aO,aR=this.originalMousePosition,aL=this.axis,aM=(aP.pageX-aR.left)||0,aK=(aP.pageY-aR.top)||0,aN=this._change[aL];this._updatePrevProperties();if(!aN){return false}aQ=aN.apply(this,[aP,aM,aK]);this._updateVirtualBoundaries(aP.shiftKey);if(this._aspectRatio||aP.shiftKey){aQ=this._updateRatio(aQ,aP)}aQ=this._respectSize(aQ,aP);this._updateCache(aQ);this._propagate("resize",aP);aO=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!ax.isEmptyObject(aO)){this._updatePrevProperties();this._trigger("resize",aP,this.ui());this._applyChanges()}return false},_mouseStop:function(aN){this.resizing=false;var aM,aK,aL,aQ,aT,aP,aS,aO=this.options,aR=this;if(this._helper){aM=this._proportionallyResizeElements;aK=aM.length&&(/textarea/i).test(aM[0].nodeName);aL=aK&&this._hasScroll(aM[0],"left")?0:aR.sizeDiff.height;aQ=aK?0:aR.sizeDiff.width;aT={width:(aR.helper.width()-aQ),height:(aR.helper.height()-aL)};aP=(parseFloat(aR.element.css("left"))+(aR.position.left-aR.originalPosition.left))||null;aS=(parseFloat(aR.element.css("top"))+(aR.position.top-aR.originalPosition.top))||null;if(!aO.animate){this.element.css(ax.extend(aT,{top:aS,left:aP}))}aR.helper.height(aR.size.height);aR.helper.width(aR.size.width);if(this._helper&&!aO.animate){this._proportionallyResize()}}ax("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",aN);if(this._helper){this.helper.remove()}return false},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var aK={};if(this.position.top!==this.prevPosition.top){aK.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){aK.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){aK.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){aK.height=this.size.height+"px"}this.helper.css(aK);return aK},_updateVirtualBoundaries:function(aM){var aO,aN,aL,aQ,aK,aP=this.options;aK={minWidth:this._isNumber(aP.minWidth)?aP.minWidth:0,maxWidth:this._isNumber(aP.maxWidth)?aP.maxWidth:Infinity,minHeight:this._isNumber(aP.minHeight)?aP.minHeight:0,maxHeight:this._isNumber(aP.maxHeight)?aP.maxHeight:Infinity};if(this._aspectRatio||aM){aO=aK.minHeight*this.aspectRatio;aL=aK.minWidth/this.aspectRatio;aN=aK.maxHeight*this.aspectRatio;aQ=aK.maxWidth/this.aspectRatio;if(aO>aK.minWidth){aK.minWidth=aO}if(aL>aK.minHeight){aK.minHeight=aL}if(aN<aK.maxWidth){aK.maxWidth=aN}if(aQ<aK.maxHeight){aK.maxHeight=aQ}}this._vBoundaries=aK},_updateCache:function(aK){this.offset=this.helper.offset();
142if(this._isNumber(aK.left)){this.position.left=aK.left}if(this._isNumber(aK.top)){this.position.top=aK.top}if(this._isNumber(aK.height)){this.size.height=aK.height}if(this._isNumber(aK.width)){this.size.width=aK.width}},_updateRatio:function(aM){var aN=this.position,aL=this.size,aK=this.axis;if(this._isNumber(aM.height)){aM.width=(aM.height*this.aspectRatio)}else{if(this._isNumber(aM.width)){aM.height=(aM.width/this.aspectRatio)}}if(aK==="sw"){aM.left=aN.left+(aL.width-aM.width);aM.top=null}if(aK==="nw"){aM.top=aN.top+(aL.height-aM.height);aM.left=aN.left+(aL.width-aM.width)}return aM},_respectSize:function(aP){var aM=this._vBoundaries,aS=this.axis,aU=this._isNumber(aP.width)&&aM.maxWidth&&(aM.maxWidth<aP.width),aQ=this._isNumber(aP.height)&&aM.maxHeight&&(aM.maxHeight<aP.height),aN=this._isNumber(aP.width)&&aM.minWidth&&(aM.minWidth>aP.width),aT=this._isNumber(aP.height)&&aM.minHeight&&(aM.minHeight>aP.height),aL=this.originalPosition.left+this.originalSize.width,aR=this.originalPosition.top+this.originalSize.height,aO=/sw|nw|w/.test(aS),aK=/nw|ne|n/.test(aS);
142if(aN){aP.width=aM.minWidth}if(aT){aP.height=aM.minHeight}if(aU){aP.width=aM.maxWidth}if(aQ){aP.height=aM.maxHeight}if(aN&&aO){aP.left=aL-aM.minWidth}if(aU&&aO){aP.left=aL-aM.maxWidth}if(aT&&aK){aP.top=aR-aM.minHeight}if(aQ&&aK){aP.top=aR-aM.maxHeight}if(!aP.width&&!aP.height&&!aP.left&&aP.top){aP.top=null}else{if(!aP.width&&!aP.height&&!aP.top&&aP.left){aP.left=null}}return aP},_getPaddingPlusBorderDimensions:function(aM){var aL=0,aN=[],aO=[aM.css("borderTopWidth"),aM.css("borderRightWidth"),aM.css("borderBottomWidth"),aM.css("borderLeftWidth")],aK=[aM.css("paddingTop"),aM.css("paddingRight"),aM.css("paddingBottom"),aM.css("paddingLeft")];for(;aL<4;aL++){aN[aL]=(parseFloat(aO[aL])||0);aN[aL]+=(parseFloat(aK[aL])||0)}return{height:aN[0]+aN[2],width:aN[1]+aN[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var aM,aL=0,aK=this.helper||this.element;for(;aL<this._proportionallyResizeElements.length;aL++){aM=this._proportionallyResizeElements[aL];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(aM)}aM.css({height:(aK.height()-this.outerDimensions.height)||0,width:(aK.width()-this.outerDimensions.width)||0})}},_renderProxy:function(){var aK=this.element,aL=this.options;this.elementOffset=aK.offset();if(this._helper){this.helper=this.helper||ax("<div></div>").css({overflow:"hidden"});this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++aL.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(aL,aK){return{width:this.originalSize.width+aK}},w:function(aM,aK){var aL=this.originalSize,aN=this.originalPosition;return{left:aN.left+aK,width:aL.width-aK}},n:function(aN,aL,aK){var aM=this.originalSize,aO=this.originalPosition;return{top:aO.top+aK,height:aM.height-aK}},s:function(aM,aL,aK){return{height:this.originalSize.height+aK}},se:function(aM,aL,aK){return ax.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[aM,aL,aK]))},sw:function(aM,aL,aK){return ax.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[aM,aL,aK]))},ne:function(aM,aL,aK){return ax.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[aM,aL,aK]))},nw:function(aM,aL,aK){return ax.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[aM,aL,aK]))}},_propagate:function(aL,aK){ax.ui.plugin.call(this,aL,[aK,this.ui()]);if(aL!=="resize"){this._trigger(aL,aK,this.ui())}},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});ax.ui.plugin.add("resizable","animate",{stop:function(aN){var aS=ax(this).resizable("instance"),aP=aS.options,aM=aS._proportionallyResizeElements,aK=aM.length&&(/textarea/i).test(aM[0].nodeName),aL=aK&&aS._hasScroll(aM[0],"left")?0:aS.sizeDiff.height,aR=aK?0:aS.sizeDiff.width,aO={width:(aS.size.width-aR),height:(aS.size.height-aL)},aQ=(parseFloat(aS.element.css("left"))+(aS.position.left-aS.originalPosition.left))||null,aT=(parseFloat(aS.element.css("top"))+(aS.position.top-aS.originalPosition.top))||null;aS.element.animate(ax.extend(aO,aT&&aQ?{top:aT,left:aQ}:{}),{duration:aP.animateDuration,easing:aP.animateEasing,step:function(){var aU={width:parseFloat(aS.element.css("width")),height:parseFloat(aS.element.css("height")),top:parseFloat(aS.element.css("top")),left:parseFloat(aS.element.css("left"))};if(aM&&aM.length){ax(aM[0]).css({width:aU.width,height:aU.height})}aS._updateCache(aU);aS._propagate("resize",aN)}})}});ax.ui.plugin.add("resizable","containment",{start:function(){var aS,aM,aU,aK,aR,aN,aV,aT=ax(this).resizable("instance"),aQ=aT.options,aP=aT.element,aL=aQ.containment,aO=(aL instanceof ax)?aL.get(0):(/parent/.test(aL))?aP.parent().get(0):aL;if(!aO){return}aT.containerElement=ax(aO);if(/document/.test(aL)||aL===document){aT.containerOffset={left:0,top:0};aT.containerPosition={left:0,top:0};aT.parentData={element:ax(document),left:0,top:0,width:ax(document).width(),height:ax(document).height()||document.body.parentNode.scrollHeight}}else{aS=ax(aO);aM=[];ax(["Top","Right","Left","Bottom"]).each(function(aX,aW){aM[aX]=aT._num(aS.css("padding"+aW))});aT.containerOffset=aS.offset();aT.containerPosition=aS.position();aT.containerSize={height:(aS.innerHeight()-aM[3]),width:(aS.innerWidth()-aM[1])};aU=aT.containerOffset;aK=aT.containerSize.height;aR=aT.containerSize.width;aN=(aT._hasScroll(aO,"left")?aO.scrollWidth:aR);aV=(aT._hasScroll(aO)?aO.scrollHeight:aK);aT.parentData={element:aO,left:aU.left,top:aU.top,width:aN,height:aV}}},resize:function(aL){var aR,aW,aQ,aO,aS=ax(this).resizable("instance"),aN=aS.options,aU=aS.containerOffset,aT=aS.position,aV=aS._aspectRatio||aL.shiftKey,aK={top:0,left:0},aM=aS.containerElement,aP=true;if(aM[0]!==document&&(/static/).test(aM.css("position"))){aK=aU}if(aT.left<(aS._helper?aU.left:0)){aS.size.width=aS.size.width+(aS._helper?(aS.position.left-aU.left):(aS.position.left-aK.left));if(aV){aS.size.height=aS.size.width/aS.aspectRatio;aP=false}
142aS.position.left=aN.helper?aU.left:0}if(aT.top<(aS._helper?aU.top:0)){aS.size.height=aS.size.height+(aS._helper?(aS.position.top-aU.top):aS.position.top);if(aV){aS.size.width=aS.size.height*aS.aspectRatio;aP=false}aS.position.top=aS._helper?aU.top:0}aQ=aS.containerElement.get(0)===aS.element.parent().get(0);aO=/relative|absolute/.test(aS.containerElement.css("position"));if(aQ&&aO){aS.offset.left=aS.parentData.left+aS.position.left;aS.offset.top=aS.parentData.top+aS.position.top}else{aS.offset.left=aS.element.offset().left;aS.offset.top=aS.element.offset().top}aR=Math.abs(aS.sizeDiff.width+(aS._helper?aS.offset.left-aK.left:(aS.offset.left-aU.left)));aW=Math.abs(aS.sizeDiff.height+(aS._helper?aS.offset.top-aK.top:(aS.offset.top-aU.top)));if(aR+aS.size.width>=aS.parentData.width){aS.size.width=aS.parentData.width-aR;if(aV){aS.size.height=aS.size.width/aS.aspectRatio;aP=false}}if(aW+aS.size.height>=aS.parentData.height){aS.size.height=aS.parentData.height-aW;if(aV){aS.size.width=aS.size.height*aS.aspectRatio;aP=false}}if(!aP){aS.position.left=aS.prevPosition.left;aS.position.top=aS.prevPosition.top;aS.size.width=aS.prevSize.width;aS.size.height=aS.prevSize.height}},stop:function(){var aP=ax(this).resizable("instance"),aL=aP.options,aQ=aP.containerOffset,aK=aP.containerPosition,aM=aP.containerElement,aN=ax(aP.helper),aS=aN.offset(),aR=aN.outerWidth()-aP.sizeDiff.width,aO=aN.outerHeight()-aP.sizeDiff.height;if(aP._helper&&!aL.animate&&(/relative/).test(aM.css("position"))){ax(this).css({left:aS.left-aK.left-aQ.left,width:aR,height:aO})}if(aP._helper&&!aL.animate&&(/static/).test(aM.css("position"))){ax(this).css({left:aS.left-aK.left-aQ.left,width:aR,height:aO})}}});ax.ui.plugin.add("resizable","alsoResize",{start:function(){var aK=ax(this).resizable("instance"),aL=aK.options;ax(aL.alsoResize).each(function(){var aM=ax(this);aM.data("ui-resizable-alsoresize",{width:parseFloat(aM.width()),height:parseFloat(aM.height()),left:parseFloat(aM.css("left")),top:parseFloat(aM.css("top"))})})},resize:function(aL,aN){var aK=ax(this).resizable("instance"),aO=aK.options,aM=aK.originalSize,aQ=aK.originalPosition,aP={height:(aK.size.height-aM.height)||0,width:(aK.size.width-aM.width)||0,top:(aK.position.top-aQ.top)||0,left
142:(aK.position.left-aQ.left)||0};ax(aO.alsoResize).each(function(){var aT=ax(this),aU=ax(this).data("ui-resizable-alsoresize"),aS={},aR=aT.parents(aN.originalElement[0]).length?["width","height"]:["width","height","top","left"];ax.each(aR,function(aV,aX){var aW=(aU[aX]||0)+(aP[aX]||0);if(aW&&aW>=0){aS[aX]=aW||null}});aT.css(aS)})},stop:function(){ax(this).removeData("ui-resizable-alsoresize")}});ax.ui.plugin.add("resizable","ghost",{start:function(){var aL=ax(this).resizable("instance"),aK=aL.size;aL.ghost=aL.originalElement.clone();aL.ghost.css({opacity:0.25,display:"block",position:"relative",height:aK.height,width:aK.width,margin:0,left:0,top:0});aL._addClass(aL.ghost,"ui-resizable-ghost");if(ax.uiBackCompat!==false&&typeof aL.options.ghost==="string"){aL.ghost.addClass(this.options.ghost)}aL.ghost.appendTo(aL.helper)},resize:function(){var aK=ax(this).resizable("instance");if(aK.ghost){aK.ghost.css({position:"relative",height:aK.size.height,width:aK.size.width})}},stop:function(){var aK=ax(this).resizable("instance");if(aK.ghost&&aK.helper){aK.helper.get(0).removeChild(aK.ghost.get(0))}}});ax.ui.plugin.add("resizable","grid",{resize:function(){var aN,aS=ax(this).resizable("instance"),aW=aS.options,aQ=aS.size,aR=aS.originalSize,aT=aS.originalPosition,a1=aS.axis,aK=typeof aW.grid==="number"?[aW.grid,aW.grid]:aW.grid,aZ=(aK[0]||1),aY=(aK[1]||1),aP=Math.round((aQ.width-aR.width)/aZ)*aZ,aO=Math.round((aQ.height-aR.height)/aY)*aY,aU=aR.width+aP,aX=aR.height+aO,aM=aW.maxWidth&&(aW.maxWidth<aU),aV=aW.maxHeight&&(aW.maxHeight<aX),a0=aW.minWidth&&(aW.minWidth>aU),aL=aW.minHeight&&(aW.minHeight>aX);aW.grid=aK;if(a0){aU+=aZ}if(aL){aX+=aY}if(aM){aU-=aZ}if(aV){aX-=aY}if(/^(se|s|e)$/.test(a1)){aS.size.width=aU;aS.size.height=aX}else{if(/^(ne)$/.test(a1)){aS.size.width=aU;aS.size.height=aX;aS.position.top=aT.top-aO}else{if(/^(sw)$/.test(a1)){aS.size.width=aU;aS.size.height=aX;aS.position.left=aT.left-aP}else{if(aX-aY<=0||aU-aZ<=0){aN=aS._getPaddingPlusBorderDimensions(this)}if(aX-aY>0){aS.size.height=aX;aS.position.top=aT.top-aO}else{aX=aY-aN.height;aS.size.height=aX;aS.position.top=aT.top+aR.height-aX}if(aU-aZ>0){aS.size.width=aU;aS.position.left=aT.left-aP}else{aU=aZ-aN.width;aS.size.width=aU;aS.position.left=aT.left+aR.width-aU}}}}}});var H=ax.ui.resizable; 143/*! 144 * jQuery UI Selectable 1.13.0 145 * http://jqueryui.com 146 * 147 * Copyright jQuery Foundation and other contributors 148 * Released under the MIT license. 149 * http://jquery.org/license 150 */ 151var u=ax.widget("ui.selectable",ax.ui.mouse,{version:"1.13.0",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var aK=this;this._addClass("ui-selectable");this.dragged=false;this.refresh=function(){aK.elementPos=ax(aK.element[0]).offset();aK.selectees=ax(aK.options.filter,aK.element[0]);aK._addClass(aK.selectees,"ui-selectee");aK.selectees.each(function(){var aM=ax(this),aL=aM.offset(),aN={left:aL.left-aK.elementPos.left,top:aL.top-aK.elementPos.top};ax.data(this,"selectable-item",{element:this,$element:aM,left:aN.left,top:aN.top,right:aN.left+aM.outerWidth(),bottom:aN.top+aM.outerHeight(),startselected:false,selected:aM.hasClass("ui-selected"),selecting:aM.hasClass("ui-selecting"),unselecting:aM.hasClass("ui-unselecting")})})};this.refresh();this._mouseInit();this.helper=ax("<div>");this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item");this._mouseDestroy()},_mouseStart:function(aM){var aL=this,aK=this.options;this.opos=[aM.pageX,aM.pageY];this.elementPos=ax(this.element[0]).offset();if(this.options.disabled){return}this.selectees=ax(aK.filter,this.element[0]);this._trigger("start",aM);ax(aK.appendTo).append(this.helper);this.helper.css({left:aM.pageX,top:aM.pageY,width:0,height:0});if(aK.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var aN=ax.data(this,"selectable-item");aN.startselected=true;if(!aM.metaKey&&!aM.ctrlKey){aL._removeClass(aN.$element,"ui-selected");aN.selected=false;aL._addClass(aN.$element,"ui-unselecting");aN.unselecting=true;aL._trigger("unselecting",aM,{unselecting:aN.element})}});ax(aM.target).parents().addBack().each(function(){var aN,aO=ax.data(this,"selectable-item");if(aO){aN=(!aM.metaKey&&!aM.ctrlKey)||!aO.$element.hasClass("ui-selected");aL._removeClass(aO.$element,aN?"ui-unselecting":"ui-selected")._addClass(aO.$element,aN?"ui-selecting":"ui-unselecting");aO.unselecting=!aN;aO.selecting=aN;aO.selected=aN;if(aN){aL._trigger("selecting",aM,{selecting:aO.element})}else{aL._trigger("unselecting",aM,{unselecting:aO.element})}return false}})},_mouseDrag:function(aR){this.dragged=true;if(this.options.disabled){return}var aO,aQ=this,aM=this.options,aL=this.opos[0],aP=this.opos[1],aK=aR.pageX,aN=aR.pageY;if(aL>aK){aO=aK;aK=aL;aL=aO}if(aP>aN){aO=aN;aN=aP;aP=aO}this.helper.css({left:aL,top:aP,width:aK-aL,height:aN-aP});this.selectees.each(function(){var aS=ax.data(this,"selectable-item"),aT=false,aU={};if(!aS||aS.element===aQ.element[0]){return}aU.left=aS.left+aQ.elementPos.left;aU.right=aS.right+aQ.elementPos.left;aU.top=aS.top+aQ.elementPos.top;aU.bottom=aS.bottom+aQ.elementPos.top;if(aM.tolerance==="touch"){aT=(!(aU.left>aK||aU.right<aL||aU.top>aN||aU.bottom<aP))}else{if(aM.tolerance==="fit"){aT=(aU.left>aL&&aU.right<aK&&aU.top>aP&&aU.bottom<aN)}}if(aT){if(aS.selected){aQ._removeClass(aS.$element,"ui-selected");aS.selected=false}if(aS.unselecting){aQ._removeClass(aS.$element,"ui-unselecting");aS.unselecting=false}if(!aS.selecting){aQ._addClass(aS.$element,"ui-selecting");aS.selecting=true;aQ._trigger("selecting",aR,{selecting:aS.element})}}else{if(aS.selecting){if((aR.metaKey||aR.ctrlKey)&&aS.startselected){aQ._removeClass(aS.$element,"ui-selecting");aS.selecting=false;aQ._addClass(aS.$element,"ui-selected");aS.selected=true}else{aQ._removeClass(aS.$element,"ui-selecting");aS.selecting=false;if(aS.startselected){aQ._addClass(aS.$element,"ui-unselecting");aS.unselecting=true}aQ._trigger("unselecting",aR,{unselecting:aS.element})}}if(aS.selected){if(!aR.metaKey&&!aR.ctrlKey&&!aS.startselected){aQ._removeClass(aS.$element,"ui-selected");aS.selected=false;aQ._addClass(aS.$element,"ui-unselecting");aS.unselecting=true;aQ._trigger("unselecting",aR,{unselecting:aS.element})}}}});return false},_mouseStop:function(aL){var aK=this;this.dragged=false;ax(".ui-unselecting",this.element[0]).each(function(){var aM=ax.data(this,"selectable-item");aK._removeClass(aM.$element,"ui-unselecting");aM.unselecting=false;aM.startselected=false;aK._trigger("unselected",aL,{unselected:aM.element})});ax(".ui-selecting",this.element[0]).each(function(){var aM=ax.data(this,"selectable-item");aK._removeClass(aM.$element,"ui-selecting")._addClass(aM.$element,"ui-selected");aM.selecting=false;aM.selected=true;aM.startselected=true;aK._trigger("selected",aL,{selected:aM.element})});this._trigger("stop",aL);this.helper.remove();return false}}); 152/*! 153 * jQuery UI Sortable 1.13.0 154 * http://jqueryui.com 155 * 156 * Copyright jQuery Foundation and other contributors 157 * Released under the MIT license. 158 * http://jquery.org/license 159 */ 160var aa=ax.widget("ui.sortable",ax.ui.mouse,{version:"1.13.0",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,curs
160or:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(aL,aK,aM){return(aL>=aK)&&(aL<(aK+aM))},_isFloating:function(aK){return(/left|right/).test(aK.css("float"))||(/inline|table-cell/).test(aK.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true},_setOption:function(aK,aL){this._super(aK,aL);if(aK==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var aK=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");ax.each(this.items,function(){aK._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var aK=this.items.length-1;aK>=0;aK--){this.items[aK].item.removeData(this.widgetName+"-item")}return this},_mouseCapture:function(aM,aN){var aK=null,aO=false,aL=this;if(this.reverting){return false}if(this.options.disabled||this.options.type==="static"){return false}this._refreshItems(aM);ax(aM.target).parents().each(function(){if(ax.data(this,aL.widgetName+"-item")===aL){aK=ax(this);return false}});if(ax.data(aM.target,aL.widgetName+"-item")===aL){aK=ax(aM.target)}if(!aK){return false}if(this.options.handle&&!aN){ax(this.options.handle,aK).find("*").addBack().each(function(){if(this===aM.target){aO=true}});if(!aO){return false}}this.currentItem=aK;this._removeCurrentsFromItems();return true},_mouseStart:function(aN,aO,aL){var aM,aK,aP=this.options;this.currentContainer=this;this.refreshPositions();this.appendTo=ax(aP.appendTo!=="parent"?aP.appendTo:this.currentItem.parent());this.helper=this._createHelper(aN);this._cacheHelperProportions();this._cacheMargins();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};ax.extend(this.offset,{click:{left:aN.pageX-this.offset.left,top:aN.pageY-this.offset.top},relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");if(aP.cursorAt){this._adjustOffsetFromHelper(aP.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();this.scrollParent=this.placeholder.scrollParent();ax.extend(this.offset,{parent:this._getParentOffset()});if(aP.containment){this._setContainment()}if(aP.cursor&&aP.cursor!=="auto"){aK=this.document.find("body");this.storedCursor=aK.css("cursor");aK.css("cursor",aP.cursor);this.storedStylesheet=ax("<style>*{ cursor: "+aP.cursor+" !important; }</style>").appendTo(aK)}if(aP.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",aP.zIndex)}if(aP.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",aP.opacity)}if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",aN,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!aL){for(aM=this.containers.length-1;aM>=0;aM--){this.containers[aM]._trigger("activate",aN,this._uiHash(this))}}if(ax.ui.ddmanager){ax.ui.ddmanager.current=this}if(ax.ui.ddmanager&&!aP.dropBehaviour){ax.ui.ddmanager.prepareOffsets(this,aN)}this.dragging=true;this._addClass(this.helper,"ui-sortable-helper");if(!this.helper.parent().is(this.appendTo)){this.helper.detach().appendTo(this.appendTo);this.offset.parent=this._getParentOffset()}this.position=this.originalPosition=this._generatePosition(aN);this.originalPageX=aN.pageX;this.originalPageY=aN.pageY;this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute");this._mouseDrag(aN);return true},_scroll:function(aL){var aM=this.options,aK=false;if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-aL.pageY<aM.scrollSensitivity){this.scrollParent[0].scrollTop=aK=this.scrollParent[0].scrollTop+aM.scrollSpeed}else{if(aL.pageY-this.overflowOffset.top<aM.scrollSensitivity){this.scrollParent[0].scrollTop=aK=this.scrollParent[0].scrollTop-aM.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-aL.pageX<aM.scrollSensitivity){this.scrollParent[0].scrollLeft=aK=this.scrollParent[0].scrollLeft+aM.scrollSpeed}else{if(aL.pageX-this.overflowOffset.left<aM.scrollSensitivity){this.scrollParent[0].scrollLeft=aK=this.scrollParent[0].scrollLeft-aM.scrollSpeed}}}else{if(aL.pageY-this.document.scrollTop()<aM.scrollSensitivity){aK=this.document.scrollTop(this.document.scrollTop()-aM.scrollSpeed)}else{if(this.window.height()-(aL.pageY-this.document.scrollTop())<aM.scrollSensitivity){aK=this.document.scrollTop(this.document.scrollTop()+aM.scrollSpeed)}}if(aL.pageX-this.document.scrollLeft()<aM.scrollSensitivity){aK=this.document.scrollLeft(this.document.scrollLeft()-aM.scrollSpeed)}else{if(this.window.width()-(aL.pageX-this.document.scrollLeft())<aM.scrollSensitivity){aK=this.document.scrollLeft(this.document.scrollLeft()+aM.scrollSpeed)}}}return aK},_mouseDrag:function(aN){var aL,aM,aK,aP,aO=this.options;this.position=this._generatePosition(aN);this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"}this._contactContainers(aN);if(this.innermostContainer!==null){if(aO.scroll){if(this._scroll(aN)!==false){this._refreshItemPositions(true);if(ax.ui.ddmanager&&!aO.dropBehaviour){ax.ui.ddmanager.prepareOffsets(this,aN)}}}this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()};for(aL=this.items.length-1;aL>=0;aL--){aM=this.items[aL];aK=aM.item[0];aP=this._intersectsWithPointer(aM);if(!aP){continue}if(aM.instance!==this.currentContainer){continue}if(aK!==this.currentItem[0]&&this.placeholder[aP===1?"next":"prev"]()[0]!==aK&&!ax.contains(this.placeholder[0],aK)&&(this.options.type==="semi-dynamic"?!ax.contains(this.element[0],aK):true)){this.direction=aP===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(aM)){this._rearrange(aN,aM)}else{break}this._trigger("change",aN,this._uiHash());break}}}if(ax.ui.ddmanager){ax.ui.ddmanager.drag(this,aN)}this._trigger("sort",aN,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(aM,aO){if(!aM){return}if(ax.ui.ddmanager&&!this.options.dropBehaviour){ax.ui.ddmanager.drop(this,aM)}if(this.options.revert){var aL=this,aP=this.placeholder.offset(),aK=this.options.axis,aN={};if(!aK||aK==="x"){aN.left=aP.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)}if(!aK||aK==="y"){aN.top=aP.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)}this.reverting=true;ax(this.helper).animate(aN,parseInt(this.options.revert,10)||500,function(){aL._clear(aM)})}else{this._clear(aM,aO)}
160return false},cancel:function(){if(this.dragging){this._mouseUp(new ax.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}for(var aK=this.containers.length-1;aK>=0;aK--){this.containers[aK]._trigger("deactivate",null,this._uiHash(this));if(this.containers[aK].containerCache.over){this.containers[aK]._trigger("out",null,this._uiHash(this));this.containers[aK].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}ax.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){ax(this.domPosition.prev).after(this.currentItem)}else{ax(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(aM){var aK=this._getItemsAsjQuery(aM&&aM.connected),aL=[];aM=aM||{};ax(aK).each(function(){var aN=(ax(aM.item||this).attr(aM.attribute||"id")||"").match(aM.expression||(/(.+)[\-=_](.+)/));if(aN){aL.push((aM.key||aN[1]+"[]")+"="+(aM.key&&aM.expression?aN[1]:aN[2]))}});if(!aL.length&&aM.key){aL.push(aM.key+"=")}return aL.join("&")},toArray:function(aM){var aK=this._getItemsAsjQuery(aM&&aM.connected),aL=[];aM=aM||{};aK.each(function(){aL.push(ax(aM.item||this).attr(aM.attribute||"id")||"")});return aL},_intersectsWith:function(aV){var aM=this.positionAbs.left,aL=aM+this.helperProportions.width,aT=this.positionAbs.top,aS=aT+this.helperProportions.height,aN=aV.left,aK=aN+aV.width,aW=aV.top,aR=aW+aV.height,aX=this.offset.click.top,aQ=this.offset.click.left,aP=(this.options.axis==="x")||((aT+aX)>aW&&(aT+aX)<aR),aU=(this.options.axis==="y")||((aM+aQ)>aN&&(aM+aQ)<aK),aO=aP&&aU;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>aV[this.floating?"width":"height"])){return aO}else{return(aN<aM+(this.helperProportions.width/2)&&aL-(this.helperProportions.width/2)<aK&&aW<aT+(this.helperProportions.height/2)&&aS-(this.helperProportions.height/2)<aR)}},_intersectsWithPointer:function(aM){var aL,aP,aN=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,aM.top,aM.height),aK=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,aM.left,aM.width),aO=aN&&aK;if(!aO){return false}aL=this.dragDirection.vertical;aP=this.dragDirection.horizontal;return this.floating?((aP==="right"||aL==="down")?2:1):(aL&&(aL==="down"?2:1))},_intersectsWithSides:function(aN){var aL=this._isOverAxis(this.positionAbs.top+this.offset.click.top,aN.top+(aN.height/2),aN.height),aM=this._isOverAxis(this.positionAbs.left+this.offset.click.left,aN.left+(aN.width/2),aN.width),aK=this.dragDirection.vertical,aO=this.dragDirection.horizontal;if(this.floating&&aO){return((aO==="right"&&aM)||(aO==="left"&&!aM))}else{return aK&&((aK==="down"&&aL)||(aK==="up"&&!aL))}},_getDragVerticalDirection:function(){var aK=this.positionAbs.top-this.lastPositionAbs.top;return aK!==0&&(aK>0?"down":"up")},_getDragHorizontalDirection:function(){var aK=this.positionAbs.left-this.lastPositionAbs.left;return aK!==0&&(aK>0?"right":"left")},refresh:function(aK){this._refreshItems(aK);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var aK=this.options;return aK.connectWith.constructor===String?[aK.connectWith]:aK.connectWith},_getItemsAsjQuery:function(aK){var aM,aL,aR,aO,aP=[],aN=[],aQ=this._connectWith();if(aQ&&aK){for(aM=aQ.length-1;aM>=0;aM--){aR=ax(aQ[aM],this.document[0]);for(aL=aR.length-1;aL>=0;aL--){aO=ax.data(aR[aL],this.widgetFullName);if(aO&&aO!==this&&!aO.options.disabled){aN.push([typeof aO.options.items==="function"?aO.options.items.call(aO.element):ax(aO.options.items,aO.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),aO])}}}}aN.push([typeof this.options.items==="function"?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):ax(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function aS(){aP.push(this)}for(aM=aN.length-1;aM>=0;aM--){aN[aM][0].each(aS)}return ax(aP)},_removeCurrentsFromItems:function(){var aK=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=ax.grep(this.items,function(aM){for(var aL=0;aL<aK.length;aL++){if(aK[aL]===aM.item[0]){return false}}return true})},_refreshItems:function(aK){this.items=[];this.containers=[this];var aO,aM,aT,aP,aS,aL,aV,aU,aQ=this.items,aN=[[typeof this.options.items==="function"?this.options.items.call(this.element[0],aK,{item:this.currentItem}):ax(this.options.items,this.element),this]],aR=this._connectWith();if(aR&&this.ready){for(aO=aR.length-1;aO>=0;aO--){aT=ax(aR[aO],this.document[0]);for(aM=aT.length-1;aM>=0;aM--){aP=ax.data(aT[aM],this.widgetFullName);if(aP&&aP!==this&&!aP.options.disabled){aN.push([typeof aP.options.items==="function"?aP.options.items.call(aP.element[0],aK,{item:this.currentItem}):ax(aP.options.items,aP.element),aP]);this.containers.push(aP)}}}}for(aO=aN.length-1;aO>=0;aO--){aS=aN[aO][1];aL=aN[aO][0];for(aM=0,aU=aL.length;aM<aU;aM++){aV=ax(aL[aM]);aV.data(this.widgetName+"-item",aS);aQ.push({item:aV,instance:aS,width:0,height:0,left:0,top:0})}}},_refreshItemPositions:function(aK){var aM,aN,aL,aO;for(aM=this.items.length-1;aM>=0;aM--){aN=this.items[aM];if(this.currentContainer&&aN.instance!==this.currentContainer&&aN.item[0]!==this.currentItem[0]){continue}aL=this.options.toleranceElement?ax(this.options.toleranceElement,aN.item):aN.item;if(!aK){aN.width=aL.outerWidth();aN.height=aL.outerHeight()}aO=aL.offset();aN.left=aO.left;aN.top=aO.top}},refreshPositions:function(aK){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):false;if(this.innermostContainer!==null){this._refreshItemPositions(aK)}var aL,aM;
160if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(aL=this.containers.length-1;aL>=0;aL--){aM=this.containers[aL].element.offset();this.containers[aL].containerCache.left=aM.left;this.containers[aL].containerCache.top=aM.top;this.containers[aL].containerCache.width=this.containers[aL].element.outerWidth();this.containers[aL].containerCache.height=this.containers[aL].element.outerHeight()}}return this},_createPlaceholder:function(aL){aL=aL||this;var aK,aN,aM=aL.options;if(!aM.placeholder||aM.placeholder.constructor===String){aK=aM.placeholder;aN=aL.currentItem[0].nodeName.toLowerCase();aM.placeholder={element:function(){var aO=ax("<"+aN+">",aL.document[0]);aL._addClass(aO,"ui-sortable-placeholder",aK||aL.currentItem[0].className)._removeClass(aO,"ui-sortable-helper");if(aN==="tbody"){aL._createTrPlaceholder(aL.currentItem.find("tr").eq(0),ax("<tr>",aL.document[0]).appendTo(aO))}else{if(aN==="tr"){aL._createTrPlaceholder(aL.currentItem,aO)}else{if(aN==="img"){aO.attr("src",aL.currentItem.attr("src"))}}}if(!aK){aO.css("visibility","hidden")}return aO},update:function(aO,aP){if(aK&&!aM.forcePlaceholderSize){return}if(!aP.height()||(aM.forcePlaceholderSize&&(aN==="tbody"||aN==="tr"))){aP.height(aL.currentItem.innerHe
160ight()-parseInt(aL.currentItem.css("paddingTop")||0,10)-parseInt(aL.currentItem.css("paddingBottom")||0,10))}if(!aP.width()){aP.width(aL.currentItem.innerWidth()-parseInt(aL.currentItem.css("paddingLeft")||0,10)-parseInt(aL.currentItem.css("paddingRight")||0,10))}}}}aL.placeholder=ax(aM.placeholder.element.call(aL.element,aL.currentItem));aL.currentItem.after(aL.placeholder);aM.placeholder.update(aL,aL.placeholder)},_createTrPlaceholder:function(aL,aK){var aM=this;aL.children().each(function(){ax("<td> </td>",aM.document[0]).attr("colspan",ax(this).attr("colspan")||1).appendTo(aK)})},_contactContainers:function(aK){var aP,aN,aT,aQ,aR,aV,aW,aO,aS,aM,aL=null,aU=null;for(aP=this.containers.length-1;aP>=0;aP--){if(ax.contains(this.currentItem[0],this.containers[aP].element[0])){continue}if(this._intersectsWith(this.containers[aP].containerCache)){if(aL&&ax.contains(this.containers[aP].element[0],aL.element[0])){continue}aL=this.containers[aP];aU=aP}else{if(this.containers[aP].containerCache.over){this.containers[aP]._trigger("out",aK,this._uiHash(this));this.containers[aP].containerCache.over=0}}}this.innermostContainer=aL;if(!aL){return}if(this.containers.length===1){if(!this.containers[aU].containerCache.over){this.containers[aU]._trigger("over",aK,this._uiHash(this));this.containers[aU].containerCache.over=1}}else{aT=10000;aQ=null;aS=aL.floating||this._isFloating(this.currentItem);aR=aS?"left":"top";aV=aS?"width":"height";aM=aS?"pageX":"pageY";for(aN=this.items.length-1;aN>=0;aN--){if(!ax.contains(this.containers[aU].element[0],this.items[aN].item[0])){continue}if(this.items[aN].item[0]===this.currentItem[0]){continue}aW=this.items[aN].item.offset()[aR];aO=false;if(aK[aM]-aW>this.items[aN][aV]/2){aO=true}if(Math.abs(aK[aM]-aW)<aT){aT=Math.abs(aK[aM]-aW);aQ=this.items[aN];this.direction=aO?"up":"down"}}if(!aQ&&!this.options.dropOnEmpty){return}if(this.currentContainer===this.containers[aU]){if(!this.currentContainer.containerCache.over){this.containers[aU]._trigger("over",aK,this._uiHash());this.currentContainer.containerCache.over=1}return}if(aQ){this._rearrange(aK,aQ,null,true)}else{this._rearrange(aK,null,this.containers[aU].element,true)}this._trigger("change",aK,this._uiHash());this.containers[aU]._trigger("change",aK,this._uiHash(this));this.currentContainer=this.containers[aU];this.options.placeholder.update(this.currentContainer,this.placeholder);this.scrollParent=this.placeholder.scrollParent();if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}this.containers[aU]._trigger("over",aK,this._uiHash(this));this.containers[aU].containerCache.over=1}},_createHelper:function(aL){var aM=this.options,aK=typeof aM.helper==="function"?ax(aM.helper.apply(this.element[0],[aL,this.currentItem])):(aM.helper==="clone"?this.currentItem.clone():this.currentItem);if(!aK.parents("body").length){this.appendTo[0].appendChild(aK[0])}if(aK[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(!aK[0].style.width||aM.forceHelperSize){aK.width(this.currentItem.width())}if(!aK[0].style.height||aM.forceHelperSize){aK.height(this.currentItem.height())}return aK},_adjustOffsetFromHelper:function(aK){if(typeof aK==="string"){aK=aK.split(" ")}if(Array.isArray(aK)){aK={left:+aK[0],top:+aK[1]||0}}if("left" in aK){this.offset.click.left=aK.left+this.margins.left}if("right" in aK){this.offset.click.left=this.helperProportions.width-aK.right+this.margins.left}if("top" in aK){this.offset.click.top=aK.top+this.margins.top}if("bottom" in aK){this.offset.click.top=this.helperProportions.height-aK.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var aK=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&ax.contains(this.scrollParent[0],this.offsetParent[0])){aK.left+=this.scrollParent.scrollLeft();aK.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&ax.ui.ie)){aK={top:0,left:0}}return{top:aK.top+(parseInt(this.offsetParent.css("borderTopWidth"),
vendor: 4,403 bytes, line 160
16010)||0),left:aK.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var aK=this.currentItem.position();return{top:aK.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:aK.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var aL,aN,aK,aM=this.options;if(aM.containment==="parent"){aM.containment=this.helper[0].parentNode}if(aM.containment==="document"||aM.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,aM.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(aM.containment==="document"?(this.document.height()||document.body.parentNode.scrollHeight):this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(aM.containment)){aL=ax(aM.containment)[0];aN=ax(aM.containment).offset();aK=(ax(aL).css("overflow")!=="hidden");this.containment=[aN.left+(parseInt(ax(aL).css("borderLeftWidth"),10)||0)+(parseInt(ax(aL).css("paddingLeft"),10)||0)-this.margins.left,aN.top+(parseInt(ax(aL).css("borderTopWidth"),10)||0)+(parseInt(ax(aL).css("paddingTop"),10)||0)-this.margins.top,aN.left+(aK?Math.max(aL.scrollWidth,aL.offsetWidth):aL.offsetWidth)-(parseInt(ax(aL).css("borderLeftWidth"),10)||0)-(parseInt(ax(aL).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,aN.top+(aK?Math.max(aL.scrollHeight,aL.offsetHeight):aL.offsetHeight)-(parseInt(ax(aL).css("borderTopWidth"),10)||0)-(parseInt(ax(aL).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(aM,aO){if(!aO){aO=this.position}var aL=aM==="absolute"?1:-1,aK=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&ax.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,aN=(/(html|body)/i).test(aK[0].tagName);return{top:(aO.top+this.offset.relative.top*aL+this.offset.parent.top*aL-((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(aN?0:aK.scrollTop()))*aL)),left:(aO.left+this.offset.relative.left*aL+this.offset.parent.left*aL-((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():aN?0:aK.scrollLeft())*aL))}},_generatePosition:function(aN){var aP,aO,aQ=this.options,aM=aN.pageX,aL=aN.pageY,aK=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&ax.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,aR=(/(html|body)/i).test(aK[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}if(this.originalPosition){if(this.containment){if(aN.pageX-this.offset.click.left<this.containment[0]){aM=this.containment[0]+this.offset.click.left}if(aN.pageY-this.offset.click.top<this.containment[1]){aL=this.containment[1]+this.offset.click.top}if(aN.pageX-this.offset.click.left>this.containment[2]){aM=this.containment[2]+this.offset.click.left}if(aN.pageY-this.offset.click.top>this.containment[3]){aL=this.containment[3]+this.offset.click.top}}if(aQ.grid){aP=this.originalPageY+Math.round((aL-this.originalPageY)/aQ.grid[1])*aQ.grid[1];aL=this.containment?((aP-this.offset.click.top>=this.containment[1]&&aP-this.offset.click.top<=this.containment[3])?aP:((aP-this.offset.click.top>=this.containment[1])?aP-aQ.grid[1]:aP+aQ.grid[1])):aP;aO=this.originalPageX+Math.round((aM-this.originalPageX)/aQ.grid[0])*aQ.grid[0];aM=this.containment?((aO-this.offset.click.left>=this.containment[0]&&aO-this.offset.click.left<=this.containment[2])?aO:((aO-this.offset.click.left>=this.containment[0])?aO-aQ.grid[0]:aO+aQ.grid[0])):aO}}return{top:(aL-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(aR?0:aK.scrollTop())))),left
160:(aM-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():aR?0:aK.scrollLeft())))}},_rearrange:function(aO,aN,aL,aM){if(aL){aL[0].appendChild(this.placeholder[0])}else{aN.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?aN.item[0]:aN.item[0].nextSibling))}this.counter=this.counter?++this.counter:1;var aK=this.counter;this._delay(function(){if(aK===this.counter){this.refreshPositions(!aM)}})},_clear:function(aL,aN){this.reverting=false;var aK,aO=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(aK in this._storedCSS){if(this._storedCSS[aK]==="auto"||this._storedCSS[aK]==="static"){this._storedCSS[aK]=""}}this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!aN){aO.push(function(aP){this._trigger("receive",aP,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!aN){aO.push(function(aP){this._trigger("update",aP,this._uiHash())})}if(this!==this.currentContainer){if(!aN){aO.push(function(aP){this._trigger("remove",aP,this._uiHash())});aO.push((function(aP){return function(aQ){aP._trigger("receive",aQ,this._uiHash(this))}}).call(this,this.currentContainer));aO.push((function(aP){return function(aQ){aP._trigger("update",aQ,this._uiHash(this))}}).call(this,this.currentContainer))}}function aM(aR,aP,aQ){return function(aS){aQ._trigger(aR,aS,aP._uiHash(aP))}}for(aK=this.containers.length-1;aK>=0;aK--){if(!aN){aO.push(aM("deactivate",this,this.containers[aK]))}if(this.containers[aK].containerCache.over){aO.push(aM("out",this,this.containers[aK]));this.containers[aK].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)}this.dragging=false;if(!aN){this._trigger("beforeStop",aL,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()}this.helper=null}if(!aN){for(aK=0;aK<aO.length;aK++){aO[aK].call(this,aL)}this._trigger("stop",aL,this._uiHash())}this.fromOutside=false;return !this.cancelHelperRemoval},_trigger:function(){if(ax.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(aK){var aL=aK||this;return{helper:aL.helper,placeholder:aL.placeholder||ax([]),position:aL.position,originalPosition:aL.originalPosition,offset:aL.positionAbs,item:aL.currentItem,sender:aK?aK.element:null}}}); 161/*! 162 * jQuery UI Accordion 1.13.0 163 * http://jqueryui.com 164 * 165 * Copyright jQuery Foundation and other contributors 166 * Released under the MIT license. 167 * http://jquery.org/license 168 */ 169var d=ax.widget("ui.accordion",{version:"1.13.0",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:false,event:"click",header:function(aK){return aK.find("> li > :first-child").add(aK.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var aK=this.options;this.prevShow=this.prevHide=ax();this._addClass("ui-accordion","ui-widget ui-helper-reset");this.element.attr("role","tablist");if(!aK.collapsible&&(aK.active===false||aK.active==null)){aK.active=0}this._processPanels();if(aK.active<0){aK.active+=this.headers.length}this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:!this.active.length?ax():this.active.next()}},_createIcons:function(){var aM,aL,aK=this.options.icons;
169if(aK){aM=ax("<span>");this._addClass(aM,"ui-accordion-header-icon","ui-icon "+aK.header);aM.prependTo(this.headers);aL=this.active.children(".ui-accordion-header-icon");this._removeClass(aL,aK.header)._addClass(aL,null,aK.activeHeader)._addClass(this.headers,"ui-accordion-icons")}},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons");this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var aK;this.element.removeAttr("role");this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId();this._destroyIcons();aK=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId();if(this.options.heightStyle!=="content"){aK.css("height","")}},_setOption:function(aK,aL){if(aK==="active"){this._activate(aL);return}if(aK==="event"){if(this.options.event){this._off(this.headers,this.options.event)}this._setupEvents(aL)}this._super(aK,aL);if(aK==="collapsible"&&!aL&&this.options.active===false){this._activate(0)}if(aK==="icons"){this._destroyIcons();if(aL){this._createIcons()}}},_setOptionDisabled:function(aK){this._super(aK);this.element.attr("aria-disabled",aK);this._toggleClass(null,"ui-state-disabled",!!aK);this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!aK)},_keydown:function(aN){if(aN.altKey||aN.ctrlKey){return}var aO=ax.ui.keyCode,aM=this.headers.length,aK=this.headers.index(aN.target),aL=false;switch(aN.keyCode){case aO.RIGHT:case aO.DOWN:aL=this.headers[(aK+1)%aM];break;case aO.LEFT:case aO.UP:aL=this.headers[(aK-1+aM)%aM];break;case aO.SPACE:case aO.ENTER:this._eventHandler(aN);break;case aO.HOME:aL=this.headers[0];break;case aO.END:aL=this.headers[aM-1];break}if(aL){ax(aN.target).attr("tabIndex",-1);ax(aL).attr("tabIndex",0);ax(aL).trigger("focus");aN.preventDefault()}},_panelKeyDown:function(aK){if(aK.keyCode===ax.ui.keyCode.UP&&aK.ctrlKey){ax(aK.currentTarget).prev().trigger("focus")}},refresh:function(){var aK=this.options;this._processPanels();if((aK.active===false&&aK.collapsible===true)||!this.headers.length){aK.active=false;this.active=ax()}else{if(aK.active===false){this._activate(0)}else{if(this.active.length&&!ax.contains(this.element[0],this.active[0])){if(this.headers.length===this.headers.find(".ui-state-disabled").length){aK.active=false;this.active=ax()}else{this._activate(Math.max(0,aK.active-1))}}else{aK.active=this.headers.index(this.active)}}}this._destroyIcons();this._refresh()},_processPanels:function(){var aL=this.headers,aK=this.panels;if(typeof this.options.header==="function"){this.headers=this.options.header(this.element)}else{this.headers=this.element.find(this.options.header)}this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default");this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide();this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content");if(aK){this._off(aL.not(this.headers));this._off(aK.not(this.panels))}},_refresh:function(){var aN,aL=this.options,aK=aL.heightStyle,aM=this.element.parent();this.active=this._findActive(aL.active);this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed");this._addClass(this.active.next(),"ui-accordion-content-active");this.active.next().show();this.headers.attr("role","tab").each(function(){var aR=ax(this),aQ=aR.uniqueId().attr("id"),aO=aR.next(),aP=aO.uniqueId().attr("id");aR.attr("aria-controls",aP);aO.attr("aria-labelledby",aQ)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0)}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"})}this._createIcons();this._setupEvents(aL.event);if(aK==="fill"){aN=aM.height();this.element.siblings(":visible").each(function(){var aP=ax(this),aO=aP.css("position");if(aO==="absolute"||aO==="fixed"){return}aN-=aP.outerHeight(true)});this.headers.each(function(){aN-=ax(this).outerHeight(true)});this.headers.next().each(function(){ax(this).height(Math.max(0,aN-ax(this).innerHeight()+ax(this).height()))}).css("overflow","auto")}else{if(aK==="auto"){aN=0;this.headers.next().each(function(){var aO=ax(this).is(":visible");if(!aO){ax(this).show()}aN=Math.max(aN,ax(this).css("height","").height());if(!aO){ax(this).hide()}}).height(aN)}}},_activate:function(aK){var aL=this._findActive(aK)[0];if(aL===this.active[0]){return}aL=aL||this.active[0];this._eventHandler({target:aL,currentTarget:aL,preventDefault:ax.noop})},_findActive:function(aK){return typeof aK==="number"?this.headers.eq(aK):ax()}
169,_setupEvents:function(aL){var aK={keydown:"_keydown"};if(aL){ax.each(aL.split(" "),function(aN,aM){aK[aM]="_eventHandler"})}this._off(this.headers.add(this.headers.next()));this._on(this.headers,aK);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers)},_eventHandler:function(aL){var aM,aN,aU=this.options,aP=this.active,aQ=ax(aL.currentTarget),aS=aQ[0]===aP[0],aO=aS&&aU.collapsible,aK=aO?ax():aQ.next(),aR=aP.next(),aT={oldHeader:aP,oldPanel:aR,newHeader:aO?ax():aQ,newPanel:aK};aL.preventDefault();if((aS&&!aU.collapsible)||(this._trigger("beforeActivate",aL,aT)===false)){return}aU.active=aO?false:this.headers.index(aQ);this.active=aS?ax():aQ;this._toggle(aT);this._removeClass(aP,"ui-accordion-header-active","ui-state-active");if(aU.icons){aM=aP.children(".ui-accordion-header-icon");this._removeClass(aM,null,aU.icons.activeHeader)._addClass(aM,null,aU.icons.header)}if(!aS){this._removeClass(aQ,"ui-accordion-header-collapsed")._addClass(aQ,"ui-accordion-header-active","ui-state-active");if(aU.icons){aN=aQ.children(".ui-accordion-header-icon");this._removeClass(aN,null,aU.icons.header)._addClass(aN,null,aU.icons.activeHeader)}this._addClass(aQ.next(),"ui-accordion-content-active")}},_toggle:function(aM){var aK=aM.newPanel,aL=this.prevShow.length?this.prevShow:aM.oldPanel;this.prevShow.add(this.prevHide).stop(true,true);this.prevShow=aK;this.prevHide=aL;if(this.options.animate){this._animate(aK,aL,aM)}else{aL.hide();aK.show();this._toggleComplete(aM)}aL.attr({"aria-hidden":"true"});aL.prev().attr({"aria-selected":"false","aria-expanded":"false"});if(aK.length&&aL.length){aL.prev().attr({tabIndex:-1,"aria-expanded":"false"})}else{if(aK.length){this.headers.filter(function(){return parseInt(ax(this).attr("tabIndex"),10)===0}).attr("tabIndex",-1)}}aK.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(aK,aT,aP){var aS,aR,aO,aQ=this,aU=0,aN=aK.css("box-sizing"),aV=aK.length&&(!aT.length||(aK.index()<aT.index())),aM=this.options.animate||{},aW=aV&&aM.down||aM,aL=function(){aQ._toggleComplete(aP)};if(typeof aW==="number"){aO=aW}if(typeof aW==="string"){aR=aW}aR=aR||aW.easing||aM.easing;aO=aO||aW.duration||aM.duration;if(!aT.length){return aK.animate(this.showProps,aO,aR,aL)}if(!aK.length){return aT.animate(this.hideProps,aO,aR,aL)}aS=aK.show().outerHeight();aT.animate(this.hideProps,{duration:aO,easing:aR,step:function(aX,aY){aY.now=Math.round(aX)}});aK.hide().animate(this.showProps,{duration:aO,easing:aR,complete:aL,step:function(aX,aY){aY.now=Math.round(aX);if(aY.prop!=="height"){if(aN==="content-box"){aU+=aY.now}}else{if(aQ.options.heightStyle!=="content"){aY.now=Math.round(aS-aT.outerHeight()-aU);aU=0}}}})},_toggleComplete:function(aM){var aK=aM.oldPanel,aL=aK.prev();this._removeClass(aK,"ui-accordion-content-active");this._removeClass(aL,"ui-accordion-header-active")._addClass(aL,"ui-accordion-header-collapsed");if(aK.length){aK.parent()[0].className=aK.parent()[0].className}this._trigger("activate",null,aM)}}); 170/*! 171 * jQuery UI Menu 1.13.0 172 * http://jqueryui.com 173 * 174 * Copyright jQuery Foundation and other contributors 175 * Released under the MIT license. 176 * http://jquery.org/license 177 */ 178var r=ax.widget("ui.menu",{version:"1.13.0",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=false;this.lastMousePosition={x:null,y:null};this.element.uniqueId().attr({role:this.options.role,tabIndex:0});this._addClass("ui-menu","ui-widget ui-widget-content");this._on({"mousedown .ui-menu-item":function(aK){aK.preventDefault();this._activateItem(aK)},"click .ui-menu-item":function(aK){var aM=ax(aK.target);var aL=ax(ax.ui.safeActiveElement(this.document[0]));if(!this.mouseHandled&&aM.not(".ui-state-disabled").length){this.select(aK);if(!aK.isPropagationStopped()){this.mouseHandled=true}if(aM.has(".ui-menu").length){this.expand(aK)}else{if(!this.element.is(":focus")&&aL.closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer)}}}}},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(aM,aK){var aL=this.active||this._menuItems().first();if(!aK){this.focus(aM,aL)}},blur:function(aK){this._delay(function(){var aL=!ax.contains(this.element[0],ax.ui.safeActiveElement(this.document[0]));if(aL){this.collapseAll(aK)}})},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(aK){if(this._closeOnDocumentClick(aK)){this.collapseAll(aK,true)}this.mouseHandled=false}})},_activateItem:function(aK){if(this.previousFilter){return}if(aK.clientX===this.lastMousePosition.x&&aK.clientY===this.lastMousePosition.y){return}this.lastMousePosition={x:aK.clientX,y:aK.clientY};var aL=ax(aK.target).closest(".ui-menu-item"),aM=ax(aK.currentTarget);if(aL[0]!==aM[0]){return}if(aM.is(".ui-state-active")){return}this._removeClass(aM.siblings().children(".ui-state-active"),null,"ui-state-active");this.focus(aK,aM)},_destroy:function(){var aL=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),aK=aL.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show();aK.children().each(function(){var aM=ax(this);if(aM.data("ui-menu-submenu-caret")){aM.remove()}})},_keydown:function(aO){var aL,aN,aP,aM,aK=true;switch(aO.keyCode){case ax.ui.keyCode.PAGE_UP:this.previousPage(aO);break;case ax.ui.keyCode.PAGE_DOWN:this.nextPage(aO);break;case ax.ui.keyCode.HOME:this._move("first","first",aO);break;case ax.ui.keyCode.END:this._move("last","last",aO);break;case ax.ui.keyCode.UP:this.previous(aO);break;case ax.ui.keyCode.DOWN:this.next(aO);break;case ax.ui.keyCode.LEFT:this.collapse(aO);break;case ax.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(aO)}break;case ax.ui.keyCode.ENTER:case ax.ui.keyCode.SPACE:this._activate(aO);break;case ax.ui.keyCode.ESCAPE:this.collapse(aO);break;default:aK=false;aN=this.previousFilter||"";aM=false;aP=aO.keyCode>=96&&aO.keyCode<=105?(aO.keyCode-96).toString():String.fromCharCode(aO.keyCode);clearTimeout(this.filterTimer);if(aP===aN){aM=true}else{aP=aN+aP}aL=this._filterMenuItems(aP);aL=aM&&aL.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):aL;if(!aL.length){aP=String.fromCharCode(aO.keyCode);aL=this._filterMenuItems(aP)}if(aL.length){this.focus(aO,aL);this.previousFilter=aP;this.filterTimer=this._delay(function(){delete this.previousFilter},1000)}else{delete this.previousFilter}}if(aK){aO.preventDefault()}},_activate:function(aK){if(this.active&&!this.active.is(".ui-state-disabled")){if(this.active.children("[aria-haspopup='true']").length){this.expand(aK)}else{this.select(aK)}}},refresh:function(){var aR,aM,aP,aN,aK,aQ=this,aO=this.options.icons.submenu,aL=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length);aP=aL.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}
178).each(function(){var aU=ax(this),aS=aU.prev(),aT=ax("<span>").data("ui-menu-submenu-caret",true);aQ._addClass(aT,"ui-menu-icon","ui-icon "+aO);aS.attr("aria-haspopup","true").prepend(aT);aU.attr("aria-labelledby",aS.attr("id"))});this._addClass(aP,"ui-menu","ui-widget ui-widget-content ui-front");aR=aL.add(this.element);aM=aR.find(this.options.items);aM.not(".ui-menu-item").each(function(){var aS=ax(this);if(aQ._isDivider(aS)){aQ._addClass(aS,"ui-menu-divider","ui-widget-content")}});aN=aM.not(".ui-menu-item, .ui-menu-divider");aK=aN.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()});this._addClass(aN,"ui-menu-item")._addClass(aK,"ui-menu-item-wrapper");aM.filter(".ui-state-disabled").attr("aria-disabled","true");if(this.active&&!ax.contains(this.element[0],this.active[0])){this.blur()}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(aL,aM){if(aL==="icons"){var aK=this.element.find(".ui-menu-icon");this._removeClass(aK,null,this.options.icons.submenu)._addClass(aK,null,aM.submenu)}this._super(aL,aM)},_setOptionDisabled:function(aK){this._super(aK);this.element.attr("aria-disabled",String(aK));this._toggleClass(null,"ui-state-disabled",!!aK)},focus:function(aM,aL){var aO,aN,aK;this.blur(aM,aM&&aM.type==="focus");this._scrollIntoView(aL);this.active=aL.first();aN=this.active.children(".ui-menu-item-wrapper");this._addClass(aN,null,"ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",aN.attr("id"))}aK=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper");this._addClass(aK,null,"ui-state-active");if(aM&&aM.type==="keydown"){this._close()}else{this.timer=this._delay(function(){this._close()},this.delay)}aO=aL.children(".ui-menu");if(aO.length&&aM&&(/^mouse/.test(aM.type))){this._startOpening(aO)}this.activeMenu=aL.parent();this._trigger("focus",aM,{item:aL})},_scrollIntoView:function(aN){var aQ,aM,aO,aK,aL,aP;if(this._hasScroll()){aQ=parseFloat(ax.css(this.activeMenu[0],"borderTopWidth"))||0;aM=parseFloat(ax.css(this.activeMenu[0],"paddingTop"))||0;aO=aN.offset().top-this.activeMenu.offset().top-aQ-aM;aK=this.activeMenu.scrollTop();aL=this.activeMenu.height();aP=aN.outerHeight();if(aO<0){this.activeMenu.scrollTop(aK+aO)}else{if(aO+aP>aL){this.activeMenu.scrollTop(aK+aO-aL+aP)}}}},blur:function(aL,aK){if(!aK){clearTimeout(this.timer)}if(!this.active){return}this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active");this._trigger("blur",aL,{item:this.active});this.active=null},_startOpening:function(aK){clearTimeout(this.timer);if(aK.attr("aria-hidden")!=="true"){return}this.timer=this._delay(function(){this._close();this._open(aK)},this.delay)},_open:function(aL){var aK=ax.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(aL.parents(".ui-menu")).hide().attr("aria-hidden","true");aL.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(aK)},collapseAll:function(aL,aK){clearTimeout(this.timer);this.timer=this._delay(function(){var aM=aK?this.element:ax(aL&&aL.target).closest(this.element.find(".ui-menu"));if(!aM.length){aM=this.element}this._close(aM);this.blur(aL);this._removeClass(aM.find(".ui-state-active"),null,"ui-state-active");this.activeMenu=aM},aK?0:this.delay)},_close:function(aK){if(!aK){aK=this.active?this.active.parent():this.element}aK.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(aK){return !ax(aK.target).closest(".ui-menu").length},_isDivider:function(aK){return !/[^\-\u2014\u2013\s]/.test(aK.text())},collapse:function(aL){var aK=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(aK&&aK.length){this._close();this.focus(aL,aK)}},expand:function(aL){var aK=this.active&&this._menuItems(this.active.children(".ui-menu")).first();if(aK&&aK.length){this._open(aK.parent());this._delay(function(){this.focus(aL,aK)})}},next:function(aK){this._move("next","first",aK)},previous:function(aK){this._move("prev","last",aK)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(aK){return(aK||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(aN,aL,aM){var aK;if(this.active){if(aN==="first"||aN==="last"){aK=this.active[aN==="first"?"prevAll":"nextAll"](".ui-menu-item").last()}else{aK=this.active[aN+"All"](".ui-menu-item").first()}}if(!aK||!aK.length||!this.active){aK=this._menuItems(this.activeMenu)[aL]()}this.focus(aM,aK)},nextPage:function(aM){var aL,aN,aK;if(!this.active){this.next(aM);return}if(this.isLastItem()){return}if(this._hasScroll()){aN=this.active.offset().top;
178aK=this.element.innerHeight();if(ax.fn.jquery.indexOf("3.2.")===0){aK+=this.element[0].offsetHeight-this.element.outerHeight()}this.active.nextAll(".ui-menu-item").each(function(){aL=ax(this);return aL.offset().top-aN-aK<0});this.focus(aM,aL)}else{this.focus(aM,this._menuItems(this.activeMenu)[!this.active?"first":"last"]())}},previousPage:function(aM){var aL,aN,aK;if(!this.active){this.next(aM);return}if(this.isFirstItem()){return}if(this._hasScroll()){aN=this.active.offset().top;aK=this.element.innerHeight();if(ax.fn.jquery.indexOf("3.2.")===0){aK+=this.element[0].offsetHeight-this.element.outerHeight()}this.active.prevAll(".ui-menu-item").each(function(){aL=ax(this);return aL.offset().top-aN+aK>0});this.focus(aM,aL)}else{this.focus(aM,this._menuItems(this.activeMenu).first())}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(aK){this.active=this.active||ax(aK.target).closest(".ui-menu-item");var aL={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(aK,true)}this._trigger("select",aK,aL)},_filterMenuItems:function(aM){var aK=aM.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),aL=new RegExp("^"+aK,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return aL.test(String.prototype.trim.call(ax(this).children(".ui-menu-item-wrapper").text()))})}}); 179/*! 180 * jQuery UI Autocomplete 1.13.0 181 * http://jqueryui.com 182 * 183 * Copyright jQuery Foundation and other contributors 184 * Released under the MIT license. 185 * http://jquery.org/license 186 */ 187ax.widget("ui.autocomplete",{version:"1.13.0",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var aM,aK,aN,aP=this.element[0].nodeName.toLowerCase(),aO=aP==="textarea",aL=aP==="input";this.isMultiLine=aO||!aL&&this._isContentEditable(this.element);this.valueMethod=this.element[aO||aL?"val":"text"];this.isNewMenu=true;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(aQ){if(this.element.prop("readOnly")){aM=true;aN=true;aK=true;return}aM=false;aN=false;aK=false;var aR=ax.ui.keyCode;switch(aQ.keyCode){case aR.PAGE_UP:aM=true;this._move("previousPage",aQ);break;case aR.PAGE_DOWN:aM=true;this._move("nextPage",aQ);break;case aR.UP:aM=true;this._keyEvent("previous",aQ);break;case aR.DOWN:aM=true;this._keyEvent("next",aQ);break;case aR.ENTER:if(this.menu.active){aM=true;aQ.preventDefault();this.menu.select(aQ)}break;case aR.TAB:if(this.menu.active){this.menu.select(aQ)}break;case aR.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term)}this.close(aQ);aQ.preventDefault()}break;default:aK=true;this._searchTimeout(aQ);break}},keypress:function(aQ){if(aM){aM=false;if(!this.isMultiLine||this.menu.element.is(":visible")){aQ.preventDefault()}return}if(aK){return}var aR=ax.ui.keyCode;switch(aQ.keyCode){case aR.PAGE_UP:this._move("previousPage",aQ);break;case aR.PAGE_DOWN:this._move("nextPage",aQ);break;case aR.UP:this._keyEvent("previous",aQ);break;case aR.DOWN:this._keyEvent("next",aQ);break}},input:function(aQ){if(aN){aN=false;aQ.preventDefault();return}this._searchTimeout(aQ)},focus:function(){this.selectedItem=null;this.previous=this._value()},blur:function(aQ){clearTimeout(this.searching);this.close(aQ);this._change(aQ)}});this._initSource();this.menu=ax("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance");this._addClass(this.menu.element,"ui-autocomplete","ui-front");this._on(this.menu.element,{mousedown:function(aQ){aQ.preventDefault()},menufocus:function(aS,aT){var aQ,aR;if(this.isNewMenu){this.isNewMenu=false;if(aS.originalEvent&&/^mouse/.test(aS.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){ax(aS.target).trigger(aS.originalEvent)});return}}aR=aT.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",aS,{item:aR}
187)){if(aS.originalEvent&&/^key/.test(aS.originalEvent.type)){this._value(aR.value)}}aQ=aT.item.attr("aria-label")||aR.value;if(aQ&&String.prototype.trim.call(aQ).length){this.liveRegion.children().hide();ax("<div>").text(aQ).appendTo(this.liveRegion)}},menuselect:function(aS,aT){var aR=aT.item.data("ui-autocomplete-item"),aQ=this.previous;if(this.element[0]!==ax.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");this.previous=aQ;this._delay(function(){this.previous=aQ;this.selectedItem=aR})}if(false!==this._trigger("select",aS,{item:aR})){this._value(aR.value)}this.term=this._value();this.close(aS);this.selectedItem=aR}});this.liveRegion=ax("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove()},_setOption:function(aK,aL){this._super(aK,aL);if(aK==="source"){this._initSource()}if(aK==="appendTo"){this.menu.element.appendTo(this._appendTo())}if(aK==="disabled"&&aL&&this.xhr){this.xhr.abort()}},_isEventTargetInWidget:function(aK){var aL=this.menu.element[0];return aK.target===this.element[0]||aK.target===aL||ax.contains(aL,aK.target)},_closeOnClickOutside:function(aK){if(!this._isEventTargetInWidget(aK)){this.close()}},_appendTo:function(){var aK=this.options.appendTo;if(aK){aK=aK.jquery||aK.nodeType?ax(aK):this.document.find(aK).eq(0)}if(!aK||!aK[0]){aK=this.element.closest(".ui-front, dialog")}if(!aK.length){aK=this.document[0].body}return aK},_initSource:function(){var aM,aK,aL=this;if(Array.isArray(this.options.source)){aM=this.options.source;this.source=function(aO,aN){aN(ax.ui.autocomplete.filter(aM,aO.term))}}else{if(typeof this.options.source==="string"){aK=this.options.source;this.source=function(aO,aN){if(aL.xhr){aL.xhr.abort()}aL.xhr=ax.ajax({url:aK,data:aO,dataType:"json",success:function(aP){aN(aP)},error:function(){aN([])}})}}else{this.source=this.options.source}}},_searchTimeout:function(aK){clearTimeout(this.searching);this.searching=this._delay(function(){var aM=this.term===this._value(),aL=this.menu.element.is(":visible"),aN=aK.altKey||aK.ctrlKey||aK.metaKey||aK.shiftKey;if(!aM||(aM&&!aL&&!aN)){this.selectedItem=null;this.search(null,aK)}},this.options.delay)},search:function(aL,aK){aL=aL!=null?aL:this._value();this.term=this._value();if(aL.length<this.options.minLength){return this.close(aK)}if(this._trigger("search",aK)===false){return}return this._search(aL)},_search:function(aK){this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:aK},this._response())},_response:function(){var aK=++this.requestIndex;return function(aL){if(aK===this.requestIndex){this.__response(aL)}this.pending--;if(!this.pending){this._removeClass("ui-autocomplete-loading")}}.bind(this)},__response:function(aK){if(aK){aK=this._normalize(aK)}this._trigger("response",null,{content:aK});if(!this.options.disabled&&aK&&aK.length&&!this.cancelSearch){this._suggest(aK);this._trigger("open")}else{this._close()}},close:function(aK){this.cancelSearch=true;this._close(aK)},_close:function(aK){this._off(this.document,"mousedown");if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",aK)}},_change:function(aK){if(this.previous!==this._value()){this._trigger("change",aK,{item:this.selectedItem})}},_normalize:function(aK){if(aK.length&&aK[0].label&&aK[0].value){return aK}return ax.map(aK,function(aL){if(typeof aL==="string"){return{label:aL,value:aL}}return ax.extend({},aL,{label:aL.label||aL.value,value:aL.value||aL.label})})},_suggest:function(aK){var aL=this.menu.element.empty();this._renderMenu(aL,aK);this.isNewMenu=true;this.menu.refresh();aL.show();this._resizeMenu();aL.position(ax.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next()}this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var aK=this.menu.element;aK.outerWidth(Math.max(aK.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(aL,aK){var aM=this;ax.each(aK,function(aN,aO){aM._renderItemData(aL,aO)})},_renderItemData:function(aK,aL){return this._renderItem(aK,aL).data("ui-autocomplete-item",aL)},_renderItem:function(aK,aL){return ax("<li>").append(ax("<div>").text(aL.label)).appendTo(aK)},_move:function(aL,aK){if(!this.menu.element.is(":visible")){this.search(null,aK);return}if(this.menu.isFirstItem()&&/^previous/.test(aL)||this.menu.isLastItem()&&/^next/.test(aL)){if
187(!this.isMultiLine){this._value(this.term)}this.menu.blur();return}this.menu[aL](aK)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(aL,aK){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(aL,aK);aK.preventDefault()}},_isContentEditable:function(aL){if(!aL.length){return false}var aK=aL.prop("contentEditable");if(aK==="inherit"){return this._isContentEditable(aL.parent())}return aK==="true"}});ax.extend(ax.ui.autocomplete,{escapeRegex:function(aK){return aK.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(aM,aK){var aL=new RegExp(ax.ui.autocomplete.escapeRegex(aK),"i");return ax.grep(aM,function(aN){return aL.test(aN.label||aN.value||aN)})}});ax.widget("ui.autocomplete",ax.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(aK){return aK+(aK>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(aL){var aK;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return}if(aL&&aL.length){aK=this.options.messages.results(aL.length)}else{aK=this.options.messages.noResults}this.liveRegion.children().hide();ax("<div>").text(aK).appendTo(this.liveRegion)}});var aB=ax.ui.autocomplete; 188/*! 189 * jQuery UI Controlgroup 1.13.0 190 * http://jqueryui.com 191 * 192 * Copyright jQuery Foundation and other contributors 193 * Released under the MIT license. 194 * http://jquery.org/license 195 */ 196var g=/ui-corner-([a-z]){2,6}/g;var y=ax.widget("ui.controlgroup",{version:"1.13.0",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:true,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar");this.refresh()},_destroy:function(){this._callChildMethod("destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");if(this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()}},_initWidgets:function(){var aL=this,aK=[];ax.each(this.options.items,function(aO,aM){var aP;var aN={};if(!aM){return}if(aO==="controlgroupLabel"){aP=aL.element.find(aM);aP.each(function(){var aQ=ax(this);if(aQ.children(".ui-controlgroup-label-contents").length){return}aQ.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")});aL._addClass(aP,null,"ui-widget ui-widget-content ui-state-default");aK=aK.concat(aP.get());return}if(!ax.fn[aO]){return}if(aL["_"+aO+"Options"]){aN=aL["_"+aO+"Options"]("middle")}else{aN={classes:{}}}aL.element.find(aM).each(function(){var aR=ax(this);var aQ=aR[aO]("instance");var aS=ax.widget.extend({},aN);if(aO==="button"&&aR.parent(".ui-spinner").length){return}if(!aQ){aQ=aR[aO]()[aO]("instance")}if(aQ){aS.classes=aL._resolveClassesValues(aS.classes,aQ)}aR[aO](aS);var aT=aR[aO]("widget");ax.data(aT[0],"ui-controlgroup-data",aQ?aQ:aR[aO]("instance"));aK.push(aT[0])})});this.childWidgets=ax(ax.uniqueSort(aK));this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(aK){this.childWidgets.each(function(){var aL=ax(this),aM=aL.data("ui-controlgroup-data");if(aM&&aM[aK]){aM[aK]()}})},_updateCornerClass:function(aM,aL){var aK="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";var aN=this._buildSimpleOptions(aL,"label").classes.label;this._removeClass(aM,null,aK);this._addClass(aM,null,aN)},_buildSimpleOptions:function(aL,aM){var aN=this.options.direction==="vertical";var aK={classes:{}};aK.classes[aM]={middle:"",first:"ui-corner-"+(aN?"top":"left"),last:"ui-corner-"+(aN?"bottom":"right"),only:"ui-corner-all"}[aL];return aK},_spinnerOptions:function(aK){var aL=this._buildSimpleOptions(aK,"ui-spinner");aL.classes["ui-spinner-up"]="";aL.classes["ui-spinner-down"]="";return aL},_buttonOptions:function(aK){return this._buildSimpleOptions(aK,"ui-button")},_checkboxradioOptions:function(aK){return this._buildSimpleOptions(aK,"ui-checkboxradio-label")},_selectmenuOptions:function(aK){var aL=this.options.direction==="vertical";return{width:aL?"auto":false,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(aL?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(aL?"top":"left")},last:{"ui-selectmenu-button-open":aL?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(aL?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[aK]}},_resolveClassesValues:function(aM,aL){var aK={};ax.each(aM,function(aN){var aO=aL.options.classes[aN]||"";aO=String.prototype.trim.call(aO.replace(g,""));aK[aN]=(aO+" "+aM[aN]).replace(/\s+/g," ")});return aK},_setOption:function(aK,aL){if(aK==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction)}this._super(aK,aL);if(aK==="disabled"){this._callChildMethod(aL?"disable":"enable");return}this.refresh()},refresh:function(){var aK,aL=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"){this._addClass(null,"ui-helper-clearfix")}this._initWidgets();aK=this.childWidgets;if(this.options.onlyVisible){aK=aK.filter(":visible")}if(aK.length){ax.each(["first","last"],function(aO,aP){var aM=aK[aP]().data("ui-controlgroup-data");if(aM&&aL["_"+aM.widgetName+"Options"]){var aN=aL["_"+aM.widgetName+"Options"](aK.length===1?"only":aP);aN.classes=aL._resolveClassesValues(aN.classes,aM);aM.element[aM.widgetName](aN)}else{aL._updateCornerClass(aK[aP](),aP)}});this._callChildMethod("refresh")}}}); 197/*! 198 * jQuery UI Checkboxradio 1.13.0 199 * http://jqueryui.com 200 * 201 * Copyright jQuery Foundation and other contributors 202 * Released under the MIT license. 203 * http://jquery.org/license 204 */ 205ax.widget("ui.checkboxradio",[ax.ui.formResetMixin,{version:"1.13.0",options:{disabled:null,label:null,icon:true,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var aL,aN;var aM=this;var aK=this._super()||{};this._readType();aN=this.element.labels();this.label=ax(aN[aN.length-1]);if(!this.label.length){ax.error("No label found for checkboxradio widget")}this.originalLabel="";this.label.contents().not(this.element[0]).each(function(){aM.originalLabel+=this.nodeType===3?ax(this).text():this.outerHTML});if(this.originalLabel){aK.label=this.originalLabel}aL=this.element[0].disabled;if(aL!=null){aK.disabled=aL}return aK},_create:function(){var aK=this.element[0].checked;this._bindFormResetHandler();if(this.options.disabled==null){this.options.disabled=this.element[0].disabled}this._setOption("disabled",this.options.disabled);this._addClass("ui-checkboxradio","ui-helper-hidden-accessible");this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget");
205if(this.type==="radio"){this._addClass(this.label,"ui-checkboxradio-radio-label")}if(this.options.label&&this.options.label!==this.originalLabel){this._updateLabel()}else{if(this.originalLabel){this.options.label=this.originalLabel}}this._enhance();if(aK){this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active")}this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var aK=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type;if(aK!=="input"||!/radio|checkbox/.test(this.type)){ax.error("Can't create checkboxradio on element.nodeName="+aK+" and element.type="+this.type)}},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var aM;var aK=this.element[0].name;var aL="input[name='"+ax.escapeSelector(aK)+"']";if(!aK){return ax([])}if(this.form.length){aM=ax(this.form[0].elements).filter(aL)}else{aM=ax(aL).filter(function(){return ax(this)._form().length===0})}return aM.not(this.element)},_toggleClasses:function(){var aK=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",aK);if(this.options.icon&&this.type==="checkbox"){this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",aK)._toggleClass(this.icon,null,"ui-icon-blank",!aK)}if(this.type==="radio"){this._getRadioGroup().each(function(){var aL=ax(this).checkboxradio("instance");if(aL){aL._removeClass(aL.label,"ui-checkboxradio-checked","ui-state-active")}})}},_destroy:function(){this._unbindFormResetHandler();if(this.icon){this.icon.remove();this.iconSpace.remove()}},_setOption:function(aK,aL){if(aK==="label"&&!aL){return}this._super(aK,aL);if(aK==="disabled"){this._toggleClass(this.label,null,"ui-state-disabled",aL);this.element[0].disabled=aL;return}this.refresh()},_updateIcon:function(aL){var aK="ui-icon ui-icon-background ";if(this.options.icon){if(!this.icon){this.icon=ax("<span>");this.iconSpace=ax("<span> </span>");
205this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")}if(this.type==="checkbox"){aK+=aL?"ui-icon-check ui-state-checked":"ui-icon-blank";this._removeClass(this.icon,null,aL?"ui-icon-blank":"ui-icon-check")}else{aK+="ui-icon-blank"}this._addClass(this.icon,"ui-checkboxradio-icon",aK);if(!aL){this._removeClass(this.icon,null,"ui-icon-check ui-state-checked")}this.icon.prependTo(this.label).after(this.iconSpace)}else{if(this.icon!==undefined){this.icon.remove();this.iconSpace.remove();delete this.icon}}},_updateLabel:function(){var aK=this.label.contents().not(this.element[0]);if(this.icon){aK=aK.not(this.icon[0])}if(this.iconSpace){aK=aK.not(this.iconSpace[0])}aK.remove();this.label.append(this.options.label)},refresh:function(){var aL=this.element[0].checked,aK=this.element[0].disabled;this._updateIcon(aL);this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",aL);if(this.options.label!==null){this._updateLabel()}if(aK!==this.options.disabled){this._setOptions({disabled:aK})}}}]);var aC=ax.ui.checkboxradio; 206/*! 207 * jQuery UI Button 1.13.0 208 * http://jqueryui.com 209 * 210 * Copyright jQuery Foundation and other contributors 211 * Released under the MIT license. 212 * http://jquery.org/license 213 */ 214ax.widget("ui.button",{version:"1.13.0",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:true},_getCreateOptions:function(){var aL,aK=this._super()||{};this.isInput=this.element.is("input");aL=this.element[0].disabled;if(aL!=null){aK.disabled=aL}this.originalLabel=this.isInput?this.element.val():this.element.html();if(this.originalLabel){aK.label=this.originalLabel}return aK},_create:function(){if(!this.option.showLabel&!this.options.icon){this.options.showLabel=true}if(this.options.disabled==null){this.options.disabled=this.element[0].disabled||false}this.hasTitle=!!this.element.attr("title");if(this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(this.options.label)}else{this.element.html(this.options.label)}}this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is("a")){this._on({keyup:function(aK){if(aK.keyCode===ax.ui.keyCode.SPACE){aK.preventDefault();if(this.element[0].click){this.element[0].click()}else{this.element.trigger("click")}}}})}},_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button")}if(this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip()}},_updateTooltip:function(){this.title=this.element.attr("title");if(!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label)}},_updateIcon:function(aM,aO){var aL=aM!=="iconPosition",aK=aL?this.options.iconPosition:aO,aN=aK==="top"||aK==="bottom";if(!this.icon){this.icon=ax("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(!this.options.showLabel){this._addClass("ui-button-icon-only")}}else{if(aL){this._removeClass(this.icon,null,this.options.icon)}}if(aL){this._addClass(this.icon,null,aO)}this._attachIcon(aK);if(aN){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){this.iconSpace.remove()}}else{if(!this.iconSpace){this.iconSpace=ax("<span> </span>");
214this._addClass(this.iconSpace,"ui-button-icon-space")}this._removeClass(this.icon,null,"ui-wiget-icon-block");this._attachIconSpace(aK)}},_destroy:function(){this.element.removeAttr("role");if(this.icon){this.icon.remove()}if(this.iconSpace){this.iconSpace.remove()}if(!this.hasTitle){this.element.removeAttr("title")}},_attachIconSpace:function(aK){this.icon[/^(?:end|bottom)/.test(aK)?"before":"after"](this.iconSpace)},_attachIcon:function(aK){this.element[/^(?:end|bottom)/.test(aK)?"append":"prepend"](this.icon)},_setOptions:function(aL){var aM=aL.showLabel===undefined?this.options.showLabel:aL.showLabel,aK=aL.icon===undefined?this.options.icon:aL.icon;if(!aM&&!aK){aL.showLabel=true}this._super(aL)},_setOption:function(aK,aL){if(aK==="icon"){if(aL){this._updateIcon(aK,aL)}else{if(this.icon){this.icon.remove();if(this.iconSpace){this.iconSpace.remove()}}}}if(aK==="iconPosition"){this._updateIcon(aK,aL)}if(aK==="showLabel"){this._toggleClass("ui-button-icon-only",null,!aL);this._updateTooltip()}if(aK==="label"){if(this.isInput){this.element.val(aL)}else{this.element.html(aL);if(this.icon){this._attachIcon(this.options.iconPosition);this._attachIconSpace(this.options.iconPosition)}}}this._super(aK,aL);if(aK==="disabled"){this._toggleClass(null,"ui-state-disabled",aL);this.element[0].disabled=aL;if(aL){this.element.trigger("blur")}}},refresh:function(){var aK=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");if(aK!==this.options.disabled){this._setOptions({disabled:aK})}this._updateTooltip()}});if(ax.uiBackCompat!==false){ax.widget("ui.button",ax.ui.button,{options:{text:true,icons:{primary:null,secondary:null}},_create:function(){if(this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text}if(!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel}if(!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(this.options.icons.primary){this.options.icon=this.options.icons.primary}else{this.options.icon=this.options.icons.secondary;this.options.iconPosition="end"}}else{if(this.options.icon){this.options.icons.primary=this.options.icon}}this._super()},_setOption:function(aK,aL){if(aK==="text"){this._super("showLabel",aL);return}if(aK==="showLabel"){this.options.text=aL}if(aK==="icon"){this.options.icons.primary=aL}if(aK==="icons"){if(aL.primary){this._super("icon",aL.primary);this._super("iconPosition","beginning")}else{if(aL.secondary){this._super("icon",aL.secondary);this._super("iconPosition","end")}}}this._superApply(arguments)}});ax.fn.button=(function(aK){return function(aN){var aL=typeof aN==="string";var aM=Array.prototype.slice.call(arguments,1);var aO=this;if(aL){if(!this.length&&aN==="instance"){aO=undefined}else{this.each(function(){var aS;var aR=ax(this).attr("type");var aQ=aR!=="checkbox"&&aR!=="radio"?"button":"checkboxradio";var aP=ax.data(this,"ui-"+aQ);if(aN==="instance"){aO=aP;return false}if(!aP){return ax.error("cannot call methods on button prior to initialization; attempted to call method '"+aN+"'")}if(typeof aP[aN]!=="function"||aN.charAt(0)==="_"){return ax.error("no such method '"+aN+"' for button widget instance")}aS=aP[aN].apply(aP,aM);if(aS!==aP&&aS!==undefined){aO=aS&&aS.jquery?aO.pushStack(aS.get()):aS;return false}})}}else{if(aM.length){aN=ax.widget.extend.apply(null,[aN].concat(aM))}this.each(function(){var aR=ax(this).attr("type");var aQ=aR!=="checkbox"&&aR!=="radio"?"button":"checkboxradio";var aP=ax.data(this,"ui-"+aQ);if(aP){aP.option(aN||{});if(aP._init){aP._init()}}else{if(aQ==="button"){aK.call(ax(this),aN);return}ax(this).checkboxradio(ax.extend({icon:false},aN))}})}return aO}})(ax.fn.button);ax.fn.buttonset=function(){if(!ax.ui.controlgroup){ax.error("Controlgroup widget missing")}if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]])}if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(this,[arguments[0],"items.button"])}if(typeof arguments[0]==="object"&&arguments[0].items){arguments[0].items={button:arguments[0].items}}return this.controlgroup.apply(this,arguments)}}var I=ax.ui.button; 215/*! 216 * jQuery UI Datepicker 1.13.0 217 * http://jqueryui.com 218 * 219 * Copyright jQuery Foundation and other contributors 220 * Released under the MIT license. 221 * http://jquery.org/license 222 */ 223ax.extend(ax.ui,{datepicker:{version:"1.13.0"}});var aF;function ao(aL){var aK,aM;while(aL.length&&aL[0]!==document){aK=aL.css("position");if(aK==="absolute"||aK==="relative"||aK==="fixed"){aM=parseInt(aL.css("zIndex"),10);if(!isNaN(aM)&&aM!==0){return aM}}aL=aL.parent()}return 0}function W(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
223ay","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};ax.extend(this._defaults,this.regional[""]);this.regional.en=ax.extend(true,{},this.regional[""]);this.regional["en-US"]=ax.extend(true,{},this.regional.en);this.dpDiv=af(ax("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}ax.extend(W.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(aK){L(this._defaults,aK||{});return this},_attachDatepicker:function(aN,aK){var aO,aM,aL;aO=aN.nodeName.toLowerCase();aM=(aO==="div"||aO==="span");if(!aN.id){this.uuid+=1;aN.id="dp"+this.uuid}aL=this._newInst(ax(aN),aM);aL.settings=ax.extend({},aK||{});if(aO==="input"){this._connectDatepicker(aN,aL)}else{if(aM){this._inlineDatepicker(aN,aL)}}},_newInst:function(aL,aK){var aM=aL[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:aM,input:aL,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:aK,dpDiv:(!aK?this.dpDiv:af(ax("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))}},_connectDatepicker:function(aM,aL){var aK=ax(aM);aL.append=ax([]);aL.trigger=ax([]);if(aK.hasClass(this.markerClassName)){return}this._attachments(aK,aL);aK.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp);this._autoSize(aL);ax.data(aM,"datepicker",aL);if(aL.settings.disabled){this._disableDatepicker(aM)}},_attachments:function(aM,aP){var aL,aO,aK,aQ=this._get(aP,"appendText"),aN=this._get(aP,"isRTL");if(aP.append){aP.append.remove()}if(aQ){aP.append=ax("<span>").addClass(this._appendClass).text(aQ);aM[aN?"before":"after"](aP.append)}aM.off("focus",this._showDatepicker);if(aP.trigger){aP.trigger.remove()}aL=this._get(aP,"showOn");if(aL==="focus"||aL==="both"){aM.on("focus",this._showDatepicker)}if(aL==="button"||aL==="both"){aO=this._get(aP,"buttonText");aK=this._get(aP,"buttonImage");if(this._get(aP,"buttonImageOnly")){aP.trigger=ax("<img>").addClass(this._triggerClass).attr({src:aK,alt:aO,title:aO})}else{aP.trigger=ax("<button type='button'>").addClass(this._triggerClass);if(aK){aP.trigger.html(ax("<img>").attr({src:aK,alt:aO,title:aO}))}else{aP.trigger.text(aO)}}aM[aN?"before":"after"](aP.trigger);aP.trigger.on("click",function(){if(ax.datepicker._datepickerShowing&&ax.datepicker._lastInput===aM[0]){ax.datepicker._hideDatepicker()}else{if(ax.datepicker._datepickerShowing&&ax.datepicker._lastInput!==aM[0]){ax.datepicker._hideDatepicker();ax.datepicker._showDatepicker(aM[0])}else{ax.datepicker._showDatepicker(aM[0])}}return false})}},_autoSize:function(aQ){if(this._get(aQ,"autoSize")&&!aQ.inline){var aN,aL,aM,aP,aO=new Date(2009,12-1,20),aK=this._get(aQ,"dateFormat");if(aK.match(/[DM]/)){aN=function(aR){aL=0;aM=0;for(aP=0;aP<aR.length;aP++){if(aR[aP].length>aL){aL=aR[aP].length;aM=aP}}return aM};aO.setMonth(aN(this._get(aQ,(aK.match(/MM/)?"monthNames":"monthNamesShort"))));aO.setDate(aN(this._get(aQ,(aK.match(/DD/)?"dayNames":"dayNamesShort")))+20-aO.getDay())}aQ.input.attr("size",this._formatDate(aQ,aO).length)}},_inlineDatepicker:function(aL,aK){var aM=ax(aL);if(aM.hasClass(this.markerClassName)){return}aM.addClass(this.markerClassName).append(aK.dpDiv);ax.data(aL,"datepicker",aK);this._setDate(aK,this._getDefaultDate(aK),true);this._updateDatepicker(aK);
223this._updateAlternate(aK);if(aK.settings.disabled){this._disableDatepicker(aL)}aK.dpDiv.css("display","block")},_dialogDatepicker:function(aR,aL,aP,aM,aQ){var aK,aU,aO,aT,aS,aN=this._dialogInst;if(!aN){this.uuid+=1;aK="dp"+this.uuid;this._dialogInput=ax("<input type='text' id='"+aK+"' style='position: absolute; top: -100px; width: 0px;'/>");this._dialogInput.on("keydown",this._doKeyDown);ax("body").append(this._dialogInput);aN=this._dialogInst=this._newInst(this._dialogInput,false);aN.settings={};ax.data(this._dialogInput[0],"datepicker",aN)}L(aN.settings,aM||{});aL=(aL&&aL.constructor===Date?this._formatDate(aN,aL):aL);this._dialogInput.val(aL);this._pos=(aQ?(aQ.length?aQ:[aQ.pageX,aQ.pageY]):null);if(!this._pos){aU=document.documentElement.clientWidth;aO=document.documentElement.clientHeight;aT=document.documentElement.scrollLeft||document.body.scrollLeft;aS=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(aU/2)-100+aT,(aO/2)-150+aS]}this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");aN.settings.onSelect=aP;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if(ax.blockUI){ax.blockUI(this.dpDiv)}ax.data(this._dialogInput[0],"datepicker",aN);return this},_destroyDatepicker:function(aM){var aN,aK=ax(aM),aL=ax.data(aM,"datepicker");if(!aK.hasClass(this.markerClassName)){return}aN=aM.nodeName.toLowerCase();ax.removeData(aM,"datepicker");if(aN==="input"){aL.append.remove();aL.trigger.remove();aK.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)}else{if(aN==="div"||aN==="span"){aK.removeClass(this.markerClassName).empty()}}if(aF===aL){aF=null;this._curInst=null}},_enableDatepicker:function(aN){var aO,aM,aK=ax(aN),aL=ax.data(aN,"datepicker");if(!aK.hasClass(this.markerClassName)){return}aO=aN.nodeName.toLowerCase();if(aO==="input"){aN.disabled=false;aL.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(aO==="div"||aO==="span"){aM=aK.children("."+this._inlineClass);aM.children().removeClass("ui-state-disabled");aM.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false)}}this._disabledInputs=ax.map(this._disabledInputs,function(aP){return(aP===aN?null:aP)})},_disableDatepicker:function(aN){var aO,aM,aK=ax(aN),aL=ax.data(aN,"datepicker");if(!aK.hasClass(this.markerClassName)){return}aO=aN.nodeName.toLowerCase();if(aO==="input"){aN.disabled=true;aL.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(aO==="div"||aO==="span"){aM=aK.children("."+this._inlineClass);aM.children().addClass("ui-state-disabled");aM.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true)}}this._disabledInputs=ax.map(this._disabledInputs,function(aP){return(aP===aN?null:aP)});this._disabledInputs[this._disabledInputs.length]=aN},_isDisabledDatepicker:function(aL){if(!aL){return false}for(var aK=0;aK<this._disabledInputs.length;aK++){if(this._disabledInputs[aK]===aL){return true}}return false},_getInst:function(aL){try{return ax.data(aL,"datepicker")}catch(aK){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(aQ,aL,aP){var aM,aK,aO,aR,aN=this._getInst(aQ);if(arguments.length===2&&typeof aL==="string"){return(aL==="defaults"?ax.extend({},ax.datepicker._defaults):(aN?(aL==="all"?ax.extend({},aN.settings):this._get(aN,aL)):null))}aM=aL||{};if(typeof aL==="string"){aM={};aM[aL]=aP}if(aN){if(this._curInst===aN){this._hideDatepicker()}aK=this._getDateDatepicker(aQ,true);aO=this._getMinMaxDate(aN,"min");aR=this._getMinMaxDate(aN,"max");L(aN.settings,aM);if(aO!==null&&aM.dateFormat!==undefined&&aM.minDate===undefined){aN.settings.minDate=this._formatDate(aN,aO)}if(aR!==null&&aM.dateFormat!==undefined&&aM.maxDate===undefined){aN.settings.maxDate=this._formatDate(aN,aR)}if("disabled" in aM){if(aM.disabled){this._disableDatepicker(aQ)}else{this._enableDatepicker(aQ)}}this._attachments(ax(aQ),aN);this._autoSize(aN);this._setDate(aN,aK);
223this._updateAlternate(aN);this._updateDatepicker(aN)}},_changeDatepicker:function(aM,aK,aL){this._optionDatepicker(aM,aK,aL)},_refreshDatepicker:function(aL){var aK=this._getInst(aL);if(aK){this._updateDatepicker(aK)}},_setDateDatepicker:function(aM,aK){var aL=this._getInst(aM);if(aL){this._setDate(aL,aK);this._updateDatepicker(aL);this._updateAlternate(aL)}},_getDateDatepicker:function(aM,aK){var aL=this._getInst(aM);if(aL&&!aL.inline){this._setDateFromField(aL,aK)}return(aL?this._getDate(aL):null)},_doKeyDown:function(aN){var aL,aK,aP,aO=ax.datepicker._getInst(aN.target),aQ=true,aM=aO.dpDiv.is(".ui-datepicker-rtl");aO._keyEvent=true;if(ax.datepicker._datepickerShowing){switch(aN.keyCode){case 9:ax.datepicker._hideDatepicker();aQ=false;break;case 13:aP=ax("td."+ax.datepicker._dayOverClass+":not(."+ax.datepicker._currentClass+")",aO.dpDiv);if(aP[0]){ax.datepicker._selectDay(aN.target,aO.selectedMonth,aO.selectedYear,aP[0])}aL=ax.datepicker._get(aO,"onSelect");if(aL){aK=ax.datepicker._formatDate(aO);aL.apply((aO.input?aO.input[0]:null),[aK,aO])}else{ax.datepicker._hideDatepicker()}return false;case 27:ax.datepicker._hideDatepicker();break;case 33:ax.datepicker._adjustDate(aN.target,(aN.ctrlKey?-ax.datepicker._get(aO,"stepBigMonths"):-ax.datepicker._get(aO,"stepMonths")),"M");break;case 34:ax.datepicker._adjustDate(aN.target,(aN.ctrlKey?+ax.datepicker._get(aO,"stepBigMonths"):+ax.datepicker._get(aO,"stepMonths")),"M");break;case 35:if(aN.ctrlKey||aN.metaKey){ax.datepicker._clearDate(aN.target)}aQ=aN.ctrlKey||aN.metaKey;break;case 36:if(aN.ctrlKey||aN.metaKey){ax.datepicker._gotoToday(aN.target)}aQ=aN.ctrlKey||aN.metaKey;break;case 37:if(aN.ctrlKey||aN.metaKey){ax.datepicker._adjustDate(aN.target,(aM?+1:-1),"D")}aQ=aN.ctrlKey||aN.metaKey;if(aN.originalEvent.altKey){ax.datepicker._adjustDate(aN.target,(aN.ctrlKey?-ax.datepicker._get(aO,"stepBigMonths"):-ax.datepicker._get(aO,"stepMonths")),"M")}break;case 38:if(aN.ctrlKey||aN.metaKey){ax.datepicker._adjustDate(aN.target,-7,"D")}aQ=aN.ctrlKey||aN.metaKey;break;case 39:if(aN.ctrlKey||aN.metaKey){ax.datepicker._adjustDate(aN.target,(aM?-1:+1),"D")}aQ=aN.ctrlKey||aN.metaKey;if(aN.originalEvent.altKey){ax.datepicker._adjustDate(aN.target,(aN.ctrlKey?+ax.datepicker._get(aO,"stepBigMonths"):+ax.datepicker._get(aO,"stepMonths")),"M")}break;case 40:if(aN.ctrlKey||aN.metaKey){ax.datepicker._adjustDate(aN.target,+7,"D")}aQ=aN.ctrlKey||aN.metaKey;break;default:aQ=false}}else{if(aN.keyCode===36&&aN.ctrlKey){ax.datepicker._showDatepicker(this)}else{aQ=false}}if(aQ){aN.preventDefault();aN.stopPropagation()}},_doKeyPress:function(aM){var aL,aK,aN=ax.datepicker._getInst(aM.target);if(ax.datepicker._get(aN,"constrainInput")){aL=ax.datepicker._possibleChars(ax.datepicker._get(aN,"dateFormat"));aK=String.fromCharCode(aM.charCode==null?aM.keyCode:aM.charCode);return aM.ctrlKey||aM.metaKey||(aK<" "||!aL||aL.indexOf(aK)>-1)}},_doKeyUp:function(aM){var aK,aN=ax.datepicker._getInst(aM.target);if(aN.input.val()!==aN.lastVal){try{aK=ax.datepicker.parseDate(ax.datepicker._get(aN,"dateFormat"),(aN.input?aN.input.val():null),ax.datepicker._getFormatConfig(aN));if(aK){ax.datepicker._setDateFromField(aN);ax.datepicker._updateAlternate(aN);ax.datepicker._updateDatepicker(aN)}}catch(aL){}}return true},_showDatepicker:function(aL){aL=aL.target||aL;if(aL.nodeName.toLowerCase()!=="input"){aL=ax("input",aL.parentNode)[0]}if(ax.datepicker._isDisabledDatepicker(aL)||ax.datepicker._lastInput===aL){return}var aN,aR,aM,aP,aQ,aK,aO;aN=ax.datepicker._getInst(aL);if(ax.datepicker._curInst&&ax.datepicker._curInst!==aN){ax.datepicker._curInst.dpDiv.stop(true,true);if(aN&&ax.datepicker._datepickerShowing){ax.datepicker._hideDatepicker(ax.datepicker._curInst.input[0])}}aR=ax.datepicker._get(aN,"beforeShow");aM=aR?aR.apply(aL,[aL,aN]):{};if(aM===false){return}L(aN.settings,aM);aN.lastVal=null;ax.datepicker._lastInput=aL;ax.datepicker._setDateFromField(aN);if(ax.datepicker._inDialog){aL.value=""}if(!ax.datepicker._pos){ax.datepicker._pos=ax.datepicker._findPos(aL);ax.datepicker._pos[1]+=aL.offsetHeight}aP=false;ax(aL).parents().each(function(){aP|=ax(this).css("position")==="fixed";return !aP});aQ={left:ax.datepicker._pos[0],top:ax.datepicker._pos[1]};ax.datepicker._pos=null;aN.dpDiv.empty();aN.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});ax.datepicker._updateDatepicker(aN);aQ=ax.datepicker._checkOffset(aN,aQ,aP);aN.dpDiv.css({position:(ax.datepicker._inDialog&&ax.blockUI?"static":(aP?"fixed":"absolute")),display:"none",left:aQ.left+"px",to
223p:aQ.top+"px"});if(!aN.inline){aK=ax.datepicker._get(aN,"showAnim");aO=ax.datepicker._get(aN,"duration");aN.dpDiv.css("z-index",ao(ax(aL))+1);ax.datepicker._datepickerShowing=true;if(ax.effects&&ax.effects.effect[aK]){aN.dpDiv.show(aK,ax.datepicker._get(aN,"showOptions"),aO)}else{aN.dpDiv[aK||"show"](aK?aO:null)}if(ax.datepicker._shouldFocusInput(aN)){aN.input.trigger("focus")}ax.datepicker._curInst=aN}},_updateDatepicker:function(aN){this.maxRows=4;aF=aN;aN.dpDiv.empty().append(this._generateHTML(aN));this._attachHandlers(aN);var aQ,aK=this._getNumberOfMonths(aN),aP=aK[1],aM=17,aL=aN.dpDiv.find("."+this._dayOverClass+" a"),aO=ax.datepicker._get(aN,"onUpdateDatepicker");if(aL.length>0){R.apply(aL.get(0))}aN.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(aP>1){aN.dpDiv.addClass("ui-datepicker-multi-"+aP).css("width",(aM*aP)+"em")}aN.dpDiv[(aK[0]!==1||aK[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");aN.dpDiv[(this._get(aN,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(aN===ax.datepicker._curInst&&ax.datepicker._datepickerShowing&&ax.datepicker._shouldFocusInput(aN)){aN.input.trigger("focus")}if(aN.yearshtml){aQ=aN.yearshtml;setTimeout(function(){if(aQ===aN.yearshtml&&aN.yearshtml){aN.dpDiv.find("select.ui-datepicker-year").first().replaceWith(aN.yearshtml)}aQ=aN.yearshtml=null},0)}if(aO){aO.apply((aN.input?aN.input[0]:null),[aN])}},_shouldFocusInput:function(aK){return aK.input&&aK.input.is(":visible")&&!aK.input.is(":disabled")&&!aK.input.is(":focus")},_checkOffset:function(aP,aN,aM){var aO=aP.dpDiv.outerWidth(),aS=aP.dpDiv.outerHeight(),aR=aP.input?aP.input.outerWidth():0,aK=aP.input?aP.input.outerHeight():0,aQ=document.documentElement.clientWidth+(aM?0:ax(document).scrollLeft()),aL=document.documentElement.clientHeight+(aM?0:ax(document).scrollTop());aN.left-=(this._get(aP,"isRTL")?(aO-aR):0);aN.left-=(aM&&aN.left===aP.input.offset().left)?ax(document).scrollLeft():0;aN.top-=(aM&&aN.top===(aP.input.offset().top+aK))?ax(document).scrollTop():0;aN.left-=Math.min(aN.left,(aN.left+aO>aQ&&aQ>aO)?Math.abs(aN.left+aO-aQ):0);aN.top-=Math.min(aN.top,(aN.top+aS>aL&&aL>aS)?Math.abs(aS+aK):0);return aN},_findPos:function(aN){var aK,aM=this._getInst(aN),aL=this._get(aM,"isRTL");while(aN&&(aN.type==="hidden"||aN.nodeType!==1||ax.expr.pseudos.hidden(aN))){aN=aN[aL?"previousSibling":"nextSibling"]}aK=ax(aN).offset();return[aK.left,aK.top]},_hideDatepicker:function(aM){var aL,aP,aO,aK,aN=this._curInst;if(!aN||(aM&&aN!==ax.data(aM,"datepicker"))){return}if(this._datepickerShowing){aL=this._get(aN,"showAnim");aP=this._get(aN,"duration");aO=function(){ax.datepicker._tidyDialog(aN)};if(ax.effects&&(ax.effects.effect[aL]||ax.effects[aL])){aN.dpDiv.hide(aL,ax.datepicker._get(aN,"showOptions"),aP,aO)}else{aN.dpDiv[(aL==="slideDown"?"slideUp":(aL==="fadeIn"?"fadeOut":"hide"))]((aL?aP:null),aO)}if(!aL){aO()}this._datepickerShowing=false;aK=this._get(aN,"onClose");if(aK){aK.apply((aN.input?aN.input[0]:null),[(aN.input?aN.input.val():""),aN])}this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(ax.blockUI){ax.unblockUI();ax("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(aK){aK.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(aL){if(!ax.datepicker._curInst){return}var aK=ax(aL.target),aM=ax.datepicker._getInst(aK[0]);if(((aK[0].id!==ax.datepicker._mainDivId&&aK.parents("#"+ax.datepicker._mainDivId).length===0&&!aK.hasClass(ax.datepicker.markerClassName)&&!aK.closest("."+ax.datepicker._triggerClass).length&&ax.datepicker._datepickerShowing&&!(ax.datepicker._inDialog&&ax.blockUI)))||(aK.hasClass(ax.datepicker.markerClassName)&&ax.datepicker._curInst!==aM)){ax.datepicker._hideDatepicker()}},_adjustDate:function(aO,aN,aM){var aL=ax(aO),aK=this._getInst(aL[0]);if(this._isDisabledDatepicker(aL[0])){return}this._adjustInstDate(aK,aN,aM);this._updateDatepicker(aK)},_gotoToday:function(aN){var aK,aM=ax(aN),aL=this._getInst(aM[0]);if(this._get(aL,"gotoCurrent")&&aL.currentDay){aL.selectedDay=aL.currentDay;aL.drawMonth=aL.selectedMonth=aL.currentMonth;aL.drawYear=aL.selectedYear=aL.currentYear}else{aK=new Date();aL.selectedDay=aK.getDate();aL.drawMonth=aL.selectedMonth=aK.getMonth();aL.drawYear=aL.selectedYear=aK.getFullYear()}this._notifyChange(aL);
223this._adjustDate(aM)},_selectMonthYear:function(aO,aK,aN){var aM=ax(aO),aL=this._getInst(aM[0]);aL["selected"+(aN==="M"?"Month":"Year")]=aL["draw"+(aN==="M"?"Month":"Year")]=parseInt(aK.options[aK.selectedIndex].value,10);this._notifyChange(aL);this._adjustDate(aM)},_selectDay:function(aP,aN,aK,aO){var aL,aM=ax(aP);if(ax(aO).hasClass(this._unselectableClass)||this._isDisabledDatepicker(aM[0])){return}aL=this._getInst(aM[0]);aL.selectedDay=aL.currentDay=parseInt(ax("a",aO).attr("data-date"));aL.selectedMonth=aL.currentMonth=aN;aL.selectedYear=aL.currentYear=aK;this._selectDate(aP,this._formatDate(aL,aL.currentDay,aL.currentMonth,aL.currentYear))},_clearDate:function(aL){var aK=ax(aL);this._selectDate(aK,"")},_selectDate:function(aO,aK){var aL,aN=ax(aO),aM=this._getInst(aN[0]);aK=(aK!=null?aK:this._formatDate(aM));if(aM.input){aM.input.val(aK)}this._updateAlternate(aM);aL=this._get(aM,"onSelect");if(aL){aL.apply((aM.input?aM.input[0]:null),[aK,aM])}else{if(aM.input){aM.input.trigger("change")}}if(aM.inline){this._updateDatepicker(aM)}else{this._hideDatepicker();this._lastInput=aM.input[0];if(typeof(aM.input[0])!=="object"){aM.input.trigger("focus")}this._lastInput=null}},_updateAlternate:function(aO){var aN,aM,aK,aL=this._get(aO,"altField");if(aL){aN=this._get(aO,"altFormat")||this._get(aO,"dateFormat");aM=this._getDate(aO);aK=this.formatDate(aN,aM,this._getFormatConfig(aO));ax(document).find(aL).val(aK)}},noWeekends:function(aL){var aK=aL.getDay();return[(aK>0&&aK<6),""]},iso8601Week:function(aK){var aL,aM=new Date(aK.getTime());aM.setDate(aM.getDate()+4-(aM.getDay()||7));aL=aM.getTime();aM.setMonth(0);aM.setDate(1);return Math.floor(Math.round((aL-aM)/86400000)/7)+1},parseDate:function(a0,aV,a2){if(a0==null||aV==null){throw"Invalid arguments"}aV=(typeof aV==="object"?aV.toString():aV+"");if(aV===""){return null}var aN,aX,aL,a1=0,aQ=(a2?a2.shortYearCutoff:null)||this._defaults.shortYearCutoff,aM=(typeof aQ!=="string"?aQ:new Date().getFullYear()%100+parseInt(aQ,10)),aT=(a2?a2.dayNamesShort:null)||this._defaults.dayNamesShort,a4=(a2?a2.dayNames:null)||this._defaults.dayNames,aK=(a2?a2.monthNamesShort:null)||this._defaults.monthNamesShort,aO=(a2?a2.monthNames:null)||this._defaults.monthNames,aP=-1,a5=-1,aZ=-1,aS=-1,aY=false,a3,aU=function(a7){var a8=(aN+1<a0.length&&a0.charAt(aN+1)===a7);if(a8){aN++}return a8},a6=function(a9){var a7=aU(a9),ba=(a9==="@"?14:(a9==="!"?20:(a9==="y"&&a7?4:(a9==="o"?3:2)))),bc=(a9==="y"?ba:1),bb=new RegExp("^\\d{"+bc+","+ba+"}"),a8=aV.substring(a1).match(bb);if(!a8){throw"Missing number at position "+a1}a1+=a8[0].length;return parseInt(a8[0],10)},aR=function(a8,a9,bb){var a7=-1,ba=ax.map(aU(a8)?bb:a9,function(bd,bc){return[[bc,bd]]}).sort(function(bd,bc){return -(bd[1].length-bc[1].length)});ax.each(ba,function(bd,be){var bc=be[1];if(aV.substr(a1,bc.length).toLowerCase()===bc.toLowerCase()){a7=be[0];a1+=bc.length;return false}});if(a7!==-1){return a7+1}else{throw"Unknown name at position "+a1}},aW=function(){if(aV.charAt(a1)!==a0.charAt(aN)){throw"Unexpected literal at position "+a1}a1++};for(aN=0;aN<a0.length;aN++){if(aY){if(a0.charAt(aN)==="'"&&!aU("'")){aY=false}else{aW()}}else{switch(a0.charAt(aN)){case"d":aZ=a6("d");break;case"D":aR("D",aT,a4);break;case"o":aS=a6("o");break;case"m":a5=a6("m");break;case"M":a5=aR("M",aK,aO);break;case"y":aP=a6("y");break;case"@":a3=new Date(a6("@"));aP=a3.getFullYear();a5=a3.getMonth()+1;aZ=a3.getDate();break;case"!":a3=new Date((a6("!")-this._ticksTo1970)/10000);aP=a3.getFullYear();a5=a3.getMonth()+1;aZ=a3.getDate();break;case"'":if(aU("'")){aW()}else{aY=true}break;default:aW()}}}if(a1<aV.length){aL=aV.substr(a1);if(!/^\s+/.test(aL)){throw"Extra/unparsed characters found in date: "+aL}}if(aP===-1){aP=new Date().getFullYear()}else{if(aP<100){aP+=new Date().getFullYear()-new Date().getFullYear()%100+(aP<=aM?0:-100)}}if(aS>-1){a5=1;aZ=aS;do{aX=this._getDaysInMonth(aP,a5-1);if(aZ<=aX){break}a5++;aZ-=aX}while(true)}a3=this._daylightSavingAdjust(new Date(aP,a5-1,aZ));if(a3.getFullYear()!==aP||a3.getMonth()+1!==a5||a3.getDate()!==aZ){throw"Invalid date"}return a3},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),formatDate:function(aT,aN,aO){if(!aN){return""}var aV,aW=(aO?aO.dayNamesShort:null)||this._defaults.dayNamesShort,aL=(aO?aO.dayNames:null)||this._defaults.dayNames,aR=(aO?aO.monthNamesShort:null)||this._defaults.monthNamesShort,aP=(aO?aO.monthNames:null)||this._defaults.monthNames,aU=function(aX){var aY=(aV+1<aT.length&&aT.charAt(aV+1)===aX);if(aY){aV++}return aY},aK=function(aZ,a0,aX){var aY=""+a0;if(aU(aZ)){while(aY.length<aX){aY="0"+aY}}return aY},aQ=function(aX,aZ,aY,a0){return(aU(aX)?a0[aZ]:aY[aZ])},aM="",aS=false;if(aN){for(aV=0;aV<aT.length;aV++){if(aS){if(aT.charAt(aV)==="'"&&!aU("'")){aS=false}else{aM+=aT.charAt(aV)}}else{switch(aT.charAt(aV)){case"d":aM+=aK("d",aN.getDate(),2);break;case"D":aM+=aQ("D",aN.getDay(),aW,aL);break;case"o":aM+=aK("o",Math.round((new Date(aN.getFullYear(),aN.getMonth(),aN.getDate()).getTime()-new Date(aN.getFullYear(),0,0).getTime())/86400000),3);break;case"m":aM+=aK("m",aN.getMonth()+1,2);break;case"M":aM+=aQ("M",aN.getMonth(),aR,aP);break;case"y":aM+=(aU("y")?aN.getFullYear():(aN.getFullYear()%100<10?"0":"")+aN.getFullYear()%100);break;case"@":aM+=aN.getTime();break;case"!":aM+=aN.getTime()*10000+this._ticksTo1970;break;case"'":if(aU("'")){aM+="'"}else{aS=true}break;default:aM+=aT.charAt(aV)}}}}return aM},_possibleChars:function(aO){var aN,aM="",aL=false,aK=function(aP){var aQ=(aN+1<aO.length&&aO.charAt(aN+1)===aP);if(aQ){aN++}return aQ};for(aN=0;aN<aO.length;aN++){if(aL){if(aO.charAt(aN)==="'"&&!aK("'")){aL=false}else{aM+=aO.charAt(aN)}}else{switch(aO.charAt(aN)){case"d":case"m":case"y":case"@":aM+="0123456789";break;case"D":case"M":return null;case"'":if(aK("'")){aM+="'"}else{aL=true}break;default:aM+=aO.charAt(aN)}}}return aM},_get:function(aL,aK){return aL.settings[aK]!==undefined?aL.settings[aK]:this._defaults[aK]},_setDateFromField:function(aP,aM){if(aP.input.val()===aP.lastVal){return}var aK=this._get(aP,"dateFormat"),aR=aP.lastVal=aP.input?aP.input.val():null,aQ=this._getDefaultDate(aP),aL=aQ,aN=this._getFormatConfig(aP);try{aL=this.parseDate(aK,aR,aN)||aQ}catch(aO){aR=(aM?"":aR)}aP.selectedDay=aL.getDate();aP.drawMonth=aP.selectedMonth=aL.getMonth();aP.drawYear=aP.selectedYear=aL.getFullYear();aP.currentDay=(aR?aL.getDate():0);aP.currentMonth=(aR?aL.getMonth():0);aP.currentYear=(aR?aL.getFullYear():0);this._adjustInstDate(aP)},_getDefaultDate:function(aK){return this._restrictMinMax(aK,this._determineDate(aK,this._get(aK,"defaultDate"),new Date()))},_determineDate:function(aO,aL,aP){var aN=function(aR){var aQ=new Date();aQ.setDate(aQ.getDate()+aR);return aQ},aM=function(aX){try{return ax.datepicker.parseDate(ax.datepicker._get(aO,"dateFormat"),aX,ax.datepicker._getFormatConfig(aO))}catch(aW){}var aR=(aX.toLowerCase().match(/^c/)?ax.datepicker._getDate(aO):null)||new Date(),aS=aR.getFullYear(),aV=aR.getMonth(),aQ=aR.getDate(),aU=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,aT=aU.exec(aX);while(aT){switch(aT[2]||"d"){case"d":case"D":aQ+=parseInt(aT[1],10);break;case"w":case"W":aQ+=parseInt(aT[1],10)*7;break;case"m":case"M":aV+=parseInt(aT[1],10);aQ=Math.min(aQ,ax.datepicker._getDaysInMonth(aS,aV));break;case"y":case"Y":aS+=parseInt(aT[1],10);aQ=Math.min(aQ,ax.datepicker._getDaysInMonth(aS,aV));break}aT=aU.exec(aX)}return new Date(aS,aV,aQ)},aK=(aL==null||aL===""?aP:(typeof aL==="string"?aM(aL):(typeof aL==="number"?(isNaN(aL)?aP:aN(aL)):new Date(aL.getTime()))));aK=(aK&&aK.toString()==="Invalid Date"?aP:aK);if(aK){aK.setHours(0);aK.setMinutes(0);aK.setSeconds(0);aK.setMilliseconds(0)}return this._daylightSavingAdjust(aK)},_daylightSavingAdjust:function(aK){if(!aK){return null}aK.setHours(aK.getHours()>12?aK.getHours()+2:0);return aK},_setDate:function(aQ,aN,aP){var aK=!aN,aM=aQ.selectedMonth,aO=aQ.selectedYear,aL=this._restrictMinMax(aQ,this._determineDate(aQ,aN,new Date()));aQ.selectedDay=aQ.currentDay=aL.getDate();aQ.drawMonth=aQ.selectedMonth=aQ.currentMonth=aL.getMonth();aQ.drawYear=aQ.selectedYear=aQ.currentYear=aL.getFullYear();if((aM!==aQ.selectedMonth||aO!==aQ.selectedYear)&&!aP){this._notifyChange(aQ)}this._adjustInstDate(aQ);
vendor: 5,806 bytes, line 223
223if(aQ.input){aQ.input.val(aK?"":this._formatDate(aQ))}},_getDate:function(aL){var aK=(!aL.currentYear||(aL.input&&aL.input.val()==="")?null:this._daylightSavingAdjust(new Date(aL.currentYear,aL.currentMonth,aL.currentDay)));return aK},_attachHandlers:function(aL){var aK=this._get(aL,"stepMonths"),aM="#"+aL.id.replace(/\\\\/g,"\\");aL.dpDiv.find("[data-handler]").map(function(){var aN={prev:function(){ax.datepicker._adjustDate(aM,-aK,"M")},next:function(){ax.datepicker._adjustDate(aM,+aK,"M")},hide:function(){ax.datepicker._hideDatepicker()},today:function(){ax.datepicker._gotoToday(aM)},selectDay:function(){ax.datepicker._selectDay(aM,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false},selectMonth:function(){ax.datepicker._selectMonthYear(aM,this,"M");return false},selectYear:function(){ax.datepicker._selectMonthYear(aM,this,"Y");return false}};ax(this).on(this.getAttribute("data-event"),aN[this.getAttribute("data-handler")])})},_generateHTML:function(bq){var a3,a2,bl,bd,aO,bu,bo,bh,bx,bb,bB,aV,aX,aW,aL,bt,aT,a6,bw,bj,bC,a5,ba,aU,aP,bm,bf,bi,bg,aS,a8,aY,bp,bs,aN,bv,bz,be,aZ,br=new Date(),a4=this._daylightSavingAdjust(new Date(br.getFullYear(),br.getMonth(),br.getDate())),by=this._get(bq,"isRTL"),bA=this._get(bq,"showButtonPanel"),bk=this._get(bq,"hideIfNoPrevNext"),a9=this._get(bq,"navigationAsDateFormat"),a0=this._getNumberOfMonths(bq),aR=this._get(bq,"showCurrentAtPos"),bc=this._get(bq,"stepMonths"),a7=(a0[0]!==1||a0[1]!==1),aM=this._daylightSavingAdjust((!bq.currentDay?new Date(9999,9,9):new Date(bq.currentYear,bq.currentMonth,bq.currentDay))),aQ=this._getMinMaxDate(bq,"min"),a1=this._getMinMaxDate(bq,"max"),aK=bq.drawMonth-aR,bn=bq.drawYear;if(aK<0){aK+=12;bn--}if(a1){a3=this._daylightSavingAdjust(new Date(a1.getFullYear(),a1.getMonth()-(a0[0]*a0[1])+1,a1.getDate()));a3=(aQ&&a3<aQ?aQ:a3);while(this._daylightSavingAdjust(new Date(bn,aK,1))>a3){aK--;if(aK<0){aK=11;bn--}}}bq.drawMonth=aK;bq.drawYear=bn;a2=this._get(bq,"prevText");a2=(!a9?a2:this.formatDate(a2,this._daylightSavingAdjust(new Date(bn,aK-bc,1)),this._getFormatConfig(bq)));if(this._canAdjustMonth(bq,-1,bn,aK)){bl=ax("<a>").attr({"class":"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:a2}).append(ax("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(by?"e":"w")).text(a2))[0].outerHTML}else{if(bk){bl=""}else{bl=ax("<a>").attr({"class":"ui-datepicker-prev ui-corner-all ui-state-disabled",title:a2}).append(ax("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(by?"e":"w")).text(a2))[0].outerHTML}}bd=this._get(bq,"nextText");bd=(!a9?bd:this.formatDate(bd,this._daylightSavingAdjust(new Date(bn,aK+bc,1)),this._getFormatConfig(bq)));if(this._canAdjustMonth(bq,+1,bn,aK)){aO=ax("<a>").attr({"class":"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:bd}).append(ax("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(by?"w":"e")).text(bd))[0].outerHTML}else{if(bk){aO=""}else{aO=ax("<a>").attr({"class":"ui-datepicker-next ui-corner-all ui-state-disabled",title:bd}).append(ax("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(by?"w":"e")).text(bd))[0].outerHTML}}bu=this._get(bq,"currentText");bo=(this._get(bq,"gotoCurrent")&&bq.currentDay?aM:a4);bu=(!a9?bu:this.formatDate(bu,bo,this._getFormatConfig(bq)));bh="";if(!bq.inline){bh=ax("<button>").attr({type:"button","class":"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(bq,"closeText"))[0].outerHTML}bx="";if(bA){bx=ax("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(by?bh:"").append(this._isInRange(bq,bo)?ax("<button>").attr({type:"button","class":"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(bu):"").append(by?"":bh)[0].outerHTML}bb=parseInt(this._get(bq,"firstDay"),10);bb=(isNaN(bb)?0:bb);bB=this._get(bq,"showWeek");aV=this._get(bq,"dayNames");aX=this._get(bq,"dayNamesMin");aW=this._get(bq,"monthNames");aL=this._get(bq,"monthNamesShort");bt=this._get(bq,"beforeShowDay");aT=this._get(bq,"showOtherMonths");a6=this._get(bq,"selectOtherMonths");bw=this._getDefaultDate(bq);bj="";for(a5=0;a5<a0[0];a5++){ba="";this.maxRows=4;for(aU=0;aU<a0[1];aU++){aP=this._daylightSavingAdjust(new Date(bn,aK,bq.selectedDay));bm=" ui-corner-all";bf="";if(a7){bf+="<div class='ui-datepicker-group";if(a0[1]>1){switch(aU){case 0:bf+=" ui-datepicker-group-first";bm=" ui-corner-"+(by?"right":"left");break;case a0[1]-1:bf+=" ui-datepicker-group-last";bm=" ui-corner-"+(by?"left":"right");break;default:bf+=" ui-datepicker-group-middle";bm="";break}}bf+="'>"}bf+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+bm+"'>"+(/all|left/.test(bm)&&a5===0?(by?aO:bl):"")+(/all|right/.test(bm)&&a5===0?(by?bl:aO):"")+this._generateMonthYearHeader(bq,aK,bn,aQ,a1,a5>0||aU>0,aW,aL)+"</div><table class='ui-datepicker-calendar'><thead><tr>";bi=(bB?"<th class='ui-datepicker-week-col'>"+this._get(bq,"weekHeader")+"</th>":"");for(bC=0;bC<7;bC++){bg=(bC+bb)%7;bi+="<th scope='col'"+((bC+bb+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+aV[bg]+"'>"+aX[bg]+"</span></th>"}bf+=bi+"</tr></thead><tbody>";aS=this._getDaysInMonth(bn,aK);if(bn===bq.selectedYear&&aK===bq.selectedMonth){bq.selectedDay=Math.min(bq.selectedDay,aS)}a8=(this._getFirstDayOfMonth(bn,aK)-bb+7)%7;aY=Math.ceil((a8+aS)/7);bp=(a7?this.maxRows>aY?this.maxRows:aY:aY);this.maxRows=bp;bs=this._daylightSavingAdjust(new Date(bn,aK,1-a8));for(aN=0;aN<bp;aN++){bf+="<tr>";bv=(!bB?"":"<td class='ui-datepicker-week-col'>"+this._get(bq,"calculateWeek")(bs)+"</td>");for(bC=0;bC<7;bC++){bz=(bt?bt.apply((bq.input?bq.input[0]:null),[bs]):[true,""]);be=(bs.getMonth()!==aK);
223aZ=(be&&!a6)||!bz[0]||(aQ&&bs<aQ)||(a1&&bs>a1);bv+="<td class='"+((bC+bb+6)%7>=5?" ui-datepicker-week-end":"")+(be?" ui-datepicker-other-month":"")+((bs.getTime()===aP.getTime()&&aK===bq.selectedMonth&&bq._keyEvent)||(bw.getTime()===bs.getTime()&&bw.getTime()===aP.getTime())?" "+this._dayOverClass:"")+(aZ?" "+this._unselectableClass+" ui-state-disabled":"")+(be&&!aT?"":" "+bz[1]+(bs.getTime()===aM.getTime()?" "+this._currentClass:"")+(bs.getTime()===a4.getTime()?" ui-datepicker-today":""))+"'"+((!be||aT)&&bz[2]?" title='"+bz[2].replace(/'/g,"'")+"'":"")+(aZ?"":" data-handler='selectDay' data-event='click' data-month='"+bs.getMonth()+"' data-year='"+bs.getFullYear()+"'")+">"+(be&&!aT?" ":(aZ?"<span class='ui-state-default'>"+bs.getDate()+"</span>":"<a class='ui-state-default"+(bs.getTime()===a4.getTime()?" ui-state-highlight":"")+(bs.getTime()===aM.getTime()?" ui-state-active":"")+(be?" ui-priority-secondary":"")+"' href='#' aria-current='"+(bs.getTime()===aM.getTime()?"true":"false")+"' data-date='"+bs.getDate()+"'>"+bs.getDate()+"</a>"))+"</td>";bs.setDate(bs.getDate()+1);bs=this._daylightSavingAdjust(bs)}bf+=bv+"</tr>"}aK++;if(aK>11){aK=0;bn++}bf+="</tbody></table>"+(a7?"</div>"+((a0[0]>0&&aU===a0[1]-1)?"<div class='ui-datepicker-row-break'></div>":""):"");ba+=bf}bj+=ba}bj+=bx;bq._keyEvent=false;return bj},_generateMonthYearHeader:function(aP,aM,aX,aR,aV,aZ,aT,aK){var a3,aL,a4,a1,aQ,a0,aW,aS,aN=this._get(aP,"changeMonth"),a5=this._get(aP,"changeYear"),a6=this._get(aP,"showMonthAfterYear"),aO=this._get(aP,"selectMonthLabel"),aY=this._get(aP,"selectYearLabel"),aU="<div class='ui-datepicker-title'>",a2="";if(aZ||!aN){a2+="<span class='ui-datepicker-month'>"+aT[aM]+"</span>"}else{a3=(aR&&aR.getFullYear()===aX);aL=(aV&&aV.getFullYear()===aX);a2+="<select class='ui-datepicker-month' aria-label='"+aO+"' data-handler='selectMonth' data-event='change'>";for(a4=0;a4<12;a4++){if((!a3||a4>=aR.getMonth())&&(!aL||a4<=aV.getMonth())){a2+="<option value='"+a4+"'"+(a4===aM?" selected='selected'":"")+">"+aK[a4]+"</option>"}}a2+="</select>"}if(!a6){aU+=a2+(aZ||!(aN&&a5)?" ":"")}if(!aP.yearshtml){aP.yearshtml="";if(aZ||!a5){aU+="<span class='ui-datepicker-year'>"+aX+"</span>"}else{a1=this._get(aP,"yearRange").split(":");aQ=new Date().getFullYear();a0=function(a8){var a7=(a8.match(/c[+\-].*/)?aX+parseInt(a8.substring(1),10):(a8.match(/[+\-].*/)?aQ+parseInt(a8,10):parseInt(a8,10)));return(isNaN(a7)?aQ:a7)};aW=a0(a1[0]);aS=Math.max(aW,a0(a1[1]||""));aW=(aR?Math.max(aW,aR.getFullYear()):aW);aS=(aV?Math.min(aS,aV.getFullYear()):aS);aP.yearshtml+="<select class='ui-datepicker-year' aria-label='"+aY+"' data-handler='selectYear' data-event='change'>";for(;aW<=aS;aW++){aP.yearshtml+="<option value='"+aW+"'"+(aW===aX?" selected='selected'":"")+">"+aW+"</option>"}aP.yearshtml+="</select>";aU+=aP.yearshtml;aP.yearshtml=null}}aU+=this._get(aP,"yearSuffix");if(a6){aU+=(aZ||!(aN&&a5)?" ":"")+a2}aU+="</div>";return aU},_adjustInstDate:function(aN,aQ,aP){var aM=aN.selectedYear+(aP==="Y"?aQ:0),aO=aN.selectedMonth+(aP==="M"?aQ:0),aK=Math.min(aN.selectedDay,this._getDaysInMonth(aM,aO))+(aP==="D"?aQ:0),aL=this._restrictMinMax(aN,this._daylightSavingAdjust(new Date(aM,aO,aK)));aN.selectedDay=aL.getDate();aN.drawMonth=aN.selectedMonth=aL.getMonth();aN.drawYear=aN.selectedYear=aL.getFullYear();if(aP==="M"||aP==="Y"){this._notifyChange(aN)}},_restrictMinMax:function(aN,aL){var aM=this._getMinMaxDate(aN,"min"),aO=this._getMinMaxDate(aN,"max"),aK=(aM&&aL<aM?aM:aL);return(aO&&aK>aO?aO:aK)},_notifyChange:function(aL){var aK=this._get(aL,"onChangeMonthYear");if(aK){aK.apply((aL.input?aL.input[0]:null),[aL.selectedYear,aL.selectedMonth+1,aL])}},_getNumberOfMonths:function(aL){var aK=this._get(aL,"numberOfMonths");return(aK==null?[1,1]:(typeof aK==="number"?[1,aK]:aK))},_getMinMaxDate:function(aL,aK){return this._determineDate(aL,this._get(aL,aK+"Date"),null)},_getDaysInMonth:function(aK,aL){return 32-this._daylightSavingAdjust(new Date(aK,aL,32)).getDate()},_getFirstDayOfMonth:function(aK,aL){return new Date(aK,aL,1).getDay()},_canAdjustMonth:function(aN,aP,aM,aO){var aK=this._getNumberOfMonths(aN),aL=this._daylightSavingAdjust(new Date(aM,aO+(aP<0?aP:aK[0]*aK[1]),1));if(aP<0){aL.setDate(this._getDaysInMonth(aL.getFullYear(),aL.getMonth()))}return this._isInRange(aN,aL)},_isInRange:function(aO,aM){var aL,aR,aN=this._getMinMaxDate(aO,"min"),aK=this._getMinMaxDate(aO,"max"),aS=null,aP=null,aQ=this._get(aO,"yearRange");if(aQ){aL=aQ.split(":");aR=new Date().getFullYear();aS=parseInt(aL[0],10);aP=parseInt(aL[1],10);if(aL[0].match(/[+\-].*/)){aS+=aR}if(aL[1].match(/[+\-].*/)){aP+=aR}}return((!aN||aM.getTime()>=aN.getTime())&&(!aK||aM.getTime()<=aK.getTime())&&(!aS||aM.getFullYear()>=aS)&&(!aP||aM.getFullYear()<=aP))},_getFormatConfig:function(aK){var aL=this._get(aK,"shortYearCutoff");
223aL=(typeof aL!=="string"?aL:new Date().getFullYear()%100+parseInt(aL,10));return{shortYearCutoff:aL,dayNamesShort:this._get(aK,"dayNamesShort"),dayNames:this._get(aK,"dayNames"),monthNamesShort:this._get(aK,"monthNamesShort"),monthNames:this._get(aK,"monthNames")}},_formatDate:function(aN,aK,aO,aM){if(!aK){aN.currentDay=aN.selectedDay;aN.currentMonth=aN.selectedMonth;aN.currentYear=aN.selectedYear}var aL=(aK?(typeof aK==="object"?aK:this._daylightSavingAdjust(new Date(aM,aO,aK))):this._daylightSavingAdjust(new Date(aN.currentYear,aN.currentMonth,aN.currentDay)));return this.formatDate(this._get(aN,"dateFormat"),aL,this._getFormatConfig(aN))}});function af(aL){var aK="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return aL.on("mouseout",aK,function(){ax(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){ax(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){ax(this).removeClass("ui-datepicker-next-hover")}}).on("mouseover",aK,R)}function R(){if(!ax.datepicker._isDisabledDatepicker(aF.inline?aF.dpDiv.parent()[0]:aF.input[0])){ax(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");ax(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){ax(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){ax(this).addClass("ui-datepicker-next-hover")}}}function L(aM,aL){ax.extend(aM,aL);for(var aK in aL){if(aL[aK]==null){aM[aK]=aL[aK]}}return aM}ax.fn.datepicker=function(aL){if(!this.length){return this}if(!ax.datepicker.initialized){ax(document).on("mousedown",ax.datepicker._checkExternalClick);ax.datepicker.initialized=true}if(ax("#"+ax.datepicker._mainDivId).length===0){ax("body").append(ax.datepicker.dpDiv)}var aK=Array.prototype.slice.call(arguments,1);if(typeof aL==="string"&&(aL==="isDisabled"||aL==="getDate"||aL==="widget")){return ax.datepicker["_"+aL+"Datepicker"].apply(ax.datepicker,[this[0]].concat(aK))}if(aL==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return ax.datepicker["_"+aL+"Datepicker"].apply(ax.datepicker,[this[0]].concat(aK))}return this.each(function(){if(typeof aL==="string"){ax.datepicker["_"+aL+"Datepicker"].apply(ax.datepicker,[this].concat(aK))}else{ax.datepicker._attachDatepicker(this,aL)}})};ax.datepicker=new W();ax.datepicker.initialized=false;ax.datepicker.uuid=new Date().getTime();ax.datepicker.version="1.13.0";var j=ax.datepicker; 224/*! 225 * jQuery UI Dialog 1.13.0 226 * http://jqueryui.com 227 * 228 * Copyright jQuery Foundation and other contributors 229 * Released under the MIT license. 230 * http://jquery.org/license 231 */ 232ax.widget("ui.dialog",{version:"1.13.0",options:{appendTo:"body",autoOpen:true,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:true,closeText:"Close",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(aL){var aK=ax(this).css(aL).offset().top;if(aK<0){ax(this).css("top",aL.top-aK)}}},resizable:true,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};this.originalTitle=this.element.attr("title");if(this.options.title==null&&this.originalTitle!=null){this.options.title=this.originalTitle}if(this.options.disabled){this.options.disabled=false}this._createWrapper();this.element.show().removeAttr("title").appendTo(this.uiDialog);this._addClass("ui-dialog-content","ui-widget-content");this._createTitlebar();this._createButtonPane();if(this.options.draggable&&ax.fn.draggable){this._makeDraggable()}if(this.options.resizable&&ax.fn.resizable){this._makeResizable()}this._isOpen=false;this._trackFocus()},_init:function(){if(this.options.autoOpen){this.open()}},_appendTo:function(){var aK=this.options.appendTo;if(aK&&(aK.jquery||aK.nodeType)){return ax(aK)}return this.document.find(aK||"body").eq(0)},_destroy:function(){var aL,aK=this.originalPosition;this._untrackInstance();this._destroyOverlay();this.element.removeUniqueId().css(this.originalCss).detach();this.uiDialog.remove();if(this.originalTitle){this.element.attr("title",this.originalTitle)}aL=aK.parent.children().eq(aK.index);if(aL.length&&aL[0]!==this.element[0]){aL.before(this.element)}else{aK.parent.append(this.element)}},widget:function(){return this.uiDialog},disable:ax.noop,enable:ax.noop,close:function(aL){var aK=this;if(!this._isOpen||this._trigger("beforeClose",aL)===false){return}this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(!this.opener.filter(":focusable").trigger("focus").length){ax.ui.safeBlur(ax.ui.safeActiveElement(this.document[0]))}this._hide(this.uiDialog,this.options.hide,function(){aK._trigger("close",aL)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(aO,aK){var aN=false,aM=this.uiDialog.siblings(".ui-front:visible").map(function(){return +ax(this).css("z-index")}).get(),aL=Math.max.apply(null,aM);if(aL>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",aL+1);aN=true}if(aN&&!aK){this._trigger("focus",aO)}return aN},open:function(){var aK=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable()}return}this._isOpen=true;this.opener=ax(ax.ui.safeActiveElement(this.document[0]));this._size();this._position();this._createOverlay();this._moveToTop(null,true);if(this.overlay){this.overlay.css("z-index",this.uiDialog.css("z-index")-1)}this._show(this.uiDialog,this.options.show,function(){aK._focusTabbable();aK._trigger("focus")});this._makeFocusTarget();this._trigger("open")},_focusTabbable:function(){var aK=this._focusedElement;if(!aK){aK=this.element.find("[autofocus]")}if(!aK.length){aK=this.element.find(":tabbable")}if(!aK.length){aK=this.uiDialogButtonPane.find(":tabbable")}if(!aK.length){aK=this.uiDialogTitlebarClose.filter(":tabbable")}if(!aK.length){aK=this.uiDialog}aK.eq(0).trigger("focus")},_restoreTabbableFocus:function(){var aL=ax.ui.safeActiveElement(this.document[0]),aK=this.uiDialog[0]===aL||ax.contains(this.uiDialog[0],aL);if(!aK){this._focusTabbable()}},_keepFocus:function(aK){aK.preventDefault();this._restoreTabbableFocus();this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=ax("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front");this._on(this.uiDialog,{keydown:function(aM){if(this.options.closeOnEscape&&!aM.isDefaultPrevented()&&aM.keyCode&&aM.keyCode===ax.ui.keyCode.ESCAPE){aM.preventDefault();this.close(aM);return}if(aM.keyCode!==ax.ui.keyCode.TAB||aM.isDefaultPrevented()){return}var aL=this.uiDialog.find(":tabbable"),aN=aL.first(),aK=aL.last();
232if((aM.target===aK[0]||aM.target===this.uiDialog[0])&&!aM.shiftKey){this._delay(function(){aN.trigger("focus")});aM.preventDefault()}else{if((aM.target===aN[0]||aM.target===this.uiDialog[0])&&aM.shiftKey){this._delay(function(){aK.trigger("focus")});aM.preventDefault()}}},mousedown:function(aK){if(this._moveToTop(aK)){this._focusTabbable()}}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})}},_createTitlebar:function(){var aK;this.uiDialogTitlebar=ax("<div>");this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix");this._on(this.uiDialogTitlebar,{mousedown:function(aL){if(!ax(aL.target).closest(".ui-dialog-titlebar-close")){this.uiDialog.trigger("focus")}}});this.uiDialogTitlebarClose=ax("<button type='button'></button>").button({label:ax("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:false}).appendTo(this.uiDialogTitlebar);this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close");this._on(this.uiDialogTitlebarClose,{click:function(aL){aL.preventDefault();this.close(aL)}});aK=ax("<span>").uniqueId().prependTo(this.uiDialogTitlebar);this._addClass(aK,"ui-dialog-title");this._title(aK);this.uiDialogTitlebar.prependTo(this.uiDialog);this.uiDialog.attr({"aria-labelledby":aK.attr("id")})},_title:function(aK){if(this.options.title){aK.text(this.options.title)}else{aK.html(" ")}},_createButtonPane:function(){this.uiDialogButtonPane=ax("<div>");this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix");this.uiButtonSet=ax("<div>").appendTo(this.uiDialogButtonPane);this._addClass(this.uiButtonSet,"ui-dialog-buttonset");this._createButtons()},_createButtons:function(){var aL=this,aK=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if(ax.isEmptyObject(aK)||(Array.isArray(aK)&&!aK.length)){this._removeClass(this.uiDialog,"ui-dialog-buttons");return}ax.each(aK,function(aM,aN){var aO,aP;aN=typeof aN==="function"?{click:aN,text:aM}:aN;aN=ax.extend({type:"button"},aN);aO=aN.click;aP={icon:aN.icon,iconPosition:aN.iconPosition,showLabel:aN.showLabel,icons:aN.icons,text:aN.text};delete aN.click;delete aN.icon;delete aN.iconPosition;delete aN.showLabel;delete aN.icons;if(typeof aN.text==="boolean"){delete aN.text}ax("<button></button>",aN).button(aP).appendTo(aL.uiButtonSet).on("click",function(){aO.apply(aL.element[0],arguments)})});this._addClass(this.uiDialog,"ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){var aM=this,aL=this.options;function aK(aN){return{position:aN.position,offset:aN.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(aN,aO){aM._addClass(ax(this),"ui-dialog-dragging");aM._blockFrames();aM._trigger("dragStart",aN,aK(aO))},drag:function(aN,aO){aM._trigger("drag",aN,aK(aO))},stop:function(aN,aO){var aQ=aO.offset.left-aM.document.scrollLeft(),aP=aO.offset.top-aM.document.scrollTop();aL.position={my:"left top",at:"left"+(aQ>=0?"+":"")+aQ+" top"+(aP>=0?"+":"")+aP,of:aM.window};aM._removeClass(ax(this),"ui-dialog-dragging");aM._unblockFrames();aM._trigger("dragStop",aN,aK(aO))}})},_makeResizable:function(){var aP=this,aN=this.options,aO=aN.resizable,aK=this.uiDialog.css("position"),aM=typeof aO==="string"?aO:"n,e,s,w,se,sw,ne,nw";function aL(aQ){return{originalPosition:aQ.originalPosition,originalSize:aQ.originalSize,position:aQ.position,size:aQ.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:aN.maxWidth,maxHeight:aN.maxHeight,minWidth:aN.minWidth,minHeight:this._minHeight(),handles:aM,start:function(aQ,aR){aP._addClass(ax(this),"ui-dialog-resizing");aP._blockFrames();aP._trigger("resizeStart",aQ,aL(aR))},resize:function(aQ,aR){aP._trigger("resize",aQ,aL(aR))},stop:function(aQ,aR){var aU=aP.uiDialog.offset(),aT=aU.left-aP.document.scrollLeft(),aS=aU.top-aP.document.scrollTop();aN.height=aP.uiDialog.height();aN.width=aP.uiDialog.width();aN.position={my:"left top",at:"left"+(aT>=0?"+":"")+aT+" top"+(aS>=0?"+":"")+aS,of:aP.window};aP._removeClass(ax(this),"ui-dialog-resizing");aP._unblockFrames();aP._trigger("resizeStop",aQ,aL(aR))}}).css("position",aK)},_trackFocus:function(){this._on(this.widget(),{focusin:function(aK){this._makeFocusTarget();this._focusedElement=ax(aK.target)}})},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this)},_untrackInstance:function(){var aL=this._trackingInstances(),aK=ax.inArray(this,aL);if(aK!==-1){aL.splice(aK,1)}},_trackingInstances:function(){var aK=this.document.data("ui-dialog-instances");if(!aK){aK=[];this.document.data("ui-dialog-instances",aK)}return aK},_minHeight:function(){var aK=this.options;return aK.height==="auto"?aK.minHeight:Math.min(aK.minHeight,aK.height)},_position:function(){var aK=this.uiDialog.is(":visible");if(!aK){this.uiDialog.show()}this.uiDialog.position(this.options.position);if(!aK){this.uiDialog.hide()}},_setOptions:function(aM){var aN=this,aL=false,aK={};ax.each(aM,function(aO,aP){aN._setOption(aO,aP);if(aO in aN.sizeRelatedOptions){aL=true}if(aO in aN.resizableRelatedOptions){aK[aO]=aP}});if(aL){this._size();this._position()}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",aK)}},_setOption:function(aM,aN){var aL,aO,aK=this.uiDialog;if(aM==="disabled"){return}this._super(aM,aN);if(aM==="appendTo"){this.uiDialog.appendTo(this._appendTo())}if(aM==="buttons"){this._createButtons()}if(aM==="closeText"){this.uiDialogTitlebarClose.button({label:ax("<a>").text(""+this.options.closeText).html()})}if(aM==="draggable"){aL=aK.is(":data(ui-draggable)");if(aL&&!aN){aK.draggable("destroy")}if(!aL&&aN){this._makeDraggable()}}if(aM==="position"){this._position()}if(aM==="resizable"){aO=aK.is(":data(ui-resizable)");if(aO&&!aN){aK.resizable("destroy")}if(aO&&typeof aN==="string"){aK.resizable("option","handles",aN)}if(!aO&&aN!==false){this._makeResizable()}}if(aM==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))}},_size:function(){var aK,aM,aN,aL=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(aL.minWidth>aL.width){aL.width=aL.minWidth}
232aK=this.uiDialog.css({height:"auto",width:aL.width}).outerHeight();aM=Math.max(0,aL.minHeight-aK);aN=typeof aL.maxHeight==="number"?Math.max(0,aL.maxHeight-aK):"none";if(aL.height==="auto"){this.element.css({minHeight:aM,maxHeight:aN,height:"auto"})}else{this.element.height(Math.max(0,aL.height-aK))}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var aK=ax(this);return ax("<div>").css({position:"absolute",width:aK.outerWidth(),height:aK.outerHeight()}).appendTo(aK.parent()).offset(aK.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_allowInteraction:function(aK){if(ax(aK.target).closest(".ui-dialog").length){return true}return !!ax(aK.target).closest(".ui-datepicker").length},_createOverlay:function(){if(!this.options.modal){return}var aK=ax.fn.jquery.substring(0,4);var aL=true;this._delay(function(){aL=false});if(!this.document.data("ui-dialog-overlays")){this.document.on("focusin.ui-dialog",function(aN){if(aL){return}var aM=this._trackingInstances()[0];if(!aM._allowInteraction(aN)){aN.preventDefault();aM._focusTabbable();if(aK==="3.4."||aK==="3.5."){aM._delay(aM._restoreTabbableFocus)}}}.bind(this))}this.overlay=ax("<div>").appendTo(this._appendTo());this._addClass(this.overlay,null,"ui-widget-overlay ui-front");this._on(this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)},_destroyOverlay:function(){if(!this.options.modal){return}if(this.overlay){var aK=this.document.data("ui-dialog-overlays")-1;if(!aK){this.document.off("focusin.ui-dialog");this.document.removeData("ui-dialog-overlays")}else{this.document.data("ui-dialog-overlays",aK)}this.overlay.remove();this.overlay=null}}});if(ax.uiBackCompat!==false){ax.widget("ui.dialog",ax.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super();this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(aK,aL){if(aK==="dialogClass"){this.uiDialog.removeClass(this.options.dialogClass).addClass(aL)}this._superApply(arguments)}})}var ak=ax.ui.dialog; 233/*! 234 * jQuery UI Progressbar 1.13.0 235 * http://jqueryui.com 236 * 237 * Copyright jQuery Foundation and other contributors 238 * Released under the MIT license. 239 * http://jquery.org/license 240 */ 241var ag=ax.widget("ui.progressbar",{version:"1.13.0",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue();this.element.attr({role:"progressbar","aria-valuemin":this.min});this._addClass("ui-progressbar","ui-widget ui-widget-content");this.valueDiv=ax("<div>").appendTo(this.element);this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header");this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow");this.valueDiv.remove()},value:function(aK){if(aK===undefined){return this.options.value}this.options.value=this._constrainedValue(aK);this._refreshValue()},_constrainedValue:function(aK){if(aK===undefined){aK=this.options.value}this.indeterminate=aK===false;if(typeof aK!=="number"){aK=0}return this.indeterminate?false:Math.min(this.options.max,Math.max(this.min,aK))},_setOptions:function(aK){var aL=aK.value;delete aK.value;this._super(aK);this.options.value=this._constrainedValue(aL);this._refreshValue()},_setOption:function(aK,aL){if(aK==="max"){aL=Math.max(this.min,aL)}this._super(aK,aL)},_setOptionDisabled:function(aK){this._super(aK);this.element.attr("aria-disabled",aK);this._toggleClass(null,"ui-state-disabled",!!aK)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var aL=this.options.value,aK=this._percentage();this.valueDiv.toggle(this.indeterminate||aL>this.min).width(aK.toFixed(0)+"%");this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,aL===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate);if(this.indeterminate){this.element.removeAttr("aria-valuenow");if(!this.overlayDiv){this.overlayDiv=ax("<div>").appendTo(this.valueDiv);this._addClass(this.overlayDiv,"ui-progressbar-overlay")}}else{this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":aL});if(this.overlayDiv){this.overlayDiv.remove();this.overlayDiv=null}}if(this.oldValue!==aL){this.oldValue=aL;this._trigger("change")}if(aL===this.options.max){this._trigger("complete")}}}); 242/*! 243 * jQuery UI Selectmenu 1.13.0 244 * http://jqueryui.com 245 * 246 * Copyright jQuery Foundation and other contributors 247 * Released under the MIT license. 248 * http://jquery.org/license 249 */ 250var e=ax.widget("ui.selectmenu",[ax.ui.formResetMixin,{version:"1.13.0",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"}
250,width:false,change:null,close:null,focus:null,open:null,select:null},_create:function(){var aK=this.element.uniqueId().attr("id");this.ids={element:aK,button:aK+"-button",menu:aK+"-menu"};this._drawButton();this._drawMenu();this._bindFormResetHandler();this._rendered=false;this.menuItems=ax()},_drawButton:function(){var aK,aM=this,aL=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button);this._on(this.labels,{click:function(aN){this.button.trigger("focus");aN.preventDefault()}});this.element.hide();this.button=ax("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element);this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget");aK=ax("<span>").appendTo(this.button);this._addClass(aK,"ui-selectmenu-icon","ui-icon "+this.options.icons.button);this.buttonItem=this._renderButtonItem(aL).appendTo(this.button);if(this.options.width!==false){this._resizeButton()}this._on(this.button,this._buttonEvents);this.button.one("focusin",function(){if(!aM._rendered){aM._refreshMenu()}})},_drawMenu:function(){var aK=this;this.menu=ax("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=ax("<div>").append(this.menu);this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front");this.menuWrap.appendTo(this._appendTo());this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(aL,aM){aL.preventDefault();aK._setSelection();aK._select(aM.item.data("ui-selectmenu-item"),aL)},focus:function(aM,aN){var aL=aN.item.data("ui-selectmenu-item");if(aK.focusIndex!=null&&aL.index!==aK.focusIndex){aK._trigger("focus",aM,{item:aL});if(!aK.isOpen){aK._select(aL,aM)}}aK.focusIndex=aL.index;aK.button.attr("aria-activedescendant",aK.menuItems.eq(aL.index).attr("id"))}}).menu("instance");this.menuInstance._off(this.menu,"mouseleave");this.menuInstance._closeOnDocumentClick=function(){return false};this.menuInstance._isDivider=function(){return false}},refresh:function(){this._refreshMenu();this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{}));if(this.options.width===null){this._resizeButton()}},_refreshMenu:function(){var aL,aK=this.element.find("option");this.menu.empty();this._parseOptions(aK);this._renderMenu(this.menu,this.items);this.menuInstance.refresh();this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper");this._rendered=true;if(!aK.length){return}aL=this._getSelectedItem();this.menuInstance.focus(null,aL);this._setAria(aL.data("ui-selectmenu-item"));this._setOption("disabled",this.element.prop("disabled"))},open:function(aK){if(this.options.disabled){return}if(!this._rendered){this._refreshMenu()}else{this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active");this.menuInstance.focus(null,this._getSelectedItem())}if(!this.menuItems.length){return}this.isOpen=true;this._toggleAttr();this._resizeMenu();this._position();this._on(this.document,this._documentClick);this._trigger("open",aK)},_position:function(){this.menuWrap.position(ax.extend({of:this.button},this.options.position))},close:function(aK){if(!this.isOpen){return}this.isOpen=false;this._toggleAttr();this.range=null;this._off(this.document);this._trigger("close",aK)},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(aL){var aK=ax("<span>");this._setText(aK,aL.label);this._addClass(aK,"ui-selectmenu-text");return aK},_renderMenu:function(aM,aL){var aN=this,aK="";ax.each(aL,function(aP,aQ){var aO;if(aQ.optgroup!==aK){aO=ax("<li>",{text:aQ.optgroup});aN._addClass(aO,"ui-selectmenu-optgroup","ui-menu-divider"+(aQ.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""));aO.appendTo(aM);aK=aQ.optgroup}aN._renderItemData(aM,aQ)})},_renderItemData:function(aK,aL){return this._renderItem(aK,aL).data("ui-selectmenu-item",aL)},_renderItem:function(aL,aM){var aK=ax("<li>"),aN=ax("<div>",{title:aM.element.attr("title")});if(aM.disabled){this._addClass(aK,null,"ui-state-disabled")}this._setText(aN,aM.label);return aK.append(aN).appendTo(aL)},_setText:function(aK,aL){if(aL){aK.text(aL)}else{aK.html(" ")}},_move:function(aO,aN){var aM,aL,aK=".ui-menu-item";if(this.isOpen){aM=this.menuItems.eq(this.focusIndex).parent("li")}else{aM=this.menuItems.eq(this.element[0].selectedIndex).parent("li");aK+=":not(.ui-state-disabled)"}if(aO==="first"||aO==="last"){aL=aM[aO==="first"?"prevAll":"nextAll"](aK).eq(-1)}else{aL=aM[aO+"All"](aK).eq(0)}
250if(aL.length){this.menuInstance.focus(aN,aL)}},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(aK){this[this.isOpen?"close":"open"](aK)},_setSelection:function(){var aK;if(!this.range){return}if(window.getSelection){aK=window.getSelection();aK.removeAllRanges();aK.addRange(this.range)}else{this.range.select()}this.button.focus()},_documentClick:{mousedown:function(aK){if(!this.isOpen){return}if(!ax(aK.target).closest(".ui-selectmenu-menu, #"+ax.escapeSelector(this.ids.button)).length){this.close(aK)}}},_buttonEvents:{mousedown:function(){var aK;if(window.getSelection){aK=window.getSelection();if(aK.rangeCount){this.range=aK.getRangeAt(0)}}else{this.range=document.selection.createRange()}},click:function(aK){this._setSelection();this._toggle(aK)},keydown:function(aL){var aK=true;switch(aL.keyCode){case ax.ui.keyCode.TAB:case ax.ui.keyCode.ESCAPE:this.close(aL);aK=false;break;case ax.ui.keyCode.ENTER:if(this.isOpen){this._selectFocusedItem(aL)}break;case ax.ui.keyCode.UP:if(aL.altKey){this._toggle(aL)}else{this._move("prev",aL)}break;case ax.ui.keyCode.DOWN:if(aL.altKey){this._toggle(aL)}else{this._move("next",aL)}break;case ax.ui.keyCode.SPACE:if(this.isOpen){this._selectFocusedItem(aL)}else{this._toggle(aL)}break;case ax.ui.keyCode.LEFT:this._move("prev",aL);break;case ax.ui.keyCode.RIGHT:this._move("next",aL);break;case ax.ui.keyCode.HOME:case ax.ui.keyCode.PAGE_UP:this._move("first",aL);break;case ax.ui.keyCode.END:case ax.ui.keyCode.PAGE_DOWN:this._move("last",aL);break;default:this.menu.trigger(aL);aK=false}if(aK){aL.preventDefault()}}},_selectFocusedItem:function(aL){var aK=this.menuItems.eq(this.focusIndex).parent("li");if(!aK.hasClass("ui-state-disabled")){this._select(aK.data("ui-selectmenu-item"),aL)}},_select:function(aL,aK){var aM=this.element[0].selectedIndex;this.element[0].selectedIndex=aL.index;this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(aL));this._setAria(aL);this._trigger("select",aK,{item:aL});if(aL.index!==aM){this._trigger("change",aK,{item:aL})}this.close(aK)},_setAria:function(aK){var aL=this.menuItems.eq(aK.index).attr("id");this.button.attr({"aria-labelledby":aL,"aria-activedescendant":aL});this.menu.attr("aria-activedescendant",aL)},_setOption:function(aK,aM){if(aK==="icons"){var aL=this.button.find("span.ui-icon");this._removeClass(aL,null,this.options.icons.button)._addClass(aL,null,aM.button)}this._super(aK,aM);if(aK==="appendTo"){this.menuWrap.appendTo(this._appendTo())}if(aK==="width"){this._resizeButton()}},_setOptionDisabled:function(aK){this._super(aK);this.menuInstance.option("disabled",aK);this.button.attr("aria-disabled",aK);this._toggleClass(this.button,null,"ui-state-disabled",aK);this.element.prop("disabled",aK);if(aK){this.button.attr("tabindex",-1);this.close()}else{this.button.attr("tabindex",0)}},_appendTo:function(){var aK=this.options.appendTo;if(aK){aK=aK.jquery||aK.nodeType?ax(aK):this.document.find(aK).eq(0)}if(!aK||!aK[0]){aK=this.element.closest(".ui-front, dialog")}if(!aK.length){aK=this.document[0].body}return aK},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen);this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen);this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var aK=this.options.width;if(aK===false){this.button.css("width","");return}if(aK===null){aK=this.element.show().outerWidth();this.element.hide()}this.button.outerWidth(aK)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var aK=this._super();aK.disabled=this.element.prop("disabled");return aK},_parseOptions:function(aK){var aL=this,aM=[];aK.each(function(aN,aO){if(aO.hidden){return}aM.push(aL._parseOption(ax(aO),aN))});this.items=aM},_parseOption:function(aM,aL){var aK=aM.parent("optgroup");return{element:aM,index:aL,value:aM.val(),label:aM.text(),optgroup:aK.attr("label")||"",disabled:aK.prop("disabled")||aM.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler();this.menuWrap.remove();this.button.remove();this.element.show();this.element.removeUniqueId();this.labels.attr("for",this.ids.element)}}]); 251/*! 252 * jQuery UI Slider 1.13.0 253 * http://jqueryui.com 254 * 255 * Copyright jQuery Foundation and other contributors 256 * Released under the MIT license. 257 * http://jquery.org/license 258 */ 259var X=ax.widget("ui.slider",ax.ui.mouse,{version:"1.13.0",widgetEventPrefix:"slide",options:{animate:false,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null}
259,numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content");this._refresh();this._animateOff=false},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var aN,aK,aL=this.options,aP=this.element.find(".ui-slider-handle"),aO="<span tabindex='0'></span>",aM=[];aK=(aL.values&&aL.values.length)||1;if(aP.length>aK){aP.slice(aK).remove();aP=aP.slice(0,aK)}for(aN=aP.length;aN<aK;aN++){aM.push(aO)}this.handles=aP.add(ax(aM.join("")).appendTo(this.element));this._addClass(this.handles,"ui-slider-handle","ui-state-default");this.handle=this.handles.eq(0);this.handles.each(function(aQ){ax(this).data("ui-slider-handle-index",aQ).attr("tabIndex",0)})},_createRange:function(){var aK=this.options;if(aK.range){if(aK.range===true){if(!aK.values){aK.values=[this._valueMin(),this._valueMin()]}else{if(aK.values.length&&aK.values.length!==2){aK.values=[aK.values[0],aK.values[0]]}else{if(Array.isArray(aK.values)){aK.values=aK.values.slice(0)}}}}if(!this.range||!this.range.length){this.range=ax("<div>").appendTo(this.element);this._addClass(this.range,"ui-slider-range")}else{this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max");this.range.css({left:"",bottom:""})}if(aK.range==="min"||aK.range==="max"){this._addClass(this.range,"ui-slider-range-"+aK.range)}}else{if(this.range){this.range.remove()}this.range=null}},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles)},_destroy:function(){this.handles.remove();if(this.range){this.range.remove()}this._mouseDestroy()},_mouseCapture:function(aM){var aQ,aT,aL,aO,aS,aU,aP,aK,aR=this,aN=this.options;if(aN.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();aQ={x:aM.pageX,y:aM.pageY};aT=this._normValueFromMouse(aQ);aL=this._valueMax()-this._valueMin()+1;this.handles.each(function(aV){var aW=Math.abs(aT-aR.values(aV));if((aL>aW)||(aL===aW&&(aV===aR._lastChangedValue||aR.values(aV)===aN.min))){aL=aW;aO=ax(this);aS=aV}});aU=this._start(aM,aS);if(aU===false){return false}this._mouseSliding=true;this._handleIndex=aS;this._addClass(aO,null,"ui-state-active");aO.trigger("focus");aP=aO.offset();aK=!ax(aM.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=aK?{left:0,top:0}:{left:aM.pageX-aP.left-(aO.width()/2),top:aM.pageY-aP.top-(aO.height()/2)-(parseInt(aO.css("borderTopWidth"),10)||0)-(parseInt(aO.css("borderBottomWidth"),10)||0)+(parseInt(aO.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(aM,aS,aT)}this._animateOff=true;return true},_mouseStart:function(){return true},_mouseDrag:function(aM){var aK={x:aM.pageX,y:aM.pageY},aL=this._normValueFromMouse(aK);this._slide(aM,this._handleIndex,aL);return false},_mouseStop:function(aK){this._removeClass(this.handles,null,"ui-state-active");this._mouseSliding=false;this._stop(aK,this._handleIndex);this._change(aK,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(aL){var aK,aO,aN,aM,aP;if(this.orientation==="horizontal"){aK=this.elementSize.width;aO=aL.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{aK=this.elementSize.height;aO=aL.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}aN=(aO/aK);if(aN>1){aN=1}if(aN<0){aN=0}if(this.orientation==="vertical"){aN=1-aN}aM=this._valueMax()-this._valueMin();aP=this._valueMin()+aN*aM;return this._trimAlignValue(aP)},_uiHash:function(aM,aN,aK){var aL={handle:this.handles[aM],handleIndex:aM,value:aN!==undefined?aN:this.value()};if(this._hasMultipleValues()){aL.value=aN!==undefined?aN:this.values(aM);aL.values=aK||this.values()}return aL},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(aL,aK){return this._trigger("start",aL,this._uiHash(aK))},_slide:function(aP,aN,aM){var aQ,aK,aO=this.value(),aL=this.values();if(this._hasMultipleValues()){aK=this.values(aN?0:1);aO=this.values(aN);if(this.options.values.length===2&&this.options.range===true){aM=aN===0?Math.min(aK,aM):Math.max(aK,aM)}aL[aN]=aM}if(aM===aO){return}aQ=this._trigger("slide",aP,this._uiHash(aN,aM,aL));if(aQ===false){return}if(this._hasMultipleValues()){this.values(aN,aM)}else{this.value(aM)}},_stop:function(aL,aK){this._trigger("stop",aL,this._uiHash(aK))},_change:function(aL,aK){if(!this._keySliding&&!this._mouseSliding){this._lastChangedValue=aK;this._trigger("change",aL,this._uiHash(aK))}},value:function(aK){if(arguments.length){this.options.value=this._trimAlignValue(aK);this._refreshValue();this._change(null,0);return}
259return this._value()},values:function(aL,aO){var aN,aK,aM;if(arguments.length>1){this.options.values[aL]=this._trimAlignValue(aO);this._refreshValue();this._change(null,aL);return}if(arguments.length){if(Array.isArray(arguments[0])){aN=this.options.values;aK=arguments[0];for(aM=0;aM<aN.length;aM+=1){aN[aM]=this._trimAlignValue(aK[aM]);this._change(null,aM)}this._refreshValue()}else{if(this._hasMultipleValues()){return this._values(aL)}else{return this.value()}}}else{return this._values()}},_setOption:function(aL,aM){var aK,aN=0;if(aL==="range"&&this.options.range===true){if(aM==="min"){this.options.value=this._values(0);this.options.values=null}else{if(aM==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null}}}if(Array.isArray(this.options.values)){aN=this.options.values.length}this._super(aL,aM);switch(aL){case"orientation":this._detectOrientation();this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation);this._refreshValue();if(this.options.range){this._refreshRange(aM)}this.handles.css(aM==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(aK=aN-1;aK>=0;aK--){this._change(null,aK)}this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break}},_setOptionDisabled:function(aK){this._super(aK);this._toggleClass(null,"ui-state-disabled",!!aK)},_value:function(){var aK=this.options.value;aK=this._trimAlignValue(aK);return aK},_values:function(aK){var aN,aM,aL;if(arguments.length){aN=this.options.values[aK];aN=this._trimAlignValue(aN);return aN}else{if(this._hasMultipleValues()){aM=this.options.values.slice();for(aL=0;aL<aM.length;aL+=1){aM[aL]=this._trimAlignValue(aM[aL])}return aM}else{return[]}}},_trimAlignValue:function(aN){if(aN<=this._valueMin()){return this._valueMin()}if(aN>=this._valueMax()){return this._valueMax()}var aK=(this.options.step>0)?this.options.step:1,aM=(aN-this._valueMin())%aK,aL=aN-aM;if(Math.abs(aM)*2>=aK){aL+=(aM>0)?aK:(-aK)}return parseFloat(aL.toFixed(5))},_calculateNewMax:function(){var aK=this.options.max,aL=this._valueMin(),aM=this.options.step,aN=Math.round((aK-aL)/aM)*aM;aK=aN+aL;if(aK>this.options.max){aK-=aM}this.max=parseFloat(aK.toFixed(this._precision()))},_precision:function(){var aK=this._precisionOf(this.options.step);if(this.options.min!==null){aK=Math.max(aK,this._precisionOf(this.options.min))}return aK},_precisionOf:function(aL){var aM=aL.toString(),aK=aM.indexOf(".");return aK===-1?0:aM.length-aK-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(aK){if(aK==="vertical"){this.range.css({width:"",left:""})}if(aK==="horizontal"){this.range.css({height:"",bottom:""})}},_refreshValue:function(){var aP,aO,aS,aQ,aT,aN=this.options.range,aM=this.options,aR=this,aL=(!this._animateOff)?aM.animate:false,aK={};if(this._hasMultipleValues()){this.handles.each(function(aU){aO=(aR.values(aU)-aR._valueMin())/(aR._valueMax()-aR._valueMin())*100;aK[aR.orientation==="horizontal"?"left":"bottom"]=aO+"%";ax(this).stop(1,1)[aL?"animate":"css"](aK,aM.animate);if(aR.options.range===true){if(aR.orientation==="horizontal"){if(aU===0){aR.range.stop(1,1)[aL?"animate":"css"]({left:aO+"%"},aM.animate)}if(aU===1){aR.range[aL?"animate":"css"]({width:(aO-aP)+"%"},{queue:false,duration:aM.animate})}}else{if(aU===0){aR.range.stop(1,1)[aL?"animate":"css"]({bottom:(aO)+"%"},aM.animate)}if(aU===1){aR.range[aL?"animate":"css"]({height:(aO-aP)+"%"},{queue:false,duration:aM.animate})}}}aP=aO})}else{aS=this.value();aQ=this._valueMin();aT=this._valueMax();aO=(aT!==aQ)?(aS-aQ)/(aT-aQ)*100:0;aK[this.orientation==="horizontal"?"left":"bottom"]=aO+"%";this.handle.stop(1,1)[aL?"animate":"css"](aK,aM.animate);if(aN==="min"&&this.orientation==="horizontal"){this.range.stop(1,
2591)[aL?"animate":"css"]({width:aO+"%"},aM.animate)}if(aN==="max"&&this.orientation==="horizontal"){this.range.stop(1,1)[aL?"animate":"css"]({width:(100-aO)+"%"},aM.animate)}if(aN==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[aL?"animate":"css"]({height:aO+"%"},aM.animate)}if(aN==="max"&&this.orientation==="vertical"){this.range.stop(1,1)[aL?"animate":"css"]({height:(100-aO)+"%"},aM.animate)}}},_handleEvents:{keydown:function(aO){var aP,aM,aL,aN,aK=ax(aO.target).data("ui-slider-handle-index");switch(aO.keyCode){case ax.ui.keyCode.HOME:case ax.ui.keyCode.END:case ax.ui.keyCode.PAGE_UP:case ax.ui.keyCode.PAGE_DOWN:case ax.ui.keyCode.UP:case ax.ui.keyCode.RIGHT:case ax.ui.keyCode.DOWN:case ax.ui.keyCode.LEFT:aO.preventDefault();if(!this._keySliding){this._keySliding=true;this._addClass(ax(aO.target),null,"ui-state-active");aP=this._start(aO,aK);if(aP===false){return}}break}aN=this.options.step;if(this._hasMultipleValues()){aM=aL=this.values(aK)}else{aM=aL=this.value()}switch(aO.keyCode){case ax.ui.keyCode.HOME:aL=this._valueMin();break;case ax.ui.keyCode.END:aL=this._valueMax();break;case ax.ui.keyCode.PAGE_UP:aL=this._trimAlignValue(aM+((this._valueMax()-this._valueMin())/this.numPages));break;case ax.ui.keyCode.PAGE_DOWN:aL=this._trimAlignValue(aM-((this._valueMax()-this._valueMin())/this.numPages));break;case ax.ui.keyCode.UP:case ax.ui.keyCode.RIGHT:if(aM===this._valueMax()){return}aL=this._trimAlignValue(aM+aN);break;case ax.ui.keyCode.DOWN:case ax.ui.keyCode.LEFT:if(aM===this._valueMin()){return}aL=this._trimAlignValue(aM-aN);break}this._slide(aO,aK,aL)},keyup:function(aL){var aK=ax(aL.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(aL,aK);this._change(aL,aK);this._removeClass(ax(aL.target),null,"ui-state-active")}}}}); 260/*! 261 * jQuery UI Spinner 1.13.0 262 * http://jqueryui.com 263 * 264 * Copyright jQuery Foundation and other contributors 265 * Released under the MIT license. 266 * http://jquery.org/license 267 */ 268function n(aK){return function(){var aL=this.element.val();aK.apply(this,arguments);this._refresh();if(aL!==this.element.val()){this._trigger("change")}}}ax.widget("ui.spinner",{version:"1.13.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:true,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max);this._setOption("min",this.options.min);this._setOption("step",this.options.step);if(this.value()!==""){this._value(this.element.val(),true)}this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var aK=this._super();var aL=this.element;ax.each(["min","max","step"],function(aM,aN){var aO=aL.attr(aN);if(aO!=null&&aO.length){aK[aN]=aO}});return aK},_events:{keydown:function(aK){if(this._start(aK)&&this._keydown(aK)){aK.preventDefault()}},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(aK){if(this.cancelBlur){delete this.cancelBlur;return}this._stop();this._refresh();if(this.previous!==this.element.val()){this._trigger("change",aK)}},mousewheel:function(aM,aN){var aL=ax.ui.safeActiveElement(this.document[0]);var aK=this.element[0]===aL;if(!aK||!aN){return}if(!this.spinning&&!this._start(aM)){return false}this._spin((aN>0?1:-1)*this.options.step,aM);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){if(this.spinning){this._stop(aM)}},100);aM.preventDefault()},"mousedown .ui-spinner-button":function(aL){var aK;aK=this.element[0]===ax.ui.safeActiveElement(this.document[0])?this.previous:this.element.val();function aM(){var aN=this.element[0]===ax.ui.safeActiveElement(this.document[0]);if(!aN){this.element.trigger("focus");this.previous=aK;this._delay(function(){this.previous=aK})}}aL.preventDefault();aM.call(this);this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;aM.call(this)});if(this._start(aL)===false){return}this._repeat(null,ax(aL.currentTarget).hasClass("ui-spinner-up")?1:-1,aL)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(aK){if(!ax(aK.currentTarget).hasClass("ui-state-active")){return}if(this._start(aK)===false){return false}this._repeat(null,ax(aK.currentTarget).hasClass("ui-spinner-up")?1:-1,aK)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<sp
268an>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance();this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content");this._addClass("ui-spinner-input");this.element.attr("role","spinbutton");this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",true).button({classes:{"ui-button":""}});this._removeClass(this.buttons,"ui-corner-all");this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up");this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down");this.buttons.first().button({icon:this.options.icons.up,showLabel:false});this.buttons.last().button({icon:this.options.icons.down,showLabel:false});if(this.buttons.height()>Math.ceil(this.uiSpinner.height()*0.5)&&this.uiSpinner.height()>0){this.uiSpinner.height(this.uiSpinner.height())}},_keydown:function(aL){var aK=this.options,aM=ax.ui.keyCode;switch(aL.keyCode){case aM.UP:this._repeat(null,1,aL);return true;case aM.DOWN:this._repeat(null,-1,aL);return true;case aM.PAGE_UP:this._repeat(null,aK.page,aL);return true;case aM.PAGE_DOWN:this._repeat(null,-aK.page,aL);return true}return false},_start:function(aK){if(!this.spinning&&this._trigger("start",aK)===false){return false}if(!this.counter){this.counter=1}this.spinning=true;return true},_repeat:function(aL,aK,aM){aL=aL||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,aK,aM)},aL);this._spin(aK*this.options.step,aM)},_spin:function(aL,aK){var aM=this.value()||0;if(!this.counter){this.counter=1}aM=this._adjustValue(aM+aL*this._increment(this.counter));if(!this.spinning||this._trigger("spin",aK,{value:aM})!==false){this._value(aM);this.counter++}},_increment:function(aK){var aL=this.options.incremental;if(aL){return typeof aL==="function"?aL(aK):Math.floor(aK*aK*aK/50000-aK*aK/500+17*aK/200+1)}return 1},_precision:function(){var aK=this._precisionOf(this.options.step);if(this.options.min!==null){aK=Math.max(aK,this._precisionOf(this.options.min))}return aK},_precisionOf:function(aL){var aM=aL.toString(),aK=aM.indexOf(".");return aK===-1?0:aM.length-aK-1},_adjustValue:function(aM){var aL,aN,aK=this.options;aL=aK.min!==null?aK.min:0;aN=aM-aL;aN=Math.round(aN/aK.step)*aK.step;aM=aL+aN;aM=parseFloat(aM.toFixed(this._precision()));if(aK.max!==null&&aM>aK.max){return aK.max}if(aK.min!==null&&aM<aK.min){return aK.min}return aM},_stop:function(aK){if(!this.spinning){return}clearTimeout(this.timer);clearTimeout(this.mousewheelTimer);this.counter=0;this.spinning=false;this._trigger("stop",aK)},_setOption:function(aK,aM){var aN,aO,aL;if(aK==="culture"||aK==="numberFormat"){aN=this._parse(this.element.val());this.options[aK]=aM;this.element.val(this._format(aN));return}if(aK==="max"||aK==="min"||aK==="step"){if(typeof aM==="string"){aM=this._parse(aM)}}if(aK==="icons"){aO=this.buttons.first().find(".ui-icon");this._removeClass(aO,null,this.options.icons.up);this._addClass(aO,null,aM.up);aL=this.buttons.last().find(".ui-icon");this._removeClass(aL,null,this.options.icons.down);this._addClass(aL,null,aM.down)}this._super(aK,aM)},_setOptionDisabled:function(aK){this._super(aK);this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!aK);this.element.prop("disabled",!!aK);this.buttons.button(aK?"disable":"enable")},_setOptions:n(function(aK){this._super(aK)}),_parse:function(aK){if(typeof aK==="string"&&aK!==""){aK=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(aK,10,this.options.culture):+aK}return aK===""||isNaN(aK)?null:aK},_format:function(aK){if(aK===""){return""}return window.Globalize&&this.options.numberFormat?Globalize.format(aK,this.options.numberFormat,this.options.culture):aK},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var aK=this.value();if(aK===null){return false}return aK===this._adjustValue(aK)},_value:function(aM,aK){var aL;if(aM!==""){aL=this._parse(aM);if(aL!==null){if(!aK){aL=this._adjustValue(aL)}aM=this._format(aL)}}this.element.val(aM);this._refresh()}
268,_destroy:function(){this.element.prop("disabled",false).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow");this.uiSpinner.replaceWith(this.element)},stepUp:n(function(aK){this._stepUp(aK)}),_stepUp:function(aK){if(this._start()){this._spin((aK||1)*this.options.step);this._stop()}},stepDown:n(function(aK){this._stepDown(aK)}),_stepDown:function(aK){if(this._start()){this._spin((aK||1)*-this.options.step);this._stop()}},pageUp:n(function(aK){this._stepUp((aK||1)*this.options.page)}),pageDown:n(function(aK){this._stepDown((aK||1)*this.options.page)}),value:function(aK){if(!arguments.length){return this._parse(this.element.val())}n(this._value).call(this,aK)},widget:function(){return this.uiSpinner}});if(ax.uiBackCompat!==false){ax.widget("ui.spinner",ax.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}})}var ap=ax.ui.spinner; 269/*! 270 * jQuery UI Tabs 1.13.0 271 * http://jqueryui.com 272 * 273 * Copyright jQuery Foundation and other contributors 274 * Released under the MIT license. 275 * http://jquery.org/license 276 */ 277ax.widget("ui.tabs",{version:"1.13.0",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(function(){var aK=/#.*$/;return function(aM){var aO,aN;aO=aM.href.replace(aK,"");aN=location.href.replace(aK,"");try{aO=decodeURIComponent(aO)}catch(aL){}try{aN=decodeURIComponent(aN)}catch(aL){}return aM.hash.length>1&&aO===aN}})(),_create:function(){var aL=this,aK=this.options;this.running=false;this._addClass("ui-tabs","ui-widget ui-widget-content");this._toggleClass("ui-tabs-collapsible",null,aK.collapsible);this._processTabs();aK.active=this._initialActive();if(Array.isArray(aK.disabled)){aK.disabled=ax.uniqueSort(aK.disabled.concat(ax.map(this.tabs.filter(".ui-state-disabled"),function(aM){return aL.tabs.index(aM)}))).sort()}if(this.options.active!==false&&this.anchors.length){this.active=this._findActive(aK.active)}else{this.active=ax()}this._refresh();if(this.active.length){this.load(aK.active)}},_initialActive:function(){var aL=this.options.active,aK=this.options.collapsible,aM=location.hash.substring(1);if(aL===null){if(aM){this.tabs.each(function(aN,aO){if(ax(aO).attr("aria-controls")===aM){aL=aN;return false}})}if(aL===null){aL=this.tabs.index(this.tabs.filter(".ui-tabs-active"))}if(aL===null||aL===-1){aL=this.tabs.length?0:false}}if(aL!==false){aL=this.tabs.index(this.tabs.eq(aL));if(aL===-1){aL=aK?false:0}}if(!aK&&aL===false&&this.anchors.length){aL=0}return aL},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?ax():this._getPanelForTab(this.active)}},_tabKeydown:function(aM){var aL=ax(ax.ui.safeActiveElement(this.document[0])).closest("li"),aK=this.tabs.index(aL),aN=true;if(this._handlePageNav(aM)){return}switch(aM.keyCode){case ax.ui.keyCode.RIGHT:case ax.ui.keyCode.DOWN:aK++;break;case ax.ui.keyCode.UP:case ax.ui.keyCode.LEFT:aN=false;aK--;break;case ax.ui.keyCode.END:aK=this.anchors.length-1;break;case ax.ui.keyCode.HOME:aK=0;break;case ax.ui.keyCode.SPACE:aM.preventDefault();clearTimeout(this.activating);this._activate(aK);return;case ax.ui.keyCode.ENTER:aM.preventDefault();clearTimeout(this.activating);this._activate(aK===this.options.active?false:aK);return;default:return}aM.preventDefault();clearTimeout(this.activating);aK=this._focusNextTab(aK,aN);if(!aM.ctrlKey&&!aM.metaKey){aL.attr("aria-selected","false");this.tabs.eq(aK).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",aK)},this.delay)}},_panelKeydown:function(aK){if(this._handlePageNav(aK)){return}if(aK.ctrlKey&&aK.keyCode===ax.ui.keyCode.UP){aK.preventDefault();this.active.trigger("focus")}},_handlePageNav:function(aK){if(aK.altKey&&aK.keyCode===ax.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true}if(aK.altKey&&aK.keyCode===ax.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true}},_findNextTab:function(aL,aM){var aK=this.tabs.length-1;function aN(){if(aL>aK){aL=0}if(aL<0){aL=aK}return aL}while(ax.inArray(aN(),this.options.disabled)!==-1){aL=aM?aL+1:aL-1}return aL},_focusNextTab:function(aK,aL){aK=this._findNextTab(aK,aL);this.tabs.eq(aK).trigger("focus");return aK},_setOption:function(aK,aL){if(aK==="active"){this._activate(aL);return}this._super(aK,aL);if(aK==="collapsible"){this._toggleClass("ui-tabs-collapsible",null,aL);if(!aL&&this.options.active===false){this._activate(0)}}if(aK==="event"){this._setupEvents(aL)}if(aK==="heightStyle"){this._setupHeightStyle(aL)}},_sanitizeSelector:function(aK){return aK?aK.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var aL=this.options,aK=this.tablist.children(":has(a[href])");aL.disabled=ax.map(aK.filter(".ui-state-disabled"),function(aM){return aK.index(aM)});this._processTabs();if(aL.active===false||!this.anchors.length){aL.active=false;this.active=ax()}else{if(this.active.length&&!ax.contains(this.tablist[0],this.active[0])
277){if(this.tabs.length===aL.disabled.length){aL.active=false;this.active=ax()}else{this._activate(this._findNextTab(Math.max(0,aL.active-1),false))}}else{aL.active=this.tabs.index(this.active)}}this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0)}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});this._addClass(this.active,"ui-tabs-active","ui-state-active");this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})}},_processTabs:function(){var aM=this,aN=this.tabs,aL=this.anchors,aK=this.panels;this.tablist=this._getList().attr("role","tablist");this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header");this.tablist.on("mousedown"+this.eventNamespace,"> li",function(aO){if(ax(this).is(".ui-state-disabled")){aO.preventDefault()}}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){if(ax(this).closest("li").is(".ui-state-disabled")){this.blur()}});this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1});this._addClass(this.tabs,"ui-tabs-tab","ui-state-default");this.anchors=this.tabs.map(function(){return ax("a",this)[0]}).attr({tabIndex:-1});this._addClass(this.anchors,"ui-tabs-anchor");this.panels=ax();this.anchors.each(function(aT,aR){var aO,aP,aS,aQ=ax(aR).uniqueId().attr("id"),aU=ax(aR).closest("li"),aV=aU.attr("aria-controls");if(aM._isLocal(aR)){aO=aR.hash;aS=aO.substring(1);aP=aM.element.find(aM._sanitizeSelector(aO))}else{aS=aU.attr("aria-controls")||ax({}).uniqueId()[0].id;aO="#"+aS;aP=aM.element.find(aO);if(!aP.length){aP=aM._createPanel(aS);aP.insertAfter(aM.panels[aT-1]||aM.tablist)}aP.attr("aria-live","polite")}if(aP.length){aM.panels=aM.panels.add(aP)}if(aV){aU.data("ui-tabs-aria-controls",aV)}aU.attr({"aria-controls":aS,"aria-labelledby":aQ});aP.attr("aria-labelledby",aQ)});this.panels.attr("role","tabpanel");this._addClass(this.panels,"ui-tabs-panel","ui-widget-content");if(aN){this._off(aN.not(this.tabs));this._off(aL.not(this.anchors));this._off(aK.not(this.panels))}},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(aK){return ax("<div>").attr("id",aK).data("ui-tabs-destroy",true)},_setOptionDisabled:function(aN){var aM,aK,aL;if(Array.isArray(aN)){if(!aN.length){aN=false}else{if(aN.length===this.anchors.length){aN=true}}}for(aL=0;(aK=this.tabs[aL]);aL++){aM=ax(aK);if(aN===true||ax.inArray(aL,aN)!==-1){aM.attr("aria-disabled","true");this._addClass(aM,null,"ui-state-disabled")}else{aM.removeAttr("aria-disabled");this._removeClass(aM,null,"ui-state-disabled")}}this.options.disabled=aN;this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,aN===true)},_setupEvents:function(aL){var aK={};if(aL){ax.each(aL.split(" "),function(aN,aM){aK[aM]="_eventHandler"})}this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(aM){aM.preventDefault()}});this._on(this.anchors,aK);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},_setupHeightStyle:function(aK){var aM,aL=this.element.parent();if(aK==="fill"){aM=aL.height();aM-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var aO=ax(this),aN=aO.css("position");if(aN==="absolute"||aN==="fixed"){return}aM-=aO.outerHeight(true)});this.element.children().not(this.panels).each(function(){aM-=ax(this).outerHeight(true)});this.panels.each(function(){ax(this).height(Math.max(0,aM-ax(this).innerHeight()+ax(this).height()))}).css("overflow","auto")}else{if(aK==="auto"){aM=0;this.panels.each(function(){aM=Math.max(aM,ax(this).height("").height())}).height(aM)}}},_eventHandler:function(aK){var aT=this.options,aO=this.active,aP=ax(aK.currentTarget),aN=aP.closest("li"),aR=aN[0]===aO[0],aL=aR&&aT.collapsible,aM=aL?ax():this._getPanelForTab(aN),aQ=!aO.length?ax():this._getPanelForTab(aO),aS={oldTab:aO,oldPanel:aQ,newTab:aL?ax():aN,newPanel:aM};aK.preventDefault();if(aN.hasClass("ui-state-disabled")||aN.hasClass("ui-tabs-loading")||this.running||(
277aR&&!aT.collapsible)||(this._trigger("beforeActivate",aK,aS)===false)){return}aT.active=aL?false:this.tabs.index(aN);this.active=aR?ax():aN;if(this.xhr){this.xhr.abort()}if(!aQ.length&&!aM.length){ax.error("jQuery UI Tabs: Mismatching fragment identifier.")}if(aM.length){this.load(this.tabs.index(aN),aK)}this._toggle(aK,aS)},_toggle:function(aQ,aP){var aO=this,aK=aP.newPanel,aN=aP.oldPanel;this.running=true;function aM(){aO.running=false;aO._trigger("activate",aQ,aP)}function aL(){aO._addClass(aP.newTab.closest("li"),"ui-tabs-active","ui-state-active");if(aK.length&&aO.options.show){aO._show(aK,aO.options.show,aM)}else{aK.show();aM()}}if(aN.length&&this.options.hide){this._hide(aN,this.options.hide,function(){aO._removeClass(aP.oldTab.closest("li"),"ui-tabs-active","ui-state-active");aL()})}else{this._removeClass(aP.oldTab.closest("li"),"ui-tabs-active","ui-state-active");aN.hide();aL()}aN.attr("aria-hidden","true");aP.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(aK.length&&aN.length){aP.oldTab.attr("tabIndex",-1)}else{if(aK.length){this.tabs.filter(function(){return ax(this).attr("tabIndex")===0}).attr("tabIndex",-1)}}aK.attr("aria-hidden","false");aP.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(aL){var aK,aM=this._findActive(aL);if(aM[0]===this.active[0]){return}if(!aM.length){aM=this.active}aK=aM.find(".ui-tabs-anchor")[0];this._eventHandler({target:aK,currentTarget:aK,preventDefault:ax.noop})},_findActive:function(aK){return aK===false?ax():this.tabs.eq(aK)},_getIndex:function(aK){if(typeof aK==="string"){aK=this.anchors.index(this.anchors.filter("[href$='"+ax.escapeSelector(aK)+"']"))}return aK},_destroy:function(){if(this.xhr){this.xhr.abort()}this.tablist.removeAttr("role").off(this.eventNamespace);this.anchors.removeAttr("role tabIndex").removeUniqueId();this.tabs.add(this.panels).each(function(){if(ax.data(this,"ui-tabs-destroy")){ax(this).remove()}else{ax(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}});this.tabs.each(function(){var aK=ax(this),aL=aK.data("ui-tabs-aria-controls");if(aL){aK.attr("aria-controls",aL).removeData("ui-tabs-aria-controls")}else{aK.removeAttr("aria-controls")}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","")}},enable:function(aK){var aL=this.options.disabled;if(aL===false){return}if(aK===undefined){aL=false}else{aK=this._getIndex(aK);if(Array.isArray(aL)){aL=ax.map(aL,function(aM){return aM!==aK?aM:null})}else{aL=ax.map(this.tabs,function(aM,aN){return aN!==aK?aN:null})}}this._setOptionDisabled(aL)},disable:function(aK){var aL=this.options.disabled;if(aL===true){return}if(aK===undefined){aL=true}else{aK=this._getIndex(aK);if(ax.inArray(aK,aL)!==-1){return}if(Array.isArray(aL)){aL=ax.merge([aK],aL).sort()}else{aL=[aK]}}this._setOptionDisabled(aL)},load:function(aN,aR){aN=this._getIndex(aN);var aQ=this,aO=this.tabs.eq(aN),aM=aO.find(".ui-tabs-anchor"),aL=this._getPanelForTab(aO),aP={tab:aO,panel:aL},aK=function(aT,aS){if(aS==="abort"){aQ.panels.stop(false,true)}aQ._removeClass(aO,"ui-tabs-loading");aL.removeAttr("aria-busy");if(aT===aQ.xhr){delete aQ.xhr}};if(this._isLocal(aM[0])){return}this.xhr=ax.ajax(this._ajaxSettings(aM,aR,aP));if(this.xhr&&this.xhr.statusText!=="canceled"){this._addClass(aO,"ui-tabs-loading");aL.attr("aria-busy","true");this.xhr.done(function(aT,aS,aU){setTimeout(function(){aL.html(aT);aQ._trigger("load",aR,aP);aK(aU,aS)},1)}).fail(function(aT,aS){setTimeout(function(){aK(aT,aS)},1)})}},_ajaxSettings:function(aK,aN,aM){var aL=this;return{url:aK.attr("href").replace(/#.*$/,""),beforeSend:function(aP,aO){return aL._trigger("beforeLoad",aN,ax.extend({jqXHR:aP,ajaxSettings:aO},aM))}}},_getPanelForTab:function(aK){var aL=ax(aK).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+aL))}});if(ax.uiBackCompat!==false){ax.widget("ui.tabs",ax.ui.tabs,{_processTabs:function(){this._superApply(arguments);this._addClass(this.tabs,"ui-tab")}})}var Y=ax.ui.tabs; 278/*! 279 * jQuery UI Tooltip 1.13.0 280 * http://jqueryui.com 281 * 282 * Copyright jQuery Foundation and other contributors 283 * Released under the MIT license. 284 * http://jquery.org/license 285 */ 286ax.widget("ui.tooltip",{version:"1.13.0",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var aK=ax(this).attr("title");return ax("<a>").text(aK).html()},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,track:false,close:null,open:null},_addDescribedBy:function(aL,aM){var aK=(aL.attr("aria-describedby")||"").split(/\s+/);aK.push(aM);aL.data("ui-tooltip-id",aM).attr("aria-describedby",String.prototype.trim.call(aK.join(" ")))},_removeDescribedBy:function(aM){var aN=aM.data("ui-tooltip-id"),aL=(aM.attr("aria-describedby")||"").split(/\s+/),aK=ax.inArray(aN,aL);if(aK!==-1){aL.splice(aK,1)}aM.removeData("ui-tooltip-id");aL=String.prototype.trim.call(aL.join(" "));if(aL){aM.attr("aria-describedby",aL)}else{aM.removeAttr("aria-describedby")}},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};this.liveRegion=ax("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this.disabledTitles=ax([])},_setOption:function(aK,aM){var aL=this;this._super(aK,aM);if(aK==="content"){ax.each(this.tooltips,function(aO,aN){aL._updateContent(aN.element)})}},_setOptionDisabled:function(aK){this[aK?"_disable":"_enable"]()},_disable:function(){var aK=this;ax.each(this.tooltips,function(aN,aM){var aL=ax.Event("blur");aL.target=aL.currentTarget=aM.element[0];aK.close(aL,true)});this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var aL=ax(this);if(aL.is("[title]")){return aL.data("ui-tooltip-title",aL.attr("title")).removeAttr("title")}}))},_enable:function(){this.disabledTitles.each(function(){var aK=ax(this);if(aK.data("ui-tooltip-title")){aK.attr("title",aK.data("ui-tooltip-title"))}});this.disabledTitles=ax([])},open:function(aL){var aK=this,aM=ax(aL?aL.target:this.element).closest(this.options.items);if(!aM.length||aM.data("ui-tooltip-id")){return}if(aM.attr("title")){aM.data("ui-tooltip-title",aM.attr("title"))}aM.data("ui-tooltip-open",true);if(aL&&aL.type==="mouseover"){aM.parents().each(function(){var aO=ax(this),aN;if(aO.data("ui-tooltip-open")){aN=ax.Event("blur");aN.target=aN.currentTarget=this;aK.close(aN,true)}if(aO.attr("title")){aO.uniqueId();aK.parents[this.id]={element:this,title:aO.attr("title")};aO.attr("title","")}})}this._registerCloseHandlers(aL,aM);this._updateContent(aM,aL)},_updateContent:function(aP,aO){var aN,aK=this.options.content,aM=this,aL=aO?aO.type:null;if(typeof aK==="string"||aK.nodeType||aK.jquery){return this._open(aO,aP,aK)}aN=aK.call(aP[0],function(aQ){aM._delay(function(){if(!aP.data("ui-tooltip-open")){return}if(aO){aO.type=aL}this._open(aO,aP,aQ)})});if(aN){this._open(aO,aP,aN)}},_open:function(aL,aO,aP){var aK,aS,aR,aM,aQ=ax.extend({},this.options.position);if(!aP){return}aK=this._find(aO);if(aK){aK.tooltip.find(".ui-tooltip-content").html(aP);return}if(aO.is("[title]")){if(aL&&aL.type==="mouseover"){aO.attr("title","")}else{aO.removeAttr("title")}}aK=this._tooltip(aO);aS=aK.tooltip;this._addDescribedBy(aO,aS.attr("id"));aS.find(".ui-tooltip-content").html(aP);this.liveRegion.children().hide();aM=ax("<div>").html(aS.find(".ui-tooltip-content").html());aM.removeAttr("name").find("[name]").removeAttr("name");aM.removeAttr("id").find("[id]").removeAttr("id");aM.appendTo(this.liveRegion);function aN(aT){aQ.of=aT;if(aS.is(":hidden")){return}aS.position(aQ)}if(this.options.track&&aL&&/^mouse/.test(aL.type)){this._on(this.document,{mousemove:aN});aN(aL)}else{aS.position(ax.extend({of:aO},this.options.position))}aS.hide();this._show(aS,this.options.show);if(this.options.track&&this.options.show&&this.options.show.delay){aR=this.delayedShow=setInterval(function(){if(aS.is(":visible")){aN(aQ.of);clearInterval(aR)}},13)}this._trigger("open",aL,{tooltip:aS})}
286,_registerCloseHandlers:function(aL,aM){var aK={keyup:function(aN){if(aN.keyCode===ax.ui.keyCode.ESCAPE){var aO=ax.Event(aN);aO.currentTarget=aM[0];this.close(aO,true)}}};if(aM[0]!==this.element[0]){aK.remove=function(){this._removeTooltip(this._find(aM).tooltip)}}if(!aL||aL.type==="mouseover"){aK.mouseleave="close"}if(!aL||aL.type==="focusin"){aK.focusout="close"}this._on(true,aM,aK)},close:function(aL){var aN,aK=this,aO=ax(aL?aL.currentTarget:this.element),aM=this._find(aO);if(!aM){aO.removeData("ui-tooltip-open");return}aN=aM.tooltip;if(aM.closing){return}clearInterval(this.delayedShow);if(aO.data("ui-tooltip-title")&&!aO.attr("title")){aO.attr("title",aO.data("ui-tooltip-title"))}this._removeDescribedBy(aO);aM.hiding=true;aN.stop(true);this._hide(aN,this.options.hide,function(){aK._removeTooltip(ax(this))});aO.removeData("ui-tooltip-open");this._off(aO,"mouseleave focusout keyup");if(aO[0]!==this.element[0]){this._off(aO,"remove")}this._off(this.document,"mousemove");if(aL&&aL.type==="mouseleave"){ax.each(this.parents,function(aQ,aP){ax(aP.element).attr("title",aP.title);delete aK.parents[aQ]})}aM.closing=true;this._trigger("close",aL,{tooltip:aN});if(!aM.hiding){aM.closing=false}},_tooltip:function(aK){var aM=ax("<div>").attr("role","tooltip"),aL=ax("<div>").appendTo(aM),aN=aM.uniqueId().attr("id");this._addClass(aL,"ui-tooltip-content");this._addClass(aM,"ui-tooltip","ui-widget ui-widget-content");aM.appendTo(this._appendTo(aK));return this.tooltips[aN]={element:aK,tooltip:aM}},_find:function(aK){var aL=aK.data("ui-tooltip-id");return aL?this.tooltips[aL]:null},_removeTooltip:function(aK){clearInterval(this.delayedShow);aK.remove();delete this.tooltips[aK.attr("id")]},_appendTo:function(aL){var aK=aL.closest(".ui-front, dialog");if(!aK.length){aK=this.document[0].body}return aK},_destroy:function(){var aK=this;ax.each(this.tooltips,function(aO,aN){var aM=ax.Event("blur"),aL=aN.element;aM.target=aM.currentTarget=aL[0];aK.close(aM,true);ax("#"+aO).remove();if(aL.data("ui-tooltip-title")){if(!aL.attr("title")){aL.attr("title",aL.data("ui-tooltip-title"))}aL.removeData("ui-tooltip-title")}});this.liveRegion.remove()}});if(ax.uiBackCompat!==false){ax.widget("ui.tooltip",ax.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var aK=this._superApply(arguments);if(this.options.tooltipClass){aK.tooltip.addClass(this.options.tooltipClass)}return aK}})}var J=ax.ui.tooltip;var b=ax; 287/*! 288 * jQuery Color Animations v2.2.0 289 * https://github.com/jquery/jquery-color 290 * 291 * Copyright OpenJS Foundation and other contributors 292 * Released under the MIT license. 293 * http://jquery.org/license 294 * 295 * Date: Sun May 10 09:02:36 2020 +0200 296 */ 297var Q="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",aw={},al=aw.toString,z=/^([\-+])=\s*(\d+\.?\d*)/,ae=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(aK){return[aK[1],aK[2],aK[3],aK[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(aK){return[aK[1]*2.55,aK[2]*2.55,aK[3]*2.55,aK[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(aK){return[parseInt(aK[1],16),parseInt(aK[2],16),parseInt(aK[3],16),aK[4]?(parseInt(aK[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(aK){return[parseInt(aK[1]+aK[1],16),parseInt(aK[2]+aK[2],16),parseInt(aK[3]+aK[3],16),aK[4]?(parseInt(aK[4]+aK[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(aK){return[aK[1],aK[2]/100,aK[3]/100,aK[4]]}}],t=b.Color=function(aL,aM,aK,aN){return new b.Color.fn.parse(aL,aM,aK,aN)},A={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},m={"byte":{floor:true,max:255},percent:{max:1},degrees:{mod:360,floor:true}},aD=t.support={},ab=b("<p>")[0],au,aH=b.each;ab.style.cssText="background-color:rgba(1,1,1,.5)";aD.rgba=ab.style.backgroundColor.indexOf("rgba")>-1;aH(A,function(aK,aL){aL.cache="_"+aK;
297aL.props.alpha={idx:3,type:"percent",def:1}});b.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(aL,aK){aw["[object "+aK+"]"]=aK.toLowerCase()});function v(aK){if(aK==null){return aK+""}return typeof aK==="object"?aw[al.call(aK)]||"object":typeof aK}function aA(aL,aN,aM){var aK=m[aN.type]||{};if(aL==null){return(aM||!aN.def)?null:aN.def}aL=aK.floor?~~aL:parseFloat(aL);if(isNaN(aL)){return aN.def}if(aK.mod){return(aL+aK.mod)%aK.mod}return Math.min(aK.max,Math.max(0,aL))}function D(aK){var aM=t(),aL=aM._rgba=[];aK=aK.toLowerCase();aH(ae,function(aR,aS){var aP,aQ=aS.re.exec(aK),aO=aQ&&aS.parse(aQ),aN=aS.space||"rgba";if(aO){aP=aM[aN](aO);aM[A[aN].cache]=aP[A[aN].cache];aL=aM._rgba=aP._rgba;return false}});if(aL.length){if(aL.join()==="0,0,0,0"){b.extend(aL,au.transparent)}return aM}return au[aK]}t.fn=b.extend(t.prototype,{parse:function(aQ,aO,aK,aP){if(aQ===undefined){this._rgba=[null,null,null,null];return this}if(aQ.jquery||aQ.nodeType){aQ=b(aQ).css(aO);aO=undefined}var aN=this,aM=v(aQ),aL=this._rgba=[];if(aO!==undefined){aQ=[aQ,aO,aK,aP];aM="array"}
297if(aM==="string"){return this.parse(D(aQ)||au._default)}if(aM==="array"){aH(A.rgba.props,function(aR,aS){aL[aS.idx]=aA(aQ[aS.idx],aS)});return this}if(aM==="object"){if(aQ instanceof t){aH(A,function(aR,aS){if(aQ[aS.cache]){aN[aS.cache]=aQ[aS.cache].slice()}})}else{aH(A,function(aS,aT){var aR=aT.cache;aH(aT.props,function(aU,aV){if(!aN[aR]&&aT.to){if(aU==="alpha"||aQ[aU]==null){return}aN[aR]=aT.to(aN._rgba)}aN[aR][aV.idx]=aA(aQ[aU],aV,true)});if(aN[aR]&&b.inArray(null,aN[aR].slice(0,3))<0){if(aN[aR][3]==null){aN[aR][3]=1}if(aT.from){aN._rgba=aT.from(aN[aR])}}})}return this}},is:function(aM){var aK=t(aM),aN=true,aL=this;aH(A,function(aO,aQ){var aR,aP=aK[aQ.cache];if(aP){aR=aL[aQ.cache]||aQ.to&&aQ.to(aL._rgba)||[];aH(aQ.props,function(aS,aT){if(aP[aT.idx]!=null){aN=(aP[aT.idx]===aR[aT.idx]);return aN}})}return aN});return aN},_space:function(){var aK=[],aL=this;aH(A,function(aM,aN){if(aL[aN.cache]){aK.push(aM)}});return aK.pop()},transition:function(aL,aR){var aM=t(aL),aN=aM._space(),aO=A[aN],aP=this.alpha()===0?t("transparent"):this,aQ=aP[aO.cache]||aO.to(aP._rgba),aK=aQ.slice();aM=aM[aO.cache];aH(aO.props,function(aW,aX){var aU=aX.idx,aT=aQ[aU],aS=aM[aU],aV=m[aX.type]||{};if(aS===null){return}if(aT===null){aK[aU]=aS}else{if(aV.mod){if(aS-aT>aV.mod/2){aT+=aV.mod}else{if(aT-aS>aV.mod/2){aT-=aV.mod}}}aK[aU]=aA((aS-aT)*aR+aT,aX)}});return this[aN](aK)},blend:function(aN){if(this._rgba[3]===1){return this}var aM=this._rgba.slice(),aL=aM.pop(),aK=t(aN)._rgba;return t(b.map(aM,function(aO,aP){return(1-aL)*aK[aP]+aL*aO}))},toRgbaString:function(){var aL="rgba(",aK=b.map(this._rgba,function(aM,aN){if(aM!=null){return aM}return aN>2?1:0});if(aK[3]===1){aK.pop();aL="rgb("}return aL+aK.join()+")"},toHslaString:function(){var aL="hsla(",aK=b.map(this.hsla(),function(aM,aN){if(aM==null){aM=aN>2?1:0}if(aN&&aN<3){aM=Math.round(aM*100)+"%"}return aM});if(aK[3]===1){aK.pop();aL="hsl("}return aL+aK.join()+")"},toHexString:function(aK){var aL=this._rgba.slice(),aM=aL.pop();if(aK){aL.push(~~(aM*255))}return"#"+b.map(aL,function(aN){aN=(aN||0).toString(16);return aN.length===1?"0"+aN:aN}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}});t.fn.parse.prototype=t.fn;function k(aM,aL,aK){aK=(aK+1)%1;if(aK*6<1){return aM+(aL-aM)*aK*6}if(aK*2<1){return aL}if(aK*3<2){return aM+(aL-aM)*((2/3)-aK)*6}return aM}A.hsla.to=function(aM){if(aM[0]==null||aM[1]==null||aM[2]==null){return[null,null,null,aM[3]]}var aK=aM[0]/255,aP=aM[1]/255,aQ=aM[2]/255,aS=aM[3],aR=Math.max(aK,aP,aQ),aN=Math.min(aK,aP,aQ),aT=aR-aN,aU=aR+aN,aL=aU*0.5,aO,aV;if(aN===aR){aO=0}else{if(aK===aR){aO=(60*(aP-aQ)/aT)+360}else{if(aP===aR){aO=(60*(aQ-aK)/aT)+120}else{aO=(60*(aK-aP)/aT)+240}}}if(aT===0){aV=0}else{if(aL<=0.5){aV=aT/aU}else{aV=aT/(2-aU)}}return[Math.round(aO)%360,aV,aL,aS==null?1:aS]};A.hsla.from=function(aO){if(aO[0]==null||aO[1]==null||aO[2]==null){return[null,null,null,aO[3]]}var aN=aO[0]/360,aM=aO[1],aL=aO[2],aK=aO[3],aP=aL<=0.5?aL*(1+aM):aL+aM-aL*aM,aQ=2*aL-aP;return[Math.round(k(aQ,aP,aN+(1/3))*255),Math.round(k(aQ,aP,aN)*255),Math.round(k(aQ,aP,aN-(1/3))*255),aK]};aH(A,function(aL,aN){var aM=aN.props,aK=aN.cache,aP=aN.to,aO=aN.from;t.fn[aL]=function(aU){if(aP&&!this[aK]){this[aK]=aP(this._rgba)}if(aU===undefined){return this[aK].slice()}var aR,aT=v(aU),aQ=(aT==="array"||aT==="object")?aU:arguments,aS=this[aK].slice();aH(aM,function(aV,aX){var aW=aQ[aT==="object"?aV:aX.idx];if(aW==null){aW=aS[aX.idx]}aS[aX.idx]=aA(aW,aX)});if(aO){aR=t(aO(aS));aR[aK]=aS;return aR}else{return t(aS)}};aH(aM,function(aQ,aR){if(t.fn[aQ]){return}t.fn[aQ]=function(aV){var aT,aX,aS,aU,aW=v(aV);if(aQ==="alpha"){aU=this._hsla?"hsla":"rgba"}else{aU=aL}aT=this[aU]();aX=aT[aR.idx];if(aW==="undefined"){return aX}if(aW==="function"){aV=aV.call(this,aX);aW=v(aV)}if(aV==null&&aR.empty){return this}if(aW==="string"){aS=z.exec(aV);if(aS){aV=aX+parseFloat(aS[2])*(aS[1]==="+"?1:-1)}}aT[aR.idx]=aV;return this[aU](aT)}})});t.hook=function(aL){var aK=aL.split(" ");aH(aK,function(aN,aM){b.cssHooks[aM]={set:function(aR,aS){var aP,aQ,aO="";if(aS!=="transparent"&&(v(aS)!=="string"||(aP=D(aS)))){aS=t(aP||aS);if(!aD.rgba&&aS._rgba[3]!==1){aQ=aM==="backgroundColor"?aR.parentNode:aR;while((aO===""||aO==="transparent")&&aQ&&aQ.style){try{aO=b.css(aQ,"backgroundColor");aQ=aQ.parentNode}catch(aT){}}aS=aS.blend(aO&&aO!=="transparent"?aO:"_default")}aS=aS.toRgbaString()}try{aR.style[aM]=aS}catch(aT){}}};b.fx.step[aM]=function(aO){if(!aO.colorInit){aO.start=t(aO.elem,aM);aO.end=t(aO.end);aO.colorInit=true}b.cssHooks[aM].set(aO.elem,aO.start.transition(aO.end,aO.pos))}})};t.hook(Q);b.cssHooks.borderColor={expand:function(aL){var aK={};aH(["Top","Right","Bottom","Left"],function(aN,aM){aK["border"+aM+"Color"]=aL});return aK}};
297au=b.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}; 298/*! 299 * jQuery UI Effects 1.13.0 300 * http://jqueryui.com 301 * 302 * Copyright jQuery Foundation and other contributors 303 * Released under the MIT license. 304 * http://jquery.org/license 305 */ 306var w="ui-effects-",am="ui-effects-style",aE="ui-effects-animated";ax.effects={effect:{}};(function(){var aL=["add","remove","toggle"],aN={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};ax.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(aP,aQ){ax.fx.step[aQ]=function(aR){if(aR.end!=="none"&&!aR.setAttr||aR.pos===1&&!aR.setAttr){b.style(aR.elem,aQ,aR.end);aR.setAttr=true}}});function aM(aP){return aP.replace(/-([\da-z])/gi,function(aQ,aR){return aR.toUpperCase()})}function aO(aT){var aQ,aP,aR=aT.ownerDocument.defaultView?aT.ownerDocument.defaultView.getComputedStyle(aT,null):aT.currentStyle,aS={};if(aR&&aR.length&&aR[0]&&aR[aR[0]]){aP=aR.length;while(aP--){aQ=aR[aP];if(typeof aR[aQ]==="string"){aS[aM(aQ)]=aR[aQ]}}}else{for(aQ in aR){if(typeof aR[aQ]==="string"){aS[aQ]=aR[aQ]}}}return aS}function aK(aP,aR){var aT={},aQ,aS;for(aQ in aR){aS=aR[aQ];
306if(aP[aQ]!==aS){if(!aN[aQ]){if(ax.fx.step[aQ]||!isNaN(parseFloat(aS))){aT[aQ]=aS}}}}return aT}if(!ax.fn.addBack){ax.fn.addBack=function(aP){return this.add(aP==null?this.prevObject:this.prevObject.filter(aP))}}ax.effects.animateClass=function(aP,aQ,aT,aS){var aR=ax.speed(aQ,aT,aS);return this.queue(function(){var aW=ax(this),aU=aW.attr("class")||"",aV,aX=aR.children?aW.find("*").addBack():aW;aX=aX.map(function(){var aY=ax(this);return{el:aY,start:aO(this)}});aV=function(){ax.each(aL,function(aY,aZ){if(aP[aZ]){aW[aZ+"Class"](aP[aZ])}})};aV();aX=aX.map(function(){this.end=aO(this.el[0]);this.diff=aK(this.start,this.end);return this});aW.attr("class",aU);aX=aX.map(function(){var a0=this,aY=ax.Deferred(),aZ=ax.extend({},aR,{queue:false,complete:function(){aY.resolve(a0)}});this.el.animate(this.diff,aZ);return aY.promise()});ax.when.apply(ax,aX.get()).done(function(){aV();ax.each(arguments,function(){var aY=this.el;ax.each(this.diff,function(aZ){aY.css(aZ,"")})});aR.complete.call(aW[0])})})};ax.fn.extend({addClass:(function(aP){return function(aR,aQ,aT,aS){return aQ?ax.effects.animateClass.call(this,{add:aR},aQ,aT,aS):aP.apply(this,arguments)}})(ax.fn.addClass),removeClass:(function(aP){return function(aR,aQ,aT,aS){return arguments.length>1?ax.effects.animateClass.call(this,{remove:aR},aQ,aT,aS):aP.apply(this,arguments)}})(ax.fn.removeClass),toggleClass:(function(aP){return function(aS,aR,aQ,aU,aT){if(typeof aR==="boolean"||aR===undefined){if(!aQ){return aP.apply(this,arguments)}else{return ax.effects.animateClass.call(this,(aR?{add:aS}:{remove:aS}),aQ,aU,aT)}}else{return ax.effects.animateClass.call(this,{toggle:aS},aR,aQ,aU)}}})(ax.fn.toggleClass),switchClass:function(aP,aR,aQ,aT,aS){return ax.effects.animateClass.call(this,{add:aR,remove:aP},aQ,aT,aS)}})})();(function(){if(ax.expr&&ax.expr.pseudos&&ax.expr.pseudos.animated){ax.expr.pseudos.animated=(function(aN){return function(aO){return !!ax(aO).data(aE)||aN(aO)}})(ax.expr.pseudos.animated)}if(ax.uiBackCompat!==false){ax.extend(ax.effects,{save:function(aO,aQ){var aN=0,aP=aQ.length;for(;aN<aP;aN++){if(aQ[aN]!==null){aO.data(w+aQ[aN],aO[0].style[aQ[aN]])}}},restore:function(aO,aR){var aQ,aN=0,aP=aR.length;for(;aN<aP;aN++){if(aR[aN]!==null){aQ=aO.data(w+aR[aN]);aO.css(aR[aN],aQ)}}},setMode:function(aN,aO){if(aO==="toggle"){aO=aN.is(":hidden")?"show":"hide"}return aO},createWrapper:function(aO){if(aO.parent().is(".ui-effects-wrapper")){return aO.parent()}var aP={width:aO.outerWidth(true),height:aO.outerHeight(true),"float":aO.css("float")},aS=ax("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),aN={width:aO.width(),height:aO.height()},aR=document.activeElement;try{aR.id}catch(aQ){aR=document.body}aO.wrap(aS);if(aO[0]===aR||ax.contains(aO[0],aR)){ax(aR).trigger("focus")}aS=aO.parent();if(aO.css("position")==="static"){aS.css({position:"relative"});aO.css({position:"relative"})}else{ax.extend(aP,{position:aO.css("position"),zIndex:aO.css("z-index")});ax.each(["top","left","bottom","right"],function(aT,aU){aP[aU]=aO.css(aU);if(isNaN(parseInt(aP[aU],10))){aP[aU]="auto"}});aO.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}aO.css(aN);return aS.css(aP).show()},removeWrapper:function(aN){var aO=document.activeElement;if(aN.parent().is(".ui-effects-wrapper")){aN.parent().replaceWith(aN);if(aN[0]===aO||ax.contains(aN[0],aO)){ax(aO).trigger("focus")}}return aN}})}ax.extend(ax.effects,{version:"1.13.0",define:function(aN,aP,aO){if(!aO){aO=aP;aP="effect"}ax.effects.effect[aN]=aO;ax.effects.effect[aN].mode=aP;return aO},scaledDimensions:function(aO,aP,aQ){if(aP===0){return{height:0,width:0,outerHeight:0,outerWidth:0}}var aN=aQ!=="horizontal"?((aP||100)/100):1,aR=aQ!=="vertical"?((aP||100)/100):1;return{height:aO.height()*aR,width:aO.width()*aN,outerHeight:aO.outerHeight()*aR,outerWidth:aO.outerWidth()*aN}},clipToBox:function(aN){return{width:aN.clip.right-aN.clip.left,height:aN.clip.bottom-aN.clip.top,left:aN.clip.left,top:aN.clip.top}},unshift:function(aO,aQ,aP){var aN=aO.queue();if(aQ>1){aN.splice.apply(aN,[1,0].concat(aN.splice(aQ,aP)))}aO.dequeue()},saveStyle:function(aN){aN.data(am,aN[0].style.cssText)},restoreStyle:function(aN){aN[0].style.cssText=aN.data(am)||"";aN.removeData(am)},mode:function(aN,aP){var aO=aN.is(":hidden");if(aP==="toggle"){aP=aO?"show":"hide"}if(aO?aP==="hide":aP==="show"){aP="none"}return aP},getBaseline:function(aO,aP){var aQ,aN;switch(aO[0]){case"top":aQ=0;break;case"middle":aQ=0.5;break;case"bottom":aQ=1;break;default:aQ=aO[0]/aP.height}switch(aO[1]){case"left":aN=0;break;case"center":aN=0.5;break;case"right":aN=1;break;default:aN=aO[1]/aP.width}return{x:aN,y:aQ}},createPlaceholder:function(aO){var aQ,aP=aO.css("position"),aN=aO.position();aO.css({marginTop:aO.css("marginTop"),marginBottom:aO.css("marginBottom"),marginLeft:aO.css("marginLeft"),marginRight:aO.css("marginRight")}).outerWidth(aO.outerWidth()).outerHeight(aO.outerHeight());if(/^(static|relative)/.test(aP)){aP="absolute";aQ=ax("<"+aO[0].nodeName+">").insertAfter(aO).css({display:/^(inline|ruby)/.test(aO.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:aO.css("marginTop"),marginBottom:aO.css("marginBottom"),marginLeft:aO.css("marginLeft"),marginRight:aO.css("marginRight"),"float":aO.css("float")}).outerWidth(aO.outerWidth()).outerHeight(aO.outerHeight()).addClass("ui-effects-placeholder");aO.data(w+"placeholder",aQ)}aO.css({position:aP,left:aN.left,top:aN.top});return aQ},removePlaceholder:function(aN){var aP=w+"placeholder",aO=aN.data(aP);if(aO){aO.remove();aN.removeData(aP)}},cleanUp:function(aN){ax.effects.restoreStyle(aN);ax.effects.removePlaceholder(aN)},setTransition:function(aO,aQ,aN,aP){aP=aP||{};ax.each(aQ,function(aS,aR){var aT=aO.cssUnit(aR);if(aT[0]>0){aP[aR]=aT[0]*aN+aT[1]}});return aP}});function aL(aO,aN,aP,aQ){if(ax.isPlainObject(aO)){aN=aO;aO=aO.effect}aO={effect:aO};if(aN==null){aN={}}if(typeof aN==="function"){aQ=aN;aP=null;aN={}}if(typeof aN==="number"||ax.fx.speeds[aN]){aQ=aP;aP=aN;aN={}}if(typeof aP==="function"){aQ=aP;aP=null}if(aN){ax.extend(aO,aN)}aP=aP||aN.duration;aO.duration=ax.fx.off?0:typeof aP==="number"?aP:aP in ax.fx.speeds?ax.fx.speeds[aP]:ax.fx.speeds._default;aO.complete=aQ||aN.complete;return aO}function aM(aN){if(!aN||typeof aN==="number"||ax.fx.speeds[aN]){return true}if(typeof aN==="string"&&!ax.effects.effect[aN]){return true}if(typeof aN==="function"){return true}if(typeof aN==="object"&&!aN.effect){return true}return false}ax.fn.extend({effect:function(){var aV=aL.apply(this,arguments),aU=ax.effects.effect[aV.effect],aR=aU.mode,aT=aV.queue,aQ=aT||"fx",aN=aV.complete,aS=aV.mode,aO=[],aW=function(aZ){var aY=ax(this),aX=ax.effects.mode(aY,aS)||aR;aY.data(aE,true);aO.push(aX);if(aR&&(aX==="show"||(aX===aR&&aX==="hide"))){aY.show()}if(!aR||aX!=="none"){ax.effects.saveStyle(aY)}if(typeof aZ==="function"){aZ()}};if(ax.fx.off||!aU){if(aS){return this[aS](aV.duration,aN)}else{return this.each(function(){if(aN){aN.call(this)}})}}function aP(aZ){var a0=ax(this);function aY(){a0.removeData(aE);ax.effects.cleanUp(a0);if(aV.mode==="hide"){a0.hide()}aX()}function aX(){if(typeof aN==="function"){aN.call(a0[0])}if(typeof aZ==="function"){aZ()}}aV.mode=aO.shift();if(ax.uiBackCompat!==false&&!aR){if(a0.is(":hidden")?aS==="hide":aS==="show"){a0[aS]();aX()}else{aU.call(a0[0],aV,aX)}}else{if(aV.mode==="none"){a0[aS]();aX()}else{aU.call(a0[0],aV,aY)}}}return aT===false?this.each(aW).each(aP):this.queue(aQ,aW).queue(aQ,aP)},show:(function(aN){return function(aP){if(aM(aP)){return aN.apply(this,arguments)}else{var aO=aL.apply(this,arguments);aO.mode="show";return this.effect.call(this,aO)}}})(ax.fn.show),hide:(function(aN){return function(aP){if(aM(aP)){return aN.apply(this,arguments)}else{var aO=aL.apply(this,arguments);aO.mode="hide";return this.effect.call(this,aO)}}})(ax.fn.hide),toggle:(function(aN){return function(aP){if(aM(aP)||typeof aP==="boolean"){return aN.apply(this,arguments)}else{var aO=aL.apply(this,arguments);aO.mode="toggle";return this.effect.call(this,aO)}}}
306)(ax.fn.toggle),cssUnit:function(aN){var aO=this.css(aN),aP=[];ax.each(["em","px","%","pt"],function(aQ,aR){if(aO.indexOf(aR)>0){aP=[parseFloat(aO),aR]}});return aP},cssClip:function(aN){if(aN){return this.css("clip","rect("+aN.top+"px "+aN.right+"px "+aN.bottom+"px "+aN.left+"px)")}return aK(this.css("clip"),this)},transfer:function(aY,aQ){var aS=ax(this),aU=ax(aY.to),aX=aU.css("position")==="fixed",aT=ax("body"),aV=aX?aT.scrollTop():0,aW=aX?aT.scrollLeft():0,aN=aU.offset(),aP={top:aN.top-aV,left:aN.left-aW,height:aU.innerHeight(),width:aU.innerWidth()},aR=aS.offset(),aO=ax("<div class='ui-effects-transfer'></div>");aO.appendTo("body").addClass(aY.className).css({top:aR.top-aV,left:aR.left-aW,height:aS.innerHeight(),width:aS.innerWidth(),position:aX?"fixed":"absolute"}).animate(aP,aY.duration,aY.easing,function(){aO.remove();if(typeof aQ==="function"){aQ()}})}});function aK(aS,aP){var aR=aP.outerWidth(),aQ=aP.outerHeight(),aO=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,aN=aO.exec(aS)||["",0,aR,aQ,0];return{top:parseFloat(aN[1])||0,right:aN[2]==="auto"?aR:parseFloat(aN[2]),bottom:aN[3]==="auto"?aQ:parseFloat(aN[3]),left:parseFloat(aN[4])||0}}ax.fx.step.clip=function(aN){if(!aN.clipInit){aN.start=ax(aN.elem).cssClip();if(typeof aN.end==="string"){aN.end=aK(aN.end,aN.elem)}aN.clipInit=true}ax(aN.elem).cssClip({top:aN.pos*(aN.end.top-aN.start.top)+aN.start.top,right:aN.pos*(aN.end.right-aN.start.right)+aN.start.right,bottom:aN.pos*(aN.end.bottom-aN.start.bottom)+aN.start.bottom,left:aN.pos*(aN.end.left-aN.start.left)+aN.start.left})}})();(function(){var aK={};ax.each(["Quad","Cubic","Quart","Quint","Expo"],function(aM,aL){aK[aL]=function(aN){return Math.pow(aN,aM+2)}});ax.extend(aK,{Sine:function(aL){return 1-Math.cos(aL*Math.PI/2)},Circ:function(aL){return 1-Math.sqrt(1-aL*aL)},Elastic:function(aL){return aL===0||aL===1?aL:-Math.pow(2,8*(aL-1))*Math.sin(((aL-1)*80-7.5)*Math.PI/15)},Back:function(aL){return aL*aL*(3*aL-2)},Bounce:function(aN){var aL,aM=4;while(aN<((aL=Math.pow(2,--aM))-1)/11){}return 1/Math.pow(4,3-aM)-7.5625*Math.pow((aL*3-2)/22-aN,2)}});ax.each(aK,function(aM,aL){ax.easing["easeIn"+aM]=aL;ax.easing["easeOut"+aM]=function(aN){return 1-aL(1-aN)};ax.easing["easeInOut"+aM]=function(aN){return aN<0.5?aL(aN*2)/2:1-aL(aN*-2+2)/2}})})();var N=ax.effects; 307/*! 308 * jQuery UI Effects Blind 1.13.0 309 * http://jqueryui.com 310 * 311 * Copyright jQuery Foundation and other contributors 312 * Released under the MIT license. 313 * http://jquery.org/license 314 */ 315var K=ax.effects.define("blind","hide",function(aM,aK){var aP={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},aN=ax(this),aO=aM.direction||"up",aR=aN.cssClip(),aL={clip:ax.extend({},aR)},aQ=ax.effects.createPlaceholder(aN);aL.clip[aP[aO][0]]=aL.clip[aP[aO][1]];if(aM.mode==="show"){aN.cssClip(aL.clip);if(aQ){aQ.css(ax.effects.clipToBox(aL))}aL.clip=aR}if(aQ){aQ.animate(ax.effects.clipToBox(aL),aM.duration,aM.easing)}aN.animate(aL,{queue:false,duration:aM.duration,easing:aM.easing,complete:aK})}); 316/*! 317 * jQuery UI Effects Bounce 1.13.0 318 * http://jqueryui.com 319 * 320 * Copyright jQuery Foundation and other contributors 321 * Released under the MIT license. 322 * http://jquery.org/license 323 */ 324var E=ax.effects.define("bounce",function(aL,aS){var aO,aW,aZ,aK=ax(this),aR=aL.mode,aQ=aR==="hide",a0=aR==="show",a1=aL.direction||"up",aM=aL.distance,aP=aL.times||5,a2=aP*2+(a0||aQ?1:0),aY=aL.duration/a2,aU=aL.easing,aN=(a1==="up"||a1==="down")?"top":"left",aT=(a1==="up"||a1==="left"),aX=0,aV=aK.queue().length;ax.effects.createPlaceholder(aK);aZ=aK.css(aN);if(!aM){aM=aK[aN==="top"?"outerHeight":"outerWidth"]()/3}if(a0){aW={opacity:1};aW[aN]=aZ;aK.css("opacity",0).css(aN,aT?-aM*2:aM*2).animate(aW,aY,aU)}if(aQ){aM=aM/Math.pow(2,aP-1)}aW={};aW[aN]=aZ;for(;aX<aP;aX++){aO={};aO[aN]=(aT?"-=":"+=")+aM;aK.animate(aO,aY,aU).animate(aW,aY,aU);aM=aQ?aM*2:aM/2}if(aQ){aO={opacity:0};aO[aN]=(aT?"-=":"+=")+aM;aK.animate(aO,aY,aU)}aK.queue(aS);ax.effects.unshift(aK,aV,a2+1)}); 325/*! 326 * jQuery UI Effects Clip 1.13.0 327 * http://jqueryui.com 328 * 329 * Copyright jQuery Foundation and other contributors 330 * Released under the MIT license. 331 * http://jquery.org/license 332 */ 333var an=ax.effects.define("clip","hide",function(aS,aO){var aL,aM={},aP=ax(this),aR=aS.direction||"vertical",aQ=aR==="both",aK=aQ||aR==="horizontal",aN=aQ||aR==="vertical";aL=aP.cssClip();aM.clip={top:aN?(aL.bottom-aL.top)/2:aL.top,right:aK?(aL.right-aL.left)/2:aL.r
vendor: 4,631 bytes, lines 333-387
333ight,bottom:aN?(aL.bottom-aL.top)/2:aL.bottom,left:aK?(aL.right-aL.left)/2:aL.left};ax.effects.createPlaceholder(aP);if(aS.mode==="show"){aP.cssClip(aM.clip);aM.clip=aL}aP.animate(aM,{queue:false,duration:aS.duration,easing:aS.easing,complete:aO})}); 334/*! 335 * jQuery UI Effects Drop 1.13.0 336 * http://jqueryui.com 337 * 338 * Copyright jQuery Foundation and other contributors 339 * Released under the MIT license. 340 * http://jquery.org/license 341 */ 342var ac=ax.effects.define("drop","hide",function(aU,aN){var aK,aO=ax(this),aQ=aU.mode,aS=aQ==="show",aR=aU.direction||"left",aL=(aR==="up"||aR==="down")?"top":"left",aT=(aR==="up"||aR==="left")?"-=":"+=",aP=(aT==="+=")?"-=":"+=",aM={opacity:0};ax.effects.createPlaceholder(aO);aK=aU.distance||aO[aL==="top"?"outerHeight":"outerWidth"](true)/2;aM[aL]=aT+aK;if(aS){aO.css(aM);aM[aL]=aP+aK;aM.opacity=1}aO.animate(aM,{queue:false,duration:aU.duration,easing:aU.easing,complete:aN})}); 343/*! 344 * jQuery UI Effects Explode 1.13.0 345 * http://jqueryui.com 346 * 347 * Copyright jQuery Foundation and other contributors 348 * Released under the MIT license. 349 * http://jquery.org/license 350 */ 351var aI=ax.effects.define("explode","hide",function(aL,aX){var a0,aZ,aN,aV,aU,aS,aR=aL.pieces?Math.round(Math.sqrt(aL.pieces)):3,aM=aR,aK=ax(this),aT=aL.mode,a1=aT==="show",aP=aK.show().css("visibility","hidden").offset(),aY=Math.ceil(aK.outerWidth()/aM),aW=Math.ceil(aK.outerHeight()/aR),aQ=[];function a2(){aQ.push(this);if(aQ.length===aR*aM){aO()}}for(a0=0;a0<aR;a0++){aV=aP.top+a0*aW;aS=a0-(aR-1)/2;for(aZ=0;aZ<aM;aZ++){aN=aP.left+aZ*aY;aU=aZ-(aM-1)/2;aK.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-aZ*aY,top:-a0*aW}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:aY,height:aW,left:aN+(a1?aU*aY:0),top:aV+(a1?aS*aW:0),opacity:a1?0:1}).animate({left:aN+(a1?0:aU*aY),top:aV+(a1?0:aS*aW),opacity:a1?1:0},aL.duration||500,aL.easing,a2)}}function aO(){aK.css({visibility:"visible"});ax(aQ).remove();aX()}}); 352/*! 353 * jQuery UI Effects Fade 1.13.0 354 * http://jqueryui.com 355 * 356 * Copyright jQuery Foundation and other contributors 357 * Released under the MIT license. 358 * http://jquery.org/license 359 */ 360var aJ=ax.effects.define("fade","toggle",function(aM,aL){var aK=aM.mode==="show";ax(this).css("opacity",aK?0:1).animate({opacity:aK?1:0},{queue:false,duration:aM.duration,easing:aM.easing,complete:aL})}); 361/*! 362 * jQuery UI Effects Fold 1.13.0 363 * http://jqueryui.com 364 * 365 * Copyright jQuery Foundation and other contributors 366 * Released under the MIT license. 367 * http://jquery.org/license 368 */ 369var x=ax.effects.define("fold","hide",function(a0,aP){var aQ=ax(this),aR=a0.mode,aX=aR==="show",aS=aR==="hide",aZ=a0.size||15,aT=/([0-9]+)%/.exec(aZ),aY=!!a0.horizFirst,aN=aY?["right","bottom"]:["bottom","right"],aO=a0.duration/2,aW=ax.effects.createPlaceholder(aQ),aL=aQ.cssClip(),aV={clip:ax.extend({},aL)},aU={clip:ax.extend({},aL)},aK=[aL[aN[0]],aL[aN[1]]],aM=aQ.queue().length;if(aT){aZ=parseInt(aT[1],10)/100*aK[aS?0:1]}aV.clip[aN[0]]=aZ;aU.clip[aN[0]]=aZ;aU.clip[aN[1]]=0;if(aX){aQ.cssClip(aU.clip);if(aW){aW.css(ax.effects.clipToBox(aU))}aU.clip=aL}aQ.queue(function(a1){if(aW){aW.animate(ax.effects.clipToBox(aV),aO,a0.easing).animate(ax.effects.clipToBox(aU),aO,a0.easing)}a1()}).animate(aV,aO,a0.easing).animate(aU,aO,a0.easing).queue(aP);ax.effects.unshift(aQ,aM,4)}); 370/*! 371 * jQuery UI Effects Highlight 1.13.0 372 * http://jqueryui.com 373 * 374 * Copyright jQuery Foundation and other contributors 375 * Released under the MIT license. 376 * http://jquery.org/license 377 */ 378var O=ax.effects.define("highlight","show",function(aL,aK){var aM=ax(this),aN={backgroundColor:aM.css("backgroundColor")};if(aL.mode==="hide"){aN.opacity=0}ax.effects.saveStyle(aM);aM.css({backgroundImage:"none",backgroundColor:aL.color||"#ffff99"}).animate(aN,{queue:false,duration:aL.duration,easing:aL.easing,complete:aK})}); 379/*! 380 * jQuery UI Effects Size 1.13.0 381 * http://jqueryui.com 382 * 383 * Copyright jQuery Foundation and other contributors 384 * Released under the MIT license. 385 * http://jquery.org/license 386 */ 387var Z=ax.effects.define("size",function(aN,aT){var aR,aS,aX,aK=ax(this),aP=["fontSize"],aY=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],aM=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],aQ=aN.mode,aW=aQ!=="effect",a1=aN.scale||"both",aZ=aN.origin||["middle","center"],a0=aK.css("position"),aO=aK.position(),aU=ax.effects.scaledDimensions(aK),aV=aN.from||aU,aL=aN.to||ax.effects.scaledDimensions(aK,0);ax.effects.createPlaceholder(aK);if(aQ==="show"){aX=aV;aV=aL;aL=aX}aS={from:{y:aV.height/aU.height,x:aV.width/aU.width}
387,to:{y:aL.height/aU.height,x:aL.width/aU.width}};if(a1==="box"||a1==="both"){if(aS.from.y!==aS.to.y){aV=ax.effects.setTransition(aK,aY,aS.from.y,aV);aL=ax.effects.setTransition(aK,aY,aS.to.y,aL)}if(aS.from.x!==aS.to.x){aV=ax.effects.setTransition(aK,aM,aS.from.x,aV);aL=ax.effects.setTransition(aK,aM,aS.to.x,aL)}}if(a1==="content"||a1==="both"){if(aS.from.y!==aS.to.y){aV=ax.effects.setTransition(aK,aP,aS.from.y,aV);aL=ax.effects.setTransition(aK,aP,aS.to.y,aL)}}if(aZ){aR=ax.effects.getBaseline(aZ,aU);aV.top=(aU.outerHeight-aV.outerHeight)*aR.y+aO.top;aV.left=(aU.outerWidth-aV.outerWidth)*aR.x+aO.left;aL.top=(aU.outerHeight-aL.outerHeight)*aR.y+aO.top;aL.left=(aU.outerWidth-aL.outerWidth)*aR.x+aO.left}delete aV.outerHeight;delete aV.outerWidth;aK.css(aV);if(a1==="content"||a1==="both"){aY=aY.concat(["marginTop","marginBottom"]).concat(aP);aM=aM.concat(["marginLeft","marginRight"]);aK.find("*[width]").each(function(){var a5=ax(this),a2=ax.effects.scaledDimensions(a5),a4={height:a2.height*aS.from.y,width:a2.width*aS.from.x,outerHeight:a2.outerHeight*aS.from.y,outerWidth:a2.outerWidth*aS.from.x},a3={height:a2.height*aS.to.y,width:a2.width*aS.to.x,outerHeight:a2.height*aS.to.y,outerWidth:a2.width*aS.to.x};if(aS.from.y!==aS.to.y){a4=ax.effects.setTransition(a5,aY,aS.from.y,a4);a3=ax.effects.setTransition(a5,aY,aS.to.y,a3)}if(aS.from.x!==aS.to.x){a4=ax.effects.setTransition(a5,aM,aS.from.x,a4);a3=ax.effects.setTransition(a5,aM,aS.to.x,a3)}if(aW){ax.effects.saveStyle(a5)}a5.css(a4);a5.animate(a3,aN.duration,aN.easing,function(){if(aW){ax.effects.restoreStyle(a5)}})})}aK.animate(aL,{queue:false,duration:aN.duration,easing:aN.easing,complete:function(){var a2=aK.offset();if(aL.opacity===0){aK.css("opacity",aV.opacity)}if(!aW){aK.css("position",a0==="static"?"relative":a0).offset(a2);ax.effects.saveStyle(aK)}aT()}})}); 388/*! 389 * jQuery UI Effects Scale 1.13.0 390 * http://jqueryui.com 391 * 392 * Copyright jQuery Foundation and other contributors 393 * Released under the MIT license. 394 * http://jquery.org/license 395 */ 396var U=ax.effects.define("scale",function(aL,aK){var aM=ax(this),aP=aL.mode,aN=parseInt(aL.percent,10)||(parseInt(aL.percent,10)===0?0:(aP!=="effect"?0:100)),aO=ax.extend(true,{from:ax.effects.scaledDimensions(aM),to:ax.effects.scaledDimensions(aM,aN,aL.direction||"both"),origin:aL.origin||["middle","center"]},aL);if(aL.fade){aO.from.opacity=1;aO.to.opacity=0}ax.effects.effect.size.call(this,aO,aK)}); 397/*! 398 * jQuery UI Effects Puff 1.13.0 399 * http://jqueryui.com 400 * 401 * Copyright jQuery Foundation and other contributors 402 * Released under the MIT license. 403 * http://jquery.org/license 404 */ 405var G=ax.effects.define("puff","hide",function(aL,aK){var aM=ax.extend(true,{},aL,{fade:true,percent:parseInt(aL.percent,10)||150});ax.effects.effect.scale.call(this,aM,aK)}); 406/*! 407 * jQuery UI Effects Pulsate 1.13.0 408 * http://jqueryui.com 409 * 410 * Copyright jQuery Foundation and other contributors 411 * Released under the MIT license. 412 * http://jquery.org/license 413 */ 414var B=ax.effects.define("pulsate","show",function(aV,aM){var aO=ax(this),aP=aV.mode,aT=aP==="show",aQ=aP==="hide",aU=aT||aQ,aR=((aV.times||5)*2)+(aU?1:0),aL=aV.duration/aR,aS=0,aN=1,aK=aO.queue().length;if(aT||!aO.is(":visible")){aO.css("opacity",0).show();aS=1}for(;aN<aR;aN++){aO.animate({opacity:aS},aL,aV.easing);aS=1-aS}aO.animate({opacity:aS},aL,aV.easing);aO.queue(aM);ax.effects.unshift(aO,aK,aR+1)}); 415/*! 416 * jQuery UI Effects Shake 1.13.0 417 * http://jqueryui.com 418 * 419 * Copyright jQuery Foundation and other contributors 420 * Released under the MIT license. 421 * http://jquery.org/license 422 */ 423var at=ax.effects.define("shake",function(aY,aR){var aS=1,aT=ax(this),aV=aY.direction||"left",aK=aY.distance||20,aL=aY.times||3,aW=aL*2+1,aP=Math.round(aY.duration/aW),aO=(aV==="up"||aV==="down")?"top":"left",aM=(aV==="up"||aV==="left"),aQ={},aX={},aU={},aN=aT.queue().length;ax.effects.createPlaceholder(aT);aQ[aO]=(aM?"-=":"+=")+aK;aX[aO]=(aM?"+=":"-=")+aK*2;aU[aO]=(aM?"-=":"+=")+aK*2;aT.animate(aQ,aP,aY.easing);for(;aS<aL;aS++){aT.animate(aX,aP,aY.easing).animate(aU,aP,aY.easing)}aT.animate(aX,aP,aY.easing).animate(aQ,aP/2,aY.easing).queue(aR);ax.effects.unshift(aT,aN,aW+1)}); 424/*! 425 * jQuery UI Effects Slide 1.13.0 426 * http://jqueryui.com 427 * 428 * Copyright jQuery Foundation and other contributors 429 * Released under the MIT license. 430 * http://jquery.org/license 431 */ 432var aq=ax.effects.define("slide","show",function(aV,aR){var aO,aL,aS=ax(this),aM={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},aT=aV.mode,aU=aV.direction||"left",aP=(aU==="up"||aU==="down")?"top":"left",aN=(aU==="up"||aU==="left"),aK=aV.distance||aS[aP==="top"?"outerHeight":"outerWidth"](true),aQ={};ax.effects.createPlaceholder(aS);aO=aS.cssClip();aL=aS.position()[aP];aQ[aP]=(aN?-1:1)*aK+aL;aQ.clip=aS.cssClip();aQ.clip[aM[aU][1]]=aQ.clip[aM[aU][0]];if(aT==="show"){aS.cssClip(aQ.clip);aS.css(aP,aQ[aP]);aQ.clip=aO;aQ[aP]=aL}aS.animate(aQ,{queue:false,duration:aV.duration,easing:aV.easing,complete:aR})}); 433/*! 434 * jQuery UI Effects Transfer 1.13.0 435 * http://jqueryui.com 436 * 437 * Copyright jQuery Foundation and other contributors 438 * Released under the MIT license. 439 * http://jquery.org/license 440 */ 441var N;if(ax.uiBackCompat!==false){N=ax.effects.define("transfer",function(aL,aK){ax(this).transfer(aL,aK)})}var S=N});
vendor: 2,114 bytes, lines 442-445
442/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20 443* http://trentrichardson.com/examples/timepicker 444* Copyright (c) 2016 Trent Richardson; Licensed MIT */ 445(function(a){if(typeof define==="function"&&define.amd){define(["jquery","jquery-ui"],a)}else{a(jQuery)}}(function($){$.ui.timepicker=$.ui.timepicker||{};if($.ui.timepicker.version){return}$.extend($.ui,{timepicker:{version:"1.6.3"}});var Timepicker=function(){this.regional=[];this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:false};this._defaults={showButtonPanel:true,timeOnly:false,timeOnlyShowDate:false,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:true,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:true,separator:" ",altFieldTimeOnly:true,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:true,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:true,timezoneList:null,addSliderAccess:false,sliderAccessArgs:null,controlType:"slider",oneLine:false,defaultValue:null,parse:"strict",afterInject:null};$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsec
445MinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_newInst:function($input,opts){var tp_inst=new Timepicker(),inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults){if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue){try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}}overrides={beforeShow:function(input,dp_inst){if(typeof tp_inst._defaults.evnts.beforeShow==="function"){return tp_inst._defaults.evnts.beforeShow.call($input[0],input,dp_inst,tp_inst)}},onChangeMonthYear:function(year,month,dp_inst){if(typeof tp_inst._defaults.evnts.onChangeMonthYear==="function"){tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],year,month,dp_inst,tp_inst)}},onClose:function(dateText,dp_inst){if(tp_inst.timeDefined===true&&$input.val()!==""){tp_inst._updateDateTime(dp_inst)}if(typeof tp_inst._defaults.evnts.onClose==="function"){tp_inst._defaults.evnts.onClose.call($input[0],dateText,dp_inst,tp_inst)}}};for(i in overrides){if(overrides.hasOwnProperty(i)){fns[i]=opts[i]||this._defaults[i]||null}}tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst});tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(val){return val.toUpperCase()});tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(val){return val.toUpperCase()});tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:""));if(typeof(tp_inst._defaults.controlType)==="string"){if(tp_inst._defaults.controlType==="slider"&&typeof($.ui.slider)==="undefined"){tp_inst._defaults.controlType="select"}tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]}else{tp_inst.control=tp_inst._defaults.controlType}var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];if(tp_inst._defaults.timezoneList!==null){timezoneList=tp_inst._defaults.timezoneList}var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&typeof timezoneList[0]!=="object"){for(;tzi<tzl;tzi++){tzv=timezoneList[tzi];timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)}}}tp_inst._defaults.timezoneList=timezoneList;tp_inst.timezone=tp_inst._defaults.timezone!==null?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):((new Date()).getTimezoneOffset()*-1);tp_inst.hour=tp_inst._defaults.hour<tp_inst._defaults.hourMin?tp_inst._defaults.hourMin:tp_inst._defaults.hour>tp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour;tp_inst.minute=tp_inst._defaults.minute<tp_inst._defaults.minuteMin?tp_inst._defaults.minuteMin:tp_inst._defaults.minute>tp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute;tp_inst.second=tp_inst._defaults.second<tp_inst._defaults.secondMin?tp_inst._defaults.secondMin:tp_inst._defaults.second>tp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second;tp_inst.millisec=tp_inst._defaults.millisec<tp_inst._defaults.millisecMin?tp_inst._defaults.millisecMin:tp_inst._defaults.millisec>tp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec;tp_inst.microsec=tp_inst._defaults.microsec<tp_inst._defaults.microsecMin?tp_inst._defaults.microsecMin:tp_inst._defaults.microsec>tp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec;tp_inst.ampm="";tp_inst.$input=$input;if(tp_inst._defaults.altField){tp_inst.$altInput=$(tp_inst._defaults.altField);if(tp_inst._defaults.altRedirectFocus===true){tp_inst.$altInput.css({cursor:"pointer"}).on("focus",function(){$input.trigger("focus")})}}if(tp_inst._defaults.minDate===0||tp_inst._defaults.minDateTime===0){tp_inst._defaults.minDate=new Date()}if(tp_inst._defaults.maxDate===0||tp_inst._defaults.maxDateTime===0){tp_inst._defaults.maxDate=new Date()}
445if(tp_inst._defaults.minDate!==undefined&&tp_inst._defaults.minDate instanceof Date){tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())}if(tp_inst._defaults.minDateTime!==undefined&&tp_inst._defaults.minDateTime instanceof Date){tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())}if(tp_inst._defaults.maxDate!==undefined&&tp_inst._defaults.maxDate instanceof Date){tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())}if(tp_inst._defaults.maxDateTime!==undefined&&tp_inst._defaults.maxDateTime instanceof Date){tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())}tp_inst.$input.on("focus",function(){tp_inst._onFocus()});return tp_inst},_addTimePicker:function(dp_inst){var currDT=PrimeFaces.trim((this.$altInput&&this._defaults.altFieldTimeOnly)?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(currDT);this._limitMinMaxDateTime(dp_inst,false);this._injectTimePicker();this._afterInject()},_parseTime:function(timeString,withDate){if(!this.inst){this.inst=$.datepicker._getInst(this.$input[0])}if(withDate||!this._defaults.timeOnly){var dp_dateFormat=$.datepicker._get(this.inst,"dateFormat");try{var parseRes=parseDateTimeInternal(dp_dateFormat,this._defaults.timeFormat,timeString,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!parseRes.timeObj){return false}$.extend(this,parseRes.timeObj)}catch(err){$.timepicker.log("Error parsing the date/time string: "+err+"\ndate/time string = "+timeString+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+dp_dateFormat);return false}return true}else{var timeObj=$.datepicker.parseTime(this._defaults.timeFormat,timeString,this._defaults);if(!timeObj){return false}$.extend(this,timeObj);return true}},_afterInject:function(){var o=this.inst.settings;if(typeof o.afterInject==="function"){o.afterInject.call(this)}},_injectTimePicker:function(){var $dp=this.inst.dpDiv,o=this.inst.settings,tp_inst=this,litem="",uitem="",show=null,max={},gridSize={},size=null,i=0,l=0;if($dp.find("div.ui-timepicker-div").length===0&&o.showTimepicker){var noDisplay=" ui_tpicker_unit_hide",html='<div class="ui-timepicker-div'+(o.isRTL?" ui-timepicker-rtl":"")+(o.oneLine&&o.controlType==="select"?" ui-timepicker-oneLine":"")+'"><dl><dt class="ui_tpicker_time_label'+((o.showTime)?"":noDisplay)+'">'+o.timeText+'</dt><dd class="ui_tpicker_time '+((o.showTime)?"":noDisplay)+'"><input class="ui_tpicker_time_input" '+(o.timeInput?"":"disabled")+"></input></dd>";for(i=0,l=this.units.length;i<l;i++){litem=this.units[i];uitem=litem.substr(0,1).toUpperCase()+litem.substr(1);show=o["show"+uitem]!==null?o["show"+uitem]:this.support[litem];max[litem]=parseInt((o[litem+"Max"]-((o[litem+"Max"]-o[litem+"Min"])%o["step"+uitem])),10);gridSize[litem]=0;html+='<dt class="ui_tpicker_'+litem+"_label"+(show?"":noDisplay)+'">'+o[litem+"Text"]+'</dt><dd class="ui_tpicker_'+litem+(show?"":noDisplay)+'"><div class="ui_tpicker_'+litem+"_slider"+(show?"":noDisplay)+'"></div>';if(show&&o[litem+"Grid"]>0){html+='<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';if(litem==="hour"){for(var h=o[litem+"Min"];h<=max[litem];h+=parseInt(o[litem+"Grid"],10)){gridSize[litem]++;var tmph=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:h},o);html+='<td data-for="'+litem+'">'+tmph+"</td>"}}else{for(var m=o[litem+"Min"];m<=max[litem];m+=parseInt(o[litem+"Grid"],10)){gridSize[litem]++;html+='<td data-for="'+litem+'">'+((m<10)?"0":"")+m+"</td>"}}html+="</tr></table></div>"}html+="</dd>"}var showTz=o.showTimezone!==null?o.showTimezone:this.support.timezone;html+='<dt class="ui_tpicker_timezone_label'+(showTz?"":noDisplay)+'">'+o.timezoneText+"</dt>";html+='<dd class="ui_tpicker_timezone'+(showTz?"":noDisplay)+'"></dd>';html+="</dl></div>";var $tp=$(html);if(o.timeOnly===true){$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+PrimeFaces.escapeHTML(o.timeOnlyTitle)+"</div></div>");$dp.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()}for(i=0,l=tp_inst.units.length;i<l;i++){litem=tp_inst.units[i];uitem=litem.substr(0,1).toUpperCase()+litem.substr(1);show=o["show"+uitem]!==null?o["show"+uitem]:this.support[litem];tp_inst[litem+"_slider"]=tp_inst.control.create(tp_inst,$tp.find(".ui_tpicker_"+litem+"_slider"),litem,tp_inst[litem],o[litem+"Min"],max[litem],o["step"+uitem]);if(show&&o[litem+"Grid"]>0){size=100*gridSize[litem]*o[litem+"Grid"]/(max[litem]-o[litem+"Min"]);$tp.find(".ui_tpicker_"+litem+" table").css({width:size+"%",marginLeft:o.isRTL?"0":((size/(-2*gridSize[litem]))+"%"),marginRight:o.isRTL?((size/(-2*gridSize[litem]))+"%"):"0px",borderCollapse:"collapse"}).find("td").on("click",function(e){var $t=$(this),h=$t.html(),n=parseInt(h.replace(/[^0-9]/g),10),ap=h.replace(/[^apm]/ig),f=$t.data("for");
445if(f==="hour"){if(ap.indexOf("p")!==-1&&n<12){n+=12}else{if(ap.indexOf("a")!==-1&&n===12){n=0}}}tp_inst.control.value(tp_inst,tp_inst[f+"_slider"],litem,n);tp_inst._onTimeChange();tp_inst._onSelectHandler()}).css({cursor:"pointer",width:(100/gridSize[litem])+"%",textAlign:"center",overflow:"hidden"})}}this.timezone_select=$tp.find(".ui_tpicker_timezone").append("<select></select>").find("select");$.fn.append.apply(this.timezone_select,$.map(o.timezoneList,function(val,idx){return $("<option></option>").val(typeof val==="object"?val.value:val).text(typeof val==="object"?val.label:val)}));if(typeof(this.timezone)!=="undefined"&&this.timezone!==null&&this.timezone!==""){var local_timezone=(new Date(this.inst.selectedYear,this.inst.selectedMonth,this.inst.selectedDay,12)).getTimezoneOffset()*-1;if(local_timezone===this.timezone){selectLocalTimezone(tp_inst)}else{this.timezone_select.val(this.timezone)}}else{if(typeof(this.hour)!=="undefined"&&this.hour!==null&&this.hour!==""){this.timezone_select.val(o.timezone)}else{selectLocalTimezone(tp_inst)}}this.timezone_select.on("change",function(){tp_inst._onTimeChange();tp_inst._onSelectHandler();tp_inst._afterInject()});var $buttonPanel=$dp.find(".ui-datepicker-buttonpane");if($buttonPanel.length){$buttonPanel.before($tp)}else{$dp.append($tp)}this.$timeObj=$tp.find(".ui_tpicker_time_input");this.$timeObj.on("change",function(){var timeFormat=tp_inst.inst.settings.timeFormat;var parsedTime=$.datepicker.parseTime(timeFormat,this.value);var update=new Date();if(parsedTime){update.setHours(parsedTime.hour);update.setMinutes(parsedTime.minute);update.setSeconds(parsedTime.second);$.datepicker._setTime(tp_inst.inst,update)}else{this.value=tp_inst.formattedTime;this.trigger("blur")}});if(this.inst!==null){var timeDefined=this.timeDefined;this._onTimeChange();this.timeDefined=timeDefined}if(this._defaults.addSliderAccess){var sliderAccessArgs=this._defaults.sliderAccessArgs,rtl=this._defaults.isRTL;sliderAccessArgs.isRTL=rtl;setTimeout(function(){if($tp.find(".ui-slider-access").length===0){$tp.find(".ui-slider:visible").sliderAccess(sliderAccessArgs);var sliderAccessWidth=$tp.find(".ui-slider-access:eq(0)").outerWidth(true);if(sliderAccessWidth){$tp.find("table:visible").each(function(){var $g=$(this),oldWidth=$g.outerWidth(),oldMarginLeft=$g.css(rtl?"marginRight":"marginLeft").toString().replace("%",""),newWidth=oldWidth-sliderAccessWidth,newMarginLeft=((oldMarginLeft*newWidth)/oldWidth)+"%",css={width:newWidth+"px",marginRight:"0px",marginLeft:"0px"};css[rtl?"marginRight":"marginLeft"]=newMarginLeft;$g.css(css)})}}},10)}tp_inst._limitMinMaxDateTime(this.inst,true)}},_limitMinMaxDateTime:function(dp_inst,adjustSliders){var o=this._defaults,dp_date=new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay);if(!this._defaults.showTimepicker){return}if($.datepicker._get(dp_inst,"minDateTime")!==null&&$.datepicker._get(dp_inst,"minDateTime")!==undefined&&dp_date){var minDateTime=$.datepicker._get(dp_inst,"minDateTime"),minDateTimeDate=new Date(minDateTime.getFullYear(),minDateTime.getMonth(),minDateTime.getDate(),0,0,0,0);if(this.hourMinOriginal===null||this.minuteMinOriginal===null||this.secondMinOriginal===null||this.millisecMinOriginal===null||this.microsecMinOriginal===null){this.hourMinOriginal=o.hourMin;this.minuteMinOriginal=o.minuteMin;this.secondMinOriginal=o.secondMin;this.millisecMinOriginal=o.millisecMin;this.microsecMinOriginal=o.microsecMin}if(dp_inst.settings.timeOnly||minDateTimeDate.getTime()===dp_date.getTime()){this._defaults.hourMin=minDateTime.getHours();if(this.hour<=this._defaults.hourMin){this.hour=this._defaults.hourMin;this._defaults.minuteMin=minDateTime.getMinutes();if(this.minute<=this._defaults.minuteMin){this.minute=this._defaults.minuteMin;this._defaults.secondMin=minDateTime.getSeconds();if(this.second<=this._defaults.secondMin){this.second=this._defaults.secondMin;this._defaults.millisecMin=minDateTime.getMilliseconds();if(this.millisec<=this._defaults.millisecMin){this.millisec=this._defaults.millisecMin;this._defaults.microsecMin=minDateTime.getMicroseconds()}
445else{if(this.microsec<this._defaults.microsecMin){this.microsec=this._defaults.microsecMin}this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}else{this._defaults.hourMin=this.hourMinOriginal;this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal;this._defaults.millisecMin=this.millisecMinOriginal;this._defaults.microsecMin=this.microsecMinOriginal}}if($.datepicker._get(dp_inst,"maxDateTime")!==null&&$.datepicker._get(dp_inst,"maxDateTime")!==undefined&&dp_date){var maxDateTime=$.datepicker._get(dp_inst,"maxDateTime"),maxDateTimeDate=new Date(maxDateTime.getFullYear(),maxDateTime.getMonth(),maxDateTime.getDate(),0,0,0,0);if(this.hourMaxOriginal===null||this.minuteMaxOriginal===null||this.secondMaxOriginal===null||this.millisecMaxOriginal===null){this.hourMaxOriginal=o.hourMax;this.minuteMaxOriginal=o.minuteMax;this.secondMaxOriginal=o.secondMax;this.millisecMaxOriginal=o.millisecMax;this.microsecMaxOriginal=o.microsecMax}if(dp_inst.settings.timeOnly||maxDateTimeDate.getTime()===dp_date.getTime()){this._defaults.hourMax=maxDateTime.getHours();if(this.hour>=this._defaults.hourMax){this.hour=this._defaults.hourMax;this._defaults.minuteMax=maxDateTime.getMinutes();if(this.minute>=this._defaults.minuteMax){this.minute=this._defaults.minuteMax;this._defaults.secondMax=maxDateTime.getSeconds();if(this.second>=this._defaults.secondMax){this.second=this._defaults.secondMax;this._defaults.millisecMax=maxDateTime.getMilliseconds();if(this.millisec>=this._defaults.millisecMax){this.millisec=this._defaults.millisecMax;this._defaults.microsecMax=maxDateTime.getMicroseconds()}else{if(this.microsec>this._defaults.microsecMax){this.microsec=this._defaults.microsecMax}this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}else{this._defaults.hourMax=this.hourMaxOriginal;this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal;this._defaults.millisecMax=this.millisecMaxOriginal;this._defaults.microsecMax=this.microsecMaxOriginal}}if(dp_inst.settings.minTime!==null){var tempMinTime=new Date("01/01/1970 "+dp_inst.settings.minTime);if(this.hour<tempMinTime.getHours()){this.hour=this._defaults.hourMin=tempMinTime.getHours();this.minute=this._defaults.minuteMin=tempMinTime.getMinutes()}else{if(this.hour===tempMinTime.getHours()&&this.minute<tempMinTime.getMinutes()){this.minute=this._defaults.minuteMin=tempMinTime.getMinutes()}else{if(this._defaults.hourMin<tempMinTime.getHours()){this._defaults.hourMin=tempMinTime.getHours();this._defaults.minuteMin=tempMinTime.getMinutes()}else{if(this._defaults.hourMin===tempMinTime.getHours()===this.hour&&this._defaults.minuteMin<tempMinTime.getMinutes()){this._defaults.minuteMin=tempMinTime.getMinutes()}else{this._defaults.minuteMin=0}}}}}if(dp_inst.settings.maxTime!==null){var tempMaxTime=new Date("01/01/1970 "+dp_inst.settings.maxTime);if(this.hour>tempMaxTime.getHours()){this.hour=this._defaults.hourMax=tempMaxTime.getHours();this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes()}else{if(this.hour===tempMaxTime.getHours()&&this.minute>tempMaxTime.getMinutes()){this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes()}else{if(this._defaults.hourMax>tempMaxTime.getHours()){this._defaults.hourMax=tempMaxTime.getHours();this._defaults.minuteMax=tempMaxTime.getMinutes()}else{if(this._defaults.hourMax===tempMaxTime.getHours()===this.hour&&this._defaults.minuteMax>tempMaxTime.getMinutes()){this._defaults.minuteMax=tempMaxTime.getMinutes()}else{this._defaults.minuteMax=59}}}}}if(adjustSliders!==undefined&&adjustSliders===true){var hourMax=parseInt((this._defaults.hourMax-((this._defaults.hourMax-this._defaults.hourMin)%this._defaults.stepHour)),10),minMax=parseInt((this._defaults.minuteMax-((this._defaults.minuteMax-this._defaults.minuteMin)%this._defaults.stepMinute)),10),secMax=parseInt((this._defaults.secondMax-((this._defaults.secondMax-this._defaults.secondMin)%this._defaults.stepSecond)),10),millisecMax=p
445arseInt((this._defaults.millisecMax-((this._defaults.millisecMax-this._defaults.millisecMin)%this._defaults.stepMillisec)),10),microsecMax=parseInt((this._defaults.microsecMax-((this._defaults.microsecMax-this._defaults.microsecMin)%this._defaults.stepMicrosec)),10);if(this.hour_slider){this.control.options(this,this.hour_slider,"hour",{min:this._defaults.hourMin,max:hourMax,step:this._defaults.stepHour});this.control.value(this,this.hour_slider,"hour",this.hour-(this.hour%this._defaults.stepHour))}if(this.minute_slider){this.control.options(this,this.minute_slider,"minute",{min:this._defaults.minuteMin,max:minMax,step:this._defaults.stepMinute});this.control.value(this,this.minute_slider,"minute",this.minute-(this.minute%this._defaults.stepMinute))}if(this.second_slider){this.control.options(this,this.second_slider,"second",{min:this._defaults.secondMin,max:secMax,step:this._defaults.stepSecond});this.control.value(this,this.second_slider,"second",this.second-(this.second%this._defaults.stepSecond))}if(this.millisec_slider){this.control.options(this,this.millisec_slider,"millisec",{min:this._defaults.millisecMin,max:millisecMax,step:this._defaults.stepMillisec});this.control.value(this,this.millisec_slider,"millisec",this.millisec-(this.millisec%this._defaults.stepMillisec))}if(this.microsec_slider){this.control.options(this,this.microsec_slider,"microsec",{min:this._defaults.microsecMin,max:microsecMax,step:this._defaults.stepMicrosec});this.control.value(this,this.microsec_slider,"microsec",this.microsec-(this.microsec%this._defaults.stepMicrosec))}}},_onTimeChange:function(){if(!this._defaults.showTimepicker){return}var hour=(this.hour_slider)?this.control.value(this,this.hour_slider,"hour"):false,minute=(this.minute_slider)?this.control.value(this,this.minute_slider,"minute"):false,second=(this.second_slider)?this.control.value(this,this.second_slider,"second"):false,millisec=(this.millisec_slider)?this.control.value(this,this.millisec_slider,"millisec"):false,microsec=(this.microsec_slider)?this.control.value(this,this.microsec_slider,"microsec"):false,timezone=(this.timezone_select)?this.timezone_select.val():false,o=this._defaults,pickerTimeFormat=o.pickerTimeFormat||o.timeFormat,pickerTimeSuffix=o.pickerTimeSuffix||o.timeSuffix;if(typeof(hour)==="object"){hour=false}if(typeof(minute)==="object"){minute=false}if(typeof(second)==="object"){second=false}if(typeof(millisec)==="object"){millisec=false}if(typeof(microsec)==="object"){microsec=false}if(typeof(timezone)==="object"){timezone=false}if(hour!==false){hour=parseInt(hour,10)}if(minute!==false){minute=parseInt(minute,10)}if(second!==false){second=parseInt(second,10)}if(millisec!==false){millisec=parseInt(millisec,10)}if(microsec!==false){microsec=parseInt(microsec,10)}if(timezone!==false){timezone=timezone.toString()}var ampm=o[hour<12?"amNames":"pmNames"][0];var hasChanged=(hour!==parseInt(this.hour,10)||minute!==parseInt(this.minute,10)||second!==parseInt(this.second,10)||millisec!==parseInt(this.millisec,10)||microsec!==parseInt(this.microsec,10)||(this.ampm.length>0&&(hour<12)!==($.inArray(this.ampm.toUpperCase(),this.amNames)!==-1))||(this.timezone!==null&&timezone!==this.timezone.toString()));if(hasChanged){if(hour!==false){this.hour=hour}if(minute!==false){this.minute=minute}if(second!==false){this.second=second}if(millisec!==false){this.millisec=millisec}if(microsec!==false){this.microsec=microsec}if(timezone!==false){this.timezone=timezone}if(!this.inst){this.inst=$.datepicker._getInst(this.$input[0])}this._limitMinMaxDateTime(this.inst,true)}if(this.support.ampm){this.ampm=ampm}this.formattedTime=$.datepicker.formatTime(o.timeFormat,this,o);if(this.$timeObj){if(pickerTimeFormat===o.timeFormat){this.$timeObj.val(this.formattedTime+pickerTimeSuffix)}else{this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat,this,o)+pickerTimeSuffix)}if(this.$timeObj[0].setSelectionRange){var sPos=this.$timeObj[0].selectionStart;var ePos=this.$timeObj[0].selectionEnd}}this.timeDefined=true;if(hasChanged){this._updateDateTime()}},_onSelectHandler:function(){var onSelect=this._defaults.onSelect||this.inst.settings.onSelect;var inputEl=this.$input?this.$input[0]:null;if(onSelect&&inputEl){onSelect.apply(inputEl,[this.formattedDateTime,this])}},_updateDateTime:function(dp_inst){dp_inst=this.inst||dp_inst;var dtTmp=(dp_inst.currentYear>0?new Date(dp_inst.currentYear,dp_inst.currentMonth,dp_inst.currentDay):new Date(dp_inst.selectedYear,dp_inst.selectedMonth,dp_inst.selectedDay)),dt=$.datepicker._daylightSavingAdjust(dtTmp),dateFmt=$.datepicker._get(dp_inst,"dateFormat"),formatCfg=$.datepicker._getFormatConfig(dp_inst),timeAvailable=dt!==null&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(dateFmt,(dt===null?new Date():dt),formatCfg);var formattedDateTime=this.formattedDate;if(dp_inst.lastVal===""){dp_inst.currentYear=dp_inst.selectedYear;dp_inst.currentMonth=dp_inst.selectedMonth;dp_inst.currentDay=dp_inst.selectedDay}if(this._defaults.timeOnly===true&&this._defaults.timeOnlyShowDate===false){formattedDateTime=this.formattedTime}else{if((this._defaults.timeOnly!==true&&(this._defaults.alwaysSetTime||timeAvailable))||(this._defaults.timeOnly===true&&this._defaults.timeOnlyShowDate===true)){formattedDateTime+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix}}this.formattedDateTime=formattedDateTime;if(!this._defaults.showTimepicker){this.$input.val(this.formattedDate)}else{if(this.$altInput&&this._defaults.timeOnly===false&&this._defaults.altFieldTimeOnly===true){this.$altInput.val(this.formattedTime);this.$input.val(this.formattedDate)}else{if(this.$altInput){this.$input.val(formattedDateTime);var altFormattedDateTime="",altSeparator=this._defaults.altSeparator!==null?this._defaults.altSeparator:this._defaults.separator,altTimeSuffix=this._defaults.altTimeSuffix!==null?this._defaults.altTimeSuffix:this._defaults.timeSuffix;if(!this._defaults.timeOnly){if(this._defaults.altFormat){altFormattedDateTime=$.datepicker.formatDate(this._defaults.altFormat,(dt===null?new Date():dt),formatCfg)}else{altFormattedDateTime=this.formattedDate}if(altFormattedDateTime){altFormattedDateTime+=altSeparator}}if(this._defaults.altTimeFormat!==null){altFormattedDateTime+=$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+altTimeSuffix}else{altFormattedDateTime+=this.formattedTime+altTimeSuffix}this.$altInput.val(altFormattedDateTime)}else{this.$input.val(formattedDateTime)}}}this.$input.trigger("change")},_onFocus:function(){if(!this.$input.val()&&this._defaults.defaultValue){this.$input.val(this._defaults.defaultValue);var inst=$.datepicker._getInst(this.$input.get(0)),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if(tp_inst._defaults.timeOnly&&(inst.input.val()!==inst.lastVal)){try{$.datepicker._updateDatepicker(inst)}catch(err){$.timepicker.log(err)}}}}},_controls:{slider:{create:function(tp_inst,obj,unit,val,min,max,step){var rtl=tp_inst._defaults.isRTL;return obj.prop("slide",null).slider({orientation:"horizontal",value:rtl?val*-1:val,min:rtl?max*-1:min,max:rtl?min*-1:max,step:step,slide:function(event,ui){tp_inst.control.value(tp_inst,$(this),unit,rtl?ui.value*-1:ui.value);tp_inst._onTimeChange()},stop:function(event,ui){tp_inst._onSelectHandler()}})},options:function(tp_inst,obj,unit,opts,val){if(tp_inst._defaults.isRTL){if(typeof(opts)==="str
445ing"){if(opts==="min"||opts==="max"){if(val!==undefined){return obj.slider(opts,val*-1)}return Math.abs(obj.slider(opts))}return obj.slider(opts)}var min=opts.min,max=opts.max;opts.min=opts.max=null;if(min!==undefined){opts.max=min*-1}if(max!==undefined){opts.min=max*-1}return obj.slider(opts)}if(typeof(opts)==="string"&&val!==undefined){return obj.slider(opts,val)}return obj.slider(opts)},value:function(tp_inst,obj,unit,val){if(tp_inst._defaults.isRTL){if(val!==undefined){return obj.slider("value",val*-1)}return Math.abs(obj.slider("value"))}if(val!==undefined){return obj.slider("value",val)}return obj.slider("value")}},select:{create:function(tp_inst,obj,unit,val,min,max,step){var sel='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+unit+'" data-min="'+min+'" data-max="'+max+'" data-step="'+step+'">',format=tp_inst._defaults.pickerTimeFormat||tp_inst._defaults.timeFormat;for(var i=min;i<=max;i+=step){sel+='<option value="'+i+'"'+(i===val?" selected":"")+">";if(unit==="hour"){sel+=$.datepicker.formatTime(PrimeFaces.trim(format.replace(/[^ht ]/ig,"")),{hour:i},tp_inst._defaults)}else{if(unit==="millisec"||unit==="microsec"||i>=10){sel+=i}else{sel+="0"+i.toString()}}sel+="</option>"}sel+="</select>";obj.children("select").remove();$(sel).appendTo(obj).on("change",function(e){tp_inst._onTimeChange();tp_inst._onSelectHandler();tp_inst._afterInject()});return obj},options:function(tp_inst,obj,unit,opts,val){var o={},$t=obj.children("select");if(typeof(opts)==="string"){if(val===undefined){return $t.data(opts)}o[opts]=val}else{o=opts}return tp_inst.control.create(tp_inst,obj,$t.data("unit"),$t.val(),o.min>=0?o.min:$t.data("min"),o.max||$t.data("max"),o.step||$t.data("step"))},value:function(tp_inst,obj,unit,val){var $t=obj.children("select");if(val!==undefined){return $t.val(val)}return $t.val()}}}});$.fn.extend({timepicker:function(o){o=o||{};var tmp_args=Array.prototype.slice.call(arguments);if(typeof o==="object"){tmp_args[0]=$.extend(o,{timeOnly:true})}return $(this).each(function(){$.fn.datetimepicker.apply($(this),tmp_args)})},datetimepicker:function(o){o=o||{};var tmp_args=arguments;if(typeof(o)==="string"){if(o==="getDate"||(o==="option"&&tmp_args.length===2&&typeof(tmp_args[1])==="string")){return $.fn.datepicker.apply($(this[0]),tmp_args)}else{return this.each(function(){var $t=$(this);$t.datepicker.apply($t,tmp_args)})}}else{return this.each(function(){var $t=$(this);$t.datepicker($.timepicker._newInst($t,o)._defaults)})}}});$.datepicker.parseDateTime=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var parseRes=parseDateTimeInternal(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings);if(parseRes.timeObj){var t=parseRes.timeObj;parseRes.date.setHours(t.hour,t.minute,t.second,t.millisec);parseRes.date.setMicroseconds(t.microsec)}return parseRes.date};$.datepicker.parseTime=function(timeFormat,timeString,options){var o=extendRemove(extendRemove({},$.timepicker._defaults),options||{}),iso8601=(timeFormat.replace(/\'.*?\'/g,"").indexOf("Z")!==-1);var strictParse=function(f,s,o){var getPatternAmpm=function(amNames,pmNames){var markers=[];if(amNames){$.merge(markers,amNames)}if(pmNames){$.merge(markers,pmNames)}markers=$.map(markers,function(val){return val.replace(/[.*+?|()\[\]{}\\]/g,"\\$&")});return"("+markers.join("|")+")?"};var getFormatPositions=function(timeFormat){var finds=timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),orders={h:-1,m:-1,s:-1,l:-1,c:-1,t:-1,z:-1};if(finds){for(var i=0;i<finds.length;i++){if(orders[finds[i].toString().charAt(0)]===-1){orders[finds[i].toString().charAt(0)]=i+1}}}return orders};var regstr="^"+f.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(match){var ml=match.length;switch(match.charAt(0).toLowerCase()){case"h":return ml===1?"(\\d?\\d)":"(\\d{"+ml+"})";case"m":return ml===1?"(\\d?\\d)":"(\\d{"+ml+"})";case"s":return ml===1?"(\\d?\\d)":"(\\d{"+ml+"})";case"l":return"(\\d?\\d?\\d)";case"c":return"(\\d?\\d?\\d)";case"z":return"(z|[-+]\\d\\d:?\\d\\d|\\S+)?";case"t":return getPatternAmpm(o.amNames,o.pmNames);default:return"("+match.replace(/\'/g,"").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g,function(m){return"\\"+m})+")?"}}).replace(/\s/g,"\\s?")+o.timeSuffix+"$",order=getFormatPositions(f),ampm="",treg;treg=s.match(new RegExp(regstr,"i"));var resTime={hour:0,minute:0,second:0,millisec:0,microsec:0};if(treg){if(order.t!==-1){if(treg[order.t]===undefined||treg[order.t].length===0){ampm="";resTime.ampm=""}else{ampm=$.inArray(treg[order.t].toUpperCase(),$.map(o.amNames,function(x,i){return x.toUpperCase()}))!==-1?"AM":"PM";resTime.ampm=o[ampm==="AM"?"amNames":"pmNames"][0]}}if(order.h!==-1){if(ampm==="AM"&&treg[order.h]==="12"){resTime.hour=0}else{if(ampm==="PM"&&treg[order.h]!=="12"){resTime.hour=parseInt(treg[order.h],10)+12}else{resTime.hour=Number(treg[order.h])}}}if(order.m!==-1){resTime.minute=Number(treg[order.m])}if(order.s!==-1){resTime.second=Number(treg[order.s])}if(order.l!==-1){resTime.millisec=Number(treg[order.l])}if(order.c!==-1){resTime.microsec=Number(treg[order.c])}
445if(order.z!==-1&&treg[order.z]!==undefined){resTime.timezone=$.timepicker.timezoneOffsetNumber(treg[order.z])}return resTime}return false};var looseParse=function(f,s,o){try{var d=new Date("2012-01-01 "+s);if(isNaN(d.getTime())){d=new Date("2012-01-01T"+s);if(isNaN(d.getTime())){d=new Date("01/01/2012 "+s);if(isNaN(d.getTime())){throw"Unable to parse time with native Date: "+s}}}return{hour:d.getHours(),minute:d.getMinutes(),second:d.getSeconds(),millisec:d.getMilliseconds(),microsec:d.getMicroseconds(),timezone:d.getTimezoneOffset()*-1}}catch(err){try{return strictParse(f,s,o)}catch(err2){$.timepicker.log("Unable to parse \ntimeString: "+s+"\ntimeFormat: "+f)}}return false};if(typeof o.parse==="function"){return o.parse(timeFormat,timeString,o)}if(o.parse==="loose"){return looseParse(timeFormat,timeString,o)}return strictParse(timeFormat,timeString,o)};$.datepicker.formatTime=function(format,time,options){options=options||{};options=$.extend({},$.timepicker._defaults,options);time=$.extend({hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null},time);var tmptime=format,ampmName=options.amNames[0],hour=parseInt(time.hour,10);if(hour>11){ampmName=options.pmNames[0]}tmptime=tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g,function(match){switch(match){case"HH":return("0"+hour).slice(-2);case"H":return hour;case"hh":return("0"+convert24to12(hour)).slice(-2);case"h":return convert24to12(hour);case"mm":return("0"+time.minute).slice(-2);case"m":return time.minute;case"ss":return("0"+time.second).slice(-2);case"s":return time.second;case"l":return("00"+time.millisec).slice(-3);case"c":return("00"+time.microsec).slice(-3);case"z":return $.timepicker.timezoneOffsetString(time.timezone===null?options.timezone:time.timezone,false);case"Z":return $.timepicker.timezoneOffsetString(time.timezone===null?options.timezone:time.timezone,true);case"T":return ampmName.charAt(0).toUpperCase();case"TT":return ampmName.toUpperCase();case"t":return ampmName.charAt(0).toLowerCase();case"tt":return ampmName.toLowerCase();default:return match.replace(/'/g,"")}});return tmptime};$.datepicker._base_selectDate=$.datepicker._selectDate;$.datepicker._selectDate=function(id,dateStr){var inst=this._getInst($(id)[0]),tp_inst=this._get(inst,"timepicker"),was_inline;if(tp_inst&&inst.settings.showTimepicker){tp_inst._limitMinMaxDateTime(inst,true);was_inline=inst.inline;inst.inline=inst.stay_open=true;this._base_selectDate(id,dateStr);inst.inline=was_inline;inst.stay_open=false;this._notifyChange(inst);this._updateDatepicker(inst)}else{this._base_selectDate(id,dateStr)}};$.datepicker._base_updateDatepicker=$.datepicker._updateDatepicker;$.datepicker._updateDatepicker=function(inst){var input=inst.input[0];if($.datepicker._curInst&&$.datepicker._curInst!==inst&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==input){return}if(typeof(inst.stay_open)!=="boolean"||inst.stay_open===false){this._base_updateDatepicker(inst);var tp_inst=this._get(inst,"timepicker");if(tp_inst){tp_inst._addTimePicker(inst)}}};$.datepicker._base_doKeyPress=$.datepicker._doKeyPress;$.datepicker._doKeyPress=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if($.datepicker._get(inst,"constrainInput")){var ampm=tp_inst.support.ampm,tz=tp_inst._defaults.showTimezone!==null?tp_inst._defaults.showTimezone:tp_inst.support.timezone,dateChars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat")),datetimeChars=tp_inst._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,ampm?"APM":"").replace(/Tt/g,ampm?"AaPpMm":"").replace(/tT/g,ampm?"AaPpMm":"").replace(/T/g,ampm?"AP":"").replace(/tt/g,ampm?"apm":"").replace(/t/g,ampm?"ap":"")+" "+tp_inst._defaults.separator+tp_inst._defaults.timeSuffix+(tz?tp_inst._defaults.timezoneList.join(""):"")+(tp_inst._defaults.amNames.join(""))+(tp_inst._defaults.pmNames.join(""))+dateChars,chr=String.fromCharCode(event.charCode===undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!dateChars||datetimeChars.indexOf(chr)>-1)}}return $.datepicker._base_doKeyPress(event)};$.datepicker._base_updateAlternate=$.datepicker._updateAlternate;$.datepicker._updateAlternate=function(inst){var tp_inst=this._get(inst,"timepicker");if(tp_inst){var altField=tp_inst._defaults.altField;if(altField){var altFormat=tp_inst._defaults.altFormat||tp_inst._defaults.dateFormat,date=this._getDate(inst),formatCfg=$.datepicker._getFormatConfig(inst),altFormattedDateTime="",altSeparator=tp_inst._defaults.altSeparator?tp_inst._defaults.altSeparator:tp_inst._defaults.separator,altTimeSuffix=tp_inst._defaults.altTimeSuffix?tp_inst._defaults.altTimeSuffix:tp_inst._defaults.timeSuffix,altTimeFormat=tp_inst._defaults.altTimeFormat!==null?tp_inst._defaults.altTimeFormat:tp_inst._defaults.timeFormat;altFormattedDateTime+=$.datepicker.formatTime(altTimeFormat,tp_inst,tp_inst._defaults)+altTimeSuffix;if(!tp_inst._defaults.timeOnly&&!tp_inst._defaults.altFieldTimeOnly&&date!==null){if(tp_inst._defaults.altFormat){altFormattedDateTime=$.datepicker.formatDate(tp_inst._defaults.altFormat,date,formatCfg)+altSeparator+altFormattedDateTime}else{altFormattedDateTime=tp_inst.formattedDate+altSeparator+altFormattedDateTime}}$(altField).val(inst.input.val()?altFormattedDateTime:"")}}else{$.datepicker._base_updateAlternate(inst)}};$.datepicker._base_doKeyUp=$.datepicker._doKeyUp;$.datepicker._doKeyUp=function(event){var inst=$.datepicker._getInst(event.target),tp_inst=$.datepicker._get(inst,"timepicker");if(tp_inst){if(tp_inst._defaults.timeOnly&&(inst.input.val()!==inst.lastVal)){try{$.datepicker._updateDatepicker(inst)}catch(err){$.timepicker.log(err)}}}return $.datepicker._base_doKeyUp(event)};$.datepicker._base_gotoToday=$.datepicker._gotoToday;$.datepicker._gotoToday=function(id){var inst=this._getInst($(id)[0]);this._base_gotoToday(id);var tp_inst=this._get(inst,"timepicker");if(!tp_inst){return}var tzoffset=$.timepicker.timezoneOffsetNumber(tp_inst.timezone);var now=new Date();now.setMinutes(now.getMinutes()+now.getTimezoneOffset()+parseInt(tzoffset,10));this._setTime(inst,now);this._setDate(inst,now);tp_inst._onSelectHandler()};$.datepicker._disableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate");if(tp_inst){inst.settings.showTimepicker=false;tp_inst._defaults.showTimepicker=false;tp_inst._updateDateTime(inst)}};$.datepicker._enableTimepickerDatepicker=function(target){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");$(target).datepicker("getDate");if(tp_inst){inst.settings.showTimepicker=true;tp_inst._defaults.showTimepicker=true;tp_inst._addTimePicker(inst);tp_inst._updateDateTime(inst)}};$.datepicker._setTime=function(inst,date){var tp_inst=this._get(inst,"timepicker");if(tp_inst){var defaults=tp_inst._defaults;tp_inst.hour=date?date.getHours():defaults.hour;tp_inst.minute=date?date.getMinutes():defaults.minute;tp_inst.second=date?date.getSeconds():defaults.second;tp_inst.millisec=date?date.getMilliseconds():defaults.millisec;tp_inst.microsec=date?date.getMicroseconds():defaults.microsec;tp_inst._limitMinMaxDateTime(inst,true);tp_inst._onTimeChange();tp_inst._updateDateTime(inst)}};$.datepicker._setTimeDatepicker=function(target,date,withDate){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");if(tp_inst){this._setDateFromField(inst);var tp_date;if(date){if(typeof date==="string"){tp_inst._parseTime(date,withDate);tp_date=new Date();tp_date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec);tp_date.setMicroseconds(tp_inst.microsec)}else{tp_date=new Date(date.getTime());tp_date.setMicroseconds(date.getMicroseconds())}if(tp_date.toString()==="Invalid Date"){tp_date=undefined}this._setTime(inst,tp_date)}}};$.datepicker._base_setDateDatepicker=$.datepicker._setDateDatepicker;$.datepicker._setDateDatepicker=function(target,_date){var inst=this._getInst(target);var date=_date;if(!inst){return}if(typeof(_date)==="string"){date=new Date(_date);if(!date.getTime()){this._base_setDateDatepicker.apply(this,arguments);date=$(target).datepicker("getDate")}}var tp_inst=this._get(inst,"timepicker");var tp_date;if(date instanceof Date){tp_date=new Date(date.getTime());tp_date.setMicroseconds(date.getMicroseconds())}else{tp_date=date}if(tp_inst&&tp_date){if(!tp_inst.support.timezone&&tp_inst._defaults.timezone===null){tp_inst.timezone=tp_date.getTimezoneOffset()*-1}date=$.timepicker.timezoneAdjust(date,$.timepicker.timezoneOffsetString(-date.getTimezoneOffset()),tp_inst.timezone);tp_date=$.timepicker.timezoneAdjust(tp_date,$.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()),tp_inst.timezone)}this._updateDatepicker(inst);this._base_setDateDatepicker.apply(this,arguments);this._setTimeDatepicker(target,tp_date,true)};$.datepicker._base_getDateDatepicker=$.datepicker._getDateDatepicker;$.datepicker._getDateDatepicker=function(target,noDefault){var inst=this._getInst(target);if(!inst){return}var tp_inst=this._get(inst,"timepicker");if(tp_inst){if(inst.lastVal===undefined){this._setDateFromField(inst,noDefault)}var date=this._getDate(inst);var currDT=null;if(tp_inst.$altInput&&tp_inst._defaults.altFieldTimeOnly){currDT=tp_inst.$input.val()+" "+tp_inst.$altInput.val()}else{if(tp_inst.$input.get(0).tagName!=="INPUT"&&tp_inst.$altInput){currDT=tp_inst.$altInput.val()}else{currDT=tp_inst.$input.val()}}if(date&&tp_inst._parseTime(currDT,!inst.settings.timeOnly)){date.setHours(tp_inst.hour,tp_inst.minute,tp_inst.second,tp_inst.millisec);date.setMicroseconds(tp_inst.microsec);if(tp_inst.timezone!=null){if(!tp_inst.support.timezone&&tp_inst._defaults.timezone===null){tp_inst.timezone=date.getTimezoneOffset()*-1}date=$.timepicker.timezoneAdjust(date,tp_inst.timezone,$.timepicker.timezoneOffsetString(-date.getTimezoneOffset()))}}return date}return this._base_getDateDatepicker(target,noDefault)};$.datepicker._base_parseDate=$.datepicker.parseDate;$.datepicker.parseDate=function(format,value,settings){var date;try{date=this._base_parseDate(format,value,settings)}catch(err){if(err.indexOf(":")>=0){date=this._base_parseDate(format,value.substring(0,value.length-(err.length-err.indexOf(":")-2)),settings);$.timepicker.log("Error parsing the date string: "+err+"\ndate string = "+value+"\ndate format = "+format)}else{throw err}}return date};$.datepicker._base_formatDate=$.datepicker._formatDate;$.datepicker._formatDate=function(inst,day,month,year){var tp_inst=this._get(inst,"timepicker");if(tp_inst){tp_inst._updateDateTime(inst);return tp_inst.$input.val()}return this._base_formatDate(inst)};$.datepicker._base_optionDatepicker=$.datepicker._optionDatepicker;$.datepicker._optionDatepicker=function(target,name,value){var inst=this._getInst(target),name_clone;if(!inst){return null}var tp_inst=this._get(inst,"timepicker");if(tp_inst){var min=null,max=null,onselect=null,overrides=tp_inst._defaults.evnts,fns={},prop,ret,oldVal,$target;if(typeof name==="string"){if(name==="minDate"||name==="minDateTime"){min=value}else{if(name==="maxDate"||name==="maxDateTime"){max=value}else{if(name==="onSelect"){onselect=value}else{if(overrides.hasOwnProperty(name)){if(typeof(value)==="undefined"){return overrides[name]}fns[name]=value;name_clone={}}}}}}else{if(typeof name==="object"){if(name.minDate){min=name.minDate}else{if(name.minDateTime){min=name.minDateTime}else{if(name.maxDate){max=name.maxDate}else{if(name.maxDateTime){max=name.maxDateTime}}}}for(prop in overrides){if(overrides.hasOwnProperty(prop)&&name[prop]){fns[prop]=name[prop]}}}}for(prop in fns){if(fns.hasOwnProperty(prop)){overrides[prop]=fns[prop];if(!name_clone){name_clone=$.extend({},name)}delete name_clone[prop]}}if(name_clone&&isEmptyObject(name_clone)){return}if(min){if(min===0){min=new Date()}else{min=new Date(min)}tp_inst._defaults.minDate=min;tp_inst._defaults.minDateTime=min}
445else{if(max){if(max===0){max=new Date()}else{max=new Date(max)}tp_inst._defaults.maxDate=max;tp_inst._defaults.maxDateTime=max}else{if(onselect){tp_inst._defaults.onSelect=onselect}}}if(min||max){$target=$(target);oldVal=$target.datetimepicker("getDate");ret=this._base_optionDatepicker.call($.datepicker,target,name_clone||name,value);$target.datetimepicker("setDate",oldVal);return ret}}if(value===undefined){return this._base_optionDatepicker.call($.datepicker,target,name)}return this._base_optionDatepicker.call($.datepicker,target,name_clone||name,value)};var isEmptyObject=function(obj){var prop;for(prop in obj){if(obj.hasOwnProperty(prop)){return false}}return true};var extendRemove=function(target,props){$.extend(target,props);for(var name in props){if(props[name]===null||props[name]===undefined){target[name]=props[name]}}return target};var detectSupport=function(timeFormat){var tf=timeFormat.replace(/'.*?'/g,"").toLowerCase(),isIn=function(f,t){return f.indexOf(t)!==-1?true:false};return{hour:isIn(tf,"h"),minute:isIn(tf,"m"),second:isIn(tf,"s"),millisec:isIn(tf,"l"),microsec:isIn(tf,"c"),timezone:isIn(tf,"z"),ampm:isIn(tf,"t")&&isIn(timeFormat,"h"),iso8601:isIn(timeFormat,"Z")}};var convert24to12=function(hour){hour%=12;if(hour===0){hour=12}return String(hour)};var computeEffectiveSetting=function(settings,property){return settings&&settings[property]?settings[property]:$.timepicker._defaults[property]};var splitDateTime=function(dateTimeString,timeSettings){var separator=computeEffectiveSetting(timeSettings,"separator"),format=computeEffectiveSetting(timeSettings,"timeFormat"),timeParts=format.split(separator),timePartsLen=timeParts.length,allParts=dateTimeString.split(separator),allPartsLen=allParts.length;if(allPartsLen>1){return{dateString:allParts.splice(0,allPartsLen-timePartsLen).join(separator),timeString:allParts.splice(0,timePartsLen).join(separator)}}return{dateString:dateTimeString,timeString:""}};var parseDateTimeInternal=function(dateFormat,timeFormat,dateTimeString,dateSettings,timeSettings){var date,parts,parsedTime;parts=splitDateTime(dateTimeString,timeSettings);date=$.datepicker._base_parseDate(dateFormat,parts.dateString,dateSettings);if(parts.timeString===""){return{date:date}}parsedTime=$.datepicker.parseTime(timeFormat,parts.timeString,timeSettings);if(!parsedTime){throw"Wrong time format"}return{date:date,timeObj:parsedTime}};var selectLocalTimezone=function(tp_inst,date){if(tp_inst&&tp_inst.timezone_select){var now=date||new Date();tp_inst.timezone_select.val(-now.getTimezoneOffset())}};$.timepicker=new Timepicker();$.timepicker.timezoneOffsetString=function(tzMinutes,iso8601){if(isNaN(tzMinutes)||tzMinutes>840||tzMinutes<-720){return tzMinutes}var off=tzMinutes,minutes=off%60,hours=(off-minutes)/60,iso=iso8601?":":"",tz=(off>=0?"+":"-")+("0"+Math.abs(hours)).slice(-2)+iso+("0"+Math.abs(minutes)).slice(-2);if(tz==="+00:00"){return"Z"}return tz};$.timepicker.timezoneOffsetNumber=function(tzString){var normalized=tzString.toString().replace(":","");if(normalized.toUpperCase()==="Z"){return 0}if(!/^(\-|\+)\d{4}$/.test(normalized)){return parseInt(tzString,10)}return((normalized.substr(0,1)==="-"?-1:1)*((parseInt(normalized.substr(1,2),10)*60)+parseInt(normalized.substr(3,2),10)))};$.timepicker.timezoneAdjust=function(date,fromTimezone,toTimezone){var fromTz=$.timepicker.timezoneOffsetNumber(fromTimezone);var toTz=$.timepicker.timezoneOffsetNumber(toTimezone);if(!isNaN(toTz)){date.setMinutes(date.getMinutes()+(-fromTz)-(-toTz))}return date};$.timepicker.timeRange=function(startTime,endTime,options){return $.timepicker.handleRange("timepicker",startTime,endTime,options)};$.timepicker.datetimeRange=function(startTime,endTime,options){$.timepicker.handleRange("datetimepicker",startTime,endTime,options)};$.timepicker.dateRange=function(startTime,endTime,options){$.timepicker.handleRange("datepicker",startTime,endTime,options)};$.timepicker.handleRange=function(method,startTime,endTime,options){options=$.extend({},{minInterval:0,maxInterval:0,start:{},end:{}},options);var timeOnly=false;if(method==="timepicker"){timeOnly=true;method="datetimepicker"}function checkDates(changed,other){var startdt=startTime[method]("getDate"),enddt=endTime[method]("getDate"),changeddt=changed[method]("getDate");if(startdt!==null){var minDate=new Date(startdt.getTime()),maxDate=new Date(startdt.getTime());minDate.setMilliseconds(minDate.getMilliseconds()+options.minInterval);maxDate.setMilliseconds(maxDate.getMilliseconds()+options.maxInterval);if(options.minInterval>0&&minDate>enddt){endTime[method]("setDate",minDate)}else{if(options.maxInterval>0&&maxDate<enddt){endTime[method]("setDate",maxDate)}else{if(startdt>enddt){other[method]("setDate",changeddt)}}}}}function selected(changed,other,option){if(!changed.val()){return}var date=changed[method].call(changed,"getDate");if(date!==null&&options.minInterval>0){if(option==="minDate"){date.setMilliseconds(date.getMilliseconds()+options.minInterval)}if(option==="maxDate"){date.setMilliseconds(date.getMilliseconds()-options.minInterval)}}if(date.getTime){other[method].call(other,"option",option,date)}}$.fn[method].call(startTime,$.extend({timeOnly:timeOnly,onClose:function(dateText,inst){checkDates($(this),endTime)},onSelect:function(selectedDateTime){selected($(this),endTime,"minDate")}},options,options.start));$.fn[method].call(endTime,$.extend({timeOnly:timeOnly,onClose:function(dateText,inst){checkDates($(this),startTime)},onSelect:function(selectedDateTime){selected($(this),startTime,"maxDate")}},options,options.end));checkDates(startTime,endTime);selected(startTime,endTime,"minDate");selected(endTime,startTime,"maxDate");return $([startTime.get(0),endTime.get(0)])};$.timepicker.log=function(){if(window.console&&window.console.log&&window.console.log.apply){window.console.log.apply(window.console,Array.prototype.slice.call(arguments))}};$.timepicker._util={_extendRemove:extendRemove,_isEmptyObject:isEmptyObject,_convert24to12:convert24to12,_detectSupport:detectSupport,_selectLocalTimezone:selectLocalTimezone,_computeEffectiveSetting:computeEffectiveSetting,_splitDateTime:splitDateTime,_parseDateTimeInternal:parseDateTimeInternal};if(!Date.prototype.getMicroseconds){Date.prototype.microseconds=0;Date.prototype.getMicroseconds=function(){return this.microseconds};Date.prototype.setMicroseconds=function(m){this.setMilliseconds(this.getMilliseconds()+Math.floor(m/1000));this.microseconds=m%1000;return this}}$.timepicker.version="1.6.3"})); 446$(function(){var a={primaryStyles:["fontFamily","fontSize","fontWeight","fontVariant","fontStyle","paddingLeft","paddingTop","paddingBottom","paddingRight","marginLeft","marginTop","marginBottom","marginRight","borderLeftColor","borderTopColor","borderBottomColor","borderRightColor","borderLeftStyle","borderTopStyle","borderBottomStyle","borderRightStyle","borderLeftWidth","borderTopWidth","borderBottomWidth","borderRightWidth","line-height","outline"],specificStyle:{"word-wrap":"break-word","overflow-x":"hidden","overflow-y":"auto"},simulator:$('<div id="textarea_simulator"></div>').css({position:"absolute",top:"0px",left:"0px",visibility:"hidden"}).appendTo(document.body),toHtml:function(b){return PrimeFaces.escapeHTML(b).replace(/\n/g,"<br>").split(" ").join('<span style="white-space:prev-wrap"> </span>')},getCaretPosition:function(){var c=a,n=this,g=n[0],d=n.offset();if($.browser.msie&&document.selection&&document.selection.createRange){g.focus();var h=document.selection.createRange();$("#hskeywords").val(g.scrollTop);return{left:h.boundingLeft-d.left,top:parseInt(h.boundingTop)-d.top+g.scrollTop+document.documentElement.scrollTop+parseInt(n.getComputedStyle("fontSize"))}}c.simulator.empty();$.each(c.primaryStyles,function(p,q){n.cloneStyle(c.simulator,q)});c.simulator.css($.extend({width:n.width()+"px",height:n.height()+"px"},c.specificStyle));var l=n.val(),e=n.getCursorPosition();var f=l.substring(0,e),m=l.substring(e);var j=$('<span class="before"></span>').html(c.toHtml(f)),o=$('<span class="focus"></span>'),b=$('<span class="after"></span>').html(c.toHtml(m));c.simulator.append(j).append(o).append(b);var i=o.offset(),k=c.simulator.offset();return{top:i.top-k.top-g.scrollTop+($.browser.mozilla?0:parseInt(n.getComputedStyle("fontSize"))),left:o[
4460].offsetLeft-c.simulator[0].offsetLeft-g.scrollLeft}}};$.fn.extend({getComputedStyle:function(c){if(this.length==0){return}var d=this[0];var b=this.css(c);b=b||($.browser.msie?d.currentStyle[c]:document.defaultView.getComputedStyle(d,null)[c]);return b},cloneStyle:function(c,b){var d=this.getComputedStyle(b);if(!!d){$(c).css(b,d)}},cloneAllStyle:function(e,d){var c=this[0];for(var b in c.style){var f=c.style[b];typeof f=="string"||typeof f=="number"?this.cloneStyle(e,b):NaN}},getCursorPosition:function(){var e=this[0],b=0;if("selectionStart" in e){b=e.selectionStart}else{if("selection" in document){var c=document.selection.createRange();if(parseInt($.browser.version)>6){e.focus();var g=document.selection.createRange().text.length;c.moveStart("character",-e.value.length);b=c.text.length-g}else{var h=document.body.createTextRange();h.moveToElementText(e);for(;h.compareEndPoints("StartToStart",c)<0;b++){h.moveStart("character",1)}for(var d=0;d<=b;d++){if(e.value.charAt(d)=="\n"){b++}}var f=e.value.split("\n").length-1;b-=f;return b}}}return b},getCaretPosition:a.getCaretPosition})}); 447/*! 448 autosize 4.0.2 449 license: MIT 450 http://www.jacklmoore.com/autosize 451*/ 452(function(c,a){if(typeof define==="function"&&define.amd){define(["module","exports"],a)}else{if(typeof exports!=="undefined"){a(module,exports)}else{var b={exports:{}};a(b,b.exports);c.autosize=b.exports}}})(this,function(b,d){var a=typeof Map==="function"?new Map():function(){var n=[];var k=[];return{has:function m(p){return n.indexOf(p)>-1},get:function l(p){return k[n.indexOf(p)]},set:function o(p,q){if(n.indexOf(p)===-1){n.push(p);k.push(q)}},_delete:function e(q){var p=n.indexOf(q);if(p>-1){n.splice(p,1);k.splice(p,1)}}}}();var h=function h(e){return new Event(e,{bubbles:true})};try{new Event("test")}catch(f){h=function h(k){var e=document.createEvent("Event");e.initEvent(k,true,false);return e}}
452function j(n){if(!n||!n.nodeName||n.nodeName!=="TEXTAREA"||a.has(n)){return}var e=null;var r=null;var k=null;function t(){var u=window.getComputedStyle(n,null);if(u.resize==="vertical"){n.style.resize="none"}else{if(u.resize==="both"){n.style.resize="horizontal"}}if(u.boxSizing==="content-box"){e=-(parseFloat(u.paddingTop)+parseFloat(u.paddingBottom))}else{e=parseFloat(u.borderTopWidth)+parseFloat(u.borderBottomWidth)}if(isNaN(e)){e=0}m()}function p(v){var u=n.style.width;n.style.width="0px";n.offsetWidth;n.style.width=u;n.style.overflowY=v}function s(v){var u=[];while(v&&v.parentNode&&v.parentNode instanceof Element){if(v.parentNode.scrollTop){u.push({node:v.parentNode,scrollTop:v.parentNode.scrollTop})}v=v.parentNode}return u}function l(){if(n.scrollHeight===0){return}var v=s(n);var u=document.documentElement&&document.documentElement.scrollTop;n.style.height="";n.style.height=n.scrollHeight+e+"px";r=n.clientWidth;v.forEach(function(w){w.node.scrollTop=w.scrollTop});if(u){document.documentElement.scrollTop=u}}function m(){l();var y=Math.round(parseFloat(n.style.height));var w=window.getComputedStyle(n,null);var x=w.boxSizing==="content-box"?Math.round(parseFloat(w.height)):n.offsetHeight;if(x<y){if(w.overflowY==="hidden"){p("scroll");l();x=w.boxSizing==="content-box"?Math.round(parseFloat(window.getComputedStyle(n,null).height)):n.offsetHeight}}else{if(w.overflowY!=="hidden"){p("hidden");l();x=w.boxSizing==="content-box"?Math.round(parseFloat(window.getComputedStyle(n,null).height)):n.offsetHeight}}if(k!==x){k=x;var u=h("autosize:resized");try{n.dispatchEvent(u)}catch(v){}}}var o=function o(){if(n.clientWidth!==r){m()}};var q=function(u){window.removeEventListener("resize",o,false);n.removeEventListener("input",m,false);n.removeEventListener("keyup",m,false);n.removeEventListener("autosize:destroy",q,false);n.removeEventListener("autosize:update",m,false);Object.keys(u).forEach(function(v){n.style[v]=u[v]});a._delete(n)}.bind(n,{height:n.style.height,resize:n.style.resize,overflowY:n.style.overflowY,overflowX:n.style.overflowX,wordWrap:n.style.wordWrap});n.addEventListener("autosize:destroy",q,false);if("onpropertychange" in n&&"oninput" in n){n.addEventListener("keyup",m,false)}window.addEventListener("resize",o,false);n.addEventListener("input",m,false);n.addEventListener("autosize:update",m,false);n.style.overflowX="hidden";n.style.wordWrap="break-word";a.set(n,{destroy:q,update:m});t()}function g(k){var e=a.get(k);
452if(e){e.destroy()}}function c(k){var e=a.get(k);if(e){e.update()}}var i=null;if(typeof window==="undefined"||typeof window.getComputedStyle!=="function"){i=function i(e){return e};i.destroy=function(e){return e};i.update=function(e){return e}}else{i=function i(k,e){if(k){Array.prototype.forEach.call(k.length?k:[k],function(l){return j(l,e)})}return k};i.destroy=function(e){if(e){Array.prototype.forEach.call(e.length?e:[e],g)}return e};i.update=function(e){if(e){Array.prototype.forEach.call(e.length?e:[e],c)}return e}}b.exports=i}); 453/*! 454 * jQuery Mousewheel 3.1.13 455 * 456 * Copyright jQuery Foundation and other contributors 457 * Released under the MIT license 458 * http://jquery.org/license 459 */ 460(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){module.exports=a}else{a(jQuery)}}}(function(c){var d=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],k=("onwheel" in document||document.documentMode>=9)?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],h=Array.prototype.slice,j,b;if(c.event.fixHooks){for(var e=d.length;e;){c.event.fixHooks[d[--e]]=c.event.mouseHooks}}var f=c.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener){for(var m=k.length;m;){this.addEventListener(k[--m],l,false)}}else{this.onmousewheel=l}c.data(this,"mousewheel-line-height",f.getLineHeight(this));c.data(this,"mousewheel-page-height",f.getPageHeight(this))},teardown:function(){if(this.removeEventListener){for(var m=k.length;m;){this.removeEventListener(k[--m],l,false)}}else{this.onmousewheel=null}c.removeData(this,"mousewheel-line-height");c.removeData(this,"mousewheel-page-height")},getLineHeight:function(m){var i=c(m),n=i["offsetParent" in c.fn?"offsetParent":"parent"]();if(!n.length){n=c("body")}return parseInt(n.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(i){return c(i).height()},settings:{adjustOldDeltas:true,normalizeOffset:true}};c.fn.extend({mousewheel:function(i){return i?this.on("mousewheel",i):this.trigger("mousewheel")},unmousewheel:function(i){return this.off("mousewheel",i)}});function l(i){var o=i||window.event,u=h.call(arguments,1),w=0,q=0,p=0,t=0,s=0,r=0;i=c.event.fix(o);i.type="mousewheel";if("detail" in o){p=o.detail*-1}if("wheelDelta" in o){p=o.wheelDelta}if("wheelDeltaY" in o){p=o.wheelDeltaY}if("wheelDeltaX" in o){q=o.wheelDeltaX*-1}if("axis" in o&&o.axis===o.HORIZONTAL_AXIS){q=p*-1;p=0}w=p===0?q:p;if("deltaY" in o){p=o.deltaY*-1;w=p}if("deltaX" in o){q=o.deltaX;if(p===0){w=q*-1}}if(p===0&&q===0){return}if(o.deltaMode===1){var v=c.data(this,"mousewheel-line-height");w*=v;p*=v;q*=v}else{if(o.deltaMode===2){var n=c.data(this,"mousewheel-page-height");w*=n;p*=n;q*=n}}t=Math.max(Math.abs(p),Math.abs(q));if(!b||t<b){b=t;if(a(o,t)){b/=40}}if(a(o,t)){w/=40;q/=40;p/=40}w=Math[w>=1?"floor":"ceil"](w/b);q=Math[q>=1?"floor":"ceil"](q/b);p=Math[p>=1?"floor":"ceil"](p/b);if(f.settings.normalizeOffset&&this.getBoundingClientRect){var m=this.getBoundingClientRect();s=i.clientX-m.left;r=i.clientY-m.top}i.deltaX=q;i.deltaY=p;i.deltaFactor=b;i.offsetX=s;i.offsetY=r;i.deltaMode=0;u.unshift(i,w,q,p);if(j){clearTimeout(j)}j=setTimeout(g,200);return(c.event.dispatch||c.event.handle).apply(this,u)}function g(){b=null}function a(m,i){return f.settings.adjustOldDeltas&&m.type==="mousewheel"&&i%120===0}})); 461(function(c){var l="undefined";var d,g,q,f,b;var n,i,m,p;function j(s,v){var u=typeof s[v];return u==="function"||(!!(u=="object"&&s[v]))||u=="unknown"}function k(s,t){return typeof(s[t])!=l}function e(s,t){return !!(typeof(s[t])=="object"&&s[t])}function h(s){if(window.console&&window.console.log){window.console.log("TextInputs module for Rangy not supported in your browser. Reason: "+s)}}function o(t,u,s){if(u<0){u+=t.value.length}if(typeof s==l){s=u}if(s<0){s+=t.value.length}return{start:u,end:s}}function a(t,u,s){return{start:u,end:s,length:s-u,text:t.value.slice(u,s)}}function r(){return e(document,"body")?document.body:document.getElementsByTagName("body")[0]}c(document).ready(function(){var t=document.createElement("textarea");r().appendChild(t);if(k(t,"selectionStart")&&k(t,"selectionEnd")){d=function(w){var x=w.selectionStart,v=w.selectionEnd;return a(w,x,v)};g=function(x,v,w){var y=o(x,v,w);x.selectionStart=y.start;x.selectionEnd=y.end};p=function(w,v){if(v){w.selectionEnd=w.selectionStart}else{w.selectionStart=w.selectionEnd}}}else{if(j(t,"createTextRange")&&e(document,"selection")&&j(document.selection,"createRange")){d=function(z){var C=0,x=0,B,w,v,A;var y=document.selection.createRange();if(y&&y.parentElement()==z){v=z.value.length;B=z.value.replace(/\r\n/g,"\n");w=z.createTextRange();w.moveToBookmark(y.getBookmark());A=z.createTextRange();A.collapse(false);
461if(w.compareEndPoints("StartToEnd",A)>-1){C=x=v}else{C=-w.moveStart("character",-v);C+=B.slice(0,C).split("\n").length-1;if(w.compareEndPoints("EndToEnd",A)>-1){x=v}else{x=-w.moveEnd("character",-v);x+=B.slice(0,x).split("\n").length-1}}}return a(z,C,x)};var u=function(v,w){return w-(v.value.slice(0,w).split("\r\n").length-1)};g=function(z,v,y){var A=o(z,v,y);var x=z.createTextRange();var w=u(z,A.start);x.collapse(true);if(A.start==A.end){x.move("character",w)}else{x.moveEnd("character",u(z,A.end));x.moveStart("character",w)}x.select()};p=function(x,w){var v=document.selection.createRange();v.collapse(w);v.select()}}else{r().removeChild(t);h("No means of finding text input caret position");return}}r().removeChild(t);f=function(w,z,v,x){var y;if(z!=v){y=w.value;w.value=y.slice(0,z)+y.slice(v)}if(x){g(w,z,z)}};q=function(v){var w=d(v);f(v,w.start,w.end,true)};m=function(v){var w=d(v),x;if(w.start!=w.end){x=v.value;v.value=x.slice(0,w.start)+x.slice(w.end)}g(v,w.start,w.start);return w.text};b=function(w,z,v,x){var y=w.value,A;w.value=y.slice(0,v)+z+y.slice(v);if(x){A=v+z.length;g(w,A,A)}};n=function(v,y){var w=d(v),x=v.value;v.value=x.slice(0,w.start)+y+x.slice(w.end);var z=w.start+y.length;g(v,z,z)};i=function(v,y,B){var x=d(v),A=v.value;v.value=A.slice(0,x.start)+y+x.text+B+A.slice(x.end);var z=x.start+y.length;var w=z+x.length;g(v,z,w)};function s(v,w){return function(){var z=this.jquery?this[0]:this;var A=z.nodeName.toLowerCase();if(z.nodeType==1&&(A=="textarea"||(A=="input"&&z.type=="text"))){var y=[z].concat(Array.prototype.slice.call(arguments));var x=v.apply(this,y);if(!w){return x}}if(w){return this}}}c.fn.extend({getSelection:s(d,false),setSelection:s(g,true),collapseSelection:s(p,true),deleteSelectedText:s(q,true),deleteText:s(f,true),extractSelectedText:s(m,false),insertText:s(b,true),replaceSelectedText:s(n,true),surroundSelectedText:s(i,true)})})})(jQuery); 462/*! 463 * jQuery UI Touch Punch 1.0.8 as modified by RWAP Software 464 * based on original touchpunch v0.2.3 which has not been updated since 2014 465 * 466 * Updates by RWAP Software to take account of various suggested changes on the original code issues 467 * 468 * Original: https://github.com/furf/jquery-ui-touch-punch 469 * Copyright 2011â2014, Dave Furfero 470 * Dual licensed under the MIT or GPL Version 2 licenses. 471 * 472 * Fork: https://github.com/RWAP/jquery-ui-touch-punch 473 * 474 * Depends: 475 * jquery.ui.widget.js 476 * jquery.ui.mouse.js 477 */ 478(function(a){if(typeof define==="function"&&define.amd){define(["jquery","jquery.ui"],a)}else{a(jQuery)}}(function(c){c.support.mspointer=window.navigator.msPointerEnabled;c.support.touch=("ontouchstart" in document||"ontouchstart" in window||window.TouchEvent||(window.DocumentTouch&&document instanceof DocumentTouch)||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);if((!c.support.touch&&!c.support.mspointer)||!c.ui.mouse){return}var e=c.ui.mouse.prototype,g=e._mouseInit,d=e._mouseDestroy,b;function a(h){return{x:h.originalEvent.changedTouches[0].pageX,y:h.originalEvent.changedTouches[0].pageY}}function f(i,j){if(i.originalEvent.touches.length>1){return}if(i.cancelable){i.preventDefault()}var k=i.originalEvent.changedTouches[0],h=document.createEvent("MouseEvents");h.initMouseEvent(j,true,true,window,1,k.screenX,k.screenY,k.clientX,k.clientY,false,false,false,false,0,null);i.target.dispatchEvent(h)}e._touchStart=function(i){var h=this;this._startedMove=i.timeStamp;h._startPos=a(i);if(b||!h._mouseCapture(i.originalEvent.changedTouches[0])){return}b=true;h._touchMoved=false;f(i,"mouseover");f(i,"mousemove");f(i,"mousedown")};e._touchMove=function(h){if(!b){return}this._touchMoved=true;f(h,"mousemove")};e._touchEnd=function(j){if(!b){return}f(j,"mouseup");f(j,"mouseout");var h=j.timeStamp-this._startedMove;if(!this._touchMoved||h<500){f(j,"click")}else{var i=a(j);if((Math.abs(i.x-this._startPos.x)<10)&&(Math.abs(i.y-this._startPos.y)<10)){if(!this._touchMoved||j.originalEvent.changedTouches[0].touchType==="stylus"){f(j,"click")}}}this._touchMoved=false;b=false};e._mouseInit=function(){var h=this;if(c.support.mspointer){h.element[0].style.msTouchAction="none"}h.element.on({touchstart:c.proxy(h,"_touchStart"),touchmove:c.proxy(h,"_touchMove"),touchend:c.proxy(h,"_touchEnd")});g.call(h)};e._mouseDestroy=function(){var h=this;h.element.off({touchstart:c.proxy(h,"_touchStart"),touchmove:c.proxy(h,"_touchMove"),touchend:c.proxy(h,"_touchEnd")});d.call(h)}})); 479(function(){var a=$.datepicker._gotoToday;$.datepicker._gotoToday=function(d){var c=$(d),b=this._getInst(c[0]);a.call(this,d);this._selectDate(d,this._formatDate(b,b.selectedDay,b.drawMonth,b.drawYear))};$.datepicker._attachHandlers=function(c){var b=this._get(c,"stepMonths"),d="#"+c.id.replace(/\\\\/g,"\\");c.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){$.datepicker._adjustDate(d,-b,"M");$.datepicker._updateDatePickerPosition(c)},next:function(){$.datepicker._adjustDate(d,+b,"M");$.datepicker._updateDatePickerPosition(c)},hide:function(){$.datepicker._hideDatepicker()},today:function(){$.datepicker._gotoToday(d);$.datepicker._updateDatePickerPosition(c)},selectDay:function(){$.datepicker._selectDay(d,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);$.datepicker._updateDatePickerPosition(c);return false},selectMonth:function(){$.datepicker._selectMonthYear(d,this,"M");$.datepicker._updateDatePickerPosition(c);return false},selectYear:function(){$.datepicker._selectMonthYear(d,this,"Y");$.datepicker._updateDatePickerPosition(c);return false}};$(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})};$.datepicker._updateDatePickerPosition=function(d){if(d.inline){return}var b=d.input[0];if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(b);$.datepicker._pos[1]+=b.offsetHeight}var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;var e=false;$(b).parents().each(function(){e|=$(this).css("position")==="fixed";return !e});var c=$.datepicker._checkOffset(d,f,e);d.dpDiv.css({top:c.top+"px"})};$.datepicker._generateMonthYearHeader=function(f,d,n,h,l,o,j,b){var s,c,t,q,g,p,m,i,e=this._get(f,"changeMonth"),u=this._get(f,"changeYear"),v=this._get(f,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",r="";if(o||!e){r+="<span class='ui-datepicker-month' aria-label='select month'>"+j[d]+"</span>"}else{s=(h&&h.getFullYear()===n);c=(l&&l.getFullYear()===n);r+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change' aria-label='select month'>";for(t=0;t<12;t++){if((!s||t>=h.getMonth())&&(!c||t<=l.getMonth())){r+="<option value='"+t+"'"+(t===d?" selected='selected'":"")+">"+b[t]+"</option>"}}r+="</select>"}if(!v){k+=r+(o||!(e&&u)?" ":"")}if(!f.yearshtml){f.yearshtml="";if(o||!u){k+="<span class='ui-datepicker-year' aria-label='select year'>"+n+"</span>"}else{q=this._get(f,"yearRange").split(":");g=new Date().getFullYear();p=function(x){var w=(x.match(/c[+\-].*/)?n+parseInt(x.substring(1),10):(x.match(/[+\-].*/)?g+parseInt(x,10):parseInt(x,10)));return(isNaN(w)?g:w)};m=p(q[0]);i=Math.max(m,p(q[1]||""));m=(h?Math.max(m,h.getFullYear()):m);i=(l?Math.min(i,l.getFullYear()):i);
479f.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change' aria-label='select year'>";for(;m<=i;m++){f.yearshtml+="<option value='"+m+"'"+(m===n?" selected='selected'":"")+">"+m+"</option>"}f.yearshtml+="</select>";k+=f.yearshtml;f.yearshtml=null}}k+=this._get(f,"yearSuffix");if(v){k+=(o||!(e&&u)?" ":"")+r}k+="</div>";return k};$.datepicker._updateDatepicker=function(c){var b=c.input[0];if($.datepicker._curInst&&$.datepicker._curInst!==c&&$.datepicker._datepickerShowing&&$.datepicker._lastInput!==b){return}if(typeof(c.stay_open)!=="boolean"||c.stay_open===false){var d=this;setTimeout(function(){d._base_updateDatepicker(c);var e=d._get(c,"timepicker");if(e){e._addTimePicker(c)}d._updateDatePickerPosition(c)},0)}};$.datepicker._base_disableDatepicker=$.datepicker._disableDatepicker;$.datepicker._disableDatepicker=function(b){setTimeout(function(){$.datepicker._base_disableDatepicker(b)},0)}})();(function(){$.fn.extend({focus:(function(a){return function(b,c){return typeof b==="number"?this.each(function(){var d=this;setTimeout(function(){$(d).trigger("focus");if(c){c.call(d)}},b)}):a.apply(this,arguments)}})($.fn.focus),disableSelection:(function(){var a="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(a+".ui-disableSelection",function(b){b.preventDefault()})}})(),enableSelection:function(){return this.off(".ui-disableSelection")},zIndex:function(d){if(d!==undefined){return this.css("zIndex",String(d))}if(this.length){var b=$(this[0]),a,c;while(b.length&&b[0]!==document){a=b.css("position");if(a==="absolute"||a==="relative"||a==="fixed"){c=parseInt(b.css("zIndex"),10);if(!isNaN(c)&&c!==0){return c}}b=b.parent()}}return 0}})})();$.widget("ui.sortable",$.ui.sortable,{_setHandleClassName:function(){this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");$.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})}});(function(){$.extend(Object.getPrototypeOf($.timepicker),{_updateDateTime:function(h){h=this.inst||h;var e=(h.currentYear>0?new Date(h.currentYear,h.currentMonth,h.currentDay):new Date(h.selectedYear,h.selectedMonth,h.selectedDay)),b=$.datepicker._daylightSavingAdjust(e),i=$.datepicker._get(h,"dateFormat"),c=$.datepicker._getFormatConfig(h),g=b!==null&&this.timeDefined;this.formattedDate=$.datepicker.formatDate(i,(b===null?new Date():b),c);var a=this.formattedDate;var j=h.lastVal;if(j===""){h.currentYear=h.selectedYear;h.currentMonth=h.selectedMonth;h.currentDay=h.selectedDay}if(this._defaults.timeOnly===true&&this._defaults.timeOnlyShowDate===false){a=this.formattedTime}else{if((this._defaults.timeOnly!==true&&(this._defaults.alwaysSetTime||g))||(this._defaults.timeOnly===true&&this._defaults.timeOnlyShowDate===true)){a+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix}}this.formattedDateTime=a;if(!this._defaults.showTimepicker){this.$input.val(this.formattedDate)}else{if(this.$altInput&&this._defaults.timeOnly===false&&this._defaults.altFieldTimeOnly===true){this.$altInput.val(this.formattedTime);this.$input.val(this.formattedDate)}else{if(this.$altInput){this.$input.val(a);var f="",k=this._defaults.altSeparator!==null?this._defaults.altSeparator:this._defaults.separator,d=this._defaults.altTimeSuffix!==null?this._defaults.altTimeSuffix:this._defaults.timeSuffix;if(!this._defaults.timeOnly){if(this._defaults.altFormat){f=$.datepicker.formatDate(this._defaults.altFormat,(b===null?new Date():b),c)}else{f=this.formattedDate}if(f){f+=k}}if(this._defaults.altTimeFormat!==null){f+=$.datepicker.formatTime(this._defaults.altTimeFormat,this,this._defaults)+d}else{f+=this.formattedTime+d}this.$altInput.val(f)}else{this.$input.val(a)}}}if(j!=a){this.$input.trigger("change")}},_addTimePicker:function(b){var a=PrimeFaces.trim((this.$altInput&&this._defaults.altFieldTimeOnly)?this.$input.val()+" "+this.$altInput.val():(b.inline?this.$input.next().val():this.$input.val()));this.timeDefined=this._parseTime(a);this._limitMinMaxDateTime(b,false);this._injectTimePicker();this._afterInject()},_controls:{slider:{create:function(b,g,e,h,c,a,d){var f=b._defaults.isRTL;return g.prop("slide",null).slider({orientation:"horizontal",value:f?h*-1:h,min:f?a*-1:c,max:f?c*-1:a,step:d,slide:function(i,j){b.control.value(b,$(this),e,f?j.value*-1:j.value);b._onTimeChange()},stop:function(i,j){b._onSelectHandler()}})},options:function(b,f,e,d,g){if(b._defaults.isRTL){if(typeof(d)==="str
479ing"){if(d==="min"||d==="max"){if(g!==undefined){return f.slider(d,g*-1)}return Math.abs(f.slider(d))}return f.slider(d)}var c=d.min,a=d.max;d.min=d.max=null;if(c!==undefined){d.max=c*-1}if(a!==undefined){d.min=a*-1}return f.slider(d)}if(typeof(d)==="string"&&g!==undefined){return f.slider(d,g)}return f.slider(d)},value:function(a,c,b,d){if(a._defaults.isRTL){if(d!==undefined){return c.slider("value",d*-1)}return Math.abs(c.slider("value"))}if(d!==undefined){return c.slider("value",d)}return c.slider("value")}},select:{create:function(g,f,k,b,d,h,c){var a='<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="'+k+'" data-min="'+d+'" data-max="'+h+'" data-step="'+c+'" aria-label="select '+k+'">',j=g._defaults.pickerTimeFormat||g._defaults.timeFormat;for(var e=d;e<=h;e+=c){a+='<option value="'+e+'"'+(e===b?" selected":"")+">";if(k==="hour"){a+=$.datepicker.formatTime(PrimeFaces.trim(j.replace(/[^ht ]/ig,"")),{hour:e},g._defaults)}else{if(k==="millisec"||k==="microsec"||e>=10){a+=e}else{a+="0"+e.toString()}}a+="</option>"}a+="</select>";f.children("select").remove();$(a).appendTo(f).on("change",function(i){g._onTimeChange();g._onSelectHandler();g._afterInject()});return f},options:function(a,d,c,b,f){var e={},g=d.children("select");if(typeof(b)==="string"){if(f===undefined){return g.data(b)}e[b]=f}else{e=b}return a.control.create(a,d,g.data("unit"),g.val(),e.min>=0?e.min:g.data("min"),e.max||g.data("max"),e.step||g.data("step"))},value:function(a,c,b,d){var e=c.children("select");if(d!==undefined){return e.val(d)}return e.val()}}}})})(); 480/*! 481 * jQuery Browser Plugin 0.1.0 482 * https://github.com/gabceb/jquery-browser-plugin 483 * 484 * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors 485 * http://jquery.org/license 486 * 487 * Modifications Copyright 2015 Gabriel Cebrian 488 * https://github.com/gabceb 489 * 490 * Released under the MIT license 491 * 492 * Date: 05-07-2015 493 */ 494(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],function(b){return a(b)})}else{if(typeof module==="object"&&typeof module.exports==="object"){module.exports=a(require("jquery"))}else{a(window.jQuery)}}}(function(b){function a(d){if(d===undefined){d=window.navigator.userAgent}d=d.toLowerCase();var j=/(edge)\/([\w.]+)/.exec(d)||/(opr)[\/]([\w.]+)/.exec(d)||/(chrome)[ \/]([\w.]+)/.exec(d)||/(iemobile)[\/]([\w.]+)/.exec(d)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(d)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(d)||/(webkit)[ \/]([\w.]+)/.exec(d)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(d)||/(msie) ([\w.]+)/.exec(d)||d.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(d)||d.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(d)||[];var i=/(ipad)/.exec(d)||/(ipod)/.exec(d)||/(windows phone)/.exec(d)||/(iphone)/.exec(d)||/(kindle)/.exec(d)||/(silk)/.exec(d)||/(android)/.exec(d)||/(win)/.exec(d)||/(mac)/.exec(d)||/(linux)/.exec(d)||/(cros)/.exec(d)||/(playbook)/.exec(d)||/(bb)/.exec(d)||/(blackberry)/.exec(d)||[];var k={},e={browser:j[5]||j[3]||j[1]||"",version:j[2]||j[4]||"0",versionNumber:j[4]||j[2]||"0",platform:i[0]||""};if(e.browser){k[e.browser]=true;k.version=e.version;k.versionNumber=parseInt(e.versionNumber,10)}if(e.platform){k[e.platform]=true}if(k.android||k.bb||k.blackberry||k.ipad||k.iphone||k.ipod||k.kindle||k.playbook||k.silk||k["windows phone"]){k.mobile=true}if(k.cros||k.mac||k.linux||k.win){k.desktop=true}if(k.chrome||k.opr||k.safari){k.webkit=true}if(k.rv||k.iemobile){var c="msie";e.browser=c;k[c]=true}if(k.edge){delete k.edge;var m="msedge";e.browser=m;k[m]=true}if(k.safari&&k.blackberry){var g="blackberry";e.browser=g;k[g]=true}if(k.safari&&k.playbook){var p="playbook";e.browser=p;k[p]=true}if(k.bb){var n="blackberry";e.browser=n;k[n]=true}if(k.opr){var h="opera";e.browser=h;k[h]=true}if(k.safari&&k.android){var f="android";e.browser=f;k[f]=true}if(k.safari&&k.kindle){var o="kindle";e.browser=o;k[o]=true}if(k.safari&&k.silk){var l="silk";e.browser=l;k[l]=true}k.name=e.browser;k.platform=e.platform;return k}window.jQBrowser=a(window.navigator.userAgent);window.jQBrowser.uaMatch=a;if(b){b.browser=window.jQBrowser}return window.jQBrowser})); 495/*! js-cookie v3.0.0-rc.0 | MIT */ 496(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?module.exports=a():typeof define==="function"&&define.amd?define(a):(b=b||self,(function(){var d=b.Cookies;var c=b.Cookies=a();c.noConflict=function(){b.Cookies=d;return c}}()))}(this,(function(){function b(h){for(var f=1;f<arguments.length;f++){var g=arguments[f];for(var e in g){h[e]=g[e]}}return h}var a={read:function(e){return e.replace(/%3B/g,";")},write:function(e){return e.replace(/;/g,"%3B")}};function d(g,e){function h(k,m,i){if(typeof document==="undefined"){return}i=b({},e,i);if(typeof i.expires==="number"){i.expires=new Date(Date.now()+i.expires*86400000)}if(i.expires){i.expires=i.expires.toUTCString()}k=a.write(k).replace(/=/g,"%3D");m=g.write(String(m),k);var l="";for(var j in i){if(!i[j]){continue}l+="; "+j;if(i[j]===true){continue}l+="="+i[j].split(";")[0]}return(document.cookie=k+"="+m+l)}
496function f(l){if(typeof document==="undefined"||(arguments.length&&!l)){return}var m=document.cookie?document.cookie.split("; "):[];var o={};for(var k=0;k<m.length;k++){var p=m[k].split("=");var n=p.slice(1).join("=");var j=a.read(p[0]).replace(/%3D/g,"=");o[j]=g.read(n,j);if(l===j){break}}return l?o[l]:o}return Object.create({set:h,get:f,remove:function(j,i){h(j,"",b({},i,{expires:-1}))},withAttributes:function(i){return d(this.converter,b({},this.attributes,i))},withConverter:function(i){return d(b({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(g)}})}var c=d(a,{path:"/"});return c}))); 497(function(a){if(a.PrimeFaces){a.PrimeFaces.debug("PrimeFaces already loaded, ignoring duplicate execution.");return}var b={escapeClientId:function(c){return"#"+c.replace(/:/g,"\\:")},onElementLoad:function(c,d){if(c.prop("complete")){d()}else{c.on("load",d)}},getWidgetById:function(e){for(var d in b.widgets){var c=b.widgets[d];if(c&&c.id===e){return c}}return null},getWidgetsByType:function(c){return $.map(this.widgets,function(e,d){return c.prototype.isPrototypeOf(e)?e:null})},addSubmitParam:function(d,f){var e=$(this.escapeClientId(d));for(var c in f){e.append('<input type="hidden" name="'+b.escapeHTML(c)+'" value="'+b.escapeHTML(f[c])+'" class="ui-submit-param"></input>')}return this},submit:function(f,e){var c=$(this.escapeClientId(f));var d;if(e){d=c.attr("target");c.attr("target",e)}c.trigger("submit");c.children("input.ui-submit-param").remove();if(e){if(d!==undefined){c.attr("target",d)}else{c.removeAttr("target")}}},abortXHRs:function(){b.ajax.Queue.abortAll()},attachBehaviors:function(d,c){$.each(c,function(f,e){d.on(f,function(g){e.call(d,g)})})},getCookie:function(c){return Cookies.get(c)},setCookie:function(d,e,c){if(location.protocol==="https:"&&b.settings.cookiesSecure){c.secure=true;if(b.settings.cookiesSameSite){c.sameSite=b.settings.cookiesSameSite}}Cookies.set(d,e,c)},deleteCookie:function(d,c){Cookies.remove(d,c)},cookiesEnabled:function(){var c=(navigator.cookieEnabled)?true:false;if(typeof navigator.cookieEnabled==="undefined"&&!c){document.cookie="testcookie";c=(document.cookie.indexOf("testcookie")!==-1)?true:false}return(c)},createStorageKey:function(f,d,e){var c=b.settings.contextPath.replace(/\//g,"-")+(e?"":b.settings.viewId.replace(/\//g,"-"))+f+"-"+d;return c.toLowerCase()},updateFilledState:function(c,d){var e=c.val();if(typeof(e)=="undefined"){return}if(e.length){c.addClass("ui-state-filled");if(d.is("span:not('.ui-float-label')")){d.addClass("ui-inputwrapper-filled")}}else{c.removeClass("ui-state-filled");d.removeClass("ui-inputwrapper-filled")}},skinInput:function(c){var d=c.parent(),e=function(){if(d.hasClass("ui-inputwrapper-focus")){d.removeClass("ui-inputwrapper-focus")}b.updateFilledState(c,d)};b.updateFilledState(c,d);c.on("mouseenter",function(){$(this).addClass("ui-state-hover")}).on("mouseleave",function(){$(this).removeClass("ui-state-hover")}).on("focus",function(){$(this).addClass("ui-state-focus");if(d.is("span:not('.ui-float-label')")){d.addClass("ui-inputwrapper-focus")}}).on("blur",function(){$(this).removeClass("ui-state-focus");if(c.hasClass("hasDatepicker")){setTimeout(function(){e()},150)}else{e()}});if(c.is(':not([type="password"])')){c.attr("role","textbox").attr("aria-readonly",c.prop("readonly"))}c.attr("aria-disabled",c.is(":disabled"));if(c.is("textarea")){c.attr("aria-multiline",true)}return this}
497,skinButton:function(c){c.on("mouseover",function(){var e=$(this);if(!c.prop("disabled")){e.addClass("ui-state-hover")}}).on("mouseout",function(){$(this).removeClass("ui-state-active ui-state-hover")}).on("mousedown",function(){var e=$(this);if(!c.prop("disabled")){e.addClass("ui-state-active").removeClass("ui-state-hover")}}).on("mouseup",function(){$(this).removeClass("ui-state-active").addClass("ui-state-hover")}).on("focus",function(){$(this).addClass("ui-state-focus")}).on("blur",function(){$(this).removeClass("ui-state-focus ui-state-active")}).on("keydown",function(f){if(f.which===$.ui.keyCode.SPACE||f.which===$.ui.keyCode.ENTER){$(this).addClass("ui-state-active")}}).on("keyup",function(){$(this).removeClass("ui-state-active")});var d=c.attr("role");if(!d){c.attr("role","button")}c.attr("aria-disabled",c.prop("disabled"));return this},skinSelect:function(c){c.on("mouseover",function(){var d=$(this);if(!d.hasClass("ui-state-focus")){d.addClass("ui-state-hover")}}).on("mouseout",function(){$(this).removeClass("ui-state-hover")}).on("focus",function(){$(this).addClass("ui-state-focus").removeClass("ui-state-hover")}).on("blur",function(){$(this).removeClass("ui-state-focus ui-state-hover")});return this},info:function(c){if(this.logger){this.logger.info(c)}},debug:function(c){if(this.logger){this.logger.debug(c)}},warn:function(c){if(this.logger){this.logger.warn(c)}if(b.isDevelopmentProjectStage()&&a.console){console.log(c)}},error:function(c){if(this.logger){this.logger.error(c)}if(b.isDevelopmentProjectStage()&&a.console){console.error(c)}},isDevelopmentProjectStage:function(){return b.settings.projectStage==="Development"},isProductionProjectStage:function(){return b.settings.projectStage==="Production"},widgetNotAvailable:function(c){b.error("Widget for var '"+c+"' not available!")},setCaretToEnd:function(d){if(d){d.trigger("focus");var e=d.value.length;if(e>0){if(d.setSelectionRange){d.setSelectionRange(0,e)}else{if(d.createTextRange){var c=d.createTextRange();c.collapse(true);c.moveEnd("character",1);c.moveStart("character",1);c.select()}}}}},getThemeLink:function(){var c=$('link[href*="'+b.RESOURCE_IDENTIFIER+'/theme.css"]');if(c.length===0){c=$('link[href*="'+b.RESOURCE_IDENTIFIER+'=theme.css"]')}return c},getTheme:function(){var f=b.getThemeLink();if(f.length===0){return""}var e=f.attr("href"),d=e.split("&")[0],c=d.split("ln=primefaces-")[1];return c},changeTheme:function(g){if(g&&g!==""){var h=b.getThemeLink();var f=h.attr("href"),e=f.split("&")[0],d=e.split("ln=")[1],c=f.replace(d,"primefaces-"+g);h.attr("href",c)}},escapeRegExp:function(c){return this.escapeHTML(c.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"))},escapeHTML:function(c){return String(c).replace(/[&<>"'`=\/]/g,function(d){return b.entityMap[d]})},clearSelection:function(){if(a.getSelection){if(a.getSelection().empty){a.getSelection().empty()}else{if(a.getSelection().removeAllRanges&&a.getSelection().rangeCount>0&&a.getSelection().getRangeAt(0).getClientRects().length>0){a.getSelection().removeAllRanges()}}}else{if(document.selection&&document.selection.empty){try{document.selection.empty()}catch(c){}}}},getSelection:function(){var c="";if(a.getSelection){c=a.getSelection()}else{if(document.getSelection){c=document.getSelection()}else{if(document.selection){c=document.selection.createRange().text}}}return c},hasSelection:function(){return this.getSelection().length>0},cw:function(d,e,c){this.createWidget(d,e,c)},getFacesResource:function(e,d,c){return b.resources.getFacesResource(e,d,c)},createWidget:function(d,f,c){c.widgetVar=f;if(this.widget[d]){var e=this.widgets[f];if(e&&(e.constructor===this.widget[d])){e.refresh(c)}else{this.widgets[f]=new this.widget[d](c);if(this.settings.legacyWidgetNamespace){a[f]=this.widgets[f]}}}else{b.error("Widget class '"+d+"' not found!")}},inArray:function(c,e){for(var d=0;d<c.length;d++){if(c[d]===e){return true}}return false},isNumber:function(c){return typeof c==="number"&&isFinite(c)},focus:function(e,d){var c=":not(:submit):not(:button):input:visible:enabled[name]";setTimeout(function(){if(e){var h=$(b.escapeClientId(e));if(h.is(c)){h.trigger("focus")}else{var f=h.find(c).eq(0);b.focusElement(f)}}else{if(d){var f=$(b.escapeClientId(d)).find(c).eq(0);b.focusElement(f)}else{var g=$(c),f=g.eq(0);b.focusElement(f)}}},50);b.customFocus=true},focusElement:function(d){if(d.is(":radio")){if(d.hasClass("ui-helper-hidden-accessible")){d.parent().trigger("focus")}else{var c=$(':radio[name="'+$.escapeSelector(d.attr("name"))+'"]').filter(":checked");if(c.length){c.trigger("focus")}else{d.trigger("focus")}}}else{d.trigger("focus")}}
497,monitorDownload:function(g,c,e){if(this.cookiesEnabled()){if(g){g()}var f="primefaces.download"+b.settings.viewId.replace(/\//g,"_");if(e&&e!==""){f+="_"+e}var d=b.settings.contextPath;if(!d||d===""){d="/"}a.downloadMonitor=setInterval(function(){var h=b.getCookie(f);if(h==="true"){if(c){c()}clearInterval(a.downloadMonitor);b.setCookie(f,null,{path:d})}},1000)}},scrollTo:function(d){var c=$(b.escapeClientId(d)).offset();$("html,body").animate({scrollTop:c.top,scrollLeft:c.left},{easing:"easeInCirc"},1000)},scrollInView:function(d,g){if(g===null||g.length===0){return}var j=parseFloat(d.css("borderTopWidth"))||0,f=parseFloat(d.css("paddingTop"))||0,h=g.offset().top-d.offset().top-j-f,c=d.scrollTop(),e=d.height(),i=g.outerHeight(true);if(h<0){d.scrollTop(c+h)}else{if((h+i)>e){d.scrollTop(c+h-e+i)}}},calculateScrollbarWidth:function(){if(!this.scrollbarWidth){var c=$("<div></div>").css({width:"100px",height:"100px",overflow:"auto",position:"absolute",top:"-1000px",left:"-1000px"}).prependTo("body").append("<div></div>").find("div").css({width:"100%",height:"200px"});this.scrollbarWidth=100-c.width();c.parent().remove()}return this.scrollbarWidth},bcn:function(d,e,g){if(g){for(var c=0;c<g.length;c++){var f=g[c].call(d,e);if(f===false){if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}break}}}},bcnu:function(e,f,d){if(d){for(var c=0;c<d.length;c++){var g=d[c].call(this,e,f);if(g===false){break}}}},openDialog:function(c){b.dialog.DialogHandler.openDialog(c)},closeDialog:function(c){b.dialog.DialogHandler.closeDialog(c)},showMessageInDialog:function(c){b.dialog.DialogHandler.showMessageInDialog(c)},confirm:function(c){if(c.type==="popup"&&b.confirmPopup){b.confirmPopup.showMessage(c)}else{b.dialog.DialogHandler.confirm(c)}},deferredRenders:[],addDeferredRender:function(e,c,d){this.deferredRenders.push({widget:e,container:c,callback:d})},removeDeferredRenders:function(e){for(var d=(this.deferredRenders.length-1);d>=0;d--){var c=this.deferredRenders[d];if(c.widget===e){this.deferredRenders.splice(d,1)}}},invokeDeferredRenders:function(c){var g=[];for(var f=0;f<this.deferredRenders.length;f++){var d=this.deferredRenders[f];if(d.container===c){var h=d.callback.call();if(h){g.push(d.widget)}}}for(var e=0;e<g.length;e++){this.removeDeferredRenders(g[e])}},getLocaleSettings:function(e){var c;if(e){c=b.locales[e]}else{if(this.localeSettings){return this.localeSettings}c=b.locales[b.settings.locale]}if(!c){var d=e?e:b.settings.locale;c=b.locales[d.split("_")[0]]}if(!c){c=b.locales.en_US}if(!e){this.localeSettings=c}return c},getAriaLabel:function(d){var c=this.getLocaleSettings()["aria"];return(c&&c[d])?c[d]:b.locales.en_US["aria"][d]},trim:function(c){if(!c){return""}
497if(typeof c==="string"||c instanceof String){return c.trim()}return c},uuid:function(){var d=[];for(var c=0;c<256;c++){d[c]=(c<16?"0":"")+(c).toString(16)}var h=Math.random()*4294967295|0;var g=Math.random()*4294967295|0;var f=Math.random()*4294967295|0;var e=Math.random()*4294967295|0;return d[h&255]+d[h>>8&255]+d[h>>16&255]+d[h>>24&255]+"-"+d[g&255]+d[g>>8&255]+"-"+d[g>>16&15|64]+d[g>>24&255]+"-"+d[f&63|128]+d[f>>8&255]+"-"+d[f>>16&255]+d[f>>24&255]+d[e&255]+d[e>>8&255]+d[e>>16&255]+d[e>>24&255]},nextZindex:function(){return String(++b.zindex)},toISOString:function(c){return new Date(c.getTime()-(c.getTimezoneOffset()*60000)).toISOString()},version:function(){var c="PrimeFaces "+b.VERSION+" (jQuery "+jQuery.fn.jquery+" / UI "+$.ui.version+")";console.log(c)},zindex:1000,animationEnabled:true,animationActive:false,customFocus:false,detachedWidgets:[],PARTIAL_REQUEST_PARAM:"javax.faces.partial.ajax",PARTIAL_UPDATE_PARAM:"javax.faces.partial.render",PARTIAL_PROCESS_PARAM:"javax.faces.partial.execute",PARTIAL_SOURCE_PARAM:"javax.faces.source",BEHAVIOR_EVENT_PARAM:"javax.faces.behavior.event",PARTIAL_EVENT_PARAM:"javax.faces.partial.event",RESET_VALUES_PARAM:"primefaces.resetvalues",IGNORE_AUTO_UPDATE_PARAM:"primefaces.ignoreautoupdate",SKIP_CHILDREN_PARAM:"primefaces.skipchildren",VIEW_STATE:"javax.faces.ViewState",CLIENT_WINDOW:"javax.faces.ClientWindow",VIEW_ROOT:"javax.faces.ViewRoot",CLIENT_ID_DATA:"primefaces.clientid",RESOURCE_IDENTIFIER:"javax.faces.resource",VERSION:"11.0.0"};b.settings={};b.util={};b.widgets={};b.locales={en_US:{closeText:"Close",prevText:"Previous",nextText:"Next",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["S","M","T","W ","T","F ","S"],weekHeader:"Week",weekNumberTitle:"W",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:"",timeOnlyTitle:"Only Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecondText:"Millisecond",currentText:"Current Date",ampm:false,year:"Year",month:"Month",week:"Week",day:"Day",list:"Agenda",allDayText:"All Day",moreLinkText:"More...",noEventsText:"No Events",aria:{"paginator.PAGE":"Page {0}","calendar.BUTTON":"Show Calendar","datatable.sort.ASC":"activate to sort column ascending","datatable.sort.DESC":"activate to sort column descending","datatable.sort.NONE":"activate to remove sorting on column","columntoggler.CLOSE":"Close","overlaypanel.CLOSE":"Close"}}};b.locales.en=b.locales.en_US;b.entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};PF=function(d){var c=b.widgets[d];if(!c){b.widgetNotAvailable(d)}return c};a.PrimeFaces=b})(window); 498if(!PrimeFaces.env){PrimeFaces.env={mobile:false,touch:false,ios:false,browser:null,init:function(){this.browser=$.browser;this.mobile=(this.browser.mobile)?true:false;this.touch="ontouchstart" in window||window.navigator.msMaxTouchPoints||PrimeFaces.env.mobile;this.ios=/iPhone|iPad|iPod/i.test(window.navigator.userAgent)||(/mac/i.test(window.navigator.userAgent)&&PrimeFaces.env.touch)},isIE:function(a){return(a===undefined)?this.browser.msie:(this.browser.msie&&parseInt(this.browser.version,10)===a)},isLtIE:function(a){return(this.browser.msie)?parseInt(this.browser.version,10)<a:false},isTouchable:function(a){var b=(a==undefined)||(a.touchable!=undefined?a.touchable:true);return PrimeFaces.env.touch&&b}};PrimeFaces.env.init()}; 499if(!PrimeFaces.ajax){PrimeFaces.ab=function(a,c){for(var b in a){if(!a.hasOwnProperty(b)){continue}if(PrimeFaces.ajax.CFG_SHORTCUTS[b]){a[PrimeFaces.ajax.CFG_SHORTCUTS[b]]=a[b];delete a[b]}}return PrimeFaces.ajax.Request.handle(a,c)};PrimeFaces.ajax={VIEW_HEAD:"javax.faces.ViewHead",VIEW_BODY:"javax.faces.ViewBody",RESOURCE:"javax.faces.Resource",CFG_SHORTCUTS:{s:"source",f:"formId",p:"process",u:"update",e:"event",a:"async",g:"global",d:"delay",t:"timeout",sc:"skipChildren",iau:"ignoreAutoUp
499date",ps:"partialSubmit",psf:"partialSubmitFilter",rv:"resetValues",fp:"fragmentProcess",fu:"fragmentUpdate",pa:"params",onst:"onstart",oner:"onerror",onsu:"onsuccess",onco:"oncomplete"},Utils:{getContent:function(c){var b="";for(var a=0;a<c.childNodes.length;a++){b+=c.childNodes[a].nodeValue}return b},getPostUrl:function(a){var c=a.attr("action");var b=a.children("input[name*='javax.faces.encodedURL']");if(b.length>0){c=b.val()}return c},getPorletForms:function(a,c){var b=a.children("input[name*='javax.faces.encodedURL']");if(b.length>0){return'form[id*="'+c+'"]'}return null},updateFormStateInput:function(b,g,j){var e=PrimeFaces.trim(g);var a=null;if(j&&j.pfSettings&&j.pfSettings.portletForms){a=$(j.pfSettings.portletForms)}else{a=$("form")}var h="";if(j&&j.pfArgs&&j.pfArgs.parameterPrefix){h=j.pfArgs.parameterPrefix}for(var d=0;d<a.length;d++){var c=a.eq(d);if(c.attr("method")==="post"){var f=c.children("input[name='"+$.escapeSelector(h+b)+"']");if(f.length>0){f.val(e)}else{c.append('<input type="hidden" name="'+h+b+'" value="'+e+'" autocomplete="off"></input>')}}}},updateHead:function(d){var b=$.ajaxSetup()["cache"];$.ajaxSetup()["cache"]=true;var a=new RegExp("<head[^>]*>","gi").exec(d)[0];var c=d.indexOf(a)+a.length;$("head").html(d.substring(c,d.lastIndexOf("</head>")));$.ajaxSetup()["cache"]=b},updateBody:function(b){var c=new RegExp("<body[^>]*>","gi").exec(b)[0];var a=b.indexOf(c)+c.length;$("body").html(b.substring(a,b.lastIndexOf("</body>")))},updateElement:function(d,b,c){if(d.indexOf(PrimeFaces.VIEW_STATE)!==-1){PrimeFaces.ajax.Utils.updateFormStateInput(PrimeFaces.VIEW_STATE,b,c)}else{if(d.indexOf(PrimeFaces.CLIENT_WINDOW)!==-1){PrimeFaces.ajax.Utils.updateFormStateInput(PrimeFaces.CLIENT_WINDOW,b,c)}else{if(d===PrimeFaces.VIEW_ROOT){var a=PrimeFaces.ajax.Utils;window.PrimeFaces=null;a.updateHead(b);a.updateBody(b)}else{if(d===PrimeFaces.ajax.VIEW_HEAD){PrimeFaces.ajax.Utils.updateHead(b)}else{if(d===PrimeFaces.ajax.VIEW_BODY){PrimeFaces.ajax.Utils.updateBody(b)}else{if(d===PrimeFaces.ajax.RESOURCE){$("head").append(b)}else{if(d===$("head")[0].id){PrimeFaces.ajax.Utils.updateHead(b)}else{$(PrimeFaces.escapeClientId(d)).replaceWith(b)}}}}}}}}},Queue:{delays:{},requests:new Array(),xhrs:new Array(),offer:function(a){if(a.delay){var b=null,d=this,b=(typeof(a.source)==="string")?a.source:$(a.source).attr("id"),c=function(){return setTimeout(function(){d.requests.push(a);if(d.requests.length===1){PrimeFaces.ajax.Request.send(a)}},a.delay)};if(this.delays[b]){clearTimeout(this.delays[b].timeout);this.delays[b].timeout=c()}else{this.delays[b]={timeout:c()}}}else{this.requests.push(a);if(this.requests.length===1){PrimeFaces.ajax.Request.send(a)}}},poll:function(){if(this.isEmpty()){return null}var b=this.requests.shift(),a=this.peek();if(a){PrimeFaces.ajax.Request.send(a)}return b},peek:function(){if(this.isEmpty()){return null}return this.requests[0]},isEmpty:function(){return this.requests.length===0},addXHR:function(a){this.xhrs.push(a)},removeXHR:function(b){var a=$.inArray(b,this.xhrs);if(a>-1){this.xhrs.splice(a,1)}},abortAll:function(){this.requests=new Array();for(var a=0;a<this.xhrs.length;a++){var b=this.xhrs[a];if(b.readyState!==4){b.abort()}}this.xhrs=new Array()}},Request:{handle:function(a,b){a.ext=b;a.promise=a.promise||$.Deferred();if(PrimeFaces.settings.earlyPostParamEvaluation){a.earlyPostParams=PrimeFaces.ajax.Request.collectEarlyPostParams(a)}if(a.async){PrimeFaces.ajax.Request.send(a)}else{PrimeFaces.ajax.Queue.offer(a)}return a.promise.promise()},collectEarlyPostParams:function(b){var c;var d;if(typeof(b.source)==="string"){d=$(PrimeFaces.escapeClientId(b.source))}else{d=$(b.source)}if(d.is(":input")&&d.is(":not(:button)")){c=[];if(d.is(":checkbox")){var a=$("input[name='"+$.escapeSelector(d.attr("name"))+"']").filter(":checked").serializeArray();$.merge(c,a)}else{c.push({name:d.attr("name"),value:d.val()})}}else{c=d.serializeArray()}return c},send:function(g){PrimeFaces.debug("Initiating ajax request.");PrimeFaces.customFocus=false;var q=(g.global===true||g.global===undefined)?true:false,c=null,j=null,A=null;if(g.onstart){A=g.onstart.call(this,g)}if(g.ext&&g.ext.onstart){A=g.ext.onstart.call(this,g)}if(A===false){PrimeFaces.debug("AJAX request cancelled by onstart callback.");
499if(!g.async){PrimeFaces.ajax.Queue.poll()}if(g.promise){g.promise.reject({textStatus:"error",errorThrown:"AJAX request cancelled by onstart callback."})}return false}if(q){$(document).trigger("pfAjaxStart")}if(typeof(g.source)==="string"){j=g.source}else{j=$(g.source).attr("id")}if(g.formId){c=PrimeFaces.expressions.SearchExpressionFacade.resolveComponentsAsSelector(g.formId)}else{var x=$(PrimeFaces.escapeClientId(j));c=x.closest("form");if(c.length===0){c=$("form").eq(0)}}PrimeFaces.debug("Form to post "+c.attr("id")+".");var r;var e;var o=c.attr("enctype")==="multipart/form-data";if(o){r=new FormData();e=$()}var C=PrimeFaces.ajax.Utils.getPostUrl(c);var k=[];var B=PrimeFaces.ajax.Request.extractParameterNamespace(c);PrimeFaces.debug("URL to post "+C+".");PrimeFaces.ajax.Request.addParam(k,PrimeFaces.PARTIAL_REQUEST_PARAM,true,B);PrimeFaces.ajax.Request.addParam(k,PrimeFaces.PARTIAL_SOURCE_PARAM,j,B);if(g.resetValues){PrimeFaces.ajax.Request.addParam(k,PrimeFaces.RESET_VALUES_PARAM,true,B)}if(g.ignoreAutoUpdate){PrimeFaces.ajax.Request.addParam(k,PrimeFaces.IGNORE_AUTO_UPDATE_PARAM,true,B)}if(g.skipChildren===false){PrimeFaces.ajax.Request.addParam(k,PrimeFaces.SKIP_CHILDREN_PARAM,false,B)}var y=PrimeFaces.ajax.Request.resolveComponentsForAjaxCall(g,"process");if(g.fragmentProcess){y.push(g.fragmentProcess)}var b="@none";if(y.length>0){b=y.join(" ")}else{var m=PrimeFaces.ajax.Request.resolveComponentsForAjaxCall(g,"process");if(m===undefined||m.length===0){b="@all"}}if(!b.includes("@none")){PrimeFaces.ajax.Request.addParam(k,PrimeFaces.PARTIAL_PROCESS_PARAM,b,B)}var f=PrimeFaces.ajax.Request.resolveComponentsForAjaxCall(g,"update");if(g.fragmentUpdate){f.push(g.fragmentUpdate)}if(f.length>0){PrimeFaces.ajax.Request.addParam(k,PrimeFaces.PARTIAL_UPDATE_PARAM,f.join(" "),B)}if(g.event){PrimeFaces.ajax.Request.addParam(k,PrimeFaces.BEHAVIOR_EVENT_PARAM,g.event,B);var p=g.event;if(g.event==="valueChange"){p="change"}else{if(g.event==="action"){p="click"}}PrimeFaces.ajax.Request.addParam(k,PrimeFaces.PARTIAL_EVENT_PARAM,p,B)}else{PrimeFaces.ajax.Request.addParam(k,j,j,B)}if(g.params){PrimeFaces.ajax.Request.addParams(k,g.params,B)}if(g.ext&&g.ext.params){PrimeFaces.ajax.Request.addParams(k,g.ext.params,B)}if(g.partialSubmit===undefined){g.partialSubmit=PrimeFaces.settings.partialSubmit}if(g.ext&&g.ext.partialSubmit){g.partialSubmit=g.ext.partialSubmit}if(g.partialSubmit&&b.indexOf("@all")===-1){var s=false;if(b.indexOf("@none")===-1){var l=g.partialSubmitFilter||":input";for(var u=0;u<y.length;u++){var n=$(PrimeFaces.escapeClientId(y[u]));var D=null;if(n.is("form")){D=n.serializeArray();s=true;if(o){e=e.add(n)}}else{if(n.is(":input")){D=n.serializeArray();if(o){e=e.add(n)}}else{var h=n.find(l);D=h.serializeArray();if(o){e=e.add(h)}}}k=PrimeFaces.ajax.Request.arrayCompare(D,k);if(g.ext&&g.ext.partialSubmitParameterFilter){var a=g.ext.partialSubmitParameterFilter.call(this,D);$.merge(k,a)}else{$.merge(k,D)}}}if(!s){PrimeFaces.ajax.Request.addParamFromInput(k,PrimeFaces.VIEW_STATE,c,B);PrimeFaces.ajax.Request.addParamFromInput(k,PrimeFaces.CLIENT_WINDOW,c,B);PrimeFaces.ajax.Request.addParamFromInput(k,PrimeFaces.csp.NONCE_INPUT,c,B);PrimeFaces.ajax.Request.addParamFromInput(k,"dsPostWindowId",c,B);PrimeFaces.ajax.Request.addParamFromInput(k,"dspwid",c,B)}}else{$.merge(k,c.serializeArray());if(o){e=e.add(c)}}if(PrimeFaces.settings.earlyPostParamEvaluation&&g.earlyPostParams){k=PrimeFaces.ajax.Request.arrayCompare(g.earlyPostParams,k);$.merge(k,g.earlyPostParams)}if(o){var t=$();e.each(function(i,F){var E=$(F);if(E.is(':input[type="file"]')){t=t.add(E)}else{t=t.add(E.find('input[type="file"]'))}});t.each(function(E,G){for(var F=0;F<G.files.length;F++){r.append(G.id,G.files[F])}})}var v={url:C,type:"POST",cache:false,dataType:"xml",portletForms:PrimeFaces.ajax.Utils.getPorletForms(c,B),source:g.source,global:false,beforeSend:function(E,i){E.setRequestHeader("Faces-Request","partial/ajax");E.pfSettings=i;E.pfArgs={};if(q){$(document).trigger("pfAjaxSend",[E,this])}}};if(o){$.each(k,function(i,E){r.append(E.name,E.value)});v.data=r;v.enctype="multipart/form-data";v.processData=false;v.contentType=false}else{var d=$.param(k);PrimeFaces.debug("Post Data:"+d);v.data=d}var w=c.children("input[name='"+$.escapeSelector(PrimeFaces.csp.NONCE_INPUT)+"']");if(w.length>0){v.nonce=w.val()}if(g.timeout){v.timeout=g.timeout}var z=$.ajax(v).fail(function(G,E,F){if(g.promise){g.promise.reject({jqXHR:G,textStatus:E,errorThrown:F})}var i=G.getResponseHeader("Location");if(G.status===401&&i){PrimeFaces.debug("Unauthorized status received. Redirecting to "+i);window.location=i;return}if(g.onerror){g.onerror.call(this,G,E,F)}if(g.ext&&g.ext.onerror){g.ext.onerror.call(this,G,E,F)}$(document).trigger("pfAjaxError",[G,this,F]);PrimeFaces.error("Request return with error:"+E+".")}).done(function(G,i,H){PrimeFaces.debug("Response received successfully.");try{var E;if(g.promise){g.promise.resolve({document:G,textStatus:i,jqXHR:H})}if(g.onsuccess){E=g.onsuccess.call(this,G,i,H)}if(g.ext&&g.ext.onsuccess&&!E){E=g.ext.onsuccess.call(this,G,i,H)}if(q){$(document).trigger("pfAjaxSuccess",[H,this])}if(E){return}else{PrimeFaces.ajax.Response.handle(G,i,H)}}catch(F){PrimeFaces.error(F)}PrimeFaces.debug("DOM is updated.")}).always(function(E,i,F){if(g.ext&&g.ext.oncomplete){g.ext.oncomplete.call(this,F,i,F.pfArgs,E)}if(g.oncomplete){g.oncomplete.call(this,F,i,F.pfArgs,E)}if(q){$(document).trigger("pfAjaxComplete",[F,this])}PrimeFaces.debug("Response completed.");PrimeFaces.ajax.Queue.removeXHR(F);if(!g.async){PrimeFaces.ajax.Queue.poll()}});PrimeFaces.ajax.Queue.addXHR(z)},resolveExpressionsForAjaxCall:function(a,b){var c="";if(a[b]){c+=a[b]}if(a.ext&&a.ext[b]){c+=" "+a.ext[b]}return c},resolveComponentsForAjaxCall:function(a,b){var c=PrimeFaces.ajax.Request.resolveExpressionsForAjaxCall(a,b);
499return PrimeFaces.expressions.SearchExpressionFacade.resolveComponents(c)},addParam:function(c,a,b,d){if(d||!a.indexOf(d)===0){c.push({name:d+a,value:b})}else{c.push({name:a,value:b})}},addFormData:function(c,a,b,d){if(d||!a.indexOf(d)===0){c.append(d+a,b)}else{c.append(a,b)}},addParams:function(d,a,e){for(var b=0;b<a.length;b++){var c=a[b];if(e&&!c.name.indexOf(e)===0){c.name=e+c.name}d.push(c)}},addParamFromInput:function(f,c,d,g){var b=null,a=$.escapeSelector(c);if(g){b=d.children("input[name*='"+a+"']")}else{b=d.children("input[name='"+a+"']")}if(b&&b.length>0){var e=b.val();PrimeFaces.ajax.Request.addParam(f,c,e,g)}},addFormDataFromInput:function(f,c,d,g){var b=null,a=$.escapeSelector(c);if(g){b=d.children("input[name*='"+a+"']")}else{b=d.children("input[name='"+a+"']")}if(b&&b.length>0){var e=b.val();PrimeFaces.ajax.Request.addFormData(f,c,e,g)}},extractParameterNamespace:function(c){var a=c.children("input[name*='"+PrimeFaces.VIEW_STATE+"']");if(a&&a.length>0){var b=a[0].name;if(b.length>PrimeFaces.VIEW_STATE.length){return b.substring(0,b.indexOf(PrimeFaces.VIEW_STATE))}}return null},arrayCompare:function(b,a){$.each(b,function(d,c){a=$.grep(a,function(e,f){if(e.name===c.name){return false}return true})});return a},createFacesAjaxFormData:function(a,f,b,d,e){var c=new FormData();PrimeFaces.ajax.Request.addFormData(c,PrimeFaces.PARTIAL_REQUEST_PARAM,true,f);PrimeFaces.ajax.Request.addFormData(c,PrimeFaces.PARTIAL_SOURCE_PARAM,b,f);if(d){PrimeFaces.ajax.Request.addFormData(c,PrimeFaces.PARTIAL_PROCESS_PARAM,d,f)}if(e){PrimeFaces.ajax.Request.addFormData(c,PrimeFaces.PARTIAL_UPDATE_PARAM,e,f)}PrimeFaces.ajax.Request.addFormDataFromInput(c,PrimeFaces.VIEW_STATE,a,f);PrimeFaces.ajax.Request.addFormDataFromInput(c,PrimeFaces.CLIENT_WINDOW,a,f);PrimeFaces.ajax.Request.addFormDataFromInput(c,PrimeFaces.csp.NONCE_INPUT,a,f);PrimeFaces.ajax.Request.addFormDataFromInput(c,"dsPostWindowId",a,f);PrimeFaces.ajax.Request.addFormDataFromInput(c,"dspwid",a,f);return c}},Response:{handle:function(h,e,m,b){if(h===undefined||h===null){return}var n=h.getElementsByTagName("partial-response")[0];for(var g=0;g<n.childNodes.length;g++){var a=n.childNodes[g];switch(a.nodeName){case"redirect":PrimeFaces.ajax.ResponseProcessor.doRedirect(a);break;case"changes":var c=$(document.activeElement);var k=c.attr("id");var f;if(c.length>0&&c.is("input")&&typeof $.fn.getSelection==="function"){f=c.getSelection()}for(var d=0;d<a.childNodes.length;d++){var l=a.childNodes[d];switch(l.nodeName){case"update":PrimeFaces.ajax.ResponseProcessor.doUpdate(l,m,b);break;case"delete":PrimeFaces.ajax.ResponseProcessor.doDelete(l);break;case"insert":PrimeFaces.ajax.ResponseProcessor.doInsert(l);break;case"attributes":PrimeFaces.ajax.ResponseProcessor.doAttributes(l);break;case"eval":PrimeFaces.ajax.ResponseProcessor.doEval(l,m);break;case"extension":PrimeFaces.ajax.ResponseProcessor.doExtension(l,m);break}}PrimeFaces.ajax.Response.handleReFocus(k,f);PrimeFaces.ajax.Response.destroyDetachedWidgets();break;case"eval":PrimeFaces.ajax.ResponseProcessor.doEval(a);break;case"extension":PrimeFaces.ajax.ResponseProcessor.doExtension(a,m);break;case"error":PrimeFaces.ajax.ResponseProcessor.doError(a,m);break}}},handleReFocus:function(d,b){if(PrimeFaces.customFocus===true){PrimeFaces.customFocus=false;return}if(!d){return}var c=$(PrimeFaces.escapeClientId(d));if(c.length>0){var a=function(){if(d!==$(document.activeElement).attr("id")){c.trigger("focus");if(b){c.setSelection(b.start,b.end)}}};a();if(PrimeFaces.env.isIE()){setTimeout(function(){a()},50)}}},destroyDetachedWidgets:function(){for(var a=0;a<PrimeFaces.detachedWidgets.length;a++){var d=PrimeFaces.detachedWidgets[a];var b=PF(d);if(b){if(b.isDetached()===true){PrimeFaces.widgets[d]=null;b.destroy();try{delete b}catch(c){}}}}PrimeFaces.detachedWidgets=[]}},ResponseProcessor:{doRedirect:function(b){try{window.location.assign(b.getAttribute("url"))}catch(a){PrimeFaces.warn("Error redirecting to URL: "+b.getAttribute("url"))}},doUpdate:function(c,d,a){var e=c.getAttribute("id"),b=PrimeFaces.ajax.Utils.getContent(c);if(a&&a.widget&&a.widget.id===e){a.handle.call(a.widget,b)}else{PrimeFaces.ajax.Utils.updateElement(e,b,d)}},doEval:function(node,xhr){var textContent=node.textContent||node.innerText||node.text;var nonce;if(xhr&&xhr.pfSettings&&xhr.pfSettings.nonce){nonce=xhr.pfSettings.nonce}PrimeFaces.csp.eval(textContent,nonce)},doExtension:function(d,e){if(e){if(d.getAttribute("ln")==="primefaces"&&d.getAttribute("type")==="args"){var c=d.textContent||d.innerText||d.text;if(e.pfArgs){var b=JSON.parse(c);
499for(var a in b){e.pfArgs[a]=b[a]}}else{e.pfArgs=JSON.parse(c)}}}},doError:function(a,b){},doDelete:function(a){var b=a.getAttribute("id");$(PrimeFaces.escapeClientId(b)).remove()},doInsert:function(d){if(!d.childNodes){return false}for(var b=0;b<d.childNodes.length;b++){var a=d.childNodes[b];var f=a.getAttribute("id");var e=$(PrimeFaces.escapeClientId(f));var c=PrimeFaces.ajax.Utils.getContent(a);if(a.nodeName==="after"){$(c).insertAfter(e)}else{if(a.nodeName==="before"){$(c).insertBefore(e)}}}},doAttributes:function(c){if(!c.childNodes){return false}var g=c.getAttribute("id");var f=$(PrimeFaces.escapeClientId(g));for(var b=0;b<c.childNodes.length;b++){var d=c.childNodes[b];var a=d.getAttribute("name");var e=d.getAttribute("value");if(!a){return}if(!e||e===null){e=""}f.attr(a,e)}}},AjaxRequest:function(a,b){return PrimeFaces.ajax.Request.handle(a,b)}};$(window).on("unload",function(){PrimeFaces.ajax.Queue.abortAll()})}; 500if(!PrimeFaces.csp){PrimeFaces.csp={NONCE_INPUT:"primefaces.nonce",NONCE_VALUE:"",EVENT_REGISTRY:new Map(),init:function(d){PrimeFaces.csp.NONCE_VALUE=d;var b=document.getElementsByTagName("form");for(var c=0;c<b.length;c++){var e=b[c];var a=e.elements[PrimeFaces.csp.NONCE_INPUT];if(!a){a=document.createElement("input");a.setAttribute("name",PrimeFaces.csp.NONCE_INPUT);a.setAttribute("type","hidden");e.appendChild(a)}a.setAttribute("value",d)}},register:function(c,a,d){if(a){var e=a.substring(2,a.length),f=document.getElementById(c),b=e+"."+c;var i=function(j){var k=d.call(f,j);if(k===false&&j.cancelable){j.preventDefault()}};$(f).off(b).on(b,i);if(!PrimeFaces.isProductionProjectStage()){if(!PrimeFaces.csp.EVENT_REGISTRY.has(c)){PrimeFaces.csp.EVENT_REGISTRY.set(c,new Map())}var g=d.toString();var h=(g.indexOf("PrimeFaces.ab(")>=0)||(g.indexOf("pf.ab(")>=0)||(g.indexOf("mojarra.ab(")>=0)||(g.indexOf("jsf.ajax.request")>=0);PrimeFaces.csp.EVENT_REGISTRY.get(c).set(b,h)}}},hasRegisteredAjaxifiedEvent:function(d,c){if(PrimeFaces.isProductionProjectStage()){console.error("PrimeFaces CSP registry may not be used in JSF Production mode.");return false}if(PrimeFaces.csp.EVENT_REGISTRY.has(d)){var b=c.substring(2,c.length),a=b+"."+d;return PrimeFaces.csp.EVENT_REGISTRY.get(d).get(a)}return false},eval:function(c,a){var b={};if(a){b={nonce:a}}else{if(PrimeFaces.csp.NONCE_VALUE){b={nonce:PrimeFaces.csp.NONCE_VALUE}}}$.globalEval(c,b)},evalResult:function(js){var executeJs="var cspResult = "+js;PrimeFaces.csp.eval(executeJs);return cspResult},executeEvent:function(id,js,e){var scriptEval="var cspFunction = function(event){"+js+"}";PrimeFaces.csp.eval(scriptEval,PrimeFaces.csp.NONCE_VALUE);cspFunction.call(id,e)},clickEvent:function(){var a=$.Event("click");if(PrimeFaces.csp.NONCE_VALUE){a.preventDefault()}return a}}}; 501if(!PrimeFaces.expressions){PrimeFaces.expressions={};PrimeFaces.expressions.SearchExpressionFacade={resolveComponentsAsSelector:function(c){if(c instanceof $){return c}if(c instanceof HTMLElement){return $(c)}var a=PrimeFaces.expressions.SearchExpressionFacade.splitExpressions(c);var e=$();if(a){for(var b=0;b<a.length;++b){var g=PrimeFaces.trim(a[b]);if(g.length>0){if(g=="@none"||g=="@all"||g.indexOf("@obs(")==0){continue}if(g.indexOf("@")==-1){e=e.add($(document.getElementById(g)))}else{if(g.indexOf("@widgetVar(")==0){var f=g.substring(11,g.length-1);var d=PrimeFaces.widgets[f];if(d){e=e.add($(document.getElementById(d.id)))}else{PrimeFaces.widgetNotAvailable(f)}}else{if(g.indexOf("@(")==0){e=e.add($(g.substring(2,g.length-1)))}}}}}}return e},resolveComponents:function(l){var k=PrimeFaces.expressions.SearchExpressionFacade.splitExpressions(l),c=[];if(k){for(var g=0;g<k.length;++g){var m=PrimeFaces.trim(k[g]);if(m.length>0){if(m.indexOf("@")==-1||m=="@none"||m=="@all"||m.indexOf("@obs(")==0){if(!PrimeFaces.inArray(c,m)){c.push(m)}}else{if(m.indexOf("@widgetVar(")==0){var d=m.substring(11,m.length-1),h=PrimeFaces.widgets[d];if(h){if(!PrimeFaces.inArray(c,h.id)){c.push(h.id)}}else{PrimeFaces.widgetNotAvailable(d)}}else{if(m.indexOf("@(")==0){var b=$(m.substring(2,m.length-1));for(var e=0;e<b.length;e++){var f=$(b[e]),a=f.data(PrimeFaces.CLIENT_ID_DATA)||f.attr("id");if(a&&!PrimeFaces.inArray(c,a)){c.push(a)}}}}}}}}return c},splitExpressions:function(f){var e=[];var b="";var a=0;for(var d=0;d<f.length;d++){var g=f[d];if(g==="("){a++}if(g===")"){a--}if((g===" "||g===",")&&a===0){e.push(b);b=""}else{b+=g}}e.push(b);return e}}}; 502if(!PrimeFaces.utils){PrimeFaces.utils={resolveAppendTo:function(d,a){if(d&&d.jq[0]){var b=d.jq[0].closest(".ui-dialog");if(b&&a&&a.length){var c=$(b);if(c.css("position")==="fixed"){a.css("position","fixed")}if(!a.parent().is(document.body)){d.cfg.appendTo="@(body)";return d.cfg.appendTo}}return d.cfg.appendTo}return null},resolveDynamicOverlayContainer:function(a){return a.cfg.appendTo?PrimeFaces.expressions.SearchExpressionFacade.resolve
502ComponentsAsSelector(a.cfg.appendTo):$(document.body)},cleanupDynamicOverlay:function(e,b,c,a){if(e.cfg.appendTo){var d=$("[id='"+c+"']");if(d.length>1){a.children("[id='"+c+"']").remove()}}},removeDynamicOverlay:function(d,b,c,a){a.children("[id='"+c+"']").not(b).remove()},appendDynamicOverlay:function(d,b,c,a){var e=b.parent();if(!e.is(a)&&!a.is(b)){PrimeFaces.utils.removeDynamicOverlay(d,b,c,a);b.appendTo(a)}},addModal:function(e,c,d){var h=e.id,g=c.css("z-index")-1;var f=e instanceof PrimeFaces.widget.ConfirmDialog?"alertdialog":"dialog";c.attr({role:f,"aria-hidden":false,"aria-modal":true,"aria-live":"polite"});PrimeFaces.utils.preventTabbing(h,g,d);if(e.cfg.blockScroll){PrimeFaces.utils.preventScrolling()}var a=h+"_modal";var b=$('<div id="'+a+'" class="ui-widget-overlay ui-dialog-mask"></div>');b.appendTo($(document.body));b.css("z-index",String(g));return b},preventTabbing:function(d,c,a){var b=$(document);b.on("focus."+d+" mousedown."+d+" mouseup."+d,function(e){if($(e.target).zIndex()<c){e.preventDefault()}});b.on("keydown."+d,function(g){var h=$(g.target);if(g.which===$.ui.keyCode.TAB){var f=a();if(f.length){var i=f.filter(":first"),e=f.filter(":last"),j=null;if(i.is(":radio")){j=f.filter('[name="'+$.escapeSelector(i.attr("name"))+'"]').filter(":checked");if(j.length>0){i=j}}if(e.is(":radio")){j=f.filter('[name="'+$.escapeSelector(e.attr("name"))+'"]').filter(":checked");if(j.length>0){e=j}}if(h.is(document.body)){i.focus(1);g.preventDefault()}else{if(g.target===e[0]&&!g.shiftKey){i.focus(1);g.preventDefault()}else{if(g.target===i[0]&&g.shiftKey){e.focus(1);g.preventDefault()}}}}}else{if(!h.is(document.body)&&(h.zIndex()<c)){g.preventDefault()}}})},removeModal:function(c,b){var d=c.id;var a=d+"_modal";if(b){b.attr({"aria-hidden":true,"aria-modal":false,"aria-live":"off"})}$(PrimeFaces.escapeClientId(a)).remove();$(document.body).children("[id='"+a+"']").remove();if(c.cfg.blockScroll){PrimeFaces.utils.enableScrolling()}PrimeFaces.utils.enableTabbing(d)},enableTabbing:function(a){$(document).off("focus."+a+" mousedown."+a+" mouseup."+a+" keydown."+a)},isModalActive:function(b){var a=b+"_modal";return $(PrimeFaces.escapeClientId(a)).length===1||$(document.body).children("[id='"+a+"']").length===1},registerHideOverlayHandler:function(e,c,d,b,a){e.addDestroyListener(function(){$(document).off(c)});$(document).off(c).on(c,function(h){if(d.is(":hidden")||d.css("visibility")==="hidden"){return}var f=$(h.target);if(b){var g=b(h);if(g){if(g.is(f)||g.has(f).length>0){return}}}a(h,f)});return{unbind:function(){$(document).off(c)}}},registerResizeHandler:function(d,a,b,c,e){d.addDestroyListener(function(){$(window).off(a)});$(window).off(a).on(a,e||null,function(f){if(b&&(b.is(":hidden")||b.css("visibility")==="hidden")){return}c(f)});return{unbind:function(){$(window).off(a)}}},registerDynamicOverlay:function(d,b,c){if(d.cfg.appendTo){var a=PrimeFaces.utils.resolveDynamicOverlayContainer(d);PrimeFaces.utils.appendDynamicOverlay(d,b,c,a);d.addDestroyListener(function(){var e=PrimeFaces.utils.resolveDynamicOverlayContainer(d);PrimeFaces.utils.removeDynamicOverlay(d,null,c,e)});d.addRefreshListener(function(){var e=PrimeFaces.utils.resolveDynamicOverlayContainer(d);PrimeFaces.utils.cleanupDynamicOverlay(d,b,c,e)})}return b},registerScrollHandler:function(c,b,a){var d=c.getJQ().scrollParent();if(d.is("body")||d.is("html")||d[0].nodeType===9){d=$(window)}c.addDestroyListener(function(){d.off(b)});d.off(b).on(b,function(f){a(f)});return{unbind:function(){d.off(b)}}},registerConnectedOverlayScrollHandler:function(f,e,c,a){var d=PrimeFaces.utils.getScrollableParents((c||f.getJQ()).get(0));for(var b=0;b<d.length;b++){var g=$(d[b]);f.addDestroyListener(function(){g.off(e)});g.off(e).on(e,function(h){a(h)})}return{unbind:function(){for(var h=0;h<d.length;h++){$(d[h]).off(e)}}}},getScrollableParents:function(g){var k=[];var l=function(j,i){return j.parentNode==null?i:l(j.parentNode,i.concat([j.parentNode]))};if(g){var m=l(g,[]);var a=/(auto|scroll)/;var f=function(j){var i=window.getComputedStyle(j,null);return a.test(i.getPropertyValue("overflow"))||a.test(i.getPropertyValue("overflowX"))||a.test(i.getPropertyValue("overflowY"))};for(var h=0;h<m.length;h++){var n=m[h];var c=n.nodeType===1&&n.dataset.scrollselectors;if(c){var o=c.split(",");for(var e=0;e<o.length;e++){var d=o[e];var b=n.querySelector(d);if(b&&f(b)){k.push(b)}}}if(n.nodeType!==9&&f(n)){k.push(n)}}}return k},unbindScrollHandler:function(b,a){var c=b.getJQ().scrollParent();if(c.is("body")||c.is("html")||c[0].nodeType===9){c=$(window)}c.off(a)},preventScrolling:function(){$(document.body).addClass("ui-overflow-hidden")},enableScrolling:function(){$(document.body).removeClass("ui-overflow-hidden")},calculateRelativeOffset:function(b){var a={left:0,top:0};var e=b.offset();var c=$(window).scrollTop();var d=$(window).scrollLeft();a.top=e.top-c;a.left=e.left-d;return a},blockEnterKey:function(c){var a=c.which,b=$.ui.keyCode;if((a===b.ENTER)){c.preventDefault()}},ignoreFilterKey:function(c){var a=c.which,b=$.ui.keyCode,d=[b.END,b.HOME,b.LEFT,b.RIGHT,b.UP,b.DOWN,b.TAB,16,17,18,91,92,93,b.ESCAPE,b.PAGE_UP,b.PAGE_DOWN,19,20,44,144,145];if(d.indexOf(a)>-1){return true}return false},excludedSwipeElements:function(){return":button:enabled, :input:enabled, a, [role='combobox'], .noSwipe"},openLink:function(c,b){var a=b.attr("href");var e;if(a&&a!=="#"){if(c.ctrlKey){e=window.open(a,"_blank")}else{var d=b.attr("target")||"_self";e=window.open(a,d)}if(e){e.focus()}}c.preventDefault()},enableInputWidget:function(b,a){if(!a){a=b}
502if(a.is(":disabled")){a.prop("disabled",false);b.removeClass("ui-state-disabled")}},disableInputWidget:function(b,a){if(!a){a=b}if(!a.is(":disabled")){a.prop("disabled",true);b.addClass("ui-state-disabled")}},enableButton:function(a){if(a){a.removeClass("ui-state-disabled").removeAttr("disabled")}},disableButton:function(a){if(a){a.removeClass("ui-state-hover ui-state-focus ui-state-active").addClass("ui-state-disabled").attr("disabled","disabled")}},enableAnimations:function(){$.fx.off=false;PrimeFaces.animationEnabled=true},disableAnimations:function(){$.fx.off=true;PrimeFaces.animationEnabled=false},registerCSSTransition:function(b,c){if(b&&c!=null){var a={enter:c+"-enter",enterActive:c+"-enter-active",enterDone:c+"-enter-done",exit:c+"-exit",exitActive:c+"-exit-active",exitDone:c+"-exit-done"};var d=function(f,e,g){if(f!=null&&f[e]!=null){f[e].call(g)}};return{show:function(e){b.removeClass([a.exit,a.exitActive,a.exitDone]);if(b.is(":hidden")){if(PrimeFaces.animationEnabled){PrimeFaces.animationActive=true;b.css("display","block").addClass(a.enter);d(e,"onEnter");requestAnimationFrame(function(){setTimeout(function(){b.addClass(a.enterActive)},0);b.one("transitionrun.css-transition-show",function(f){d(e,"onEntering",f)}).one("transitioncancel.css-transition-show",function(){b.removeClass([a.enter,a.enterActive,a.enterDone]);PrimeFaces.animationActive=false}).one("transitionend.css-transition-show",function(f){b.removeClass([a.enterActive,a.enter]).addClass(a.enterDone);d(e,"onEntered",f);PrimeFaces.animationActive=false})})}else{b.css("display","block");d(e,"onEnter");d(e,"onEntering");d(e,"onEntered")}}},hide:function(e){b.removeClass([a.enter,a.enterActive,a.enterDone]);if(b.is(":visible")){if(PrimeFaces.animationEnabled){PrimeFaces.animationActive=true;b.addClass(a.exit);d(e,"onExit");setTimeout(function(){b.addClass(a.exitActive)},0);b.one("transitionrun.css-transition-hide",function(f){d(e,"onExiting",f)}).one("transitioncancel.css-transition-hide",function(){b.removeClass([a.exit,a.exitActive,a.exitDone]);PrimeFaces.animationActive=false}).one("transitionend.css-transition-hide",function(f){b.css("display","none").removeClass([a.exitActive,a.exit]).addClass(a.exitDone);d(e,"onExited",f);PrimeFaces.animationActive=false})}else{d(e,"onExit");d(e,"onExiting");d(e,"onExited");b.css("display","none")}}}}}return null},countBytes:function(e){var c=0,a=e.length,b;e=String(e||"");for(b=0;b<a;b++){var d=encodeURI(e[b]).split("%").length;c+=d===1?1:d-1}return c},styleClass:function(){var b=Array.prototype.slice.call(arguments);if(b){var d=[];for(var c=0;c<b.length;c++){var f=b[c];if(!f){continue}var e=typeof f;if(e==="string"||e==="number"){d.push(f)}else{if(e==="object"){var a=Array.isArray(f)?f:Object.keys(f).map(function(g){return !!f[g]?g:null});d=a.length?d.concat(a.filter(function(g){return !!g})):d}}}return d.join(" ")}return undefined}}}; 503(function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(g){var f=this.prototype;a=true;var e=new this();a=false;for(var d in g){e[d]=typeof g[d]=="function"&&typeof f[d]=="function"&&b.test(g[d])?(function(h,i){return function(){var k=this._super;this._super=f[h];var j=i.apply(this,arguments);this._super=k;return j}})(d,g[d]):g[d]}function c(){if(!a&&this.init){this.init.apply(this,arguments)}}c.prototype=e;c.prototype.constructor=c;c.extend=arguments.callee;return c}})();if(!PrimeFaces.widget){PrimeFaces.widget={};PrimeFaces.widget.BaseWidget=Class.extend({init:function(a){this.cfg=a;this.id=a.id;if(Array.isArray(this.id)){this.jqId=$.map(this.id,function(c){return PrimeFaces.escapeClientId(c)}).join(",")}else{this.jqId=PrimeFaces.escapeClientId(this.id)}this.jq=$(this.jqId);this.widgetVar=a.widgetVar;this.destroyListeners=[];this.refreshListeners=[];this.removeScriptElement(this.id);if(this.widgetVar){var b=this;this.jq.on("remove",function(){PrimeFaces.detachedWidgets.push(b.widgetVar)})}if(this.cfg.postConstruct){this.cfg.postConstruct.call(this,this)}},refresh:function(a){this.destroyListeners=[];if(this.refreshListeners){for(var b=0;b<this.refreshListeners.length;b++){var d=this.refreshListeners[b];d.call(this,this)}}this.refreshListeners=[];
503var c=this.init(a);if(this.cfg.postRefresh){this.cfg.postRefresh.call(this,this)}return c},destroy:function(){if(this.cfg.preDestroy){this.cfg.preDestroy.call(this,this)}PrimeFaces.debug("Destroyed detached widget: "+this.widgetVar);if(this.destroyListeners){for(var a=0;a<this.destroyListeners.length;a++){var b=this.destroyListeners[a];b.call(this,this)}}this.destroyListeners=[]},isDetached:function(){var a=document.getElementById(this.id);if(typeof(a)!=="undefined"&&a!==null){return false}return true},getJQ:function(){return this.jq},removeScriptElement:function(a){if(Array.isArray(a)){$.each(a,function(b,c){$(PrimeFaces.escapeClientId(c)+"_s").remove()})}else{$(PrimeFaces.escapeClientId(a)+"_s").remove()}},hasBehavior:function(a){if(this.cfg.behaviors){return this.cfg.behaviors[a]!=undefined}return false},callBehavior:function(b,a){if(this.hasBehavior(b)){this.cfg.behaviors[b].call(this,a)}},getBehavior:function(a){return this.cfg.behaviors?this.cfg.behaviors[a]:null},addDestroyListener:function(a){if(!this.destroyListeners){this.destroyListeners=[]}this.destroyListeners.push(a)},addRefreshListener:function(a){if(!this.refreshListeners){this.refreshListeners=[]}this.refreshListeners.push(a)},getParentForm:function(){return this.jq.closest("form")},getParentFormId:function(){if(this.cfg.formId){return this.cfg.formId}
503var a=this.getParentForm();if(a.length>0){this.cfg.formId=a.attr("id")}return this.cfg.formId}});PrimeFaces.widget.DynamicOverlayWidget=PrimeFaces.widget.BaseWidget.extend({init:function(a){this._super(a);PrimeFaces.utils.registerDynamicOverlay(this,this.jq,this.id)},refresh:function(a){PrimeFaces.utils.removeModal(this,this.modalOverlay);this.appendTo=null;this.modalOverlay=null;this._super(a)},destroy:function(){this._super();PrimeFaces.utils.removeModal(this);this.appendTo=null;this.modalOverlay=null},enableModality:function(a){var b=a||this.jq;this.modalOverlay=PrimeFaces.utils.addModal(this,b,$.proxy(function(){return this.getModalTabbables()},this))},disableModality:function(a){var b=a||this.jq;PrimeFaces.utils.removeModal(this,b);this.modalOverlay=null},getModalTabbables:function(){return null}});PrimeFaces.widget.DeferredWidget=PrimeFaces.widget.BaseWidget.extend({renderDeferred:function(){if(this.jq.is(":visible")){this._render();this.postRender()}else{if(this.jq[0]){var a=this.jq[0].closest(".ui-hidden-container");if(a){var c=$(a);if(c.length){var b=this;this.addDeferredRender(this.id,c,function(){return b.render()})}}}}},render:function(){if(this.jq.is(":visible")){this._render();this.postRender();return true}else{return false}},_render:function(){throw"Unsupported Operation"},postRender:function(){},destroy:function(){this._super();PrimeFaces.removeDeferredRenders(this.id)},addDeferredRender:function(b,a,d){PrimeFaces.addDeferredRender(b,a.attr("id"),d);if(a.is(":hidden")){var c=this.jq.closest(".ui-hidden-container");if(c.length){this.addDeferredRender(b,a.parent().closest(".ui-hidden-container"),d)}}}})}; 504if(!PrimeFaces.resources){PrimeFaces.resources={getFacesResource:function(a,i,g){if(a.indexOf("/")===0){a=a.substring(1,a.length)}var k=PrimeFaces.resources.getResourceScriptURI();var b=PrimeFaces.resources.getResourceScriptName(k);k=k.replace(b,a);var j=new RegExp("[?&]([^&=]*)ln=(.*?)(&|$)");var h="ln="+j.exec(k)[2];var d="";var f=!(k.indexOf("?"+h)>-1||k.indexOf("&"+h)>-1);if(f){d=new RegExp("[?&]([^&=]+)"+h+"($|&)").exec(k)[1]}k=k.replace(d+h,d+"ln="+i);if(g){var c=new RegExp("[?&]"+d+"v=([^&]*)").exec(k)[1];k=k.replace(d+"v="+c,d+"v="+g)}var e=window.location.protocol+"//"+window.location.host;return k.indexOf(e)>=0?k:e+k},isExtensionMapping:function(){if(!PrimeFaces.resources.IS_EXTENSION_MAPPING){var a=PrimeFaces.resources.getResourceScriptURI();var b=PrimeFaces.resources.getResourceScriptName(a);PrimeFaces.resources.IS_EXTENSION_MAPPING=a.charAt(a.indexOf(b)+b.length)==="."}return PrimeFaces.IS_EXTENSION_MAPPING},getResourceUrlExtension:function(){if(!PrimeFaces.resources.RESOURCE_URL_EXTENSION){var a=PrimeFaces.resources.getResourceScriptURI();var b=PrimeFaces.resources.getResourceScriptName(a);PrimeFaces.resources.RESOURCE_URL_EXTENSION=RegExp(b+".([^?]*)").exec(a)[1]}return PrimeFaces.resources.RESOURCE_URL_EXTENSION},getResourceScriptName:function(a){var b=new RegExp("\\/?"+PrimeFaces.RESOURCE_IDENTIFIER+"(\\/|=)(.*?)\\.js");return b.exec(a)[2]+".js"},getResourceScriptURI:function(){if(!PrimeFaces.resources.SCRIPT_URI){PrimeFaces.resources.SCRIPT_URI=$('script[src*="/'+PrimeFaces.RESOURCE_IDENTIFIER+'/"]').first().attr("src");if(!PrimeFaces.resources.SCRIPT_URI){PrimeFaces.resources.SCRIPT_URI=$('script[src*="'+PrimeFaces.RESOURCE_IDENTIFIER+'="]').first().attr("src")}}return PrimeFaces.resources.SCRIPT_URI}}}; 505if(!PrimeFaces.clientwindow){PrimeFaces.clientwindow={CLIENT_WINDOW_URL_PARAM:"jfwid",CLIENT_WINDOW_SESSION_STORAGE:"pf.windowId",TEMP_CLIENT_WINDOW_ID:"temp",LENGTH_CLIENT_WINDOW_ID:5,initialized:false,clientWindowId:null,initialRedirect:false,init:function(b,a){if(PrimeFaces.clientwindow.initialized===true){return}this.initialized=true;this.clientWindowId=b;this.initialRedirect=a;this.cleanupCookies();this.assertClientWindowId()},cleanupCookies:function(){var a=this.getUrlParameter(window.location.href,this.CLIENT_WINDOW_URL_PARAM);if(a){this.expireCookie("pf.initialredirect-"+a)}},assertClientWindowId:function(){var b=this.getUrlParameter(window.location.href,this.CLIENT_WINDOW_URL_PARAM);var a=sessionStorage.getItem(this.CLIENT_WINDOW_SESSION_STORAGE);if(a===null){if(this.initialRedirect&&b===this.clientWindowId){sessionStorage.setItem(this.CLIENT_WINDOW_SESSION_STORAGE,this.clientWindowId)}else{this.requestNewClientWindowId()}}else{if(a===this.TEMP_CLIENT_WINDOW_ID){sessionStorage.setItem(this.CLIENT_WINDOW_SESSION_STORAGE,this.clientWindowId)}else{if(a.length!==this.LENGTH_CLIENT_WINDOW_ID){this.requestNewClientWindowId()}else{if(a!==b||a!==this.clientWindowId){window.location=this.replaceUrlParam(window.location.href,this.CLIENT_WINDOW_URL_PARAM,a)}}}}},requestNewClientWindowId:function(){sessionStorage.setItem(this.CLIENT_WINDOW_SESSION_STORAGE,this.TEMP_CLIENT_WINDOW_ID);window.location=this.replaceUrlParam(window.location.href,this.CLIENT_WINDOW_URL_PARAM,null)},getUrlParameter:function(f,d){var b=document.createElement("a");b.href=f;var h=b.search;if(h&&h.length>0){var c=h.substring(1).split("&");for(var e=0;e<c.length;e++){var g=c[e].split("=");if(g[0]===d){return g.length>
5051?decodeURIComponent(g[1]):""}}}return null},replaceUrlParam:function(d,l,e){var k=document.createElement("a");k.href=d;if(!e||e.replace(/^\s+|\s+$/g,"").length===0){e=""}if(e.length===0){if(k.search.length===0||k.search.indexOf(l+"=")===-1){return k.href}}if(k.search.length===0){k.search="?"+encodeURIComponent(l)+"="+encodeURIComponent(e);return k.href}var c=k.search.substring(1).split("&");var h=[];h.push(l+"="+encodeURIComponent(e));for(var g=0;g<c.length;g++){var f=c[g];if(f.length>0){var b=f.split("=")[0];var j=f.split("=")[1];if(j&&j.replace(/^\s+|\s+$/g,"").length>0){if(b!==l){h.push(b+"="+j)}}}}k.search="?"+h.join("&");return k.href},expireCookie:function(a){PrimeFaces.setCookie(a,"true",{path:"/",expires:-10,"max-age":"0"})}}}; 506if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=function(b){var a=this;do{if(a.matches(b)){return a}a=a.parentElement||a.parentNode}while(a!==null&&a.nodeType===1);return null}}if(!String.prototype.includes){String.prototype.includes=function(a,b){if(a instanceof RegExp){throw TypeError("first argument must not be a RegExp")}if(b===undefined){b=0}return this.indexOf(a,b)!==-1}}if(!String.prototype.endsWith){String.prototype.endsWith=function(b,a){if(a===undefined||a>this.length){a=this.length}return this.substring(a-b.length,a)===b}}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function(c,d){if(this==null){throw new TypeError('"this" is null or not defined')}var e=Object(this);var a=e.length>>>0;if(a===0){return false}var f=d|0;var b=Math.max(f>=0?f:a-Math.abs(f),0);while(b<a){if(e[b]===c){return true}b++}return false}})}if(!("remove" in Element.prototype)){Element.prototype.remove=function(){if(this.parentNode){this.parentNode.removeChild(this)}}}; 507!function(){return function a(f,d,h){function g(i,m){if(!d[i]){if(!f[i]){var k="function"==typeof require&&require;if(!m&&k){return k(i,!0)}if(c){return c(i,!0)}var j=new Error("Cannot find module '"+i+"'");throw j.code="MODULE_NOT_FOUND",j}var e=d[i]={exports:{}};f[i][0].call(e.exports,function(l){return g(f[i][1][l]||l)},e,e.exports,a,f,d,h)}return d[i].exports}for(var c="function"==typeof require&&require,b=0;b<h.length;b++){g(h[b])}return g}}()({1:[function(a,c,b){a("string.prototype.replaceall").shim()},{"string.prototype.replaceall":40}],2:[function(a,c,b){},{}],3:[function(b,d,c){var g=b("get-intrinsic"),f=b("./"),a=f(g("String.prototype.indexOf"));d.exports=function(h,j){var i=g(h,!!j);return"function"==typeof i&&a(h,".prototype.")>-1?f(i):i}},{"./":4,"get-intrinsic":29}],4:[function(x,q,b){var h=x("function-bind"),g=x("get-intrinsic"),k=g("%Function.prototype.apply%"),v=g("%Function.prototype.call%"),s=g("%Reflect.apply%",!0)||h.call(v,k),d=g("%Object.getOwnPropertyDescriptor%",!0),w=g("%Object.defineProperty%",!0),j=g("%Math.max%");if(w){try{w({},"a",{value:1})}catch(x){w=null}}q.exports=function(a){var c=s(h,v,arguments);d&&w&&(d(c,"length").configurable&&w(c,"length",{value:1+j(0,a.length-(arguments.length-1))}));return c};var m=function(){return s(h,k,arguments)};w?w(q.exports,"apply",{value:m}):q.exports.apply=m},{"function-bind":28,"get-intrinsic":29}],5:[function(v,k,b){var g=v("object-keys"),f="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),j=Object.prototype.toString,q=Array.prototype.concat,m=Object.defineProperty,d=m&&function(){var a={};try{for(var c in m(a,"x",{enumerable:!1,value:a}),a){return !1}return a.x===a}catch(a){return !1}}(),s=function(a,i,c,p){var l;i in a&&("function"!=typeof(l=p)||"[object Function]"!==j.call(l)||!p())||(d?m(a,i,{configurable:!0,enumerable:!1,value:c,writable:!0}):a[i]=c)},h=function(l,o){var n=arguments.length>2?arguments[2]:{},a=g(o);f&&(a=q.call(a,Object.getOwnPropertySymbols(o)));for(var p=0;p<a.length;p+=1){s(l,a[p],o[a[p]],n[a[p]])}};h.supportsDescriptors=!!d,k.exports=h},{"object-keys":37}],6:[function(f,h,g){var l=f("get-intrinsic"),j=f("call-bind/callBound"),d=l("%TypeError%"),b=f("./IsArray"),k=l("%Reflect.apply%",!0)||j("%Function.prototype.apply%");h.exports=function(a,i){var c=arguments.length>2?arguments[2]:[];if(!b(c)){throw new d("Assertion failed: optional `argumentsList`, if provided, must be a List")}return k(a,i,c)}},{"./IsArray":11,"call-bind/callBound":3,"get-intrinsic":29}],7:[function(d,g,f){var j=d("get-intrinsic")("%TypeError%"),h=d("object-inspect"),c=d("./IsPropertyKey"),b=d("./Type");g.exports=function(a,i){if("Object"!==b(a)){throw new j("Assertion failed: Type(O)
507is not Object")}if(!c(i)){throw new j("Assertion failed: IsPropertyKey(P) is not true, got "+h(i))}return a[i]}},{"./IsPropertyKey":14,"./Type":18,"get-intrinsic":29,"object-inspect":35}],8:[function(d,g,f){var j=d("get-intrinsic")("%TypeError%"),h=d("./GetV"),c=d("./IsCallable"),b=d("./IsPropertyKey");g.exports=function(a,k){if(!b(k)){throw new j("Assertion failed: IsPropertyKey(P) is not true")}var i=h(a,k);if(null!=i){if(!c(i)){throw new j(k+"is not a function")}return i}}},{"./GetV":10,"./IsCallable":12,"./IsPropertyKey":14,"get-intrinsic":29}],9:[function(x,K,A){var D=x("get-intrinsic")("%TypeError%"),C=x("call-bind/callBound"),G=x("../helpers/regexTester"),O=x("../helpers/every"),M=C("String.prototype.charAt"),B=C("String.prototype.slice"),w=C("String.prototype.indexOf"),F=parseInt,J=G(/^[0-9]$/),k=x("object-inspect"),z=x("./Get"),N=x("./IsArray"),I=x("./IsInteger"),L=x("./ToObject"),H=x("./ToString"),q=x("./Type"),E=0 in [void 0],j=function(a,c,b){return"String"===q(a)||(E?!(c in b):"Undefined"===q(a))};K.exports=function(y,ab,Q,W,aa,X){if("String"!==q(y)){throw new D("Assertion failed: `matched` must be a String")}var Z=y.length;if("String"!==q(ab)){throw new D("Assertion failed: `str` must be a String")}var V=ab.length;if(!I(Q)||Q<0||Q>V){throw new D("Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got "+k(Q))}if(!N(W)||!O(W,j)){throw new D("Assertion failed: `captures` must be a List of Strings, got "+k(W))}if("String"!==q(X)){throw new D("Assertion failed: `replacement` must be a String")}var g=Q+Z,s=W.length;"Undefined"!==q(aa)&&(aa=L(aa));for(var f="",p=0;p<X.length;p+=1){var n=M(X,p),v=p+1>=X.length,u=p+2>=X.length;if("$"!==n||v){f+=M(X,p)}else{var d=M(X,p+1);if("$"===d){f+="$",p+=1}else{if("&"===d){f+=y,p+=1}else{if("`"===d){f+=0===Q?"":B(ab,0,Q-1),p+=1}else{if("'"===d){f+=g>=V?"":B(ab,g),p+=1}else{var b=u?null:M(X,p+2);if(!J(d)||"0"===d||!u&&J(b)){if(J(d)&&(u||J(b))){var Y=d+b,a=F(Y,10)-1;f+=Y<=s&&"Undefined"===q(W[a])?"":W[a],p+=2}else{if("<"===d){if("Undefined"===q(aa)){f+="$<",p+=2}else{var h=w(X,">",p);if(h>-1){var c=B(X,p+"$<".length,h),l=z(aa,c);"Undefined"!==q(l)&&(f+=H(l)),p+=("<"+c+">").length}}}else{f+="$"}}}else{var S=F(d,10);f+=S<=s&&"Undefined"===q(W[S-1])?"":W[S-1],p+=1}}}}}}}return f}},{"../helpers/every":23,"../helpers/regexTester":26,"./Get":7,"./IsArray":11,"./IsInteger":13,"./ToObject":16,"./ToString":17,"./Type":18,"call-bind/callBound":3,"get-intrinsic":29,"object-inspect":35}],10:[function(b,d,c){var g=b("get-intrinsic")("%TypeError%"),f=b("./IsPropertyKey"),a=b("./ToObject");d.exports=function(h,i){if(!f(i)){throw new g("Assertion failed: IsPropertyKey(P) is not true")}return a(h)[i]}},{"./IsPropertyKey":14,"./ToObject":16,"get-intrinsic":29}],11:[function(a,c,b){var f=a("get-intrinsic")("%Array%"),d=!f.isArray&&a("call-bind/callBound")("Object.prototype.toString");c.exports=f.isArray||function(e){return"[object Array]"===d(e)}},{"call-bind/callBound":3,"get-intrinsic":29}],12:[function(a,c,b){c.exports=a("is-callable")},{"is-callable":33}],13:[function(d,g,f){var j=d("./abs"),h=d("./floor"),c=d("../helpers/isNaN"),b=d("../helpers/isFinite");g.exports=function(a){if("number"!=typeof a||c(a)||!b(a)){return !1}var i=j(a);return h(i)===i}},{"../helpers/isFinite":24,"../helpers/isNaN":25,"./abs":19,"./floor":20}],14:[function(a,c,b){c.exports=function(d){return"string"==typeof d||"symbol"==typeof d}},{}],15:[function(a,c,b){c.exports=a("../5/CheckObjectCoercible")},{"../5/CheckObjectCoercible":21}],16:[function(a,c,b){var f=a("get-intrinsic")("%Object%"),d=a("./RequireObjectCoercible");c.exports=function(e){return d(e),f(e)}},{"./RequireObjectCoercible":15,"get-intrinsic":29}],17:[function(b,d,c){var g=b("get-intrinsic"),f=g("%String%"),a=g("%TypeError%");d.exports=function(e){if("symbol"==typeof e){throw new a("Cannot convert a Symbol value to a string")}return f(e)}},{"get-intrinsic":29}],18:[function(a,c,b){var d=a("../5/Type");c.exports=function(e){return"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":d(e)}},{"../5/Type":22}],19:[function(a,c,b){var d=a("get-intrinsic")("%Math.abs%");c.exports=function(e){return d(e)}},{"get-intrinsic":29}],20:[function(a,c,b){var d=Math.floor;c.exports=function(e){return d(e)}},{}],21:[function(a,c,b){var d=a("get-intrinsic")("%TypeError%");c.exports=function(f,g){if(null==f){throw new d(g||"Cannot call method on "+f)}return f}},{"get-intrinsic":29}],22:[function(a,c,b){c.exports=function(d){return null===d?"Null":void 0===d?"Undefined":"function"==typeof d||"object"==typeof d?"Object":"number"==typeof d?"Number":"boolean"==typeof d?"Boolean":"string"==typeof d?"String":void 0}},{}],23:[function(a,c,b){c.exports=function(d,g){for(var f=0;f<d.length;f+=1){if(!g(d[f],f,d)){return !1}}return !0}},{}],24:[function(a,c,b){var d=Number.isNaN||function(e){return e!=e};c.exports=Number.isFinite||function(e){return"number"==typeof e&&!d(e)&&e!==1/0&&e!==-1/0}},{}],25:[function(a,c,b){c.exports=Number.isNaN||function(d){return d!=d}},{}],26:[function(a,c,b){var f=a("get-intrinsic")("RegExp.prototype.test"),d=a("call-bind");c.exports=function(e){return d(f,e)}},{"call-bind":4,"get-intrinsic":29}],27:[function(a,c,b){var f=Array.prototype.slice,d=Object.prototype.toString;c.exports=function(k){var n=this;if("function"!=typeof n||"[object Function]"!==d.call(n)){throw new TypeError("Function.prototype.bind called on incompatible "+n)}
507for(var l,j=f.call(arguments,1),g=Math.max(0,n.length-j.length),o=[],m=0;m<g;m++){o.push("$"+m)}if(l=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof l){var e=n.apply(this,j.concat(f.call(arguments)));return Object(e)===e?e:this}return n.apply(k,j.concat(f.call(arguments)))}),n.prototype){var h=function(){};h.prototype=n.prototype,l.prototype=new h,h.prototype=null}return l}},{}],28:[function(a,c,b){var d=a("./implementation");c.exports=Function.prototype.bind||d},{"./implementation":27}],29:[function(t,e,r){var n=SyntaxError,o=Function,i=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},c=Object.getOwnPropertyDescriptor;if(c){try{c({},"")}catch(t){c=null}}var p=function(){throw new i},u=c?function(){try{return arguments.callee,p}catch(t){try{return c(arguments,"callee").get}catch(t){return p}}}():p,l=t("has-symbols")(),f=Object.getPrototypeOf||function(t){return t.__proto__},y={},s="undefined"==typeof Uint8Array?void 0:f(Uint8Array),b={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":l?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
507IteratorPrototype%":l?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?f(""[Symbol.iterator]()):void 0,"%Symbol%":l?Symbol:void 0,"%SyntaxError%":n,"%ThrowTypeError%":u,"%TypedArray%":s,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},d=t("function-bind"),h=t("has"),v=d.call(Function.call,Array.prototype.concat),m=d.call(Function.apply,Array.prototype.splice),S=d.call(Function.call,String.prototype.replace),j=d.call(Function.call,String.prototype.slice),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,w=function(t,e){var r,o=t;if(h(g,o)&&(o="%"+(r=g[o])[0]+"%"),h(b,o)){var c=b[o];if(c===y&&(c=function t(e){var r;if("%AsyncFunction%"===e){r=a("async function () {}")}else{if("%GeneratorFunction%"===e){r=a("function* () {}")}else{if("%AsyncGeneratorFunction%"===e){r=a("async function* () {}")}else{if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else{if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(r=f(o.prototype))}}}}}return b[e]=r,r}(o)),void 0===c&&!e){throw new i("intrinsic "+t+" exists, but is not available. Please file an issue!")}return{alias:r,name:o,value:c}}throw new n("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length){throw new i("intrinsic name must be a non-empty string")}if(arguments.length>1&&"boolean"!=typeof e){throw new i('"allowMissing" argument must be a boolean')}var r=function(t){var e=j(t,0,1),r=j(t,-1);if("%"===e&&"%"!==r){throw new n("invalid intrinsic syntax, expected closing `%`")}if("%"===r&&"%"!==e){throw new n("invalid intrinsic syntax, expected opening `%`")}var o=[];return S(t,A,function(t,e,r,n){o[o.length]=r?S(n,O,"$1"):e||t}),o}(t),o=r.length>0?r[0]:"",a=w("%"+o+"%",e),p=a.name,u=a.value,l=!1,f=a.alias;f&&(o=f[0],m(r,v([0,1],f)));for(var y=1,s=!0;y<r.length;y+=1){var g=r[y],d=j(g,0,1),P=j(g,-1);if(('"'===d||"'"===d||"`"===d||'"'===P||"'"===P||"`"===P)&&d!==P){throw new n("property names with quotes must have matching quotes")}if("constructor"!==g&&s||(l=!0),h(b,p="%"+(o+="."+g)+"%")){u=b[p]}else{if(null!=u){if(!(g in u)){if(!e){throw new i("base intrinsic for "+t+" exists, but the property is not available.")}return}if(c&&y+1>=r.length){var x=c(u,g);u=(s=!!x)&&"get" in x&&!("originalValue" in x.get)?x.get:u[g]}else{s=h(u,g),u=u[g]}s&&!l&&(b[p]=u)}}}return u}},{"function-bind":28,has:32,"has-symbols":30}],30:[function(a,c,b){var f="undefined"!=typeof Symbol&&Symbol,d=a("./shams");c.exports=function(){return"function"==typeof f&&("function"==typeof Symbol&&("symbol"==typeof f("foo")&&("symbol"==typeof Symbol("bar")&&d())))}},{"./shams":31}],31:[function(a,c,b){c.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols){return !1}if("symbol"==typeof Symbol.iterator){return !0}var d={},g=Symbol("test"),f=Object(g);if("string"==typeof g){return !1}if("[object Symbol]"!==Object.prototype.toString.call(g)){return !1}if("[object Symbol]"!==Object.prototype.toString.call(f)){return !1}for(g in d[g]=42,d){return !1}if("function"==typeof Object.keys&&0!==Object.keys(d).length){return !1}if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(d).length){return !1}var i=Object.getOwnPropertySymbols(d);if(1!==i.length||i[0]!==g){return !1}if(!Object.prototype.propertyIsEnumerable.call(d,g)){return !1}if("function"==typeof Object.getOwnPropertyDescriptor){var h=Object.getOwnPropertyDescriptor(d,g);if(42!==h.value||!0!==h.enumerable){return !1}}return !0}},{}],32:[function(a,c,b){var d=a("function-bind");c.exports=d.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":28}],33:[function(x,q,b){var h,g,k=Function.prototype.toString,v="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof v&&"function"==typeof Object.defineProperty){try{h=Object.defineProperty({},"length",{get:function(){throw g}}),g={},v(function(){throw 42},null,h)}catch(x){x!==g&&(v=null)}}else{v=null}var s=/^\s*class\b/,d=function(a){try{var c=k.call(a);return s.test(c)}catch(a){return !1}},w=Object.prototype.toString,j="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,m="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};
507q.exports=v?function(a){if(a===m){return !0}if(!a){return !1}if("function"!=typeof a&&"object"!=typeof a){return !1}if("function"==typeof a&&!a.prototype){return !0}try{v(a,null,h)}catch(a){if(a!==g){return !1}}return !d(a)}:function(a){if(a===m){return !0}if(!a){return !1}if("function"!=typeof a&&"object"!=typeof a){return !1}if("function"==typeof a&&!a.prototype){return !0}if(j){return function(e){try{return !d(e)&&(k.call(e),!0)}catch(e){return !1}}(a)}if(d(a)){return !1}var c=w.call(a);return"[object Function]"===c||"[object GeneratorFunction]"===c}},{}],34:[function(x,q,b){var h,g,k,v,s=x("call-bind/callBound"),d=x("has-symbols/shams")()&&!!Symbol.toStringTag;if(d){h=s("Object.prototype.hasOwnProperty"),g=s("RegExp.prototype.exec"),k={};var w=function(){throw k};v={toString:w,valueOf:w},"symbol"==typeof Symbol.toPrimitive&&(v[Symbol.toPrimitive]=w)}var j=s("Object.prototype.toString"),m=Object.getOwnPropertyDescriptor;q.exports=d?function(a){if(!a||"object"!=typeof a){return !1}var c=m(a,"lastIndex");if(!(c&&h(c,"value"))){return !1}try{g(a,v)}catch(a){return a===k}}:function(a){return !(!a||"object"!=typeof a&&"function"!=typeof a)&&"[object RegExp]"===j(a)}},{"call-bind/callBound":3,"has-symbols/shams":31}],35:[function(ak,az,am){var ap="function"==typeof Map&&Map.prototype,ao=Object.getOwnPropertyDescriptor&&ap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,av=ap&&ao&&"function"==typeof ao.get?ao.get:null,aD=ap&&Map.prototype.forEach,aB="function"==typeof Set&&Set.prototype,an=Object.getOwnPropertyDescriptor&&aB?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,aj=aB&&an&&"function"==typeof an.get?an.get:null,ar=aB&&Set.prototype.forEach,ay="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,af="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,al="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,aC=Boolean.prototype.valueOf,ax=Object.prototype.toString,aA=Function.prototype.toString,aw=String.prototype.match,ai="function"==typeof BigInt?BigInt.prototype.valueOf:null,aq=Object.getOwnPropertySymbols,H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,au="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ad=Object.prototype.propertyIsEnumerable,L=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(a){return a.__proto__}:null),ah=ak("./util.inspect").custom,K=ah&&J(ah)?ah:null,ag="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function X(a,c,b){var d="double"===(b.quoteStyle||c)?'"':"'";return d+a+d}function aa(a){return String(a).replace(/"/g,""")}function Z(a){return !("[object Array]"!==z(a)||ag&&"object"==typeof a&&ag in a)}function J(a){if(au){return a&&"object"==typeof a&&a instanceof Symbol}if("symbol"==typeof a){return !0}if(!a||"object"!=typeof a||!H){return !1}try{return H.call(a),!0}catch(a){}return !1}az.exports=function ak(O,B,I,G){var P=B||{};if(at(P,"quoteStyle")&&"single"!==P.quoteStyle&&"double"!==P.quoteStyle){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(at(P,"maxStringLength")&&("number"==typeof P.maxStringLength?P.maxStringLength<0&&P.maxStringLength!==1/0:null!==P.maxStringLength)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var F=!at(P,"customInspect")||P.customInspect;if("boolean"!=typeof F){throw new TypeError('option "customInspect", if provided, must be `true` or `false`')}if(at(P,"indent")&&null!==P.indent&&"\t"!==P.indent&&!(parseInt(P.indent,10)===P.indent&&P.indent>0)){throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`')}if(void 0===O){return"undefined"}if(null===O){return"null"}if("boolean"==typeof O){return O?"true":"false"}if("string"==typeof O){return function x(m,g){if(m.length>g.maxStringLength){var t=m.length-g.maxStringLength,p="... "+t+" more character"+(t>1?"s":"");return x(m.slice(0,g.maxStringLength),g)+p}var c=m.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,ae);return X(c,"single",g)}(O,P)}if("number"==typeof O){return 0===O?1/0/O>0?"0":"-0":String(O)}if("bigint"==typeof O){return String(O)+"n"}var N=void 0===P.depth?5:P.depth;if(void 0===I&&(I=0),I>=N&&N>0&&"object"==typeof O){return Z(O)?"[Array]":"[Object]"}var M=function(c,m){var g;if("\t"===c.indent){g="\t"}else{if(!("number"==typeof c.indent&&c.indent>0)){return null}g=Array(c.indent+1).join(" ")}return{base:g,prev:Array(m+1).join(g)}}(P,I);if(void 0===G){G=[]}else{if(Q(G,O)>=0){return"[Circular]"}}function E(n,m,g){if(m&&(G=G.slice()).push(m),g){var c={depth:P.depth};return at(P,"quoteStyle")&&(c.quoteStyle=P.quoteStyle),x(n,c,I+1,G)}return x(n,P,I+1,G)}if("function"==typeof O){var v=function(c){if(c.name){return c.name}var g=aw.call(aA.call(c),/^function\s*([\w$]+)/);if(g){return g[1]}return null}(O),h=Y(O,E);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(h.length>0?" { "+h.join(", ")+" }":"")}if(J(O)){var R=au?String(O).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):H.call(O);return"object"!=typeof O||au?R:V(R)}if(function(c){if(!c||"object"!=typeof c){return !1}if("undefined"!=typeof HTMLElement&&c instanceof HTMLElement){return !0}return"string"==typeof c.nodeName&&"function"==typeof c.getAttribute}(O)){for(var y="<"+String(O.nodeName).toLowerCase(),C=O.attributes||[],j=0;j<C.length;j++){y+=" "+C[j].name+"="+X(aa(C[j].value),"double",P)}return y+=">",O.childNodes&&O.childNodes.length&&(y+="..."),y+="</"+String(O.nodeName).toLowerCase()+">"}if(Z(O)){if(0===O.length){return"[]"}var f=Y(O,E);return M&&!function(c){for(var g=0;g<c.length;g++){if(Q(c[g],"\n")>=0){return !1}}return !0}(f)?"["+q(f,M)+"]":"[ "+f.join(", ")+" ]"}if(function(c){return !("[object Error]"!==z(c)||ag&&"object"==typeof c&&ag in c)}(O)){var l=Y(O,E);return 0===l.length?"["+String(O)+"]":"{ ["+String(O)+"] "+l.join(", ")+" }"}if("object"==typeof O&&F){if(K&&"function"==typeof O[K]){return O[K]()}if("function"==typeof O.inspect){return O.inspect()}}if(function(c){if(!av||!c||"object"!=typeof c){return !1}try{av.call(c);try{aj.call(c)}catch(c){return !0}return c instanceof Map}catch(c){}return !1}(O)){var k=[];return aD.call(O,function(c,e){k.push(E(e,O,!0)+" => "+E(c,O))}),ab("Map",av.call(O),k,M)}if(function(c){if(!aj||!c||"object"!=typeof c){return !1}try{aj.call(c);try{av.call(c)}catch(c){return !0}return c instanceof Set}catch(c){}return !1}(O)){var s=[];return ar.call(O,function(c){s.push(E(c,O))}),ab("Set",aj.call(O),s,M)}if(function(c){if(!ay||!c||"object"!=typeof c){return !1}try{ay.call(c,ay);try{af.call(c,af)}catch(c){return !0}return c instanceof WeakMap}catch(c){}return !1}(O)){return ac("WeakMap")}if(function(c){if(!af||!c||"object"!=typeof c){return !1}try{af.call(c,af);try{ay.call(c,ay)}catch(c){return !0}return c instanceof WeakSet}catch(c){}return !1}(O)){return ac("WeakSet")}if(function(c){if(!al||!c||"object"!=typeof c){return !1}try{return al.call(c),!0}catch(c){}return !1}(O)){return ac("WeakRef")}if(function(c){return !("[object Number]"!==z(c)||ag&&"object"==typeof c&&ag in c)}(O)){return V(E(Number(O)))}if(function(c){if(!c||"object"!=typeof c||!ai){return !1}try{return ai.call(c),!0}catch(c){}return !1}(O)){return V(E(ai.call(O)))}if(function(c){return !("[object Boolean]"!==z(c)||ag&&"object"==typeof c&&ag in c)}(O)){return V(aC.call(O))}if(function(c){return !("[object String]"!==z(c)||ag&&"object"==typeof c&&ag in c)}(O)){return V(E(String(O)))}if(!function(c){return !("[object Date]"!==z(c)||ag&&"object"==typeof c&&ag in c)}(O)&&!function(c){return !("[object RegExp]"!==z(c)||ag&&"object"==typeof c&&ag in c)}(O)){var u=Y(O,E),d=L?L(O)===Object.prototype:O instanceof Object||O.constructor===Object,b=O instanceof Object?"":"null prototype",i=!d&&ag&&Object(O)===O&&ag in O?z(O).slice(8,-1):b?"Object":"",a=(d||"function"!=typeof O.constructor?"":O.constructor.name?O.constructor.name+" ":"")+(i||b?"["+[].concat(i||[],b||[]).join(": ")+"] ":"");return 0===u.length?a+"{}":M?a+"{"+q(u,M)+"}":a+"{ "+u.join(", ")+" }"}return String(O)};var D=Object.prototype.hasOwnProperty||function(a){return a in this};function at(a,b){return D.call(a,b)}function z(a){return ax.call(a)}function Q(a,c){if(a.indexOf){return a.indexOf(c)}for(var b=0,d=a.length;b<d;b++){if(a[b]===c){return b}}return -1}
507function ae(a){var c=a.charCodeAt(0),b={8:"b",9:"t",10:"n",12:"f",13:"r"}[c];return b?"\\"+b:"\\x"+(c<16?"0":"")+c.toString(16).toUpperCase()}function V(a){return"Object("+a+")"}function ac(a){return a+" { ? }"}function ab(a,c,b,d){return a+" ("+c+") {"+(d?q(b,d):b.join(", "))+"}"}function q(a,c){if(0===a.length){return""}var b="\n"+c.prev+c.base;return b+a.join(","+b)+"\n"+c.prev}function Y(s,j){var b=Z(s),g=[];if(b){g.length=s.length;for(var f=0;f<s.length;f++){g[f]=at(s,f)?j(s[f],s):""}}var h,l="function"==typeof aq?aq(s):[];if(au){h={};for(var k=0;k<l.length;k++){h["$"+l[k]]=l[k]}}for(var d in s){at(s,d)&&(b&&String(Number(d))===d&&d<s.length||au&&h["$"+d] instanceof Symbol||(/[^\w$]/.test(d)?g.push(j(d,s)+": "+j(s[d],s)):g.push(d+": "+j(s[d],s))))}if("function"==typeof aq){for(var m=0;m<l.length;m++){ad.call(s,l[m])&&g.push("["+j(l[m])+"]: "+j(s[l[m]],s))}}return g}},{"./util.inspect":2}],36:[function(A,q,b){var h;if(!Object.keys){var g=Object.prototype.hasOwnProperty,k=Object.prototype.toString,x=A("./isArguments"),v=Object.prototype.propertyIsEnumerable,d=!v.call({toString:null},"toString"),z=v.call(function(){},"prototype"),j=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],m=function(a){var c=a.constructor;return c&&c.prototype===a},w={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},B=function(){if("undefined"==typeof window){return !1}for(var a in window){try{if(!w["$"+a]&&g.call(window,a)&&null!==window[a]&&"object"==typeof window[a]){try{m(window[a])}catch(a){return !0}}}catch(a){return !0}}return !1}();h=function(F){var p=null!==F&&"object"==typeof F,a="[object Function]"===k.call(F),f=x(F),u=p&&"[object String]"===k.call(F),C=[];if(!p&&!a&&!f){throw new TypeError("Object.keys called on a non-object")}var D=z&&a;if(u&&F.length>0&&!g.call(F,0)){for(var o=0;o<F.length;++o){C.push(String(o))}}if(f&&F.length>0){for(var s=0;s<F.length;++s){C.push(String(s))}}else{for(var l in F){D&&"prototype"===l||!g.call(F,l)||C.push(String(l))}}if(d){for(var E=function(c){if("undefined"==typeof window||!B){return m(c)}try{return m(c)}catch(c){return !1}}(F),i=0;i<j.length;++i){E&&"constructor"===j[i]||!g.call(F,j[i])||C.push(j[i])}}return C}}q.exports=h},{"./isArguments":38}],37:[function(f,h,g){var l=Array.prototype.slice,j=f("./isArguments"),d=Object.keys,b=d?function(a){return d(a)}:f("./implementation"),k=Object.keys;b.shim=function(){Object.keys?function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2)||(Object.keys=function(a){return j(a)?k(l.call(a)):k(a)}):Object.keys=b;return Object.keys||b},h.exports=b},{"./implementation":36,"./isArguments":38}],38:[function(a,c,b){var d=Object.prototype.toString;c.exports=function(f){var h=d.call(f),g="[object Arguments]"===h;return g||(g="[object Array]"!==h&&null!==f&&"object"==typeof f&&"number"==typeof f.length&&f.length>=0&&"[object Function]"===d.call(f.callee)),g}},{}],39:[function(z,M,B){var E=z("es-abstract/2020/Call"),D=z("es-abstract/2020/GetMethod"),I=z("es-abstract/2020/GetSubstitution"),Q=z("es-abstract/2020/IsCallable"),O=z("es-abstract/2020/IsInteger"),C=z("es-abstract/2020/RequireObjectCoercible"),x=z("es-abstract/2020/ToString"),G=z("es-abstract/2020/Type"),L=z("get-intrinsic"),q=z("call-bind/callBound"),A=z("has-symbols")(),P=z("is-regex"),K=L("%Math.max%"),N=L("%TypeError%"),J=q("Array.prototype.push"),w=q("String.prototype.slice"),F=q("String.prototype.indexOf"),k=q("String.prototype.replace");function H(b,d,c){if("String"!==G(b)||"String"!==G(d)){throw new N("Assertion failed: string and searchValue must both be Strings")}if(!O(c)||c<0){throw new N("Assertion failed: fromIndex must be a nonnegative integer")}var g=b.length;if(""===d&&c<=g){return c}var f=d.length;if(c>g){return -1}for(var a=c;a<g;a+=1){if(""===d||w(b,a,a+f)===d){return a}}return -1}M.exports=function(v,l){var a=C(this),m=P(v);
507if(m&&-1===F(w(v,v.source.length+2),"g")){throw new TypeError("use .replace for a non-global regex. NOTE: this may be allowed in the future.")}if(A&&Symbol.replace){if(null!=v){var j=D(v,Symbol.replace);if(void 0!==j){return E(j,v,[a,l])}}}else{if(m){return k(a,v,l)}}var n=x(a),b=x(v),i=Q(l);i||(l=x(l));for(var s=b.length,h=K(1,s),o=[],p=H(n,b,0);-1!==p;){J(o,p),p=H(n,b,p+h)}for(var S=0,u="",g=0;g<o.length;g+=1){var d;if(i){d=x(E(l,void 0,[b,o[g],n]))}else{if("String"!==G(l)){throw new N("Assertion failed: `replaceValue` should be a string at this point")}d=I(b,n,o[g],[],void 0,l)}u+=w(n,S,o[g])+d,S=o[g]+s}return S<n.length&&(u+=w(n,S)),u}},{"call-bind/callBound":3,"es-abstract/2020/Call":6,"es-abstract/2020/GetMethod":8,"es-abstract/2020/GetSubstitution":9,"es-abstract/2020/IsCallable":12,"es-abstract/2020/IsInteger":13,"es-abstract/2020/RequireObjectCoercible":15,"es-abstract/2020/ToString":17,"es-abstract/2020/Type":18,"get-intrinsic":29,"has-symbols":30,"is-regex":34}],40:[function(m,j,b){var g=m("call-bind"),f=m("define-properties"),h=m("./implementation"),l=m("./polyfill"),k=m("./shim"),d=g(h);f(d,{getPolyfill:l,implementation:h,shim:k}),j.exports=d},{"./implementation":39,"./polyfill":41,"./shim":42,"call-bind":4,"define-properties":5}],41:[function(a,c,b){var d=a("./implementation");c.exports=function(){return String.prototype.replaceAll||d}},{"./implementation":39}],42:[function(a,c,b){var f=a("define-properties"),d=a("./polyfill");c.exports=function(){var e=d();return f(String.prototype,{replaceAll:e},{replaceAll:function(){return String.prototype.replaceAll!==e}}),e}},{"./polyfill":41,"define-properties":5}]},{},[1]); 508PrimeFaces.widget.AjaxStatus=PrimeFaces.widget.BaseWidget.extend({init:function(a){this._super(a);this.bind()},bind:function(){var b=$(document),a=this;b.on("pfAjaxStart",function(){var c=a.cfg.delay;if(c>0){a.timeout=setTimeout(function(){a.trigger("start",arguments)},c)}else{a.trigger("start",arguments)}}).on("pfAjaxError",function(){a.trigger("error",arguments)}).on("pfAjaxSuccess",function(){a.trigger("success",arguments)}).on("pfAjaxComplete",function(){if(a.timeout){a.deleteTimeout()}a.trigger("complete",arguments)});if(window.jsf&&jsf.ajax){jsf.ajax.addOnEvent(function(d){if(d.status==="begin"){var c=a.cfg.delay;if(c>0){a.timeout=setTimeout(function(){a.trigger("start",arguments)},c)}else{a.trigger("start",arguments)}}else{if(d.status==="complete"){}else{if(d.status==="success"){if(a.timeout){a.deleteTimeout()}a.trigger("success",arguments);a.trigger("complete",arguments)}}}});jsf.ajax.addOnError(function(c){if(a.timeout){a.deleteTimeout()}a.trigger("error",arguments);a.trigger("complete",arguments)})}},trigger:function(b,a){var c=this.cfg[b];if(c){c.apply(document,a)}if(b!=="complete"||this.jq.children().filter(this.toFacetId("complete")).length){this.jq.children().hide().filter(this.toFacetId(b)).show()}},toFacetId:function(a){return this.jqId+"_"+a},deleteTimeout:function(){clearTimeout(this.timeout);this.timeout=null}}); 509PrimeFaces.widget.Poll=PrimeFaces.widget.BaseWidget.extend({init:function(a){this._super(a);this.active=false;if(this.cfg.autoStart){this.start()}},refresh:function(a){this.stop();this._super(a)},destroy:function(){this._super();this.stop()},start:function(){if(!this.active){var a=this.cfg.intervalType=="millisecond"?this.cfg.frequency:(this.cfg.frequency*1000);this.timer=setInterval(this.cfg.fn,a);this.active=true}},stop:function(){if(this.active){clearInterval(this.timer);this.active=false}},isActive:function(){return this.active}}); 510(!window.myfaces)?window.myfaces={}:null;if(!myfaces.oam){myfaces.oam=new function(){this.setHiddenInput=function(E,B,D){var C=document.forms[E];if(typeof C=="undefined"){C=document.getElementById(E);}if(typeof C.elements[B]!="undefined"&&(C.elements[B].nodeName=="INPUT"||C.elements[B].nodeName=="input")){C.elements[B].value=D;}else{var A=document.createElement("input");A.setAttribute("type","hidden");A.setAttribute("id",B);A.setAttribute("name",B);A.setAttribute("value",D);C.appendChild(A);}};this.clearHiddenInput=function(E,A,D){var C=document.forms[E];if(typeof C=="undefined"){C=document.getElementById(E);}var B=C.elements[A];if(typeof B!="undefined"){C.removeChild(B);}}
510;this.submitForm=function(L,K,I,C){var F="clearFormHiddenParams_"+L.replace(/-/g,"$:").replace(/:/g,"_");if(typeof window[F]=="function"){window[F](L);}var A=document.forms[L];if(typeof A=="undefined"){A=document.getElementById(L);}if(myfaces.core.config.autoScroll&&typeof window.getScrolling!="undefined"){myfaces.oam.setHiddenInput(L,"autoScroll",getScrolling());}if(myfaces.core.config.ieAutoSave){var E=navigator.userAgent.toLowerCase();var J=navigator.appVersion;if(E.indexOf("msie")!=-1){if(!(E.indexOf("ppc")!=-1&&E.indexOf("windows ce")!=-1&&J>=4)){window.external.AutoCompleteSaveForm(A);}}}var H=A.target;if(I!=null){A.target=I;}if((typeof C!="undefined")&&C!=null){for(var D=0,B;(B=C[D]);D++){myfaces.oam.setHiddenInput(L,B[0],B[1]);}}myfaces.oam.setHiddenInput(L,L+":"+"_idcl",K);if(A.onsubmit){var M=A.onsubmit();if((typeof M=="undefined")||M){try{A.submit();}catch(G){}}}else{try{A.submit();}catch(G){}}A.target=H;if((typeof C!="undefined")&&C!=null){for(var D=0,B;(B=C[D]);D++){myfaces.oam.clearHiddenInput(L,B[0],B[1]);}}myfaces.oam.clearHiddenInput(L,L+":"+"_idcl",K);return false;};};}(!myfaces.core)?myfaces.core={}:null;(!myfaces.core.config)?myfaces.core.config={}:null; 511/** 512 * Helper to 'declare' packages. 513 * @param packageName 514 */ 515function use_package(packageName) { 516 if (typeof (packageName) != "string") { 517 throw new Error("Can only declare packages in string format!") 518 } 519 var packageParts = packageName.split(".") 520 currentPackage = window, 521 i = 0, 522 len = packageParts.length; 523 for (; i < len; i++) { 524 if (!currentPackage[packageParts[i]]) { 525 currentPackage[packageParts[i]] = {}; 526 } 527 currentPackage = currentPackage[packageParts[i]]; 528 } 529} 530use_package("de.his.common"); 531 532/** 533 * Some common utils. 534 */ 535de.his.common.Util = new function() { 536 /** 537 * Translates exceptions to a string. 538 */ 539 this.toExceptionMessage = function(e) { 540 if (typeof e === "string") { 541 return e; 542 } 543 return e.message; 544 }; 545 546 /** 547 * Converts the given JSF client id so that it could be used within jQuery selectors. 548 */ 549 this.toJQueryId = function(jsfClientId) { 550 return jsfClientId.replace(/:/g, '\\:'); 551 }; 552 553 this.escapeHtml = function (text) { 554 return text 555 .replace(/&/g, "&") 556 .replace(/</g, "<") 557 .replace(/>/g, ">") 558 .replace(/"/g, """) 559 .replace(/'/g, "'"); 560 }; 561 562 this.getQueryParam = function(param) { 563 var found, 564 items = window.location.search.substr(1).split("&"), 565 it; 566 //http://jsperf.com/url-query-search 567 for(var i = 0, l = items.length; i<l; i++){ 568 it = items[i].split( "=" ); 569 if (param === it[0]) { 570 found = it[1]; 571 break; 572 } 573 } 574 575 return found; 576 }; 577 578 579 580 /** 581 * Erzeugt ein neues Popup-Fenster für die URL 582 * @param url 583 */ 584 this.openPopupWindow = function(url) { 585 var left = (screen.width/2)-(screen.width/3); 586 var top = (screen.height/2)-(screen.height/3); 587 var params = 'width=' + (screen.width*2/3) + ', height=' + (screen.height*2/3) + ', resizeable, scrollbars, top=' + top + ', left=' + left; 588 if (typeof(popupWindowRef) == 'undefined' || popupWindowRef.closed) { 589 popupWindowRef = window.open(url, 'popupWindowRef', params); // neues Popup 590 } else { 591 popupWindowRef.location.href = url; // Erneuere die URL und hole Popup in Focus 592 popupWindowRef.focus(); 593 } 594 }; 595 596 var alreadyLoadedFiles = {}; 597 /** 598 * Filepath of js files to load. String or an Array of Strings 599 */ 600 this.loadFile = function (filepath, callback, async){ 601 602 if(filepath){ 603 604 //if filepath is just a string - then convert to array with 1 entry 605 if(!jQuery.isArray(filepath)){ 606 filepath = [filepath]; 607 } 608 609 var filesLoaded = 0, //fileloaded counter 610 file, 611 callbackFunction = function(){ 612 //if all the files have loaded 613 if(filesLoaded === filepath.length){ 614 //check to see if there is a callback function to call 615 if(jQuery.isFunction(callback)){ 616 callback.call(); 617 } 618 } 619 }; 620 621 for(var i = 0, l = filepath.length; i<l; i++){ 622 file = filepath[i]; 623 if(!alreadyLoadedFiles[file]){ 624 //file hasn't been loaded before - so load it now 625 jQuery.ajax({ 626 async:typeof async === "boolean" ? async : true, 627 dataType:'script', 628 url:file, 629 success:function(){ 630 filesLoaded++; //increment counter 631 alreadyLoadedFiles[file] = true; //mark file as loaded 632 callbackFunction(); 633 }, 634 error:function(){ 635 console.error("error whilst loading file:", file); 636 } 637 }); 638 }else{ 639 filesLoaded++; //increment counter 640 callbackFunction(); 641 } 642 643 } 644 645 }else{ 646 console.error("no filepath defined, nothing is loaded"); 647 } 648 } 649 650 this.sleep = function (milliseconds) { 651 console.log("Sleeping for "+milliseconds+" ms. DO NOT USE IN PRODUCTION!") 652 var start = new Date().getTime(); 653 for (var i = 0; i < 1e7; i++) { 654 if ((new Date().getTime() - start) > milliseconds){ 655 break; 656 } 657 } 658 } 659 660 this.isCollection = function(element) { 661 if (element instanceof NodeList || Array.isArray(element)) { 662 if (element.length > 0) { 663 return true; 664 } 665 } 666 else if (element instanceof HTMLElement) { 667 return false;
668 } 669 } 670 671 672}; 673 674/** 675 * Context information / metadata of the server / from JSF to be used in Javascript. 676 * The metadata is stored with a DOM-element rendered by '<his:globalJavascriptContextInformation />'. 677 * This compoent must be included in every layout where global metadata is used in javascript. 678 * 679 * Additional metadata have to be declared in the xhtml-file named above. 680 * 681 * TODO: Automatisch durch PreRenderListener von JSF inkludieren lassen? 682 * 683 */ 684de.his.common.ContextInformation = new function() { 685 686 var context; 687 688 this.get = function(property) { 689 context = jQuery("#contextInformation"); 690 return context.data(property); 691 }; 692 693 this.set = function(property, value) { 694 context = jQuery("#contextInformation"); 695 return context.data(property, value); 696 }; 697 698 this.isEditUITexts = function() { 699 return this.get('is-edit-ui-texts') == true; 700 }; 701}; 702 703/** 704 * Ermittelt die aktuelle System-Sprache 705 */ 706de.his.common.LanguageHelper = new function() { 707 var language; 708 709 this.currentLanguage = function() { 710 if (!language) { 711 language = jQuery('html').attr('lang'); 712 if (!language) { 713 language = 'de'; 714 } 715 } 716 return language; 717 }; 718}; 719 720de.his.common.browser = new function(){ 721 722 var checkForString = function(name){ 723 return navigator.userAgent.toLowerCase().indexOf(name.toLowerCase()) > -1 ? true : false; 724 } 725 726 this.isChrome = function(){
727 return checkForString("chrome") && !checkForString("opr"); 728 } 729 730 this.isFirefox = function(){ 731 return checkForString("firefox"); 732 } 733 734 this.isIE = function(){ 735 return checkForString("msie") || checkForString("trident"); 736 } 737 738 739/** 740 * Add Class for IE 741 */ 742 var ua = navigator.userAgent, 743 doc = document.documentElement; 744 if ((ua.match(/MSIE 10.0/i))) { 745 doc.className = doc.className + " ie_old"; 746 } else if((ua.match(/rv:11.0/i))){ 747 doc.className = doc.className + " ie_old"; 748 } 749 750} 751 752/** 753 * @param cursor - string (css value) - optional - defaults to "auto" 754 */ 755de.his.common.chromeCursorFix = function(cursor){ 756 var wkch = document.createElement("div"); 757 wkch.style.overflow = "hidden"; 758 wkch.style.position = "absolute"; 759 wkch.style.left = "0px"; 760 wkch.style.top = "0px"; 761 wkch.style.width = "100%"; 762 wkch.style.height = "100%"; 763 var wkch2 = document.createElement("div"); 764 wkch2.style.width = "200%"; 765 wkch2.style.height = "200%"; 766 wkch.appendChild(wkch2); 767 document.body.appendChild(wkch); 768 document.body.style.cursor = cursor || "auto"; 769 wkch.scrollLeft = 1; 770 wkch.scrollLeft = 0; 771 document.body.removeChild(wkch); 772} 773 774/** 775 * IE bug fix - no contains method 776 */ 777if ( !String.prototype.contains ) { 778 String.prototype.contains = function() { 779 return String.prototype.indexOf.apply( this, arguments ) !== -1; 780 }; 781} 782 783de.his.common.langSelected = function(select){ 784 var select = jQuery(select), 785 option = select.find(":selected"); 786 //fire language change 787 window.location = option.attr("data-value"); 788} 789 790 791de.his.common.getAlreadyLoadedResources = function() { 792 var list = performance.getEntriesByType("resource"); 793 if (list === undefined) { 794 return[]; 795 } 796 797 var names = []; 798 799 for (var i=0; i < list.length; i++) { 800 names.push(list[i].name); 801 } 802 803 return names; 804}/** 805 * Auf Cookies zugreifen 806 */ 807de.his.common.Cookie = new function() { 808 809 this.areCookiesEnabled = function (){ 810 // Quick test if browser has cookieEnabled host property 811 if (navigator.cookieEnabled) return true; 812 // Create cookie 813 document.cookie = "cookietest=1; SameSite=Lax; Secure"; 814 var ret = document.cookie.indexOf("cookietest=") != -1; 815 // Delete cookie 816 document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT"; 817 return ret; 818 } 819 820 this.create = function(name, value) { 821 this.createWithPath(name, value, de.his.common.ContextInformation.get('context-path')); 822 }; 823 824 this.createWithPath = function(name, value, path) { 825 var cookie = name + '=' + value + '; path=' + path +"; SameSite=Lax;Secure"; 826 827 // Der Path soll immer nur den Servernamen enthalten. 828 if (name == "lastRefresh" && (path.lastIndexOf("/") > path.indexOf("/"))) { 829 alert("Setting cookie with bad path. Report to SYS (JOL): " + cookie); 830 } 831 document.cookie = cookie; 832 }; 833 834 this.read = function(name) { 835 var nameEQ = name + '=', 836 ca = document.cookie.split(';'), 837 i = 0; 838 for (; i < ca.length; i++) { 839 var c = ca[i]; 840 while (c && c.charAt(0) == ' ') { 841 c = c.substring(1, c.length); 842 } 843 if (c.indexOf(nameEQ) == 0) { 844 return c.substring(nameEQ.length, c.length); 845 } 846 } 847 return null; 848 }; 849 850 this.erase = function(name) { 851 this.eraseWithPath(name, de.his.common.ContextInformation.get('context-path')); 852 }; 853 854 this.eraseWithPath = function(name, path) { 855 var cookie = name + '=0; path=' + path +"; SameSite=Lax; expires=Thu, 01-Jan-1970 00:00:01 GMT"; 856 document.cookie = cookie; 857 }; 858 859 // common function aliases 860 this.get = this.read; 861 this.set = this.create; 862 this.del = this.erase; 863};/** 864 * Initializes some HISinOne JS functionality. 865 * 866 * Modules to be initialized need a method 'init'. Modules to be refreshed after AJAX requests need a 'refresh' method. 867 */ 868 869/** 870 * sets console loglevel 871 */ 872jQuery("#contextInformation").ready(function(){ 873 874 // # LOG, DEBUG, INFO, WARN, ERROR 875var jsLoglevel = de.his.common.ContextInformation.get('jsconsoleLoglevel'); 876 window = window['hisJsLoglevel'] = jsLoglevel; 877 878 // disables console functions 879 var setLogLevel = function( methods ) { 880 for (var i = 0; methods.length > i; i++) { 881 window.console[ methods[ i ] ] = function() {}; 882 } 883 }; 884 885 // debug a single page without JS debugging enabled globally. 886 if(window.location.href.endsWith("jsdebug")){ 887 jsLoglevel = 'LOG'; 888 console.info("JS-Console loglevel set to '", jsLoglevel, "' for one request."); 889 } else { 890 console.info("JS-Console loglevel set to '", jsLoglevel, "'. Set loglevel in DispatcherProperties with HIS_JS_CONSOLE_LOGLEVEL=LOG/DEBUG/INFO/WARN/ERROR."); 891 } 892 893 if(jsLoglevel === "LOG"){ 894 // enable better serviceworker debugging 895 if(de.his.serviceworker.registration.isServiceWorkerRegistered()){ 896 navigator.serviceWorker.addEventListener('message', (event) => { 897 console.log('Message from Service Worker:', event.data.msg, event.data.event); 898 }); 899 } 900 901 }else if(jsLoglevel === "DEBUG"){ 902 setLogLevel( ["log"] ); 903 904 }else if(jsLoglevel === "INFO"){ 905 setLogLevel( ["log", "debug"] ); 906 }else if(jsLoglevel === "WARN"){ 907 setLogLevel( ["log", "debug", "info"] ); 908 }else if(jsLoglevel === "ERROR"){ 909 setLogLevel( ["log", "debug", "info", "warn", "group", "groupEnd"] ); 910 } 911 912}); 913 914 915/** 916 * initializes all modules by calling init() on document.ready 917 */ 918jQuery(document).ready(function() { 919 de.his.modules.ModuleRegistry.initializeAll(); 920 window.allHISinOneModulesInitialized = true; 921}); 922 923use_package("de.his.modules"); 924 925de.his.modules.eventRegistry = new function(){ 926 var eventReg = {}; 927 var eventCounter = 0; // increased with each event registered 928 929 /** 930 * @param eventName - string 931 * @param func - function to be called when eventName is fired 932 * @param scope - object - optional 933 * @param destoryWhenFired - boolean - optional - default false : when the listener is fired once then it is destroyed 934 */ 935 this.addListener = function(eventName, func, scope, destoryWhenFired){ 936 if(!eventReg[eventName]){ 937 eventReg[eventName] = []; 938 } 939 940 if(func){ 941 console.log("registering event: ", eventName); 942 func.eventId = eventCounter++; // give the function an eventId 943 func.eventName = eventName; // register eventName too 944 console.log("listener registered for event", func.eventName, "with Id", func.eventId); 945 eventReg[eventName].push({ 946 func:func, 947 scope:scope, 948 destoryWhenFired:destoryWhenFired 949 }); 950 }else{ 951 console.warn("no function defined when adding a listener", eventName); 952 } 953 }; 954 955 // fire events by name across the application 956 this.fireEvent = function(eventName){ 957 console.log("fired event: ", eventName); 958 var events = eventReg[eventName] || [], 959 value; 960 for(var i = 0, l = events.length; i<l; i++){ 961 value = events[i]; 962 if(value && value.func){ 963 if(value.scope){ 964 value.func.apply(value.scope); 965 }else{ 966 value.func.call(); 967 } 968 969 if(value.destoryWhenFired === true){ 970 this.destroyListener(value.func); 971 } 972 } 973 974 } 975 }; 976 977 /** 978 * @param func = function itself 979 */ 980 this.destroyListener = function(func){ 981 // TODO: allow func to be an array of listeners 982 if(func){ 983 var eventName = func.eventName, 984 events = eventReg[eventName], //array of objects {} see addListener for more details 985 eventId = func.eventId; 986 console.log("destroy listener registered for event", eventName, "with Id", eventId); 987 // iterate all events for given eventName; 988 for(var i = 0, l = events.length; i<l; i++){ 989 //check to see if the iterated event has the same eventId as the parameter func 990 if(events[i].func.eventId == eventId){ 991 eventReg[eventName].splice(i, 1); 992 break; 993 } 994 } 995 } 996 }; 997 998 /** 999 * @param - eventName (string), destroys all listeners for the given eventName 1000 * beware! this could destroy system based events - use destroyListener() instead and destroy each listener at a time 1001 */ 1002 this.destroyEvent = function(eventName){ 1003 delete eventReg[eventName]; 1004 }; 1005 1006 1007 1008}; 1009 1010/** 1011 * Registry of modules that want to be initialized on startup and / or refreshed after aja
1011x requests. 1012 */ 1013de.his.modules.ModuleRegistry = new function() { 1014 var initModules = []; 1015 var ajaxRefreshModules = []; 1016 var ajaxStartModules = []; 1017 var asyncScripts = []; 1018 /** 1019 * check if initialized, see bug:109744 1020 */ 1021 var hasModuleIntialized = function(module){ 1022 return module.moduleIntialized; 1023 }; 1024 1025 this.registerModule = function(module) { 1026 initModules.push(module); 1027 return this; 1028 }; 1029 1030 this.registerAjaxRefreshModule = function(module) { 1031 ajaxRefreshModules.push(module); 1032 return this; 1033 }; 1034 1035 this.registerAjaxStartModule = function(module) { 1036 ajaxStartModules.push(module); 1037 return this; 1038 }; 1039 1040 this.initializeAll = function() { 1041 1042 callModules(initModules, 'init', "Error initialising HISinOne-JS-Module!"); 1043 }; 1044 1045 this.refreshAll = function(data) { 1046 // check if initialised, see bug:109744 1047 1048 if(initModules.length == 0){ 1049 console.warn("attempting refresh when no modules where initalized.... initalizing all modules"); 1050 this.initializeAll(); 1051 } 1052 1053 de.his.modules.ModuleRegistry.loadScriptsFromSpan(); 1054 1055 if(ajaxRefreshModules.length > 0){ 1056 // double check to see if any module hasn't loaded yet 1057 for(var i = 0, l = ajaxRefreshModules.length; i<l; i++){ 1058 if(!hasModuleIntialized(ajaxRefreshModules[i])){ 1059 console.warn("trying to refresh un-initialized module... init attempt first", ajaxRefreshModules[i]); 1060 callModules([ajaxRefreshModules[i]], 'init', "Error initialising HISinOne-JS-Module!"); 1061 } 1062 } 1063 } 1064 1065 callModules(ajaxRefreshModules, 'refresh', "Error refreshing HISinOne-JS-Module after AJAX request!", data); 1066 }; 1067 1068 this.indicateAjaxRequestStart = function() { 1069 callModules(ajaxStartModules, 'indicateAjaxRequestStart', "Error indicating ajax start to HISinOne-JS-Module!"); 1070 }; 1071 1072 var executeFunctionByName = function(functionName, context /*, args */) { 1073 console.log("execute function: "+functionName+ " on: ",context); 1074 var args = Array.prototype.slice.call(arguments, 2); 1075 var namespaces = functionName.split("."); 1076 var func = namespaces.pop(); 1077 try{ 1078 for (var i = 0; i < namespaces.length; i++) { 1079 context = context[namespaces[i]]; 1080 } 1081 return context[func].apply(context, args); 1082 } catch (e){ 1083 console.log("Could not init script. This might be ok. ", e); 1084 return false; 1085 } 1086 } 1087 1088 var getCallbackFunction = function(callbackObject){ 1089 var callback = function(response){ 1090 executeFunctionByName(callbackObject+".init", window); 1091 }; 1092 return callback; 1093 } 1094 1095 this.loadScript = function (url, callbackObject) { 1096 if(asyncScripts.indexOf(url) > -1){ 1097 // do not load script if it already has been loaded dynamically 1098 console.log("%s already loaded ", src); 1099 return; 1100 } 1101 loadScript(url,getCallbackFunction(callbackObject)); 1102 asyncScripts.push(url); 1103 }; 1104 1105 var loadScript = function (url, callback) { 1106 console.log("Async loading Script: "+ url); 1107 jQuery.ajax({ 1108 url: url, 1109 dataType: 'script', 1110 success: callback, 1111 async: true 1112 }); 1113 }; 1114 /** 1115 * DOES: 1116 * - searches for span.loadScript [data-library] [data-script] [data-callback-object] 1117 * - load them damn scripts dynamically into the site 1118 * - initialize them damn scripts on successful load by calling [data-callback-object].init() 1119 * - refresh and ajaxStart functions are working magically, those register automatically when the Module gets initialized. 1120 */ 1121 this.loadScriptsFromSpan = function(){ 1122 jQuery("span.loadScript[data-library][data-script][data-callback-object]").each(function(index, elem){ 1123 //console.log("initModules",initModules); 1124 1125 var library = jQuery(elem).data('library'); 1126 var script = jQuery(elem).data('script'); 1127 var refresh = jQuery(elem).data('refresh'); 1128 var callbackObject = jQuery(elem).data('callback-object'); 1129 var qisserverUrl = de.his.common.ContextInformation.get('context-path'); 1130 var url = qisserverUrl+"/javax.faces.resource/"+script+".xhtml?ln="+library; 1131 1132 var initModulesContain = function(moduleName){ 1133 // check if any loaded JS has the given module name 1134 var val = false;
1135 for ( var i = 0, length = initModules.length; i < length; i++) { 1136 if(initModules[i].moduleName === moduleName){ 1137 val = true; 1138 } 1139 } 1140 console.log("initModulesContain: "+ moduleName+" ? "+val); 1141 return val; 1142 } 1143 //console.log("trying to load script dynamically: "+ script, callbackObject); 1144 1145 if(asyncScripts.indexOf(script) > -1){ 1146 // do not load script if it already has been loaded dynamically 1147 //console.log("script already loaded "+ script); 1148 return; 1149 } 1150 asyncScripts.push(script); 1151 1152 if(initModulesContain(callbackObject)){ 1153 // Do not load module if JSF already included it 1154 console.log("script already loaded by JSF: "+ script); 1155 return; 1156 } 1157 1158 loadScript(url,getCallbackFunction(callbackObject)); 1159 }); 1160 }; 1161 class ModuleRegistryError extends Error { 1162 constructor(message, e){ 1163 super(message); 1164 this.name = this.constructor.name; 1165 this.stack = e.stack; 1166 } 1167 }; 1168 var callModules = function(modules, method, errorBaseMessage, data) { 1169 var errorList = []; 1170 console.group('ð§© HIS-Modules', method); 1171 for ( var i = 0, length = modules.length; i < length; i++) { 1172 console.group('ð¨' , modules[i].moduleName); 1173 try { 1174 modules[i][method](data); 1175 if(method == "init"){ 1176 modules[i].moduleIntialized = true; 1177 } 1178 } catch (e) { 1179 let errmsg = errorBaseMessage + " Src: "+modules[i].moduleName+"."+method+" (" + de.his.common.Util.toExceptionMessage(e) + ")"; 1180 console.error(errmsg, e); 1181 errorList.push( new ModuleRegistryError(errmsg, e)); 1182 } 1183 console.groupEnd(); 1184 } 1185 console.groupEnd(); 1186 if(errorList.length > 0){ 1187 console.group('â Errors in HIS-Modules:', method); 1188 for ( var i = 0, length = errorList.length; i < length; i++) { 1189 console.error(errorList[i].message, errorList[i].stack); 1190 } 1191 console.groupEnd(); 1192 } 1193 1194 }; 1195 1196}; 1197//Current workaround to warn users using android browser or other (not chrome) on a mobile device, that the browser is not supported 1198// Eventually to be removed 1199de.his.modules.mobile = new function(){ 1200 var me = this; 1201 de.his.modules.ModuleRegistry.registerModule(this); 1202 1203 this.moduleName = "de.his.modules.mobile"; 1204 1205 this.mobile = { 1206 /** 1207 * @property warnDelay 1208 * @type {Integer} days 1209 * @default 30 1210 */ 1211 warnDelay: 30, 1212 /** 1213 * @property _cacheKey 1214 * @private 1215 * @type {String} 1216 * @default "_his.mobile.browser.warning" 1217 */ 1218 _cacheKey: "_his.mobile.browser.warning", 1219 /** 1220 * check whether the user has been warned 1221 * @method hasBeenWarned 1222 * @return {Boolean} 1223 */ 1224 hasBeenWarned: function(){ 1225 var me = this; 1226 return !!me.getCacheValue( me._cacheKey ); //convert to boolean 1227 }, 1228 /** 1229 * @method getCacheValue 1230 * @returns 1231 */ 1232 getCacheValue: function(){ 1233 var me = this; 1234 if(typeof window.localStorage !== 'undefined'){ 1235 return window.localStorage.getItem( me._cacheKey ); 1236 } else { 1237 return 0; 1238 } 1239 1240 }, 1241 /** 1242 * checks whether the warn message is due to show itself again 1243 * @method hasWarningExpired 1244 * @return {Boolean} 1245 */ 1246 hasWarningExpired: function(){ 1247 var me = this, 1248 currentTime = new Date().getTime(); 1249 if(!me.hasBeenWarned() || (currentTime > me.getCacheValue()) ){ 1250 return true; 1251 } 1252 return false; 1253 }, 1254 /** 1255 * sets the cache key that the user has been warned 1256 * @method setWarning 1257 */ 1258 setWarning: function(){ 1259 var me = this, 1260 timestamp = new Date().getTime() + (me.warnDelay * 24 * 60 * 60 * 1000); //30 days from now 1261 return window.localStorage.setItem( me._cacheKey, timestamp ); 1262 }, 1263 /** 1264 * @method init 1265 */ 1266 init: function(){ 1267 var me = this, 1268 device = window.device; 1269 1270 if(typeof localStorage !== "undefined" && device){ 1271 var storage = window.localStorage; 1272 if(device.android() && !de.his.common.browser.isChrome()){ 1273 if( me.hasWarningExpired() ){ 1274 me.setWarning(); 1275 alert("Bitte verwenden Sie Google Chrome als Standardbrowser für diese Webseite. <br /> Please use Google Chrome as standard browser for this webpage."); 1276 } 1277 } 1278 } 1279 } 1280 }; 1281 1282 this.init = function(){ 1283 return me.mobile.init(); 1284 }; 1285 1286};/** 1287 * @Author: masala, wahrendorff 1288 * This is for non-module specific fixes/features etc 1289 * TODO: 1290 */ 1291use_package("de.his.modules"); 1292de.his.modules.GeneralFixes = new function() { 1293 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 1294 1295 this.moduleName = "de.his.modules.GeneralFixes"; 1296 1297 this.init = function() { 1298 de.his.modules.GeneralFixes.fixTablePagerMaxValidation(); 1299 //de.his.modules.GeneralFixes.fixCheckboxesWithLeftLabels(); 1300 //de.his.modules.GeneralFixes.showCheckboxesWithoutLabelsWorkaround(); 1301 fixTomahawkJSPopupPosition(); 1302 handleInfoboxHide(); 1303 handleUserQueryFocusTrap(); 1304 //handleTextareaCharCounter(); 1305 resizeTextareaOnExpand(); 1306 hideFlagIcon(); 1307 } 1308 this.refresh = function() { 1309 de.his.modules.GeneralFixes.init(); 1310 } 1311 1312 var handleTextareaCharCounter = function(){ 1313 document.querySelectorAll('textarea[maxlength]').forEach(textarea => { 1314 const max = parseInt(textarea.getAttribute('maxlength'), 10); 1315 if (isNaN(max)) return; 1316 1317 const parent = textarea.parentElement; 1318 const isSummer = parent && parent.classList.contains('summernote-container'); 1319 const label = document.querySelector('label[for="' + textarea.id + '"]'); 1320 // Erzeuge den Counter 1321 const counter = document.createElement( label !== null ? 'div' : 'span'); 1322 if (isSummer) { 1323 1324 if(label){ 1325 counter.style.marginLeft = '0.5em'; 1326 counter.style.fontWeight = 'normal'; 1327 label.appendChild(counter); 1328 } else { 1329 counter.style.marginTop = '0.5em'; 1330 counter.style.display = 'block';
1331 parent.prepend(counter); 1332 } 1333 } else { 1334 if (!label) return; 1335 counter.style.marginLeft = '0.5em'; 1336 label.appendChild(counter); 1337 } 1338 1339 function updateCounter() { 1340 /*let len = textarea.value.length; 1341 if (len > max) len = max;*/ 1342 counter.textContent = '(max. ' + max +' Zeichen)'; 1343 counter.style.color = (len >= max ? 'red' : ''); 1344 } 1345 1346 // Listener auf das eigentliche <textarea> 1347 //textarea.addEventListener('input', updateCounter); 1348 //textarea.addEventListener('change', updateCounter); 1349 1350 // Wenn es ein Summernote-Container ist, auch auf den Editor selbst hören 1351 /*if (isSummer) { 1352 const editable = parent.querySelector('.note-editable'); 1353 if (editable) { 1354 editable.addEventListener('input', updateCounter); 1355 } 1356 }*/ 1357 1358 updateCounter(); 1359 }); 1360 } 1361 var handleUserQueryFocusTrap = function() { 1362 var overlay = jQuery(".overlay.modal:visible").last(); 1363 1364 // Legacy Accessibility workaround for old callbacks 1365 // focus old callback, when there is no overlay. 1366 1367 //Lagacy handling with overlays is in de.his.component.overlay.js 1368 var callBackContainer = jQuery('div[data-infobox-type="Query"]:visible'); 1369 if (callBackContainer.length > 0 && overlay.length == 0) { 1370 var okButton = callBackContainer.find('.ok-button-behavior'); 1371 var cancelButton = callBackContainer.find('.cancel-button-behavior'); 1372 console.log("Overlay: Callback exists, focus callback"); 1373 callBackContainer.find(':focusable').first().attr("firstmodalfield", true); 1374 callBackContainer.find(':focusable').last().attr("lastmodalfield", true); 1375 /** set inert #299063 */ 1376 //document.querySelectorAll("[tabindex], input:not([type=hidden]), button, a, textarea, label").forEach( function(element,key,parent) { 1377 // /** erkenne ob element parent von .overlayContainer oder anders herum und spare aus. */ 1378 // /** ignoriere elemente ohne offset (versteckt oder hidden oder anderweitig nicht interagierbar) */ 1379 // 1380 // if (!element.contains(callBackContainer[0]) && !callBackContainer[0].contains(element) && element.offsetParent !== null ) { 1381 // element.setAttribute('inert','inert'); 1382 // console.log('set inert',key, element); 1383 // } 1384 //}); 1385 var removeFocusTrap = function(){ 1386 console.log("Overlay: Remove focus Trap"); 1387 jQuery("[firstfocusableelement='true']").off("focus"); 1388 jQuery("[lastfocusableelement='true']").off("focus"); 1389 /** remove inert #299063 */ 1390 //document.querySelectorAll("*[inert]").forEach( function(element,key,parent) { 1391 // element.removeAttribute('inert'); 1392 //}); 1393 } 1394 okButton.on('click', removeFocusTrap); 1395 cancelButton.on('click', removeFocusTrap); 1396 // handle Tab Key in userQuery 1397 jQuery('div[data-infobox-type="Query"]:visible').last().bind('keydown', function(e) { 1398 console.log("bind userQuery Tab key."); 1399 if (e.keyCode == 9) { 1400 // 9 is tab key 1401 if (e.shiftKey) { 1402 // tab and Shift pressed... do anything here... 1403 if (jQuery(document.activeElement).attr("firstmodalfield") == "true") { 1404 e.preventDefault(); 1405 jQuery(this).find("[lastmodalfield=true]").focus(); 1406 } 1407 return; 1408 } 1409 // tab without shift is pressed 1410 if (jQuery(document.activeElement).attr("lastmodalfield") == "true") { 1411 e.preventDefault(); 1412 jQuery(this).find("[firstmodalfield=true]").first().focus(); 1413 } 1414 } 1415 }); 1416 } 1417 1418 }; 1419 1420 var handleInfoboxHide = function () { 1421 var handleClicksAndPropagation = function(e,infoboxCloseBtn){ 1422 // stop bubbling and propagation, cause burgermenu would close again when infobox is opened and automatically closed upon menu call. 1423 infoboxCloseBtn.on('click', function(){ 1424 e.stopPropagation(); 1425 return false; 1426 }); 1427 infoboxCloseBtn.click(); 1428 infoboxCloseBtn.off('click'); 1429 } 1430 // hide infobox when user clicks somewhere else in the page 1431 // caveeat: does not work when user clicks on iframes. 1432 // does not propagade click events on closing infoboxes (due to problems with burgermenu) 1433 //jQuery(document).off('click'); 1434 if(jQuery("html").data('infoboxHandlerInitialized') === 'true'){ 1435 return; 1436 } 1437 jQuery(document).on("click", function (e) { 1438 jQuery("html").data('infoboxHandlerInitialized','true'); 1439 1440 // fix for #322099, check if selectonemenu item triggered 1441 if(jQuery(e.target).hasClass("loadContent-behavior") || jQuery(e.target).hasClass("ui-selectonemenu-item")){ 1442 // do not close Infobox on automated loading Button clicks or selectbox change. 1443 return; 1444 } 1445 //console.log("clicked somewhere, target is: ", jQuery(e.target)); 1446 //console.log("clicked somewhere, find collapsibleHeaderActionFrom: ", jQuery(e.target).closest('#collapsibleHeaderActionFrom')); 1447 // close all visible portalinfoboxes of service Header on elsewhere click 1448 if (!jQuery(e.target).closest("[id$='collapsibleHeaderActionFrom']").length && !jQuery(e.target).closest('.confirm_infobox').length) { 1449 //[id$='txtTitle'] 1450 if (jQuery('#infoboxElement') && jQuery('#infoboxElement').find(".infoboxContainer").html()) { 1451 //console.log("close infoboxElement:visible"); 1452 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:infobox\\:close']")); 1453 } 1454 if (jQuery('#userInformationCenterElement') && jQuery('#userInformationCenterElement').find(".infoboxContainer").html()) { 1455 //console.log("close userInformationCenterElement:visible"); 1456 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:userInformationCenter\\:close']")); 1457 } 1458 if (jQuery('#systemInformationCenterElement') && jQuery('#systemInformationCenterElement').find(".infoboxContainer").html()) { 1459 //console.log("close systemInformationCenterElement:visible"); 1460 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:systemInformationCenter\\:close']")); 1461 } 1462 if (jQuery('#myJobs') && jQuery('#myJobs').find(".infoboxContainer").html()) { 1463 //console.log("close myJobs:visible"); 1464 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:myJobsInfobox\\:myJobsInfoBox\\
1464:close']")); 1465 } 1466 } 1467 1468 var clickedLink = jQuery(e.target).closest('a'); 1469 //close all other portalinfoboxes on portalinfobox open click 1470 if(clickedLink && typeof jQuery(clickedLink).attr("id") !== 'undefined' && jQuery(clickedLink).attr("id").endsWith("open") && jQuery(clickedLink).attr("id").startsWith("collapsibleHeaderActionFrom")){ 1471 console.log("click portalinfobox open", clickedLink); 1472 if (jQuery('#infoboxElement') && jQuery('#infoboxElement').find(".infoboxContainer").html() && !jQuery(clickedLink).attr("id").includes("infobox")) { 1473 //console.log("close infoboxElement:visible"); 1474 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:infobox\\:close']")); 1475 } 1476 if (jQuery('#userInformationCenterElement') && jQuery('#userInformationCenterElement').find(".infoboxContainer").html() && !jQuery(clickedLink).attr("id").includes("userInformationCenter")) { 1477 //console.log("close userInformationCenterElement:visible"); 1478 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:userInformationCenter\\:close']")); 1479 } 1480 if (jQuery('#systemInformationCenterElement') && jQuery('#systemInformationCenterElement').find(".infoboxContainer").html() && !jQuery(clickedLink).attr("id").includes("systemInformationCenter")) { 1481 //console.log("close systemInformationCenterElement:visible"); 1482 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:systemInformationCenter\\:close']")); 1483 } 1484 if (jQuery('#myJobs') && jQuery('#myJobs').find(".infoboxContainer").html() && !jQuery(clickedLink).attr("id").includes("myJobsInfobox")) { 1485 //console.log("close myJobs:visible"); 1486 handleClicksAndPropagation(e,jQuery("[id$='collapsibleHeaderActionFrom\\:myJobsInfobox\\:myJobsInfoBox\\:close']")); 1487 } 1488 } 1489 }); 1490 }; 1491 1492 var fixTomahawkJSPopupPosition = function(){ 1493 // we do not want to fix the tomahawk directly 1494 // so we do it here 1495 var popupElems = jQuery('.metadata_popup'); 1496 if(popupElems.length>0){ 1497 var observer = new MutationObserver(function(mutations) { 1498 1499 mutations.forEach(function(mutationRecord) { 1500 var popupElem = mutationRecord.target; 1501 var x = popupElem.style.left.replace('px',''); 1502 // correct outer document limits. 1503 if (Number(popupElem.offsetWidth) + Number(x) > document.body.clientWidth){ 1504 console.log("Correct position of datdaDictPopup"); 1505 x = document.body.clientWidth - popupElem.offsetWidth; 1506 popupElem.style.left = "" + x + "px"; 1507 } 1508 }); 1509 }); 1510 1511 popupElems.each(function(index, elem){ 1512 observer.observe(elem, { attributes : true, attributeFilter : ['style'] }); 1513 }); 1514 } 1515 } 1516 1517 /** 1518 * TODO: 1519 * - should be removed when Umstellung is finished 1520 * Otherwise combine loops from here and fixCheckboxesWithLeftLabels for better performance 1521 */ 1522 /*this.showCheckboxesWithoutLabelsWorkaround = function(){ 1523 jQuery('input[type="checkbox"]').each(function(){ 1524 if(typeof jQuery(this).attr('id') === 'undefined'){ 1525 return; 1526 } 1527 var checkboxId = de.his.common.Util.toJQueryId(jQuery(this).attr('id')); 1528 if(!jQuery('label[for="'+checkboxId+'"]').length && jQuery(this).is(":visible")){ 1529 jQuery(this).css('opacity','1'); 1530 jQuery(this).wrap("<div class='thisCheckboxHasNoLabelError' title='Checkbox muss per id/for mit einem Label verknüpft sein. Bei Bedarf an einem unsichtbaren Label bitte barrierefreie Lösung aus dem Styleguide unter Checkboxen verwenden.'></div>"); 1531 } 1532 1533 jQuery(this).on('focus',function(e){ 1534 jQuery(this).addClass("checkbox-focus"); 1535 }); 1536 jQuery(this).on('blur',function(e){ 1537 jQuery(this).removeClass("checkbox-focus"); 1538 }); 1539 1540 }); 1541 };*/ 1542 1543 /* 1544 * DONE: 1545 * select checkboxes with prev label and id = for 1546 * apply style 1547 * add change handler 1548 */ 1549 /*this.fixCheckboxesWithLeftLabels = function(){ 1550 1551 // select checkboxes 1552 jQuery('input[type="checkbox"]').each(function(){ 1553 if(jQuery(this).data('checkboxified') == 'true'){ 1554 return true; 1555 } else{ 1556 jQuery(this).data('checkboxified', 'true'); 1557 } 1558 1559 // check if previous element is a label and belongs to the checkbox 1560 var checkboxId = jQuery(this).attr('id'); 1561 var labelElem = jQuery(this).prev(); 1562 if(labelElem.hasClass("labelrequired")){ 1563 labelElem = labelElem.find('label'); 1564 } 1565 //console.log("labelElem:", labelElem)
1566 if(labelElem.is('label') && labelElem.attr('for') == checkboxId){ 1567 // apply magic 1568 if(typeof jQuery(this).attr('checked') === 'undefined'){ 1569 labelElem.addClass("checkbox-unchecked"); 1570 }else{ 1571 labelElem.addClass("checkbox-checked"); 1572 } 1573 if(typeof jQuery(this).attr('disabled') !== 'undefined'){ 1574 labelElem.addClass("checkbox-disabled"); 1575 } 1576 1577 jQuery(this).on('focus',function(e){ 1578 labelElem.addClass("checkbox-focus"); 1579 }); 1580 jQuery(this).on('blur',function(e){ 1581 labelElem.removeClass("checkbox-focus"); 1582 }); 1583 1584 // add changehandler to update checkbox image 1585 jQuery(this).on('change',function(e){ 1586 if(e.target.checked){ 1587 labelElem.removeClass("checkbox-unchecked").addClass("checkbox-checked"); 1588 }else{ 1589 labelElem.removeClass("checkbox-checked").addClass("checkbox-unchecked"); 1590 } 1591 }); 1592 } 1593 1594 }); 1595 };*/ 1596 1597 function hideFlagIcon(){ 1598 var flagIcon = jQuery(".langLabel"); 1599 if (flagIcon.length === 0) { 1600 // Keine Flaggen gefunden, nichts tun 1601 return; 1602 } 1603 1604 else{ 1605 // Flaggen gefunden, dann aria-hidden setzen 1606 flagIcon.attr("aria-hidden", "true"); 1607 console.log("Found translation field"); 1608 } 1609 } 1610 1611 this.fixTablePagerMaxValidation = function(){ 1612 //Temp Fix for: #114282 1613 //Stop the user from entering a number higher than 300 in the pager (tables) 1614 jQuery("input.pagerInput_behaviour").keyup(function(){ 1615 var input = jQuery(this), 1616 val = parseInt(input.val()), 1617 maxInt = 300; //TODO: make 300 variable/configurable 1618 1619 console.log("val:"+val); 1620 var err = function(){ 1621 //TODO: get the text from messages (i18n texts) 1622 //console.log("set input to 300"); 1623 //alert("Max: 0-300"); // creates Problems on second execution (alert box is out of pageview, Background curtain cannot be removed) 1624 input.val(maxInt); 1625 }; 1626 1627 if(val != NaN){ 1628 if(val > maxInt || val < 0){ 1629 //console.log("if call err"); 1630 err(); 1631 } 1632 }else{ 1633 //console.log("else call err"); 1634 err(); 1635 } 1636 }); 1637 } 1638 1639 var resizeTextareaOnExpand = function () { 1640 const allTextareasExpand = document.querySelectorAll('textarea.expand'); 1641 allTextareasExpand.forEach(function (textarea) { 1642 if (textarea.tagName.toLowerCase() === 'textarea') { 1643 let originalHeight = null; 1644 textarea.addEventListener('focus', function () { 1645 originalHeight = textarea.style.height || window.getComputedStyle(textarea).height; 1646 requestAnimationFrame(() => { 1647 textarea.style.height = '10em'; 1648 textarea.style.overflow = 'auto'; 1649 }); 1650 }); 1651 textarea.addEventListener('blur', function () { 1652 if (originalHeight) { 1653 textarea.style.height = originalHeight; 1654 } else { 1655 textarea.style.removeProperty('height'); 1656 } 1657 textarea.style.overflow = 'hidden'; 1658 }); 1659 } 1660 }); 1661 }; 1662};use_package("de.his.portal"); 1663 1664/** 1665 * injects userinformation for autologin login 1666 */ 1667de.his.portal.AutoLogin = new function() { 1668 de.his.modules.ModuleRegistry.registerModule(this); // .registerAjaxRefreshModule(this); 1669 1670 this.moduleName = "de.his.portal.AutoLogin"; 1671 1672 this.init = function() { 1673 console.log("autologinAllowed: " + de.his.common.ContextInformation.get('autologinAllowed')); 1674 console.log("userLoggedIn: " + de.his.common.ContextInformation.get('userLoggedIn')); 1675 1676 if(de.his.common.ContextInformation.get('autologinAllowed') && !de.his.common.ContextInformation.get('userLoggedIn')){ 1677 injectUserInfoIntoLoginForm(); 1678 } 1679 }; 1680 1681 var injectUserInfoIntoLoginForm = function (){ 1682 console.log("injectUserInfoIntoLoginForm start"); 1683 jQuery("input[name='userInfo']").val(JSON.stringify(getUserInformations())); 1684 } 1685 1686 var getTimeZone = function(){ 1687 1688 var d = new Date(); 1689 return d.getTimezoneOffset(); 1690 } 1691 1692 var getScreenInfos = function() { 1693 //Unter FF kann das Screen-Objekt nicht direkt weiter gegeben werden 1694 var screen = {}; 1695 screen["height"] = window.screen.height;
1696 screen["width"] = window.screen.width; 1697 screen["pixelDepth"] = window.screen.pixelDepth; 1698 return screen; 1699 }; 1700 1701 var getClientInformation = function() { 1702 var clientInformation = {}; 1703 if (window) { 1704 if (window.clientInformation) { 1705 if (window.clientInformation.appCodeName) { 1706 clientInformation["appCodeName"] = window.clientInformation.appCodeName; 1707 } 1708 if (window.clientInformation.appName) { 1709 clientInformation["appName"] = window.clientInformation.appName; 1710 } 1711 if (window.clientInformation.cpuClass) { 1712 clientInformation["cpuClass"] = window.clientInformation.cpuClass; 1713 } 1714 if (window.clientInformation.platform) { 1715 clientInformation["platform"] = window.clientInformation.platform; 1716 } 1717 } 1718 if (window.navigator) { 1719 if (window.navigator.oscpu) { 1720 clientInformation["oscpu"] = window.navigator.oscpu; 1721 } 1722 } 1723 } 1724 return clientInformation; 1725 1726 } 1727 1728 var getUserInformations = function() { 1729 var userInfo = {}; 1730 userInfo["test"] = "test"; 1731 userInfo["screen"] = getScreenInfos(); 1732 userInfo["timeZone"] = getTimeZone(); 1733 userInfo["clientInformation"] = getClientInformation(); 1734 return userInfo; 1735 1736 }; 1737 1738// this.refresh = function() { 1739// this.init(); 1740// }; 1741}; 1742use_package("de.his.serviceworker"); 1743/** 1744 * Handles ServiceWorker registration 1745 */ 1746de.his.serviceworker.registration = new function() { 1747 de.his.modules.ModuleRegistry 1748 .registerModule(this); 1749 this.moduleName = "de.his.serviceworker.registration"; 1750 1751 this.serviceWorkerRegistered = false; 1752 this.swRegistration = null; 1753 1754 1755 // map class instance to self, since the context of "this" can change. 1756 var self = this; 1757 1758 this.init = function() { 1759 // disable Buttons if push is not configured or serviceWorkers are not supported 1760 if(!('serviceWorker' in navigator)){ 1761 if(!('serviceWorker' in navigator)){ 1762 console.error('Service workers aren\'t supported in this browser.'); 1763 } 1764 return; 1765 } 1766 1767 // check if the service worker is registered 1768 self.serviceWorkerRegistered = self.isServiceWorkerRegistered(); 1769 1770 //console.log("sw: ", navigator); 1771 if(self.serviceWorkerRegistered){ 1772// console.log("sw: ", navigator.serviceWorker); 1773// console.log("sw: ", navigator.serviceWorker.controller); 1774 } else { 1775 self.registerServiceWorker(); 1776 } 1777 }; 1778 1779 this.registerServiceWorker = function(){ 1780 if(self.serviceWorkerRegistered && self.swRegistration != null){ 1781 console.log('ServiceWorker already registered'); 1782 de.his.modules.eventRegistry.fireEvent("serviceWorkerRegistered"); 1783 return self.swRegistration; 1784 } 1785 1786 return navigator.serviceWorker.register(de.his.common.ContextInformation.get('context-path') + "/serviceworker.js", 1787 { scope: de.his.common.ContextInformation.get('context-path') + "/", updateViaCache: 'all'}) 1788 .then(function(registration) { 1789 self.swRegistration = registration; 1790 de.his.modules.eventRegistry.fireEvent("serviceWorkerRegistered"); 1791 console.log('Service worker successfully registered.'); 1792 return registration; 1793 }, function(err) { 1794 // registration failed :( 1795 console.log('ServiceWorker registration failed: ', err); 1796 }).catch(function(err) { 1797 console.error('Unable to register service worker.', err); 1798 }); 1799 }; 1800 1801 this.unregisterServiceWorker = function(){ 1802 navigator.serviceWorker.getRegistrations().then(function(r) { 1803 console.log('Removing ServiceWorker.'); 1804 self.swRegistration = null; 1805 return Promise.all(r.map(function(reg){reg.unregister()})); 1806 }).catch(function(err){ 1807 console.log('Removing ServiceWorker failed with error: ', err); 1808 }); 1809 }; 1810 1811 this.isServiceWorkerRegistered = function(){ 1812 if ('serviceWorker' in navigator && navigator.serviceWorker !== null && typeof navigator.serviceWorker !== 'undefined') { 1813 if('controller' in navigator.serviceWorker && navigator.serviceWorker.controller !== null && typeof navigator.serviceWorker.controller !== 'undefined'){ 1814 if( navigator.serviceWorker.controller.state === 'activated'){ 1815 return true; 1816 } 1817 }else{ 1818 return false;
1819 } 1820 } else{ 1821 return false; 1822 } 1823 }; 1824}; 1825use_package("de.his.pwa"); 1826/** 1827 * Handles ServiceWorker registration 1828 */ 1829de.his.pwa.install = new function() { 1830 de.his.modules.ModuleRegistry 1831 .registerModule(this); 1832 1833 this.moduleName = "de.his.pwa.install"; 1834 1835 // map class instance to self, since the context of "this" can change. 1836 var self = this; 1837 var deferredPrompt; 1838 var btnContainer = jQuery("#pwaInstallContainer"); 1839 var installBtn = jQuery("#pwaInstallBtn"); 1840 var dismissBtn = jQuery("#dismissPwaInstallBtn"); 1841 1842 this.init = function() { 1843 window.addEventListener('beforeinstallprompt', (e) => { 1844 console.log("beforeinstallprompt event triggered"); 1845 // Prevent Chrome 67 and earlier from automatically showing the prompt 1846 e.preventDefault(); 1847 1848 if(typeof localStorage.getItem("pwa_install_dismissed") === 'undefined' 1849 || localStorage.getItem("pwa_install_dismissed") === null 1850 || (Date.now() - localStorage.getItem("pwa_install_dismissed")) > 2592000000 ){ // 30 Tage 1851 console.log("show install prompt"); 1852 // Stash the event so it can be triggered later. 1853 deferredPrompt = e; 1854 // show the install button Container 1855 btnContainer.css("display",""); 1856 } else { 1857 // day in ms: 86400000 1858 var time2NextInstall = (2592000000 - (Date.now() - localStorage.getItem("pwa_install_dismissed")))/86400000; 1859 console.log("time to new install prompt: "+time2NextInstall +" days."); 1860 } 1861 1862 }); 1863 1864 installBtn.on('click', (e) => { 1865 // hide user interface that shows install button 1866 btnContainer.css("display","none"); 1867 // Show the prompt 1868 deferredPrompt.prompt(); 1869 deferredPrompt.userChoice.then((choiceResult) => { 1870 if (choiceResult.outcome === 'accepted') { 1871 console.log('User accepted the A2HS prompt'); 1872 } else { 1873 console.log('User dismissed the A2HS prompt'); 1874 } 1875 deferredPrompt = null; 1876 }); 1877 }); 1878 dismissBtn.on('click', (e) => { 1879 // hide user interface that shows install button 1880 btnContainer.css("display","none"); 1881 1882 deferredPrompt = null; 1883 1884 // Set curretn timestamp to show dialog again in 30 days 1885 localStorage.setItem("pwa_install_dismissed", Date.now()); 1886 1887 }); 1888 1889 1890 }; 1891 1892 1893 1894}; 1895/** 1896 * Setzt den Focus auf das erste Element im content frame, das mit der Style-Klasse 'autofocus-behavior' gekennzeichnet ist. 1897 */ 1898de.his.modules.Autofocus = new function() { 1899 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 1900 1901 this.moduleName = "de.his.modules.Autofocus"; 1902 1903 this.init = function() { 1904 console.log("autofocus start"); 1905 manageFocus(); 1906 leftMenuClickHandler(); 1907 manageFormStepFocus(); 1908 }; 1909 this.refresh = function() { 1910 // Nur neu initialisiren, wenn es sich um eine User-Query handelt. 1911 if( jQuery('.messages-infobox').data('infobox-type') == 'Query') { 1912 this.init(); 1913 } 1914 }; 1915 1916 this.ajaxCallback = function(data) { 1917 console.log("AjaxCallback: " + data.status); //while ,data.status can be 1)"begin" 2)"complete" 3)"success" 1918 if (data.status === 'success') { 1919 manageFocus(); 1920 } 1921 1922 }; 1923 1924 var leftMenuClickHandler = function(){ 1925 // Werden Untermenüpunkte im linken Navigationsmenü geklickt, soll auf der neuen Seite die Ãberschrift fokussiert werden. 1926 jQuery('a.linkNavigationSecond').click(function(e) { 1927 if (window.localStorage) { 1928 localStorage.setItem("leftMenuActivePageElementId", this.id); 1929 } 1930 }); 1931 1932 // Wenn ein SubMenu Link geklickt wurde, soll der Link nach dem Ãffnen wieder fokussiert werden. 1933 jQuery('a.linkNavigationFirst').click(function(e) { 1934 if (window.localStorage) { 1935 localStorage.setItem("leftSubMenuActivePageElementId", this.id); 1936 } 1937 }); 1938 }; 1939 1940 var manageFocus = function(){ 1941 var parentSelector = "#contentFrame"; 1942 // wenn messages-infobox angezeigt wird, setze den Fokus auf jeden Fall im in die Meldung 1943 if(jQuery(".messages_infobox_header").length > 0 && !jQuery(".messages-infobox").hasClass("hideWhenClosed")){ 1944 //de.his.modules.messagesInfobox manage focus by itself 1945 return; 1946 } 1947 // wenn overlay offen setze den focus auf jeden Fall im overlay 1948 if(jQuery("div.overlay.modal").length > 0){ 1949 console.log("overlay found, *overlay.js calls setFocusAutomatically...") 1950 parentSelector = "div.overlay.modal"; 1951 1952 // no left menu with overlay 1953 //manageLeftMenuFocus(); 1954 return; 1955 } 1956 1957 if (jQuery(parentSelector+" .autofocus-behavior").filter(':visible').length || jQuery(parentSelector+" .autofocus-behavior-focused").filter(':visible').length) { 1958 de.his.modules.Autofocus.setFocusAutomatically(parentSelector); 1959 1960 } else { 1961 manageLeftMenuFocus(); 1962 } 1963 }; 1964 1965 /** 1966 * Set focus on first element with autofocus-behavior or first focusable element in container element 1967 */ 1968 this.setFocusAutomatically = function(containerElementSelector){ 1969 1970 var element = jQuery(containerElementSelector); 1971 1972 if (jQuery(containerElementSelector+" .autofocus-behavior").filter(':visible').length) { 1973 if(!jQuery(containerElementSelector+" .autofocus-behavior").filter(':visible').first()[0].classList.contains('wizard-step__title')){ 1974 element = jQuery(containerElementSelector+" .autofocus-behavior").filter(':visible').first(); 1975 } 1976 } 1977 1978 // wenn klasse autofocus-behavior-focused gesetzt 1979 if (jQuery(containerElementSelector+" .autofocus-behavior-focused").filter(':visible').length) { 1980 // Zum fokussierbaren Element scrollen 1981 element = jQuery(containerElementSelector+" .autofocus-behavior-focused"); 1982 // letzte geänderte Element wenn vorhanden und localstorage gesetzt ist 1983 if (localStorage.lastChangedField !== undefined && jQuery('*[id="'+localStorage.getItem('lastChangedField')+'"]').length !== 0 ) { 1984 element = jQuery('*[id="'+localStorage.getItem('lastChangedField')+'"]').filter(':visible'); 1985 } else if(localStorage.lastChangedField) { 1986 localStorage.removeItem('lastChangedField'); 1987 } 1988 } 1989 1990 console.log("autofocus found autofocus-behavior class. Element:",element); 1991 1992 // Styleklasse könnte auf einem Div liegen, deshalb suchen wir in diesem nach relevanten Elementen. Das ist bspw. bei selectOneMenu der Fall! 1993 var getFocusableElement = function(element){ 1994 //beachten, dass fokussierbare elemente einen noAutofocus parent haben können. 1995 var focusableElements = jQuery(element).find('a[href], area[href], input, select, textarea, button, iframe, object, embed, *[tabindex], *[contenteditable], .iconfont-error_mono').not('[tabindex=-1], [disabled], :hidden, .titleCollapseArea,.fieldsetHeadlineCollapseButton,.collapsableFieldsetHelpButton,.noAutofocus'); 1996 console.log("focusableElements",focusableElements); 1997 var elemntToFocus; 1998 focusableElements.each(function(index,elem){ 1999 2000 if(!jQuery(elem).parents('.noAutofocus').length){ 2001 elemntToFocus = jQuery(elem); 2002 return false;
2003 } 2004 }); 2005 console.log("elemntToFocus",elemntToFocus); 2006 return elemntToFocus; 2007 }; 2008 var focusableElement = getFocusableElement(element); 2009 2010 //var focusableElement = jQuery(element).find('a[href], area[href], input, select, textarea, button, iframe, object, embed, *[tabindex], *[contenteditable]').not('[tabindex=-1], [disabled], :hidden, .titleCollapseArea,.fieldsetHeadlineCollapseButton,.collapsableFieldsetHelpButton,.noAutofocus'); 2011 2012 if (focusableElement && focusableElement.length) { 2013 console.log("autofocus for focusable "+focusableElement.attr('id')); 2014 2015 /** 2016 * PRIMEFACES PATCH START 2017 */ 2018 // element is correct for this, its a div which has the autofocus behaviour class, focus is getting set to included input. 2019 if(element.hasClass("ui-selectonemenu") || focusableElement.parent().hasClass("ui-helper-hidden-accessible")){ 2020 setTimeout(function(){ 2021 focusableElement.focus(); 2022 },100); 2023 } else { 2024 focusableElement.focus(); 2025 } 2026 /** 2027 * PRIMEFACES PATCH ENDE 2028 */ 2029 jQuery('input[name="activePageElementId"]').attr('value', focusableElement.first().attr('id')); 2030 de.his.common.ContextInformation.set("active-page-element-id", focusableElement.first().attr('id')); 2031 } else { 2032 console.log("autofocus for "+element.attr('id')); 2033 /** 2034 * PRIMEFACES PATCH START 2035 */ 2036 if(element.hasClass("ui-selectonemenu") || element.hasClass("callBackButton")){ 2037 setTimeout(function(){ 2038 element.focus(); 2039 },100); 2040 } else { 2041 element.focus(); 2042 } 2043 /** 2044 * PRIMEFACES PATCH ENDE 2045 */ 2046 2047 jQuery('input[name="activePageElementId"]').attr('value', element.attr('id')); 2048 de.his.common.ContextInformation.set("active-page-element-id", element.attr('id')); 2049 } 2050 // scroll to autofocus object if needed 2051 var scrollTop = jQuery(document).scrollTop(); 2052 var windowHeight = jQuery(window).height(); 2053 var elementOffset = element.offset().top; 2054 2055 if ((scrollTop == 0 && elementOffset < windowHeight) || jQuery("div.overlay.modal").length || element.hasClass("callBackButton")) { 2056 // Element ist sehr weit oben und daher sichtbar oder overlay. scrollen nicht notwendig 2057 return; 2058 } 2059 2060 // Beim scrollen einen evtl. vorhandenen ScrollWithMe Container beachten. 2061 var scrollWithMe = jQuery('.scrollWithMe'); 2062 if (scrollWithMe.length > 0) { 2063 var newOffsetTop = elementOffset - scrollWithMe.offset().top; 2064 if (newOffsetTop < 0) { 2065 newOffsetTop = 0; 2066 } 2067 elementOffset = newOffsetTop; 2068 } 2069 2070 //Scrollen mit einer Animation zum Element. 2071 jQuery('html, body').animate({ 2072 scrollTop: elementOffset 2073 }, 1000); 2074 2075 }; 2076 2077 /** 2078 * Wird im linken Navigationsmenü ein Link geklickt, wird dessen Id in die LocalStorage geschrieben. Nach dem öffnen des Links 2079 * wird diese id wieder ausgelesen und der Fokus entsprechend gesetzt. 2080 * Wenn ein SubMenu Link geklickt wurde, soll der Fokus auf dem geklickten Link bleiben. 2081 * Wenn ein Untermenü Link geklickt wurde, soll der Fokus auf die Ãberschrift der Seite gesetzt werden. 2082 * 2083 */ 2084 var manageLeftMenuFocus = function() { 2085 console.log("autofocus manage left menu."); 2086 if (window.localStorage) { 2087 var leftMenuActivePageElementId = localStorage.getItem("leftMenuActivePageElementId"); 2088 var leftSubMenuActivePageElementId = localStorage.getItem("leftSubMenuActivePageElementId"); 2089// console.log("leftMenuActivePageElementId "+leftMenuActivePageElementId ); 2090// console.log("leftSubMenuActivePageElementId "+leftSubMenuActivePageElementId ); 2091 if (leftSubMenuActivePageElementId) { 2092 var subMenuLink = document.getElementById(leftSubMenuActivePageElementId); 2093 if (subMenuLink) { 2094 subMenuLink.focus(); 2095 } 2096 } 2097 2098 if (leftMenuActivePageElementId) { 2099 jQuery("#hisinoneTitle").attr("tabindex", "0").focus(); 2100 } 2101 2102 localStorage.removeItem("leftMenuActivePageElementId"); 2103 localStorage.removeItem("leftSubMenuActivePageElementId"); 2104 } 2105 }; 2106 2107 /** 2108 * PRIMEFACES PATCH START 2109 */ 2110 var manageFormStepFocus = function() { 2111 // id von letzte geänderte Element in localStorage speichern 2112 jQuery('.autofocus-behavior-focused').on('click', '.ui-selectonemenu-item', function(e) { 2113 $this = jQuery(this).closest('.autofocus-behavior-focused'); 2114 if(window.localStorage) { 2115 localStorage.setItem('lastChangedField', $this.attr('id')); 2116 } 2117 }); 2118 // Tabnavigation bestätigung mit Enter 2119 jQuery('.autofocus-behavior-focused').on('keyup', function(e) { 2120 // bei enter 2121 if(e.which == 13) { 2122 $this = jQuery(this); 2123 if(window.localStorage) { 2124 localStorage.setItem('lastChangedField', $this.attr('id')); 2125 } 2126 } 2127 }); 2128 2129 // Für mobile Android-Geräte, diese setzen sonst den Focus auf die Startseite des Browsers. 2130 jQuery('.ui-selectonemenu').on('click', '.ui-selectonemenu-item', function(){ 2131 if( jQuery('html').hasClass('android mobile') ) { 2132 $this = jQuery(this); 2133 $this.closest('.ui-selectonemenu').find('input').blur(); 2134 setTimeout(function(){ 2135 $this.closest('.ui-selectonemenu').find('input').focus(); 2136 }, 100); 2137 } 2138 }); 2139 2140 }; 2141 /** 2142 * PRIMEFACES PATCH EDNE 2143 */ 2144}; 2145/** 2146 * Hilfsobjekt zur Behandlung der Default-Buttons.
2147 * Author: Hoersch, Wahrendorff 2148 */ 2149de.his.modules.DefaultButton = new function() { 2150 de.his.modules.ModuleRegistry 2151 .registerModule(this) 2152 .registerAjaxRefreshModule(this); 2153 2154 this.moduleName = "de.his.modules.DefaultButton"; 2155 2156 var buttonClicked = false; 2157 var registeredButtons = []; 2158 var registeredForms = []; 2159 2160 this.init = function() { 2161 console.log("default Button init"); 2162 2163 jQuery('form').each(function() { 2164 var form = jQuery(this); 2165 handleSelfDeclaredDefaultButton(form); 2166 }); 2167 buttonClicked = false; 2168 }; 2169 2170 this.refresh = function() { 2171 console.log("default Button refresh"); 2172 resetRegistry(); 2173 this.init(); 2174 }; 2175 2176 var resetRegistry = function(){ 2177 console.log("reset defaultButton Registry"); 2178 registeredButtons = []; 2179 registeredForms = []; 2180 } 2181 2182 var handleSelfDeclaredDefaultButton = function(form){ 2183 /** 2184 * Button declares itself as default via JSF default=true 2185 * 2186 * in this case a button is written as first element into the form to act as default when no js is active. 2187 */ 2188 form.children("button[class='defaultbutton']").each(function(){ 2189 if(jQuery(this).is(":visible") === true){ 2190 var id = jQuery(this).attr('name'); 2191 2192 console.log("add "+id+" to default-button-behavior (JSF)"); 2193 register(form, id); 2194 } 2195 }); 2196 /** 2197 * or styleClass 2198 */ 2199 form.find('.default-button-behavior').each(function() { 2200 if(jQuery(this).is(":visible") === true){ 2201 var id = jQuery(this).attr('id'); 2202 2203 console.log("add "+id+" to default-button-behavior"); 2204 register(form, id); 2205 } 2206 2207 }); 2208 }; 2209 2210 var register = function(form, buttonId) { 2211 if (alreadyRegistered(buttonId)) { 2212 return; 2213 } 2214 console.log("register button:"+buttonId); 2215 registeredButtons.push(buttonId); 2216 2217 if (alreadyRegisteredForm(form.attr('id'))) { 2218 return; 2219 } else { 2220 console.log("register form:"+form.attr('id')); 2221 registeredForms.push(form.attr('id')); 2222 handleFormSubmit(form); 2223 } 2224 2225 }; 2226 2227 var handleFormSubmit = function(form){ 2228 form.off('keydown'); 2229 form.keydown(function(event) { 2230 var keycode = event.keyCode; 2231 if(keycode != 13){ 2232 return; 2233 } 2234 //console.log("Enter target: " , jQuery(event.target)); 2235 // Für selects geht das nicht, denn hier verhalten sich die Browser unterschiedlich: 2236 // Firefox: nix bei Enter 2237 // Chrome: menü aufklappen bei Enter 2238 // Keiner schickt hierbei das Formular ab 2239 if (jQuery(event.target).is('select')) { 2240 console.log("item selected, no form submit on enter."); 2241 return false; 2242 } 2243 2244 if (jQuery(event.target).parent().hasClass('ui-selectonemenu-items-wrapper')) { 2245 //maybe unnecessary, Prime fetches event from items. 2246 console.log("PrimeSelect item selected, no form submit on enter."); 2247 return false; 2248 } 2249 2250 /** Elemente die kein input sind, sollen keine default form submit on Enter auslösen können */ 2251 if (!jQuery(event.target).is('input')) { 2252 console.log(jQuery(event.target)+" no default form submit on enter allowed."); 2253 return true; 2254 } 2255 2256 if(keycode == 13 && jQuery(event.target).is('input') && jQuery(event.target).is('[defaultbutton]')){ 2257 console.log("input has declared default submit button"); 2258 var defaultButtonId = jQuery(event.target).attr('defaultbutton'); 2259 if(jQuery("button[id$='"+de.his.common.Util.toJQueryId(defaultButtonId)+"']").length > 0){ 2260 jQuery("button[id$='"+de.his.common.Util.toJQueryId(defaultButtonId)+"']").click(); 2261 return false; 2262 } else { 2263 console.warn("DefaultButton with id ending '"+defaultButtonId+"' does not exist. It has been ignored."); 2264 } 2265 } 2266 2267 if (keycode == 13 ) { 2268 // Suche letztes overlay
2269 var overlay = jQuery('div.overlay.modal').filter(':visible').last(); 2270 if (overlay && overlay.length) { 2271 console.log("search for generic Search with defaultbutton in overlay"); 2272 2273 // Ausnahme: Generische Untersuchmaske zur Auswahl im Overlay 2274 /** 2275 * Schauen ob suchmaske vorhanden, wenn ja , clicke ersten defaultbutton 2276 */ 2277 if(overlay.find("#genericSearchMask").length > 0){ 2278 var gsFirstDefaultBtn = jQuery(event.target).parents("#genericSearchMask").first().parent().find(".default-button-behavior").first(); 2279 2280 if(gsFirstDefaultBtn.length > 0){ 2281 console.log("found generic search in overlay"); 2282 gsFirstDefaultBtn.addClass("noAutofocus").click(); 2283 return false; 2284 } 2285 2286 } else { 2287 // JS defaultbutton behavior ist wegen Anfrage 199654 in overlays abgeschaltet. 2288 // ^^ Vermutlich wegen unsichtbarer overlays die das Verhalten gestört haben, optimierter selektor sollte das Problem beheben. 2289 2290 var defaultBtn = jQuery(event.target).parents(".overlayContainer").first().find(".default-button-behavior").first(); 2291 var refreshBtn = jQuery(event.target).parents().children('label').parent().children('.refreshButtonNoDisplay'); 2292 // Prevent trigger save button if event.target is in dataTable. Fix for #350828 2293 var datatable = jQuery(event.target).parents(".datatable").first(); 2294 2295 if(defaultBtn.length > 0 && refreshBtn.length == 0 && datatable.length == 0){ 2296 console.log("found defaultButton in overlay"); 2297 defaultBtn.click(); 2298 return false; 2299 } 2300 } 2301 2302 console.log("nothing found"); 2303 return true; 2304 } 2305 } 2306 2307 2308 console.log("nothing happened for defaultbutton from JS"); 2309 2310 return true; 2311 }); 2312 }; 2313 2314 var alreadyRegistered = function(buttonId) { 2315 console.log(buttonId + " indexOf: " + registeredButtons.indexOf(buttonId)); 2316 return registeredButtons.indexOf(buttonId) > -1; 2317 }; 2318 var alreadyRegisteredForm = function(formId) { 2319 console.log(formId + " indexOf: " + registeredButtons.indexOf(formId)); 2320 return registeredForms.indexOf(formId) > -1; 2321 }; 2322 2323 this.submitEnter = function (buttonId, e) { 2324 var keycode; 2325 if (window.event) { 2326 keycode = window.event.keyCode; 2327 } else if (e) { 2328 keycode = e.which; 2329 } else { 2330 return true; 2331 } 2332 if (keycode == 13) { 2333 clickButton(buttonId); 2334 return false; 2335 } 2336 return true; 2337 }; 2338 2339 var clickButton = function(buttonId) { 2340 if (buttonClicked) { 2341 return; 2342 } 2343 console.log("try to click:"+buttonId); 2344 if (document.getElementById(buttonId) != null) { 2345 document.getElementById(buttonId).click(); 2346 } 2347 if (document.getElementById(buttonId+':add_button') != null) { 2348 document.getElementById(buttonId+':add_button').click(); 2349 } 2350 buttonClicked = true; 2351 }; 2352};/** 2353 * HISinOne HTML-Textfeld (hier mit CK-Editor). 2354 */ 2355 2356var CKEDITOR_BASEPATH; 2357 2358de.his.modules.HtmlEditor = new function() { 2359 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this).registerAjaxStartModule(this); 2360 2361 this.moduleName = "de.his.modules.HtmlEditor"; 2362 2363 var textareaSelector = 'textarea.fckEditor,textarea.fckeditor'; // ,textarea.ckeditor<-- class ckeditor is recognised by ckeditor.js and replaces textareas with default ckeditor 2364 var contextPath = de.his.common.ContextInformation.get('context-path'); 2365 var getParam = function(key){ 2366 2367 return jQuery('span#ckeditorParams').data(key); 2368 } 2369 2370 this.init = function() { 2371 // DONE: new approach: each editor can be configured individually 2372 // so we begin with iterating potential textareas 2373 // and look out for data attributes for configuration 2374 // before falling back to global configuration for legacy reasons 2375 2376 var textareas = jQuery(textareaSelector); 2377 if(textareas.length==0){ 2378 // return if no textareas match. 2379 return; 2380 } 2381 2382 if (typeof CKEDITOR!=='undefined') { 2383 textareas.each(function(e, i){ 2384 2385 var ta = jQuery(this); 2386 //console.log("editor:",ta); 2387 if(ta.data("loadonstart")){ 2388 // new approach 2389 createCkeditors(ta); 2390 } else { 2391 // legacy 2392 if (getParam("loadonstart")) { 2393 if (!jQuery.fn.ckeditor) { 2394 return; 2395 } 2396 ta.data(toolbar) 2397 createCkeditors(ta); 2398 } 2399 } 2400 2401 }); 2402 } else { 2403 // we need to set CKEDITOR_BASEPATH when loading ckeditor dynamically or ckeditor thinks the current url is it's actual path 2404 CKEDITOR_BASEPATH = de.his.common.ContextInformation.get('context-path')+'/pub/ckeditor/'; 2405 console.log("init ckeditor Basepath: %s",CKEDITOR_BASEPATH); 2406 de.his.modules.ModuleRegistry.loadScript(CKEDITOR_BASEPATH+"ckeditor.js", "de.his.modules.HtmlEditor"); 2407 } 2408 2409 }; 2410 2411 this.indicateAjaxRequestStart = function(){ 2412 /** 2413 * Updating Textarea for potential ajax submit 2414 */ 2415 if (typeof CKEDITOR!=='undefined') { 2416 2417 // update all instances of CKEDITOR that are not disabled 2418 var textareas = jQuery(textareaSelector); 2419 textareas.each(function() { 2420 var instanceKey = this.id; 2421 var $instance = jQuery(this); 2422 2423 if(!$instance.is(':disabled')){ 2424 try{ 2425 CKEDITOR.instances[instanceKey].updateElement(); 2426 } catch(e){ 2427 // log error 2428 console.log(e); 2429 } 2430 } 2431 }); 2432 } 2433 2434 }; 2435 2436 this.debugSettings = function() { 2437 //TODO: needs something else all these params are deprecated and unused in new approach 2438 //alert("loadOnStart = " + loadOnStart + "\r\n" + "replaceNewlines = " + replaceNewlines + "\r\n" + "customConfigFile = " + customConfigFile); 2439 }; 2440 2441 this.triggerElementUpdate = function() { 2442 for ( var instance in CKEDITOR.instances ) { 2443 if( CKEDITOR.instances.hasOwnProperty( instance ) ){ 2444 CKEDITOR.instances[instance].updateElement(); 2445 } 2446 } 2447 } 2448 2449 this.replace = function(){ 2450 this.init(); 2451 }; 2452 2453 this.toggle = function(selector){ 2454 if(typeof selector === 'undefined'){ 2455 //console.log("toggle: selector undefined", selector); 2456 selector = textareaSelector; 2457 } 2458 2459 var textareas = jQuery(selector); 2460 if(textareas.length == 0){
2461 //console.log("toggle: not texareas found", selector); 2462 return; 2463 } 2464 2465 if(textareas[0].classList.contains("summernote-container") || textareas[0].classList.contains("summernote-textarea")){ 2466 // also toggles summernote for easy migration 2467 de.his.component.SummernoteEditor.toggle(selector); 2468 return; 2469 } 2470 2471 //console.log("CKEDITOR.instances: "+selector ,CKEDITOR.instances); 2472 2473 // we replace all findings or nothing, so simply check if the first selected textarea is ckeditorfied 2474 if(!CKEDITOR.instances[textareas[0].id]){ 2475 createCkeditors(textareas); 2476 } else{ 2477 destroyCkeditors(textareas); 2478 } 2479 }; 2480 2481 var destroyCkeditors = function(textareas){ 2482 for (var i = 0; textareas.length > i; i++){ 2483 jQuery("#"+de.his.common.Util.toJQueryId(textareas[i].id)).data('already-ckeditorified', false); 2484 CKEDITOR.instances[textareas[i].id].destroy(); 2485 } 2486 } 2487 2488 var createCkeditors = function(textareas){ 2489 if (textareas.length == 0) { 2490 return; 2491 } 2492 2493 var customConfigFile = contextPath+'/pub/ckeditor_his/hisconfiguration.js?20240124'; 2494 2495 textareas.ckeditor(customConfigFile); 2496 } 2497 2498 this.refresh = function() { 2499 if (!jQuery.fn.ckeditor) { 2500 console.log("no juery ckeditor function available."); 2501 return; 2502 } 2503 2504 this.init(); 2505 }; 2506 2507 this.getAllowedContent = function(mode, allowedHtmlTags, allowedHtmlAttributes){ 2508 var allowedContent; 2509 switch (mode){ 2510 case 'extendedHtml': 2511 allowedContent = { 2512 $1: { 2513 // Use the ability to specify elements as an object. 2514 elements: allowedHtmlTags, 2515 attributes: allowedHtmlAttributes, 2516 styles: true, 2517 classes: true 2518 } 2519 } 2520 break; 2521 case 'tagsOnly': 2522 allowedContent = { 2523 $1: { 2524 // Use the ability to specify elements as an object. 2525 // Tags only 2526 elements: { h1: false, h2: true, h3: true, h4: true, h5: true, h6: true, a: true, abbr: true, b: true, i: true, u: true, sub: true, sup: true, ul: true, ol: true, li: true, dl: true, dt: true, dd: true, p: true, span: true, em: true, s: true, strike: true, strong: true, table: true, tbody: true, thead: true, tfoot: true, tr: true, th: true, td: true, colgroup: true, col: true, caption: true, div: true, small: true, pre: true, code: true,br: true, hr: true, img: true, col: true, style: true}, 2527 attributes: false, 2528 styles: false, 2529 classes: false 2530 } 2531 }; 2532 break; 2533 default: 2534 allowedContent = { 2535 $1: { 2536 // Use the ability to specify elements as an object. 2537 // allowed tags, attributes and styles, from HTMLUtil.java, keep in sync! 2538 // font and font-family is allowed in HTMLUtil.java, but ' and " in style attribute aren't. 2539 // therefore filter font and font-family, since there is no value in getting the font-family from a Word Document, because the texts are always within a font-family setting context (Portal, FOP-Report, LO-Report) 2540 elements: { h1: false, h2: true, h3: true, h4: true, h5: true, h6: true, a: true, abbr: true, b: true, i: true, u: true, sub: true, sup: true, ul: true, ol: true, li: true, dl: true, dt: true, dd: true, p: true, span: true, em: true, s: true, strike: true, strong: true, table: true, tbody: true, thead: true, tfoot: true, tr: true, th: true, td: true, colgroup: true, col: true, caption: true, div: true, small: true, pre: true, code: true,br: true, hr: true, img: true, col: true, style: true}, 2541 attributes: [ 'aria-label','aria-labelledby','aria-describedby','title', 'alt', 'src', 'target', 'style', 'class', 'align', 'valign', 'bgcolor', 'colspan', 'rowspan', 'height', 'nowrap', 'width', 'cellpadding', 'cellspacing', 'border', 'id', 'scope', 'summary', 'href', 'lang', 'data-delayedsrc' ], 2542 styles: ['width', 'height', 'direction', 'line-height', 'vertical-align', 'list-style-type', 'list-style-position', 'color', 'background-color', 'background-repeat', 'font-style', 'font-variant', 'font-weight', 'font-size', 'text-indent', 'text-align', 'text-decoration', 'letter-spacing', 'word-spacing', 'text-transform', 'white-space', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width', 'border-style', 'border-color', 'border-collapse'], 2543 classes: true 2544 } 2545 }; 2546 } 2547 return allowedContent; 2548 } 2549 2550 /** 2551 * return array with toolbarGroups and removeButtons 2552 */ 2553 this.getToolbarConfig = function(toolbar){ 2554 var array = [] 2555 switch (toolbar){ 2556 case 'full': 2557 array['toolbarGroups'] = [ 2558 { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 2559 { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 2560 { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, 2561 { name: 'links', groups: [ 'links' ] }, 2562 { name: 'insert', groups: [ 'insert' ] },
2563 { name: 'forms', groups: [ 'forms' ] }, 2564 { name: 'others', groups: [ 'others' ] }, 2565 { name: 'tools', groups: [ 'tools' ] }, 2566 '/', 2567 { name: 'styles', groups: [ 'styles' ] }, 2568 { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 2569 { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] }, 2570 { name: 'colors', groups: [ 'colors' ] }, 2571 2572 { name: 'about', groups: [ 'about' ] } 2573 2574 ]; 2575 array['removeButtons'] = 'About,Format,AutoComplete,UncommentSelectedRange,CommentSelectedRange,autoFormat,searchCode,Indent,Outdent,codemirrorAbout'; 2576 2577 break; 2578 case 'basic': 2579 array['toolbarGroups'] = [ 2580 { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 2581 { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 2582 { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] }, 2583 { name: 'colors', groups: [ 'colors' ] }, 2584 { name: 'links', groups: [ 'links' ] }, 2585 { name: 'others', groups: [ 'others' ] }, 2586 { name: 'tools', groups: [ 'tools' ] }, 2587 { name: 'about', groups: [ 'about' ] } 2588 2589 ]; 2590 2591 array['removeButtons'] = 'About,Format,AutoComplete,UncommentSelectedRange,CommentSelectedRange,autoFormat,searchCode,Indent,Outdent,Blockquote,codemirrorAbout'; 2592 2593 break; 2594 case 'slim': 2595 array['toolbarGroups'] = [ 2596 { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 2597 { name: 'colors', groups: [ 'colors' ] }, 2598 { name: 'links', groups: [ 'links' ] }, 2599 { name: 'others', groups: [ 'others' ] }, 2600 { name: 'about', groups: [ 'about' ] } 2601 ]; 2602 2603 array['removeButtons'] = 'About,Format,AutoComplete,UncommentSelectedRange,CommentSelectedRange,autoFormat,searchCode,Indent,Outdent,Blockquote,Subscript,Superscript,codemirrorAbout'; 2604 2605 break; 2606 default: 2607 array['toolbarGroups'] = [ 2608 { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 2609 { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 2610 { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, 2611 { name: 'links', groups: [ 'links' ] }, 2612 { name: 'insert', groups: [ 'insert' ] }, 2613 { name: 'forms', groups: [ 'forms' ] }, 2614 { name: 'others', groups: [ 'others' ] }, 2615 { name: 'tools', groups: [ 'tools' ] }, 2616 '/', 2617 { name: 'styles', groups: [ 'styles' ] }, 2618 { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 2619 { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] }, 2620 { name: 'colors', groups: [ 'colors' ] }, 2621 2622 { name: 'about', groups: [ 'about' ] } 2623 2624 ]; 2625 array['removeButtons'] = 'About,Format,AutoComplete,UncommentSelectedRange,CommentSelectedRange,autoFormat,searchCode,Indent,Outdent,codemirrorAbout'; 2626 2627 2628 } 2629 2630 return array; 2631 } 2632};/** 2633 * Kapselt Methoden, die für den Refresh-Button in Kombination mit Eingabefeldern benötigt werden. 2634 * 2635 * NOTE: in situations where focusing the next input element is undesireable the focus behavior 2636 * can be disabled via the style class "disable-input-focus-behavior". 2637 */ 2638de.his.modules.InputRefresh = new function() { 2639 de.his.modules.ModuleRegistry 2640 .registerModule(this) 2641 .registerAjaxRefreshModule(this); 2642 2643 this.moduleName = "de.his.modules.InputRefresh"; 2644 var self = this; 2645 2646 var lastActiveElements = []; 2647 2648 this.init = function() { 2649 2650 /** 2651 * jQuery-Funktion, welche den Focus in das nächste Eingabefeld setzt. 2652 * reverse - boolean - optional - set to true to focus previous input field 2653 */ 2654 jQuery.fn.focusNextInputField = function(reverse) { 2655 // durch select:not(.langSelector) wird die Auswahlliste der Sprachumsschaltung nicht betrachtet. 2656 var fields = jQuery("body").find('input[type!="submit"][type!="image"][type!="hidden"][type!="file"][data-exclude!="true"][tabindex!="-1"]:not(.ui-selectonemenu-filter),textarea,select[tabindex!="-1"]:not(.langSelector),button:not(.helpButton)'); 2657 2658 var index = fields.index(this); 2659 2660 if(jQuery(this).hasClass("refreshButtonNoDisplay") && reverse){ 2661 console.log("refresh Button did it!"); 2662 index = index-1; 2663 } 2664 2665 console.log("activeElementIndex: "+index); 2666 2667 // ein bischen Magie zum bestimmen des Focus. 2668 if (index > -1 && (index + 1) < fields.length) { 2669 var i = reverse === true ? index - 1 : index + 1; 2670 2671 // search for the next input that is NOT disabled nor a refresh, a hidden or a help -button. 2672 for(var n=i;i<=fields.length; n++){ 2673 var jQueryField = jQuery(fields.eq(i)); 2674 2675 if(!jQueryField.is(":disabled") 2676 //&& !jQueryField.is("[readonly]") 2677 && !jQueryField.hasClass("refreshButtonNoDisplay") 2678 && !jQueryField.hasClass("unsichtbar") 2679 //&& !jQueryField.hasClass("submit_image") 2680 //&& !jQueryField.hasClass("helpButton") 2681 ){ 2682 console.log("Set Focus on : "+jQueryField.attr('id')); 2683 jQueryField.focus().select(); 2684 break; 2685 } 2686 i = reverse === true ? i - 1 : i + 1; 2687 } 2688 } 2689 2690 // Falls es keine Tabelle gibt, kann es vorkommen, dass es nach dem letzten Input noc
2690h einen Button gibt 2691 // (um bspws. das Formular abzusenden siehe #166658). Ohne isTablePresent würde der viewPort aber wieder 2692 // nach oben gesetzt werden. In Tabellen ist genau das aber gewünscht, deshalb an dieser Stelle die Prüfung. 2693 var isTablePresent = jQuery(".datascroller"); 2694 if (index > -1 && (index + 1) == fields.length && isTablePresent[0]) { 2695 console.log("Set Focus on : "+ fields.eq(0)); 2696 fields.eq(0).focus(); 2697 window.scrollTo(0,0); 2698 } 2699 return this; 2700 }; 2701 2702 initIntern(); 2703 }; 2704 2705 this.refresh = function() { 2706 initIntern(); 2707 }; 2708 2709 var initIntern = function() { 2710 // reset flag for radiobutton Patch 2711 if(typeof window.sessionStorage !== 'undefined'){ 2712 sessionStorage.removeItem("his_refreshButtonClicked"); 2713 } 2714 2715 // Focus Behaviour beim klicken mit Maus für einen Refresh abschalten. 2716 jQuery('input[type!="submit"][type!="image"][type!="hidden"][type!="file"],textarea,select').click(function(){ 2717 if(!jQuery(this).hasClass('noAutofocus')){ 2718 var id = jQuery(this).attr('id'); 2719 console.log("click focus set on: "+id); 2720 sessionStorage.setItem("his_lastClickedPageElementId",id); 2721 setActivePageElement(id); 2722 } 2723 }); 2724 2725 jQuery('input[type!="submit"][type!="image"][type!="hidden"][type!="file"],textarea,select,a').focus(function() { 2726 if(!jQuery(this).hasClass('noAutofocus')){ 2727 var id = jQuery(this).attr('id'); 2728 setActivePageElement(id); 2729 } 2730 }); 2731 2732 //Buttons sollen Fokus nach Bedienung behalten 2733 jQuery('button[type=submit],button.submit').click(function() { 2734 var activePageElementFocusId = jQuery(this).data('focusid'); 2735 if(typeof activePageElementFocusId !== 'undefined'){ 2736 sessionStorage.setItem("his_manualFocusByDataFocusId", activePageElementFocusId); 2737 } 2738 if(!jQuery(this).hasClass('noAutofocus') && !jQuery(this).hasClass('refreshButtonNoDisplay')){ 2739 setActivePageElement(this.id); 2740 } 2741 if(jQuery(this).hasClass('tabButton')){ 2742 sessionStorage.setItem("his_lastClickedTab", this.id); 2743 } 2744 2745 // add tooltip to rerendered button element in CollapsibleFieldset ajax/java 2746 if(jQuery(this).hasClass("fieldsetHeadlineCollapseButton") || jQuery(this).hasClass("collapsableFieldsetHelpButton")){ 2747 de.his.modules.eventRegistry.addListener('refresherSuccess', function(){ 2748 var focused = document.activeElement; 2749 de.his.component.customtooltip.removeTooltip(focused); 2750 de.his.component.customtooltip.setTooltip(focused); 2751 }); 2752 } 2753 }); 2754 2755 // Shift key pressed on tab Erkennung für Primefaces Select. 2756 jQuery('.ui-selectonemenu-filter,ui-selectonemenu-label').keydown(function(event){ 2757 var keyCode; 2758 if (event) { 2759 var input = jQuery(this); 2760 keyCode = event.keyCode || event.which; 2761 if(keyCode === 9 || (jQuery(this).hasClass("_refreshOnEnter") && keyCode === 13)){ 2762 if(event.shiftKey){ 2763 console.log("shiftKEy pressed!"); 2764 //TODO: don't use globals! 2765 de.his.common.ContextInformation.set("refresh-shift-key", true); 2766 }else{ 2767 // reset if tab without shift is pressed 2768 de.his.common.ContextInformation.set("refresh-shift-key", false); 2769 } 2770 }else{ 2771 // reset on any other key 2772 de.his.common.ContextInformation.set("refresh-shift-key", false); 2773 } 2774 } 2775 }); 2776 2777 jQuery('button[class="refreshButtonNoDisplay"]').click(function() { 2778 var id = jQuery(this).attr('id'); 2779 refreshBtnClicked(id); 2780 }); 2781 2782 var activePageElementId = de.his.common.ContextInformation.get("active-page-element-id"); 2783 2784 if (activePageElementId) { 2785 2786 var pollButtonClicked = de.his.common.ContextInformation.get("poll-button-clicked"); 2787 var refreshButtonClicked = de.his.common.ContextInformation.get("refresh-button-clicked"); 2788 var activePageElement = jQuery('#' + de.his.common.Util.toJQueryId(activePageElementId)); 2789 2790 var hasActivePageElementDisabledFocusBehavior = activePageElement.hasClass("disable-input-focus-behavior"); 2791 var hasParentWithDisabledFocusBehavior = activePageElement.parents(".disable-input-focus-behavior").length > 0; 2792 var focusInputBehaviorEnabled = ! hasActivePageElementDisabledFocusBehavior && ! hasParentWithDisabledFocusBehavior; 2793 2794 var fieldsetHelpButtonClicked = false;
2795 var popupButtonClicked = false; 2796 var tableFilterButtonClicked = false; 2797 var captchaRefreshButtonClicked = false; 2798 var tableConfigButtonClicked = false; 2799 var portalInfoBoxLinkClicked = false; 2800 2801 //Es kann vorkommen, dass das ursprüngliche Element nicht mehr da ist, obwohl die Id noch gesetzt ist. Deshalb prüfen... 2802 if (document.getElementById(activePageElementId)) { 2803 fieldsetHelpButtonClicked = document.getElementById(activePageElementId).parentElement.classList.contains('fieldsetHelpButton'); 2804 popupButtonClicked = document.getElementById(activePageElementId).dataset.popupbutton; 2805 tableFilterButtonClicked = document.getElementById(activePageElementId).dataset.tablefilterbutton; 2806 captchaRefreshButtonClicked = document.getElementById(activePageElementId).classList.contains('refreshCaptcha'); 2807 tableConfigButtonClicked = document.getElementById(activePageElementId).classList.contains('configTableButton'); 2808 portalInfoBoxLinkClicked = document.getElementById(activePageElementId).classList.contains('portalInfoBoxLink'); 2809 } 2810 2811 // keep focus manually with data-attribute on active element, used in ui repeats to keep focus on moving element 2812 var manualFocusByDataFocusId = sessionStorage.getItem("his_manualFocusByDataFocusId"); 2813 if(manualFocusByDataFocusId !== null){ 2814 manualFocusByDataFocusId = de.his.common.Util.toJQueryId(manualFocusByDataFocusId); 2815 if(jQuery('[data-focusid="' + manualFocusByDataFocusId + '"]').length>0){ 2816 jQuery('[data-focusid="' + manualFocusByDataFocusId + '"]').focus().select(); 2817 } else{ 2818 if(manualFocusByDataFocusId.indexOf('up')>-1){ 2819 manualFocusByDataFocusId = manualFocusByDataFocusId.replace('up','down'); 2820 } else { 2821 manualFocusByDataFocusId = manualFocusByDataFocusId.replace('down','up'); 2822 } 2823 jQuery('[data-focusid="' + manualFocusByDataFocusId + '"]').focus().select(); 2824 } 2825 console.log("focus set manually, data-focusId: %s",manualFocusByDataFocusId); 2826 sessionStorage.removeItem("his_manualFocusByDataFocusId"); 2827 return; 2828 } 2829
2830 // disable focus on refresh after mouse click select 2831 var radioButtonClickedId = sessionStorage.getItem("his_radioButtonClickedId"); 2832 var lastClickedPageElementId = sessionStorage.getItem("his_lastClickedPageElementId"); 2833 console.log("lastClickedPageElementId: %s",lastClickedPageElementId); 2834 console.log("activePageElement: %s",activePageElementId); 2835 2836 // check if is lastClickedPageElementId a checkbox and if yes, set focus to label and remove lastClicked 2837 if(lastClickedPageElementId != null && jQuery("#"+de.his.common.Util.toJQueryId(lastClickedPageElementId)).is(':checkbox') ){ 2838 jQuery("label[for='"+de.his.common.Util.toJQueryId(lastClickedPageElementId)+"']").focus(); 2839 sessionStorage.removeItem("his_lastClickedPageElementId"); 2840 return; 2841 } 2842 2843 console.log("radioButtonClickedId: %s",radioButtonClickedId); 2844 2845 // Wenn eine Nutzer Rückfrage (IssueQuery) eingeblendet wird, soll die Ãberschrift bzw. der Text fokussiert werden 2846 var query = jQuery('.infobox.confirm_infobox.messages-infobox'); 2847 if (query && query.length) { 2848 query.find('h2').attr("tabindex", "0").focus(); 2849 return; 2850 } 2851 2852 if(lastClickedPageElementId === activePageElementId || (radioButtonClickedId === lastClickedPageElementId && lastClickedPageElementId !== null && radioButtonClickedId!== null)) { 2853 console.log("disabled Focus behaviour cause a radio button or input was clicked.. "); 2854 focusInputBehaviorEnabled = false; 2855 if(!jQuery(this).hasClass('noAutofocus')){ 2856 // TODO: 2857 // - wenn geklicktes Element hat noAutofocus, behalte id des vorherigen Elements als geklicktes Element 2858 sessionStorage.removeItem("his_lastClickedPageElementId"); 2859 } 2860 sessionStorage.removeItem("his_radioButtonClickedId"); 2861 jQuery("#"+de.his.common.Util.toJQueryId(lastClickedPageElementId)).focus(); 2862 return; 2863 2864 } 2865 2866 if (focusInputBehaviorEnabled) { 2867 2868 if(pollButtonClicked) { 2869 de.his.common.ContextInformation.set("poll-button-clicked", false); 2870 return; 2871 } 2872 2873 //Wenn ein Popup geöffnet wird, soll hier nichts mehr gemacht werden, weil das popup Skript den Fokus selbst setzt. 2874 if (popupButtonClicked) { 2875 return; 2876 } 2877 2878 // Wenn der Filter Button in einer Tabelle geklickt wird, soll der Fokus auf das erste Filter Input gesetzt werdenn. 2879 if (tableFilterButtonClicked == "false") { 2880 // erst den Container indem die Tabelle enthalten ist holen 2881 var tableParent = document.getElementById(activePageElementId).parentElement.parentElement; 2882 var tableInputs = jQuery(tableParent).find('table').find('input'); 2883 tableInputs[0].focus(); 2884 return; 2885 } 2886 2887 //Tabellen Konfiguration wurde geöffnet 2888 if (tableConfigButtonClicked) { 2889 var tableConfigH2 = jQuery('.curtainTableConfig').find('h2').first(); 2890 if (tableConfigH2.length > 0) { 2891 tableConfigH2.attr("tabindex", "0"); 2892 tableConfigH2.focus(); 2893 } 2894 return; 2895 } 2896 2897 //Portal Infobox soll nach dem Ãffnen den Fokus erhatlen 2898 if (portalInfoBoxLinkClicked) { 2899 jQuery('.infoboxContainer').find("h2").first().focus(); 2900 bindFocus(jQuery('.infoboxContainer')); 2901 return; 2902 } 2903 2904 // Bei Captcha Eingaben soll der Fokus nach dem Klick auf den RefreshButton auf das Captcha Input gesetzt werden 2905 if (captchaRefreshButtonClicked && activePageElement) { 2906 var previousSibling = jQuery('.refreshCaptcha').get()[0].previousSibling; 2907 if (previousSibling) { 2908 previousSibling.focus(); 2909 return; 2910 } 2911 } 2912 2913 // Wenn auf der Seite ein Fehler aufgetreten ist, soll der Fokus in das erste fehlerhafte Eingabeelement gesetzt werden 2914 var firstErrorText = jQuery('.error').first(); 2915 if (firstErrorText.length) { 2916 if (firstErrorText.find("input[type!=hidden]").length) { 2917 firstErrorText.find("input[type!=hidden]").focus().select(); 2918 return; 2919 } 2920 } 2921 2922 if (refreshButtonClicked) { 2923 // fix for #299994 and #300348 2924 activePageElement.focus().select(); 2925 /*if(!de.his.common.ContextInformation.get("refresh-shift-key")) { 2926 //normal tab 2927 console.log("Focus next input: ",activePageElement); 2928 activePageElement.focusNextInputField(); 2929 }else{ 2930 //backwards - shift-tab 2931 console.log("Focus prev input: ",activePageElement); 2932 de.his.common.ContextInformation.set("refresh-shift-key", false); 2933 activePageElement.focusNextInputField(true); 2934 }*/ 2935 } else{ 2936 console.log("Focus input: ",activePageElement); 2937 if(activePageElement.length){ 2938 if(activePageElement.hasClass('his-autocomplete-select-input')){ 2939 // do not select input on autocomplete, or user will erase input accedentilly upon ajax update. 2940 activePageElement.focus(); 2941 } else { 2942 activePageElement.focus().select(); 2943 } 2944 } else { 2945 console.log("lastActive Element vanished.. :( "); 2946 const lastActiveElementId = lastActiveElements.find(id => jQuery('#' + de.his.common.Util.toJQueryId(id)).length>0); 2947 if (lastActiveElementId) { 2948 const previousActiveElem = jQuery('#' + de.his.common.Util.toJQueryId(lastActiveElementId)); 2949 console.log("Focus previousActiveElem: ",previousActiveElem); 2950 if(previousActiveElem.hasClass('his-autocomplete-select-input')){ 2951 // do not select input on autocomplete, or user will erase input accedentilly upon ajax update. 2952 previousActiveElem.focus(); 2953 } else { 2954 previousActiveElem.focus().select(); 2955 } 2956 } 2957 } 2958 } 2959 }else{ 2960 // keep selection when input focus behaviour is disabled. 2961 if(activePageElement.is(':disabled')){ 2962 console.log("Focus next input 2: "+activePageElement.attr('id')); 2963 activePageElement.focusNextInputField(); 2964 }else{ 2965 console.log("Focus input 2: "+activePageElement.attr('id')); 2966 //Das soll nur für Inputs relevant sein. KEINE Buttons. 2967 if(activePageElement.length && jQuery(activePageElement).is('input')){ 2968 activePageElement.focus().select(); 2969 } 2970 } 2971 2972 } 2973 2974 } 2975 // Wenn ein Tabbutton geklick wurde diesen wieder fokussiern 2976 if( sessionStorage.getItem("his_lastClickedTab") ) { 2977 jQuery('#' + de.his.common.Util.toJQueryId(sessionStorage.getItem("his_lastClickedTab"))).focus(); 2978 sessionStorage.removeItem("his_lastClickedTab"); 2979 } 2980 }; 2981 2982 this.pollButtonClicked = function(event){ 2983 de.his.common.ContextInformation.set("poll-button-clicked", true); 2984 } 2985 2986 this.refreshSelectedValues = function (event, element, hiddenFieldCliendId, hiddenInputClientId) { 2987 var hiddenField = document.getElementById(hiddenFieldCliendId); 2988 var hiddenInput = document.getElementById(hiddenInputClientId); 2989 if (hiddenField && hiddenInput) { 2990// if (element) { 2991// beforeAjax(element); 2992// } 2993 console.log("selectManyPicklist changed: "+hiddenField.value); 2994 hiddenInput.value = hiddenField.value; 2995 hiddenInput.change(); 2996 } 2997 }; 2998 2999 this.refreshBtnClick = function(event, element, btnId) { 3000 var btn = document.getElementById(btnId); 3001 if (btn) { 3002 beforeAjax(element); 3003 refreshBtnClicked(btnId); 3004 // set flag for radiobutton 3005 sessionStorage.setItem("his_refreshButtonClicked", "true"); 3006 // fix für #349844: setzt his_lastRefresherElementId, auf dieses Element wird dann im overlay nach dem refresh der Fokus wieder gesetzt 3007 sessionStorage.setItem("his_lastRefresherElementId", element.i
3007d); 3008 btn.click(); 3009 } 3010 }; 3011 3012 this.radioBtnClick = function(event, element, btnId) { 3013 3014 sessionStorage.setItem("his_radioButtonClickedId", jQuery(element).attr('id')); 3015 console.log("radioButtonClickedId: "+jQuery(element).attr('id')); 3016 }; 3017 3018 var setActivePageElement = function(activePageElementId) { 3019 if (activePageElementId) { 3020 jQuery('input[name="activePageElementId"]').attr('value', activePageElementId); 3021 de.his.common.ContextInformation.set("active-page-element-id", activePageElementId); 3022 //console.log("lastActiveElements", lastActiveElements); 3023 lastActiveElements.unshift(activePageElementId); 3024 if(lastActiveElements.length >10){ 3025 lastActiveElements.pop(); 3026 //console.log("lastActiveElements popped", lastActiveElements); 3027 } 3028 } 3029 }; 3030 3031 3032 var refreshBtnClicked = function(btnId) { 3033 if (btnId) { 3034 setActivePageElement(btnId); 3035 de.his.common.ContextInformation.set("refresh-button-clicked-id", btnId); 3036 de.his.common.ContextInformation.set("refresh-button-clicked", true); 3037 de.his.common.ContextInformation.set("refresh-button-clicked-for-tree", true); 3038 } 3039 }; 3040 3041 var beforeAjax = function(input){ 3042 var claz = "waitingAnimation"; 3043 input = jQuery(input); 3044 if(input.length > 0){ 3045 3046 var p = input.parent(); 3047 if(p.find("." +claz).length <= 0){ 3048 //show mask 3049 //p.append(de.his.modules.Waiting.getWaitingAnimationHtml(2)); 3050 //de.his.modules.Waiting.executeNormalWaiting(); 3051 de.his.modules.eventRegistry.addListener("refresherComplete", function(){ 3052 //hide mask 3053 //de.his.modules.Waiting.refresh(); 3054 //jQuery("." + claz).remove(); 3055 //de.his.modules.Waiting.removeWaitingAnimationHtml(); 3056 }, this, true); 3057 } 3058 3059 } 3060 }; 3061 3062 this.inputBlur = function(event, element, btnId) { 3063 if (element._changed) { 3064 //beforeAjax(element); 3065 this.refreshBtnClick(event, element, btnId); 3066 var btn = document.getElementById(btnId); 3067 if (btn) { 3068 btn.alreadyClicked = true; 3069 } 3070 } 3071 }; 3072 3073 this.inputKeydown = function(event, element, btnId) { 3074 var keyCode; 3075 if (event) { 3076 keyCode = event.keyCode || event.which; 3077 console.log("keycode: "+keyCode); 3078 if(keyCode === 9 || (jQuery(element).hasClass("_refreshOnEnter") && keyCode === 13)){ 3079 sessionStorage.removeItem("his_lastClickedPageElementId"); 3080 if(event.shiftKey){ 3081 //TODO: don't use globals! 3082 de.his.common.ContextInformation.set("refresh-shift-key", true); 3083 } else { 3084 de.his.common.ContextInformation.set("refresh-shift-key", false); 3085 } 3086 // only refresh if element has changed 3087 if (element._changed) { 3088 console.log("element changed! REFRESH!"); 3089 //beforeAjax(event.originalTarget); 3090 this.refreshBtnClick(event, element, btnId); 3091 var btn = document.getElementById(btnId); 3092 if (btn) { 3093 btn.alreadyClicked = true; 3094 } 3095 return false; 3096 } 3097 }else{ 3098 // do not mark element as changed if only shift is pressed, it might be Shift+Tab action 3099 if(keyCode!==16){ 3100 console.log("element changed!"); 3101 element._changed = true; 3102 } 3103 // reset on any other key 3104 de.his.common.ContextInformation.set("refresh-shift-key", false); 3105 } 3106 // workaround für ajax Fehler in Datumsfeldern bei Return siehe #166480 3107 if(jQuery(element).hasClass("input_date") || jQuery(element).hasClass('input_standard')){ 3108 if(keyCode === 13){ 3109 // refresh vor dem Absenden des Formulars 3110 event.preventDefault(); 3111 this.refreshBtnClick(event, element, btnId); 3112 var btn = document.getElementById(btnId); 3113 if (btn) { 3114 btn.alreadyClicked = true; 3115 } 3116 if(!jQuery(element).hasClass("_refreshOnEnter")){ 3117 jQuery(element).parent("form").submit(); 3118 } 3119 } 3120 } 3121 } 3122 return true; 3123 }, 3124 3125 this.inputRadioKeydown = function(event,element,btnId){ 3126 if (sessionStorage.getItem("his_refreshButtonClicked") === "true") { 3127 event.preventDefault(); 3128 console.log("preventDefault while AJAX refreshing"); 3129 3130 return false;
3131 } 3132 } 3133 3134 this.inputChange = function(event, element, btnId) { 3135 console.log("element changed!"); 3136 element._changed = true; 3137 }; 3138 3139 this.checkBtnAlreadyClicked = function(event, element, btnId) { 3140 if (element.alreadyClicked) { 3141 return false; 3142 } 3143 refreshBtnClicked(element.id); 3144 return true; 3145 }; 3146 3147 var bindFocus = function(infoboxcontainer){ 3148 jQuery("[class='focusTrapFirst']").on("focus", function(){ 3149 console.log("FocusTrap"); 3150 infoboxcontainer.find("[id$='close1']").focus(); 3151 }) 3152 jQuery("[class='focusTrapEnd']").on("focus", function(){ 3153 console.log("FocusTrap"); 3154 infoboxcontainer.find("h2").focus(); 3155 }) 3156 } 3157}; 3158/** 3159 * Whenever the session runs out the logged-in User will see a Popup window with 3160 * the possibility to re-login. Pressing the ESC-Button will close this window 3161 * 3162 * For Mobile Users the site is reloaded, what causes an autologin and leads to the startpage in any case. 3163 */ 3164de.his.modules.SessionTimeout = new function() { 3165 de.his.modules.ModuleRegistry.registerModule(this); 3166 this.moduleName = "de.his.modules.SessionTimeout"; 3167 this.init = function() { 3168 window.onkeydown = function(e) { 3169 var key = e.keyCode ? e.keyCode : e.which; 3170 if (key == 27) { 3171 de.his.modules.SessionTimeout.closeLoginForm(); 3172 } 3173 } 3174 }; 3175 3176 this.showLoginForm = function() { 3177 this.closeAlertMessage(); 3178 var loginDiv = document.getElementById("sessionTimeoutLoginDiv"); 3179 this.bindFocus(loginDiv); 3180 if (loginDiv) { 3181 loginDiv.className = "curtainBoxCallBackBackground"; 3182 //cas logout fix ticket #122889 3183 var cas = jQuery("#casLogouts img[data-value]"); 3184 if(cas.length){ 3185 var a; 3186 jQuery.each(cas, function(i,v){ 3187 a = jQuery(v); 3188 if(a.attr("data-value")){ 3189 a.attr("src", a.attr("data-value")); 3190 } 3191 }); 3192 } 3193 } 3194 const mainContent = document.querySelector('.his_main_content'); 3195 const services = document.querySelector('.services'); 3196 const roleSwitcher = document.querySelector('[id$="roleSwitcherForm"]') 3197 if(mainContent != null){ 3198 roleSwitcher.innerHTML = ''; 3199 services.innerHTML = ''; 3200 mainContent.innerHTML = ''; 3201 mainContent.appendChild(loginDiv); 3202 } else { 3203 document.body.innerHTML = ''; 3204 document.body.appendChild(loginDiv); 3205 } 3206 3207 loginDiv.classList.remove('noDisplay'); 3208 // set inert for sessionTimeoutLoginDiv 3209 de.his.component.overlay.setInert(); 3210 jQuery("[class='sessionTimeoutAccessibilityTitle']").focus();/**/ 3211 }; 3212 3213 this.closeAlertMessage = function() { 3214 var alertElement = document.getElementById("alert") 3215 if (alertElement) { 3216 alertElement.parentNode.removeChild(alertElement); 3217 3218 var alertModal = document.getElementById("alert-modal"); 3219 alertModal.parentNode.removeChild(alertModal); 3220 } 3221 }; 3222 3223 this.closeLoginForm = function() { 3224 var loginDiv = document.getElementById('sessionTimeoutLoginDiv'); 3225 if (loginDiv && jQuery('#sessionTimeoutLoginDiv.sessionTimeoutLogin').length == 0) { 3226 loginDiv.className = "noDisplay"; 3227 //cas logout fix ticket #122889 3228 var cas = jQuery("#casLogouts img[data-value]"); 3229 if(cas.length){ 3230 jQuery.each(cas, function(i,v){ 3231 jQuery(v).removeAttr("src"); 3232 }); 3233 } 3234 window.location.reload(); 3235 } 3236 }; 3237 3238 this.submitLoginForm = function() { 3239 var loginDiv = document.getElementById('sessionTimeoutLoginDiv'); 3240 if (loginDiv) { 3241 loginDiv.className = "noDisplay"; 3242 //cas logout fix ticket #122889 3243 var cas = jQuery("#casLogouts img[data-value]"); 3244 if(cas.length){ 3245 jQuery.each(cas, function(i,v){ 3246 jQuery(v).removeAttr("src"); 3247 }); 3248 } 3249 } 3250 } 3251 3252 this.bindFocus = function (sessionTimeoutContainer){ 3253 jQuery("[id='focusTrapEnde']", sessionTimeoutContainer).on("focus", function(){ 3254 jQuery("[class='sessionTimeoutAccessibilityTitle']").focus(); 3255 }); 3256 3257 jQuery("[id='focusTrapStart']", sessionTimeoutContainer).on("focus", function(){ 3258 jQuery("[class='reset']").focus(); 3259 }); 3260 }; 3261 3262};/** 3263 * Das ablaufen der Nutzer-Session verhindern, in dem Requests an den Server 3264 * geschickt werden 3265 * 3266 * 3267 */ 3268// alert(navigator.userAgent); 3269de.his.modules.SessionRefresh = new function() { 3270 de.his.modules.ModuleRegistry.registerModule(this) 3271 .registerAjaxRefreshModule(this); 3272 3273 var refreshSec = undefined; 3274 var refreshActive = false;
3275 var lastRefresh = new Date().getTime(); 3276 var resfreshTimer = undefined; 3277 var resfreshViewTimer = undefined; 3278 var timedOut = false; 3279 var loginFormShown = false; 3280 var autoLoginEnabled = false; 3281 var globalSessionTimeout = undefined; 3282 var globalRefreshSession = undefined; 3283 this.moduleName = "de.his.modules.SessionRefresh"; 3284 var self = this; 3285 this.init = function() { 3286 autoLoginEnabled = de.his.common.Cookie.get('cs.sys.hisinoneAutoLoginEnabled') == 'true' ? true : false; 3287 var globalSessionRefreshAllowed = de.his.common.ContextInformation.get("global-session-refresh-allowed"); 3288 var isLoggedIn = de.his.common.ContextInformation.get("user-logged-in"); 3289 3290 console.log("loggedIN",isLoggedIn); 3291 if(!isLoggedIn){ 3292 // behebt Probleme 3293 timedOut = true; 3294 de.his.common.Cookie.erase('lastRefresh'); 3295 de.his.common.Cookie.erase('sessionRefresh'); 3296 } 3297 console.log("timedOut",timedOut); 3298 //console.log("refresh Counter isLoggedIn",isLoggedIn); 3299 // Ist immer erlaubt, nur wenn das Setup aktiv ist nicht 3300 if (typeof globalSessionRefreshAllowed != 'undefined' 3301 && globalSessionRefreshAllowed 3302 && isLoggedIn) { 3303 globalSessionTimeout = de.his.common.ContextInformation.get("global-session-timeout"); 3304 globalRefreshSession = de.his.common.ContextInformation.get("global-refresh-session"); 3305// console.log('always refresh Session? ' + globalRefreshSession); 3306// console.log('session timeout ' + globalSessionTimeout); 3307 startCounter(globalSessionTimeout,globalRefreshSession); 3308 } 3309 if(isLoggedIn){ 3310 // run on focus, fixes sleepy problems of session timeouts on mobiles 3311 jQuery(window).add(document.body); //necessary for mobile browsers 3312 jQuery(window).focus(function(){ 3313 console.log("window gained focus."); 3314 de.his.modules.SessionRefresh.refreshCounter(); 3315 }); 3316 } 3317 }; 3318 3319 /** 3320 * Startet Counter mit übergebenes Parametern 3321 */ 3322 var startCounter = function(globalSessionTimeout,globalRefreshSession) { 3323 de.his.common.Cookie.create('lastRefresh', lastRefresh); 3324 refreshSec = Math.max(globalSessionTimeout - 120, 3325 globalSessionTimeout / 2); // 2 Min. vor Ablauf 3326 // aktualisieren 3327 3328 // activate refresh for autologin 3329 if (globalRefreshSession || autoLoginEnabled) { 3330 self.activateRefresh(); 3331 } else { 3332 self.deactivateRefresh(); 3333 } 3334 resfreshViewTimer = window.setInterval(function(){de.his.modules.SessionRefresh.refreshCounter()}, 1000); 3335 3336 3337 }; 3338 3339 this.refresh = function() { 3340 lastRefresh = new Date().getTime(); 3341 }; 3342 3343 /** 3344 * Ãberschreibt globalSessionTimeout und globalRefreshSession und startet den Counter neu. 3345 * Gedacht für Selenium-Tests, um die Session früher ablaufen zu lassen. 3346 * 3347 * @param {number} newSessionTimeout - Neues Session-Timeout in Sekunden 3348 * @param {boolean} newRefreshSession - Ob die Session automatisch verlängert werden soll. akzeptiert nur false, verwendet bei true den Originalwert 3349 */ 3350 this.overrideSessionConfig = function(newSessionTimeout, newRefreshSession) { 3351 var currentTimeout = de.his.common.ContextInformation.get("global-session-timeout"); 3352 if (currentTimeout !== undefined && newSessionTimeout >= currentTimeout) { 3353 console.warn("overrideSessionConfig: newSessionTimeout (" + newSessionTimeout + ") muss kleiner als der aktuelle Wert (" + currentTimeout + ") sein."); 3354 return; 3355 } 3356 if (resfreshViewTimer) { 3357 window.clearInterval(resfreshViewTimer); 3358 resfreshViewTimer = undefined; 3359 } 3360 if (resfreshTimer) { 3361 window.clearTimeout(resfreshTimer); 3362 resfreshTimer = undefined; 3363 } 3364 de.his.common.ContextInformation.set("global-session-timeout", newSessionTimeout); 3365 lastRefresh = new Date().getTime(); 3366 de.his.common.Cookie.create('lastRefresh', lastRefresh); 3367 self.startCounter(newSessionTimeout, newRefreshSession ? globalRefreshSession : newRefreshSession); 3368 }; 3369 3370 this.activateRefresh = function() { 3371 if (!timedOut) { 3372 de.his.common.Cookie.create('sessionRefresh', '1'); 3373 refreshActive = true; 3374 this.setRefreshServerSessionTimeout( false ); 3375 jQuery('.sessionTimeout').hide(); 3376 jQuery('#sessionNoTimeoutText').show(); 3377 } 3378 }; 3379 3380 this.deactivateRefresh = function() { 3381 if (!timedOut) { 3382 de.his.common.Cookie.create('sessionRefresh', '0'); 3383 refreshActive = false;
3384 if (resfreshTimer) { 3385 window.clearTimeout(resfreshTimer); 3386 } 3387 jQuery('.sessionTimeout').show(); 3388 jQuery('#sessionNoTimeoutText').hide(); 3389 } 3390 }; 3391 3392 this.refreshCounter = function() { 3393 if(document.getElementsByTagName('body')[0].getAttribute('class').contains('embedded')){ 3394 //do not show login warning or login form in portlets 3395 return; 3396 } 3397 if (!timedOut) { 3398 var tmp = de.his.common.Cookie.read('lastRefresh'); 3399 if (tmp) { 3400 lastRefresh = tmp; 3401 } 3402 tmp = de.his.common.Cookie.read('sessionRefresh'); 3403 if (tmp === '1' && !refreshActive) { 3404 jQuery('#refreshSession').attr("checked", true); 3405 return this.activateRefresh(); 3406 } else if (tmp === '0' && refreshActive) { 3407 jQuery('#refreshSession').attr("checked", false); 3408 return this.deactivateRefresh(); 3409 } 3410 // tmp = null: Keine Cookies im Browser aktiviert.. 3411 3412 if (refreshActive) { 3413 return; 3414 } 3415 } 3416 3417 var diff = (new Date().getTime() - lastRefresh) / 1000; 3418 var globalSessionTimeout = de.his.common.ContextInformation 3419 .get("global-session-timeout"); 3420 var diffSeconds = (globalSessionTimeout - diff); 3421 if (diffSeconds > 0) { 3422 var min = Math.floor(diffSeconds / 60); 3423 var sec = Math.floor(diffSeconds % 60); 3424 if (min > 0) { 3425 jQuery('#sessionCounter').html(min + 1); 3426 } else { 3427 jQuery('#sessionCounter').html('00:' + (sec < 10 ? '0' + sec : sec)); 3428 } 3429 3430 // Prüfen ob Nutzer eingeloggt ist. 3431 // Klicken auf "OK" ruft eine Funktion auf, welche die Session 3432 // zurücksetzen und verlängern kann. 3433 var loginForm = document.getElementById("sessionTimeoutLoginForm"); 3434 3435 //console.log("Cookie cs.sys.hisinoneAutoLoginEnabled: ", autoLoginEnabled); 3436 if (min == 5 && (sec >= 0 && sec < 2) && !autoLoginEnabled) { 3437 3438 // Prüfen ob bereits Alert Meldungen ausgegeben wurde 3439 var alertMessage = document.getElementById("alert"); 3440 if (!alertMessage) { 3441 var language = de.his.common.LanguageHelper.currentLanguage(); 3442 var alertTitle = null; 3443 var alertText = null; 3444 var alertButton = null; 3445 if (language == "de") { 3446 // Deutsche Meldung 3447 var text1 = "Zu Ihrer eigenen Sicherheit werden Sie in 5 Minuten automatisch vom System abgemeldet."; 3448 var text2 = "Bitte klicken Sie auf \"Anmeldung verlängern\", um Ihre Sitzung zu verlängern."; 3449 alertTitle = "<div id='focusTrapStart' tabindex='0'></div><div class='alertWarningTitle'><span class='iconfont-time'></span><h1>Warnung</h1></div>"; 3450 alertText = "<div class='alertWarningBody' aria-label='Warnung. "+ text1 + text2 +"' tabindex='0'><p>"+ text1 +"<br />" + text2 + "</p></div>"; 3451 alertButton = "Anmeldung verlängern"; 3452 } else { 3453 // Englische Meldung 3454 var text1eng = "You will be automatically logged out in 5 minutes for security reasons."; 3455 var text2eng = "Please choose \"Stay logged in\" to renew your session."; 3456 alertTitle = "<div id='focusTrapStart' tabindex='0'></div><div class='alertWarningTitle'><span class='iconfont-time'></span><h1>Warning</h1></div>"; 3457 alertText = "<div class='alertWarningBody' aria-label='Warning. "+ text1eng + text2eng +"' tabindex='0'><p>" + text1eng + "<br />" + text2eng + "</p></div>"; 3458 alertButton = "Stay logged in"; 3459 } 3460 alert(alertTitle, alertText, { 3461 button_title : alertButton, 3462 callback : function() { 3463 de.his.modules.SessionRefresh.refreshSession(); 3464 } 3465 }); 3466 3467 var alertElem = document.getElementById("alert"); 3468 3469 var focusTrap = document.createElement("div"); 3470 focusTrap.tabIndex = "0"; 3471 focusTrap.id = "focusTrapEnde"; 3472 alertElem.appendChild(focusTrap); 3473 3474 this.bindFocus(alertElem); 3475 jQuery("[class='alertWarningBody']").focus(); 3476 } 3477 } 3478 } else { 3479 jQuery('#sessionCounter').html('--'); 3480 timedOut = true; 3481 if (resfreshViewTimer) { 3482 window.clearInterval(resfreshViewTimer); 3483 } 3484 3485 if (!loginFormShown) { 3486 de.his.modules.SessionRefresh.logoutServerSession(); 3487 de.his.modules.SessionTimeout.showLoginForm(); 3488 loginFormShown = true; 3489 } 3490 } 3491 }; 3492 3493 this.bindFocus = function (alert) { 3494 jQuery("[id='focusTrapEnde']", alert).on("focus", function(){ 3495 jQuery("[class='alertWarningBody']").focus(); 3496 }); 3497 3498 jQuery("[id='focusTrapStart']", alert).on("focus", function(){ 3499 jQuery("a",alert).focus(); 3500 }); 3501 }; 3502
3503 // Wenn nur noch 0 bis 5 Minuten der Sessionzeit eines eingeloggten 3504 // Benutzers übrig sind, kann dieser die Session mit klicken auf "ok" 3505 // zurücksetzen und verlängern. 3506 this.refreshSession = function() { 3507 if (!timedOut) { 3508 this.refreshServerSession(); 3509 this.refresh(); 3510 this.init(); 3511 } 3512 }; 3513 3514 this.lastRefresh = function() { 3515 lastRefresh = new Date().getTime(); 3516 de.his.common.Cookie.create('lastRefresh', lastRefresh); 3517 } 3518 3519 this.setRefreshServerSessionTimeout = function( ajax ){ 3520 if (!timedOut) { 3521 console.log("Running refresh Session Timeout.") 3522 this.refreshServerSession( ajax ); 3523 resfreshTimer = window.setTimeout( function() { 3524 de.his.modules.SessionRefresh.setRefreshServerSessionTimeout(); 3525 }, refreshSec*1000); 3526 } 3527 } 3528 3529 /** 3530 * refreshes the session one time 3531 */ 3532 this.refreshServerSession = function( ajax ) { 3533 var me = this; 3534 console.log("refreshing Server Session"); 3535 if( ajax !== false ){ //ajax can be undefined, null or boolean - only interesting if its false 3536 jQuery.ajax({ 3537 global: false, 3538 url : de.his.common.ContextInformation.get('context-path') + '/pages/common/setSessionTimeout.faces', 3539 success : function() { 3540 me.lastRefresh(); 3541 }, 3542 error : function() { 3543 de.his.ajax.Refresher.onError('Fehler beim aktuallisieren der Server Session.'); 3544 }, 3545 complete : function(){ 3546 self.refresh(); 3547 } 3548 }); 3549 }else{ 3550 me.lastRefresh(); 3551 } 3552 3553 }; 3554 3555 /** 3556 * logout current user via ajax request 3557 */ 3558 this.logoutServerSession = function (){ 3559 jQuery.ajax({ 3560 global: false, 3561 url: de.his.common.ContextInformation.get('context-path') 3562 + "/rds?state=user&type=3&category=auth.logout&source=js-timeout", 3563 complete : function(){ 3564 self.refresh(); 3565 } 3566 }); 3567 // von SuperX abmelden 3568 jQuery.ajax({ 3569 global: false, 3570 url: de.his.common.ContextInformation.get('host') 3571 + "/superx/servlet/SuperXmlAbmeldung", 3572 complete : function(){ 3573 self.refresh(); 3574 } 3575 }); 3576 } 3577 3578 /** 3579 * sets global refresh flag on server session 3580 */ 3581 this.setRefresh = function(value) { 3582 console.log("set Server Refresh Session Cookie to "+value); 3583 jQuery.ajax({ 3584 global: false, 3585 url : de.his.common.ContextInformation.get('context-path') 3586 + '/pages/common/setSessionTimeout.faces?refreshSession=' 3587 + value, 3588 success : function() { 3589 lastRefresh = new Date().getTime(); 3590 de.his.common.Cookie.create('lastRefresh', lastRefresh); 3591 de.his.common.ContextInformation.set("global-refresh-session", value); 3592 }, 3593 error : function() { 3594 de.his.ajax.Refresher.onError('Fehler beim setzen des globalen Refresh flags.'); 3595 }, 3596 complete : function(){ 3597 self.refresh(); 3598 } 3599 }); 3600 }; 3601};/** 3602 * Definiert einige Tastenkombinationen, die Funktionen in HISinOne ausführen 3603 * Insbesondere ESC zum schlieÃen von modalen Overlays, Message-Infoboxen, Popups und Callbacks 3604 * SchlieÃen Buttons werden mit der styleClass .simple-close-button-behavior deklariert 3605 * Sind keine Buttons mit .simple-close-button-behavior deklariert, wird versucht den ersten Button mit .cancel-button-behavior aus zu lösen, die in einem Overlay vorkommen können. 3606 */ 3607de.his.modules.Shortcuts = new function() { 3608 de.his.modules.ModuleRegistry 3609 .registerModule(this); 3610 this.moduleName = "de.his.modules.Shortcuts"; 3611 this.init = function() { 3612 3613 /** bei Nachfragen (callBack.xhtml) kann der Abbrechen/Nein-Button per Escape-Taste bedient werden. */ 3614 jQuery(document).keyup(function(e) { 3615 // enter Shortcut führt zu Problemen wenn zusätzlich zu einer Nutzerrückfrage Infoboxen wie z.B. Warnhinweise angezeigt werden. siehe #352866 3616 /*if (e.keyCode == 13) { // enter 3617 jQuery('.ok-button-behavior:visible').first().click(); 3618 }*/ 3619 if (e.keyCode == 27) { // esc 3620 3621 // wenn UserQuery callback vorhanden 3622 // ist immer am Anfang der Seite 3623 var callBackContainer = jQuery('div[data-infobox-type="Query"]'); 3624 if (callBackContainer.length > 0) { 3625 var callBackCancelButton = callBackContainer.find('.cancel-button-behavior'); 3626 if (callBackCancelButton.length > 0) { 3627 console.log("ESC click legacy callback cancel:", callBackCancelButton); 3628 callBackCancelButton.click(); 3629 } 3630 return false;
3631 } 3632 // Wenn ein infoboxCloseButton vorhanden ist, dann soll nur dieser ausgelöst werden 3633 // ist immer am Anfang der Seite, daher eine Ausnahme von anderen simpleCloseButtons 3634 var infoboxClose = jQuery('.simple-close-button-behavior.infobox_close:visible').first(); 3635 if (infoboxClose.length > 0) { 3636 console.log("ESC click infoboxClose:", infoboxClose); 3637 infoboxClose.click(); 3638 return false; 3639 } 3640 // Wenn ein simpleCloseButton vorhanden ist, dann soll dieser ausgelöst werden 3641 // sind verschachtelt am Anfang der modalen Overlay Komponente, daher immer letzten nehmen 3642 var simpleCloseButton = jQuery('.simple-close-button-behavior:visible').last(); 3643 if (simpleCloseButton.length > 0) { 3644 console.log("ESC click simpleCloseButton:", simpleCloseButton); 3645 simpleCloseButton.click(); 3646 return false; 3647 } 3648 3649 // sind verschachtelt am Ende der modalen Overlay Komponente, daher immer ersten nehmen 3650 var cancelButton = jQuery('.cancel-button-behavior:visible').first(); 3651 if (cancelButton.length > 0) { 3652 console.log("ESC click cancelButton:", cancelButton); 3653 cancelButton.click(); 3654 return false; 3655 } 3656 } 3657 }); 3658 }; 3659};/** 3660 * Objekt das Funktionalitäten zum 'Warten' bereitstellt. 3661 * - Graut den Bildschirm (kurz) aus, wenn 3662 * - eine Form submitted wird 3663 * - markierte Links geklickt werden 3664 * - markierung erfolgt mit der Styleklasse 'waiting-behavior' 3665 * - mit der Styleklasse 'short-waiting-behavior' markierte Links bewirken nur einen "warten"-Cursor 3666 * - links, buttons und inputs innerhalb 3667 * - Verhindert bspw. auch Doppelklicks. 3668 * 3669 * Bei Downloads: 3670 * Die Download-Ausgabe-Komponente muss ein Cookie 'download-complete=true' mitschicken, damit das JS erkennt, das der Doownload fertig ist. 3671 */ 3672de.his.modules.Waiting = new function() { 3673 de.his.modules.ModuleRegistry 3674 .registerModule(this) 3675 .registerAjaxRefreshModule(this); 3676 this.moduleName = "de.his.modules.Waiting"; 3677 this.init = function() { 3678 console.log('[.waiting] init'); 3679 initIntern(this, false); 3680 jQuery(window).on("unload", function() { 3681 // dummy unload, forces Firefox to re-run the on-ready code if the user pressed the back button. 3682 }); 3683 3684 jQuery(window).on("beforeunload", function() { 3685 console.log("[.waiting] beforeunload"); 3686 jsf.ajax.cancel(); // Laufende und ausstehende Ajax-Requests entfernen 3687 // PrimeFaces.ajax.Queue.abortAll(); // wird vielleicht mal interessant 3688 }); 3689 3690 }; 3691 3692 this.refresh = function(data) { 3693 console.log('[.waiting] refresh'); 3694 var doResetWaiting = (data == null) || hasWaitingBehavior(data); 3695 initIntern(this, doResetWaiting); 3696 }; 3697 3698 var initIntern = function(self, doResetWaiting) { 3699 if (doResetWaiting) { 3700 resetNormalWaiting(); 3701 } 3702 console.log("waiting start"); 3703 /** bei jedem submit den Screen ausgrauen. */ 3704 jQuery( "form:not(.no-waiting-behavior, .full-screen-waiting-behavior)" ).each( function(index, elem) { 3705 if( typeof jQuery(elem).data("waitingBehaviorSet") !== 'undefined'){ 3706 return; 3707 } 3708 jQuery(elem).data("waitingBehaviorSet", true); 3709 // schaltet das Script bei Angular o.ä. eingebetteten Anwendungen aus. 3710 if(jQuery(".noHisJsModule").length > 0 && jQuery(elem).closest(".noHisJsModule").length > 0){ 3711 // Angular Formulare ausnehmen. 3712 console.log(".noHisJsModule found on parent... Do not register waiting handlers."); 3713 return; 3714 } 3715 3716 // JSF führt direkt form.submit aus, wenn kein form.onsubmit gesetzt ist. 3717 // Und wider erwarten schreibt sich jQuery hier nicht rein, wenn man .submit(function(){}) benutzt 3718 var prevOnsubmit = this.onsubmit; 3719 this.onsubmit = function( event ) { 3720 3721 var $form = jQuery( this ); 3722 if ( $form.attr("target") !== "_blank" && $form[0].tagName && this.id != ''){
3723 console.log("form: "+this.id); 3724 self.executeNormalWaiting(this.id); 3725 } 3726 if (prevOnsubmit) { 3727 prevOnsubmit(event); 3728 } 3729 }; 3730 } ); 3731 3732 /** bei speziell ausgezeichneten Buttons ein 'full screen waiting' durchführen. */ 3733 jQuery('form.full-screen-waiting-behavior').submit(function(e) { 3734 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3735 return; 3736 } 3737 jQuery(this).data("waitingBehaviorSet", true); 3738 if (de.his.common.ContextInformation.isEditUITexts()) { 3739 return; 3740 } 3741 3742 3743 // den eigentlichen Text über data-Attribut holen 3744 // TODO JSF2 Dazu muss die JSF-Komponenten diese Attribute rendern 3745 // TODO JSF2 Für die Anmeldemaske ginge es schon so, da hier eh html-Input-Tags benutzt werden 3746 // SOLUTION: <f:passThroughAttribute name="data-waiting-text" value="Bitte warten..." /> 3747 var text = jQuery(this).data('waiting-text') || ""; 3748 self.executeFullScreenWaiting(text); 3749 3750 }); 3751 3752 jQuery('input.full-screen-waiting-behavior, a.full-screen-waiting-behavior, button.full-screen-waiting-behavior').not(".no-waiting-behavior").click(function(e) { 3753 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3754 return; 3755 } 3756 jQuery(this).data("waitingBehaviorSet", true); 3757 if (this.tagName == 'a' && (e.ctrlKey || e.shiftKey)) { 3758 return; 3759 } 3760 console.log("execute Full Screen Waiting"); 3761 var text = jQuery(this).data('waiting-text') || ""; 3762 self.executeFullScreenWaiting(text); 3763 setWaitingBehaviorMarker(this); 3764 3765 }); 3766 3767 3768 /** 3769 * only allow interactive elements (input, a, button) to have an waiting behaviour. Otherwise non active elements can block the UI upon accidental clicks 3770 */ 3771 jQuery('input.waiting-behavior, a.waiting-behavior, button.waiting-behavior, .waiting-behavior input, .waiting-behavior a, .waiting-behavior button').click(function(e) { 3772 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3773 return; 3774 } 3775 jQuery(this).data("waitingBehaviorSet", true); 3776 if ((this.tagName.toLowerCase() === 'a' && (e.ctrlKey || e.shiftKey)) 3777 || (this.tagName.toLowerCase() === 'a' && jQuery(this).attr("target") === "_blank")){ 3778 return; 3779 } 3780 console.log("tagName:" + this.tagName == 'a'); 3781 console.log("execute Normal Waiting"); 3782 self.executeNormalWaiting(this.id); 3783 setWaitingBehaviorMarker(this); 3784 }); 3785 3786 jQuery('input.short-waiting-behavior:not(.rf-sel, [onchange]), a.short-waiting-behavior:not(.rf-sel), button.short-waiting-behavior:not(.rf-sel), .short-waiting-behavior:not(.rf-sel, .radio-buttons, .ui-selectonemenu) input:not([onchange]), .short-waiting-behavior:not(.rf-sel) button, .short-waiting-behavior:not(.rf-sel) a, .scroller a').not(".waiting-behavior, .no-waiting-behavior, .full-screen-waiting-behavior").click(function(e) { 3787 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3788 return; 3789 } 3790 jQuery(this).data("waitingBehaviorSet", true); 3791 if ((this.tagName.toLowerCase() === 'a' && (e.ctrlKey || e.shiftKey)) 3792 || (this.tagName.toLowerCase() === 'a' && jQuery(this).attr("target") === "_blank")) { 3793 return; 3794 } 3795 console.log("execute Short Waiting (not .rd-sel)"); 3796 self.executeShortWaiting(this.id); 3797 setWaitingBehaviorMarker(this); 3798 }); 3799 3800 3801 // Radiobuttons benötigen 'change'-Event 3802 jQuery('.short-waiting-behavior.radio-buttons:not(.no-waiting-behavior, .full-screen-waiting-behavior)').on("change", function(e){ 3803 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3804 return; 3805 } 3806 jQuery(this).data("waitingBehaviorSet", true); 3807 console.log("execute Short Waiting (radio-buttons)");
3808 self.executeShortWaiting(this.id); 3809 setWaitingBehaviorMarker(this); 3810 }); 3811 3812 // Sonstige Inputs mit 'change'-Event 3813 jQuery('input.short-waiting-behavior[onchange]:not(.no-waiting-behavior)').on("change", function(e){ 3814 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3815 return; 3816 } 3817 jQuery(this).data("waitingBehaviorSet", true); 3818 console.log("execute Short Waiting (input with 'onchange' e.g. checkboxes)"); 3819 self.executeShortWaiting(this.id); 3820 setWaitingBehaviorMarker(this); 3821 }); 3822 3823 // Inputs mit 'change'-Event innerhalb einer Tabelle - z.B. selectManyCheckbox - 3824 jQuery('table.short-waiting-behavior:not(.no-waiting-behavior)').on("change", 'input[onchange]', function(e){ 3825 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3826 return; 3827 } 3828 jQuery(this).data("waitingBehaviorSet", true); 3829 console.log("execute Short Waiting (input with 'onchange' e.g. checkboxes in selectManyCheckbox component)"); 3830 jQuery(this).addClass('short-waiting-behavior'); 3831 self.executeShortWaiting(this.id); 3832 setWaitingBehaviorMarker(this); 3833 }); 3834 3835 // Primefaces SelectOneMenu benötigt 'selectitem'-Event 3836 jQuery('.short-waiting-behavior.ui-selectonemenu').on("selectitem", function(e){ 3837 if( typeof jQuery(this).data("waitingBehaviorSet") !== 'undefined'){ 3838 return; 3839 } 3840 jQuery(this).data("waitingBehaviorSet", true); 3841 console.log("execute Short Waiting (.ui-selectonemenu)"); 3842 self.executeShortWaiting(this.id); 3843 setWaitingBehaviorMarker(this); 3844 }); 3845 3846 }; 3847 3848 var setWaitingBehaviorMarker = function(source) { 3849 source.setAttribute("data-startsWaiting", "true"); 3850 } 3851 3852 var hasWaitingBehavior = function(data) { 3853 3854 // Workaround für manipulierte checkboxes ('checkboxified') 3855 if (data.source.type == "checkbox") { 3856 return data.source.classList.contains("short-waiting-behavior"); 3857 } 3858 3859 return data.source.getAttribute("data-startsWaiting") == "true"; 3860 } 3861 3862 this.executeFullScreenWaiting = function(waitingText){ 3863 if (jQuery("#full-screen-waiting").length > 0) { 3864 console.log('[.waiting] full-screen-waiting already exists'); 3865 return; 3866 } 3867 // normal waitings are needed by automated tests. 3868 executeWaiting('curtainBackgroundTransparent', this.id 3869 ); 3870 3871 jQuery('body').append(''+ 3872 '<div id="full-screen-waiting" class="curtainBoxCallBackBackground waitingCursor">'+ 3873 ' <center><div class="curtainBoxCallBack">'+ 3874 ' <div class="infobox confirm_infobox" style="background-color: rgba(255, 255, 255, 0.9) !important;">'+ 3875 ' <center>'+ 3876 ' <div class="imageContainer imageContainerWaitingPadding">'+ 3877 3878 // Variant 1 3879 '<div class="floatBarsGContainer" >'+ 3880 ' <div id="" class="floatBarsG floatBarsG_1"></div>'+ 3881 ' <div id="" class="floatBarsG floatBarsG_2"></div>'+ 3882 ' <div id="" class="floatBarsG floatBarsG_3"></div>'+ 3883 ' <div id="" class="floatBarsG floatBarsG_4"></div>'+ 3884 ' <div id="" class="floatBarsG floatBarsG_5"></div>'+ 3885 ' <div id="" class="floatBarsG floatBarsG_6"></div>'+ 3886 ' <div id="" class="floatBarsG floatBarsG_7"></div>'+ 3887 ' <div id="" class="floatBarsG floatBarsG_8"></div>'+ 3888 '</div>'+ 3889 3890 // original 3891 //' <img src="/HISinOne/images/loader/loader_33.gif" title=" " alt=" " />'+ 3892 ' </div>'+ 3893 ' ' + waitingText + ''+ 3894 ' </center>'+ 3895 ' </div>'+ 3896 ' <div class="clearer"></div>'+ 3897 ' </div></center>'+ 3898 '</div>'); 3899 } 3900 3901 this.executeShortWaiting = function(sourceId) {
3902 executeWaiting('curtainBackgroundTransparent loadingTopAnimation', sourceId); 3903 }; 3904 3905 this.executeNormalWaiting = function(sourceId) { 3906 executeWaiting('curtainBoxCallBackBackground loadingTopAnimation', sourceId); 3907 }; 3908 3909 var executeWaiting = function(styleClass, sourceId) { 3910 if (de.his.common.ContextInformation.isEditUITexts()) { 3911 return; 3912 } 3913 if (jQuery("#global-waiting").length > 0) { 3914 console.log('[.waiting] global-waiting already exists - skipping: %s from %s', styleClass, sourceId); 3915 return; 3916 } 3917 3918 console.log('[.waiting] setting global-waiting with style: %s from %s', styleClass, sourceId); 3919 jQuery('body').append(''+ 3920 ' <div id="global-waiting" class="' + styleClass + ' waitingCursor">'+ 3921 ' <div></div>'+ // do not remove. is used for the "flicker" effekt on waiting click 3922 ' </div>'); 3923 3924 // Warn when user tries to click while waiting to complete the request 3925 jQuery("#global-waiting").click(function() { 3926 var childs = jQuery(this).children(); 3927 childs.fadeIn(50, function() { 3928 childs.fadeOut(30); 3929 }); 3930 }); 3931 3932 // Bei Download-Links wird die Seite nicht neugerendert. 3933 // Deswegen wird wird hier ein Cookie ausgelesen, dass durch die Download-Ausgabe-Komponente gesetzt werden muss. 3934 resetOnComplete('global-waiting', sourceId); 3935 }; 3936 3937 var resetOnComplete = function(elementId, sourceId) { 3938 setTimeout(function () { 3939 reset(elementId, sourceId); 3940 }, 100); 3941 }; 3942 3943 var reset = function(elementId, sourceId) { 3944 if (de.his.common.Cookie.read("download-complete") == 'true') { 3945 //de.his.component.MessagesInfobox.showMessagesInfobox('Download Complete remove waiting-behaviour','success'); 3946 de.his.common.Cookie.erase("download-complete"); 3947 console.log('[.waiting] download-complete; resetting: %s from %s', elementId, sourceId); 3948 3949 jQuery('#'+elementId).css("animation", "fadeout 0.5s"); 3950 setTimeout(function () { 3951 jQuery('#' + elementId).remove(); 3952 }, 500); 3953 3954 if(de.his.component.Poll) { 3955 de.his.component.Poll.downloadComplete(); 3956 } 3957 } else { 3958 setTimeout(function () { 3959 // console.log('[.waiting] reset step: %s from %s', elementId, sourceId); 3960 reset(elementId, sourceId); 3961 }, 100); 3962 } 3963 }; 3964 3965 var resetNormalWaiting = function() { 3966 jQuery('#global-waiting').css("animation", "fadeout 0.5s"); 3967 jQuery('#global-waiting').css("cursor", "initial"); 3968 setTimeout(function(){ 3969 if(de.his.common.browser.isChrome()){ 3970 de.his.common.chromeCursorFix(); 3971 } 3972 console.log('[.waiting] resetting global-waiting'); 3973 jQuery('#global-waiting').remove(); 3974 }, 500); 3975 3976 if (jQuery("#full-screen-waiting").length > 0) { 3977 jQuery('#full-screen-waiting').css("animation", "fadeout 0.5s"); 3978 setTimeout(function(){ 3979 if(de.his.common.browser.isChrome()){ 3980 de.his.common.chromeCursorFix(); 3981 } 3982 console.log('[.waiting] resetting global-waiting'); 3983 jQuery('#full-screen-waiting').remove(); 3984 }, 500); 3985 } 3986 de.his.common.Cookie.erase("download-complete"); 3987 }; 3988 3989 this.resetWaitingBehaviour = function(){ 3990 resetNormalWaiting(); 3991 } 3992 /** 3993 * small or big 3994 * 2 or 1 3995 */ 3996 this.getWaitingAnimationHtml = function (variant){ 3997 if(variant === 'big' || variant === 1){ 3998 var html = '<div class="floatBarsGContainer waitingAnimation">'+ 3999 '<div class="floatBarsG floatBarsG_1"></div>'+ 4000 '<div class="floatBarsG floatBarsG_2"></div>'+ 4001 '<div class="floatBarsG floatBarsG_3"></div>'+ 4002 '<div class="floatBarsG floatBarsG_4"></div>'+ 4003 '<div class="floatBarsG floatBarsG_5"></div>'+ 4004 '<div class="floatBarsG floatBarsG_6"></div>'+ 4005 '<div class="floatBarsG floatBarsG_7"></div>'+ 4006 '<div class="floatBarsG floatBarsG_8"></div>'+ 4007 '</div>'; 4008 } 4009 if(variant === 'small' || variant === 2){ 4010 var html = '<div class="theySeeMeLoading" >'+ 4011 '<div class="cssload-loader waitingAnimation" >'+ 4012 '<div class="cssload-flipper">'+ 4013 '<div class="cssload-front"></div>'+ 4014 '<div class="cssload-back"></div>'+ 4015 '</div>'+ 4016 '</div>'+ 4017 '</div>'; 4018 } 4019 return html; 4020 }; 4021 /** 4022 * removes all objects with .waitingAnimation 4023 */ 4024 this.removeWaitingAnimationHtml = function (){ 4025 console.log('[.waiting] removing waitingAnimation'); 4026 jQuery(".waitingAnimation").remove(); 4027 }; 4028 4029 4030 this.isShortWaitingActive = function () { 4031 var globalWaiting = jQuery('#global-waiting.curtainBackgroun
4031dTransparent'); 4032 return globalWaiting.length > 0; 4033 } 4034 4035 this.isFullWaitingActive = function () { 4036 var globalWaiting = jQuery('#global-waiting.curtainBoxCallBackBackground'); 4037 if (globalWaiting.length > 0) { 4038 return true; 4039 } 4040 4041 var fullScreenWaiting = jQuery('#full-screen-waiting'); 4042 if (fullScreenWaiting.length > 0) { 4043 return true; 4044 } 4045 4046 return false; 4047 } 4048};/** 4049 * fügt Links mit der Klasse js_outputLink_newWindow eine popup funktionalität hinzu und zentriert das popup automatisch. 4050 */ 4051de.his.modules.Window = new function() { 4052 de.his.modules.ModuleRegistry.registerModule(this); 4053 this.moduleName = "de.his.modules.Window"; 4054 this.init = function() { 4055 jQuery(".outputLink-newWindow-behavior").click(function(event) { 4056 var width, 4057 height; 4058 4059 event.preventDefault(); 4060 4061 // get Width and Height, otherwise use default 4062 if (jQuery(this).attr('data-popupWidth') !== undefined) { 4063 width = jQuery(this).attr('data-popupWidth'); 4064 } else { 4065 width = 800; // default Width 4066 } 4067 if (jQuery(this).attr('data-popupHeight') !== undefined) { 4068 height = jQuery(this).attr('data-popupHeight'); 4069 } else { 4070 height = 400; // default Height 4071 } 4072 // center popup window automatically 4073 var top = (document.body.clientHeight / 2) - (height / 2); 4074 var left = (document.body.clientWidth / 2) - (width / 2); 4075 4076 window.open(jQuery(this).attr("href"), 'newwindow', 'menubar=no,resizable=yes,scrollbars=yes,status=no,width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ''); 4077 }); 4078 }; 4079};/** 4080 * Zweck: 4081 * - linkes Menü per JS ein-/ausklappen. Der Zustand wird per f:ajax an den Server übertragen. 4082 * - mobiles menü im mobile modus 4083 * - Ãnderungen am menü für desktop ansicht auf mobilen Geräten 4084 */ 4085 4086de.his.modules.NavigationMenu = new function() { 4087 4088 de.his.modules.ModuleRegistry.registerModule(this); 4089 this.moduleName = "de.his.modules.NavigationMenu"; 4090 var navigation = { 4091 /** 4092 * used to determine whether the navigation is currently open - only for mobile 4093 * @property navOpen 4094 * @private 4095 * @type {Boolean} 4096 * @default false 4097 */ 4098 navOpen: false, 4099 /** 4100 * @property topNav 4101 * @type {jQuery Object} 4102 * @private 4103 * @default null 4104 */ 4105 topNav: null, 4106 /** 4107 * @property leftMenu 4108 * @type {jQuery Object} 4109 * @private 4110 * @default null 4111 */ 4112 leftMenu: null, 4113 /** 4114 * @property minNav 4115 * @type {jQuery Object} 4116 * @private 4117 * @default null 4118 */ 4119 minNav: null, 4120 /** 4121 * @property touchMoved 4122 * @type {Boolean} 4123 * @private 4124 * @default null 4125 */ 4126 touchMoved: null, 4127 /** 4128 * @property childULClass
4129 * @type String} 4130 * @default "smartphoneNavigation" 4131 */ 4132 childULClass: "smartphoneNavigation", 4133 /** 4134 * stop the height resize event being set more than once - memory leak 4135 * @property winheightResize 4136 * @private 4137 * @type {Boolean} 4138 * @default false 4139 */ 4140 winheightResize: false, 4141 /** 4142 * used on smartphones for showing menus on top of each other 4143 * @property globalZindex 4144 * @type {Integer} 4145 * @default 10 4146 */ 4147 globalZindex: 10, 4148 /** 4149 * attached to the body element to indicate that the navigation is open and apply certain styles 4150 * @property navigationOpenClass 4151 * @type {String} 4152 * @private 4153 * @default "navigationOpen" 4154 */ 4155 navigationOpenClass: "navigationOpen", 4156 /** 4157 * @property mobileNav 4158 * @private 4159 * @type {jQuery Object} 4160 * @default null 4161 */ 4162 mobileNav: null, 4163 /** 4164 * @property mobileNavSelector 4165 * @private 4166 * @type {String} 4167 * @default ".topMenuContainer" 4168 */ 4169 mobileNavSelector: ".topMenuContainer", 4170 /** 4171 * 4172 */ 4173 getNavForMobile: function(){ 4174 var me = this; 4175 if(!me.mobileNav){ 4176 me.mobileNav = jQuery( me.mobileNavSelector ); 4177 } 4178 4179 return me.mobileNav; 4180 }, 4181 /** 4182 * @method getTopNav 4183 * @return {jQuery Object} 4184 */ 4185 getTopNav: function(){ 4186 var me = this; 4187 if(!me.topNav){ 4188 me.topNav = jQuery(".topMenuContainer"); 4189 } 4190 return me.topNav; 4191 }, 4192 /** 4193 * @method getLeftMenu 4194 * @return {jQuery Object} 4195 */ 4196 getLeftMenu: function(){ 4197 var me = this; 4198 if(!me.leftMenu){ 4199 me.leftMenu = jQuery("#leftMenu"); 4200 } 4201 return me.leftMenu; 4202 }, 4203 /** 4204 * @method getMinNav 4205 * @return {jQuery Object} 4206 */ 4207 getMinNav: function(){ 4208 var me = this; 4209 if(!me.minNav){ 4210 me.minNav = jQuery("#min_navigation"); 4211 } 4212 return me.minNav; 4213 }, 4214 /** 4215 * @method removeMenu 4216 */ 4217 removeMenu: function() { 4218 var me = this, 4219 leftMenu = me.getLeftMenu(); 4220 if(!leftMenu.hasClass("_ignoreForTablet")){ 4221 leftMenu.hide(); 4222 me.getMinNav().show(); 4223 4224 // CSS Klassen ersetzen 4225 jQuery(".content_navi_on").removeClass('content_navi_on').addClass('content_max_navi_off'); 4226 jQuery("#wrapper").attr("id", "wrapper_no_navigation"); 4227 } 4228 4229 }, 4230 /** 4231 * redirect to removeMenu 4232 * @method hideMenu 4233 */ 4234 hideMenu: function(){ 4235 var me = this; 4236 return me.removeMenu.apply(me, arguments) 4237 }, 4238 /** 4239 * @method showMenu 4240 */ 4241 showMenu: function() { 4242 var me = this, 4243 leftMenu = me.getLeftMenu(); 4244 4245 if(!leftMenu.hasClass("_ignoreForTablet")){ 4246 leftMenu.show(); 4247 me.getMinNav().hide(); 4248 4249 jQuery('.content_max_navi_off').removeClass('content_max_navi_off').addClass('content_navi_on'); 4250 jQuery('#wrapper_no_navigation').attr('id', 'wrapper'); 4251 } 4252 }, 4253 /** 4254 * override the behaviour of the current top navigation for smartphones - i.e the submenus in particular 4255 * @method overrideNavigationForMenu 4256 */ 4257 overrideNavigationForMenu: function(doParentLinkClick){ 4258 var me = this, 4259 top = me.getTopNav(), 4260 nav = jQuery("> ul.nav", top), 4261 links; 4262 console.log('overrideNavigationForMenu'); 4263 if(nav.length){ 4264 links = jQuery("li.parentListItem > a", nav); 4265 console.log('we have links in nav.'); 4266 if(links.length){ 4267 links.click(function(event){ 4268 console.log('navlink Clicked'); 4269 if(jQuery(this).hasClass('subMenuLink')){ 4270 // another submenu in desktop view 4271 // leave the link clickable, do nothing. 4272 console.log('subMenuLink Clicked'); 4273 }else{ 4274 console.log('try parentLinkClick'); 4275 4276 event.preventDefault(); 4277 if(doParentLinkClick){ 4278 // indicates mobile menu on mobile 4279 me.parentLinkClickMobile(this); 4280 }else{ 4281 // indicates desktop menu on mobile 4282 me.parentLinkClickDesktop(this); 4283 } 4284 } 4285 }); 4286 } 4287 } 4288 }, 4289 /** 4290 * called by link.click in overrideNavigationForMenu 4291 * @method parentLinkClick 4292 * @private 4293 * @param el {HTMLElement} click events "this" property 4294 */ 4295 parentLinkClickDesktop : function(el) { 4296 window.console.log('parentLinkClick'); 4297 var me = this, $this = jQuery(el), child = $this.siblings("ul"), $window = jQuery(window), orientationchange; 4298 4299 if (child.length) { 4300 console.log('childs are there..'); 4301 orientationchange = function() { 4302 var $thisOffset = $this.parent().offset(); 4303 4304 if ($thisOffset.left + child.width() > $window.width()) { 4305 child.css("left", $window.innerWidth() - child.width()); 4306 } else { 4307 child.css("left", $thisOffset.left); 4308 } 4309 child.css("margin", 0); // disable margin on orientation change, easier than to compute them and take them into account 4310 // child.css("top", $thisOffset.top + ($this.outerHeight())); 4311 console.log('orientation computed!'); 4312 }; 4313 child.addClass(me.childULClass); 4314 // orientation change event 4315 $window.on("orientationchange, resize", orientationchange); 4316 4317 document.ontouchend = function(e) { 4318 if (!$(e.target).closest('.smartphoneNavigation')) { 4319 jQuery(child).css('display', 'none'); 4320 document.activeElement.blur(); 4321 } 4322 }; 4323 } 4324 }, 4325 parentLinkClickMobile: function(el){ 4326 var me = this, 4327 $this = jQuery(el), 4328 child = $this.siblings("ul"), 4329 top = me.getTopNav(), 4330 topOffset = top.offset(), 4331 $window = jQuery(window), 4332 $document = jQuery(document), 4333 windowHeight = $document.height(), 4334 zIndex = $this.css("z-index"), 4335 orientationchange, 4336 backButton; 4337 4338 if(typeof zIndex === "number"){ 4339 zIndex += 1; 4340 }else{ 4341 me.globalZindex += 1; 4342 zIndex = me.globalZindex 4343 } 4344 4345 if(child.length){ 4346 4347 orientationchange = function(){ 4348 4349 if( jQuery('body').hasClass('navigationOpen') ){ 4350 jQuery('.navbar-toggle').trigger('click'); 4351 } 4352 4353 var _top = top.offset().top, 4354 _windowHeight = $window.height(); 4355 child.css("top", _top); 4356 child.css("bottom", "0px"); 4357 child.css("height", jQuery('.topMenuContainer').height()); 4358 console.log("orientation/resize computed.") 4359 }; 4360 4361 child.addClass(me.childULClass); 4362 child.css({ 4363 top: topOffset.top, 4364 bottom: "0px", 4365 height: jQuery('.topMenuContainer').height(), 4366 zIndex: zIndex 4367 }); 4368 4369 //orientation change 4370 $window.on("orientationchange", orientationchange); 4371 4372 backButton = jQuery("> li.mobileOnly > a.backButton", child); 4373 if(backButton.length){ 4374 backButton.on("click", function(){ 4375 me.globalZindex -= 1; 4376 child.removeClass(me.childULClass); 4377 $window.off("orientationchange", orientationchange); 4378 }); 4379 } 4380 4381 } 4382 4383 }, 4384 /** 4385 * this method sets the height of target to that of the (device height - it's y position) 4386 * @method resizeHeight 4387 * @param target {jQuery Object} 4388 */ 4389 resizeHeight: function(target){ 4390 var height = window.innerHeight ? window.innerHeight : $(window).height(); 4391 target.css({ 4392 height: (height - target.offset().top), 4393 overflow: "auto" 4394 }); 4395 }, 4396 4397 /** 4398 * @method toggle 4399 */ 4400 toggle: function(data){ 4401 var me = this; 4402 return de.his.ajax.Helper.callHandlerIfPhase(data, "begin", me.toggleMenu, me); 4403 }, 4404 /** 4405 * used to toggle the left navigation 4406 * @method toggleMenu 4407 */ 4408 toggleMenu: function(){ 4409 var me = this, 4410 leftMenu = me.getLeftMenu(), 4411 minNav = me.getMinNav(); 4412 4413 if(leftMenu.length && minNav.length){ 4414 if(leftMenu.is(":visible")){ 4415 me.removeMenu(); 4416 }else{ 4417 me.showMenu(); 4418 } 4419 } 4420 4421 }, 4422 /** 4423 * @method remove 4424 */ 4425 remove: function(data) { 4426 var me = this; 4427 return de.his.ajax.Helper.callHandlerIfPhase(data, "begin", mw.removeMenu, me); 4428 }, 4429 /** 4430 * @method show 4431 */ 4432 show: function(data) { 4433 var me = this; 4434 return de.his.ajax.Helper.callHandlerIfPhase(data, "begin", me.showMenu, me); 4435 }, 4436 4437 /** 4438 * @method initDesktop 4439 */ 4440 initDesktop: function() { 4441 jQuery( document ).on( "click", ".topMenuLink, .subMenuLink, .bookmarkPopupMenuLink", function(e) { 4442 // Kein waiting behaviour auslösen, wenn auf einen Eintrag mit Strg+Click oder Shift+Click geklickt wird. 4443 if (e.ctrlKey || e.shiftKey) { 4444 return; 4445 } 4446 if ( jQuery(this).attr("target") !== "_blank" ){ 4447 de.his.modules.Waiting.executeNormalWaiting(); 4448 } 4449 } ); 4450 }, 4451 4452 /** 4453 * set up an initial conditions when viewed on a tablet 4454 * @method initTablet 4455 */ 4456 initTablet: function(){ 4457 var me = this; 4458 4459 jQuery(document).bind("touchstart", function(e){ 4460 me.touchMoved = false;
4461 }); 4462 4463 jQuery(document).bind("touchmove", function(e){ 4464 me.touchMoved = true; 4465 }); 4466 4467 jQuery(document).bind("touchend", function(e){ 4468 var nav = me.getLeftMenu(); 4469 4470 if(nav.is(":visible")){ 4471 4472 //check if the coordinates are the same -- i.e if the use is not scrolling 4473 if(!me.touchMoved){ 4474 4475 if(!nav.is(e.target) && nav.has(e.target).length == 0){ 4476 me.hideMenu(); 4477 } 4478 4479 } 4480 4481 4482 } 4483 4484 }); 4485 }, 4486 /** 4487 * set up an initial conditions when viewed on a mobile 4488 * @method initMobile 4489 */ 4490 initMobile: function(){ 4491 var me = this; 4492 4493 me.overrideNavigationForMenu(true); 4494 me.initMobileNavToggle(); 4495 4496 }, 4497 /** 4498 * call the widgetPanelIconClick outside of this scope if calling this function from JSF 4499 * - de.his.modules.NavigationMenu.widgetPanelIconClick 4500 * @method widgetPanelIconClick 4501 * this function is called by JSF in 4502 */ 4503 widgetPanelIconClick: function(data){ 4504 var me = this, 4505 body = jQuery("body"), 4506 css = navigation.navigationOpenClass; 4507 4508 //only for mobile 4509 if(window.device && window.device.mobile()){ 4510 body.addClass( navigation.navigationOpenClass ); 4511 4512 if(me.navOpen){ 4513 me.mobileHideNavigation(); 4514 }else{ 4515 //if the icon was clicked again to close it - if the container has no longer 4516 //any content and is no longer visible 4517 if( !jQuery(".infoboxContainer").children().length ){ 4518 //remove class 4519 body.removeClass( navigation.navigationOpenClass ); 4520 } 4521 } 4522 } 4523 if (window.localStorage) { 4524 localStorage.setItem('wpanellsource', jQuery(data.source).attr('id')); 4525 } 4526 }, 4527 widgetPanelClose: function(){ 4528 if (window.localStorage) { 4529 jQuery(document.getElementById(localStorage.getItem('wpanellsource'))).focus(); 4530 } 4531 }, 4532 /** 4533 * registers the events when using the ||| toggle menu button found on the mobile version of the site 4534 * - imitate that of Bootstrap navigation when browser is scaled. 4535 * @method initMobileNavToggle 4536 */ 4537 initMobileNavToggle: function(){ 4538 var me = this; 4539 4540 if ( jQuery(".infoboxContainer > *").length ) { 4541 //has children means a widget it currently open 4542 jQuery("body").addClass( navigation.navigationOpenClass ); 4543 } 4544 4545 jQuery(".navbar-toggle").on("click", function(event){ 4546 return me.toggleMobileNavigation(); 4547 }); 4548 }, 4549 /** 4550 * @method toggleMobileNavigation 4551 */ 4552 toggleMobileNavigation: function(){ 4553 var me = this, 4554 target = me.getNavForMobile(), 4555 widget = jQuery(".closeWidgetPanelButtonLayout > a"); 4556 4557 if(target.length){ 4558 if(target.is(":visible")){ 4559 me.mobileHideNavigation(); 4560 }else{ 4561 me.mobileShowNavigation(); 4562 if(widget.length){ 4563 //TODO: is there has to be a better way of closing the infoboxes!? 4564 //TODO: ajax request? 4565 //mimic click event 4566 widget[0].click(); 4567 } 4568 } 4569 } 4570 }, 4571 /** 4572 * @method mobileHideNavigation 4573 */ 4574 mobileHideNavigation: function(target){ 4575 var me = this, 4576 target = me.getNavForMobile(); 4577 4578 jQuery("li.parentListItem > ul", target).scrollTop(0).removeClass(me.childULClass); 4579 jQuery("body").removeClass( me.navigationOpenClass ); 4580 4581 target.scrollTop(0); 4582 target.hide(); 4583 me.navOpen = false; 4584 }, 4585 /** 4586 * @method mobileHideNavigation 4587 */ 4588 mobileShowNavigation: function(){ 4589 var me = this, 4590 target = me.getNavForMobile(); 4591 4592 jQuery("body").addClass( me.navigationOpenClass ); 4593 4594 if(!me.winheightResize){ 4595 me.winheightResize = true; 4596 jQuery(window).on("resize", function(){ 4597 if(me.navOpen){ 4598 return me.resizeHeight(target); 4599 } 4600 }); 4601 } 4602 4603 target.show(); 4604 me.resizeHeight(target); 4605 me.navOpen = true; 4606 }, 4607 4608 /** 4609 * set up event listeners etc to toggle the top navigation (usually desktop mode) by clicking on the collapse/expand button 4610 * @method initToggleTopNav 4611 */ 4612 initToggleTopNav: function(){ 4613 var me = this, 4614 closeNav, 4615 navigation, 4616 toggleBtn, 4617 closeTheNav, 4618 showTheNav; 4619 4620 if(navigator.cookieEnabled){ 4621 closeNav = window.localStorage.getItem("his_topnavigation_closed") === "true"; 4622 navigation = me.getTopNav(); 4623 toggleBtn = jQuery("#hisinoneHeader .toggleNavigation"); 4624 closeTheNav = function () { 4625 navigation.addClass("topNavClosed"); 4626 navigation.hide(); 4627 toggleBtn.addClass("iconfont-arrow_right_v"); 4628 toggleBtn.removeClass("iconfont-arrow_up_v"); 4629 }; 4630 showTheNav = function () { 4631 navigation.removeClass("topNavClosed"); 4632 navigation.show(); 4633 toggleBtn.removeClass("iconfont-arrow_right_v"); 4634 toggleBtn.addClass("iconfont-arrow_up_v"); 4635 }; 4636 4637 if(closeNav){ 4638 closeTheNav(); 4639 } 4640 4641 toggleBtn.click(function(event, element){ 4642 closeNav = !closeNav; 4643 window.localStorage.setItem("his_topnavigation_closed", closeNav); 4644 if(closeNav){ 4645 closeTheNav(); 4646 }else{ 4647 showTheNav(); 4648 } 4649 //his global function 4650 window.resizeHeader(); 4651 //window.resizeIframesIfAvailable(); 4652 }); 4653 } 4654 }, 4655 /** 4656 * general init method, this is called when the module is loaded 4657 * @method init 4658 */ 4659 init: function(){ 4660 var me = this, 4661 device = window.device, //stop any errors if global doesn't exist 4662 minNav = me.getMinNav(); 4663 4664 if ( device && jQuery(".notBurgernavigation").length ){ 4665 if ( !jQuery("._isDesktopMode").length && !jQuery(".currentDevice_desktop").length) { //todo with left menu on tablet/mobile 4666 if(device.tablet()){ 4667 me.initTablet(); 4668 }else if(device.mobile()){ 4669 me.initMobile(); 4670 } 4671 } 4672 4673 if(jQuery(".currentDevice_desktop").length && jQuery(".originDevice_mobile").length){ 4674 me.overrideNavigationForMenu(false); 4675 } 4676 4677 if ( device.desktop() ) { 4678 me.initDesktop(); 4679 } 4680 4681 4682 } 4683 4684 if(jQuery("form.hide_navigation_onready").length > 0 || (device && device.tablet())){ 4685 minNav.hide(); 4686 me.hideMenu(); 4687 } 4688 4689 // me.initDesktop(); 4690 if ( jQuery(".notBurgernavigation").length ){ 4691 me.initToggleTopNav(); 4692 } else { 4693 me.initDesktop(); 4694 } 4695 4696 } 4697 4698 }; 4699 4700 this.navigation = navigation; 4701 4702 //map old functions in case they are used elsewhere 4703 //TODO: remove and change any calls to these functions and not .navigation 4704 this.toggle = function(){ 4705 // this scope in this context is changed at some point and cannot see this.navigation 4706 // hence the navigation variable 4707 return navigation.toggle.apply(navigation, arguments); 4708 }; 4709 this.toggleMenu = function(){ 4710 return navigation.toggleMenu.apply(navigation, arguments); 4711 }; 4712 this.hideMenu = function(){ 4713 return navigation.hideMenu.apply(navigation, arguments); 4714 }; 4715 this.remove = function(){ 4716 return navigation.remove.apply(navigation, arguments); 4717 }; 4718 this.show = function(){ 4719 return navigation.show.apply(navigation, arguments); 4720 }; 4721 // ********** // 4722 4723 this.init = function(){ 4724 return navigation.init.apply(navigation, arguments); 4725 }; 4726 this.widgetPanelIconClick = function(){ 4727 return navigation.widgetPanelIconClick.apply(navigation, arguments); 4728 }; 4729this.widgetPanelClose = function(){ 4730 return navigation.widgetPanelClose.apply(navigation, arguments); 4731 }; 4732 4733 4734}; 4735 4736/** 4737 * Author: Daniel Dziegielewski 4738 * 4739 */ 4740 4741de.his.modules.sys = new function() { 4742 de.his.modules.ModuleRegistry.registerModule(this) 4743 .registerAjaxRefreshModule(this); 4744 4745 this.moduleName = "de.his.modules.sys"; 4746 4747 this.init = function() { 4748 this.stopHoverWhenScrolling(); 4749 }; 4750 4751 this.initWithAjax = function() { 4752 }; 4753 4754 // Stoppt jegliche Hover-Effekte wenn der User scrollt. (#170492) 4755 this.stopHoverWhenScrolling = function(){ 4756 4757 if(jQuery(".originDevice_mobile")[0]){ 4758 // do not do this on mobile devices, it is very annoying 4759 return; 4760 } 4761 4762 var body = document.body, 4763 timer; 4764 4765 window.addEventListener('scroll', function() { 4766 clearTimeout(timer); 4767 if(!body.classList.contains('disable-hover')) { 4768 body.classList.add('disable-hover'); 4769 } 4770 4771 timer = setTimeout(function(){ 4772 body.classList.remove('disable-hover'); 4773 },200); 4774 }, false); 4775 4776 jQuery(".rf-sel-lst-scrl").on('scroll', function() { 4777 clearTimeout(timer); 4778 if(!body.classList.contains('disable-hover')) { 4779 body.classList.add('disable-hover'); 4780 } 4781 4782 timer = setTimeout(function(){ 4783 body.classList.remove('disable-hover'); 4784 },50); 4785 }); 4786 }; 4787 4788 this.refresh = function() { 4789 this.initWithAjax(); 4790 }; 4791};/* Placeholders.js v3.0.2 */ 4792/*! 4793 * The MIT License 4794 * 4795 * Copyright (c) 2012 James Allardice 4796 * 4797 * Permission is hereby granted, free of charge, to any person obtaining a copy 4798 * of this software and associated documentation files (the "Software"), to 4799 * deal in the Software without restriction, including without limitation the 4800 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 4801 * sell copies of the Software, and to permit persons to whom the Software is 4802 * furnished to do so, subject to the following conditions: 4803 * 4804 * The above copyright notice and this permission notice shall be included in 4805 * all copies or substantial portions of the Software. 4806 * 4807 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4808 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 4809 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 4810 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 4811 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 4812 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 4813 * IN THE SOFTWARE. 4814 */ 4815!function(a){"use strict";function b(){}function c(){try{return document.activeElement}catch(a){}}function d(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1}function e(a,b,c){return a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):void 0}function f(a,b){var c;a.createTextRange?(c=a.createTextRange(),c.move("character",b),c.select()):a.selectionStart&&(a.focus(),a.setSelectionRange(b,b))}function g(a,b){try{return a.type=b,!0}catch(c){return!1}}function h(a,b){if(a&&a.getAttribute(B))b(a);else for(var c,d=a?a.getElementsByTagName("input"):N,e=a?a.getElementsByTagName("textarea"):O,f=d?d.length:0,g=e?e.length:0,h=f+g,i=0;h>i;i++)c=f>i?d[i]:e[i-f],b(c)}function i(a){h(a,k)}function j(a){h(a,l)}function k(a,b){var c=!!b&&a.value!==b,d=a.value===a.getAttribute(B);if((c||d)&&"true"===a.getAttribute(C)){a.removeAttribute(C),a.value=a.value.replace(a.getAttribute(B),""),a.className=a.className.replace(A,"");var e=a.getAttribute(I);parseInt(e,10)>=0&&(a.setAttribute("maxLength",e),a.removeAttribute(I));var f=a.getAttribute(D);return f&&(a.type=f),!0}return!1}function l(a){var b=a.getAttribute(B);if(""===a.value&&b){a.setAttribute(C,"true"),a.value=b,a.className+=" "+z;var c=a.getAttribute(I);c||(a.setAttribute(I,a.maxLength),a.removeAttribute("maxLength"));var d=a.getAttribute(D);return d?a.type="text":"password"===a.type&&g(a,"text")&&a.setAttribute(D,"password"),!0}return!1}function m(a){return function(){P&&a.value===a.getAttribute(B)&&"true"===a.getAttribute(C)?f(a,0):k(a)}}function n(a){return function(){l(a)}}function o(a){return function(){i(a)}}function p(a){return function(b){return v=a.value,"true"===a.getAttribute(C)&&v===a.getAttribute(B)&&d(x,b.keyCode)?(b.preventDefault&&b.preventDefault(),!1):void 0}}
4815function q(a){return function(){k(a,v),""===a.value&&(a.blur(),f(a,0))}}function r(a){return function(){a===c()&&a.value===a.getAttribute(B)&&"true"===a.getAttribute(C)&&f(a,0)}}function s(a){var b=a.form;b&&"string"==typeof b&&(b=document.getElementById(b),b.getAttribute(E)||(e(b,"submit",o(b)),b.setAttribute(E,"true"))),e(a,"focus",m(a)),e(a,"blur",n(a)),P&&(e(a,"keydown",p(a)),e(a,"keyup",q(a)),e(a,"click",r(a))),a.setAttribute(F,"true"),a.setAttribute(B,T),(P||a!==c())&&l(a)}var t=document.createElement("input"),u=void 0!==t.placeholder;if(a.Placeholders={nativeSupport:u,disable:u?b:i,enable:u?b:j},!u){var v,w=["text","search","url","tel","email","password","number","textarea"],x=[27,33,34,35,36,37,38,39,40,8,46],y="#ccc",z="placeholdersjs",A=new RegExp("(?:^|\\s)"+z+"(?!\\S)"),B="data-placeholder-value",C="data-placeholder-active",D="data-placeholder-type",E="data-placeholder-submit",F="data-placeholder-bound",G="data-placeholder-focus",H="data-placeholder-live",I="data-placeholder-maxlength",J=100,K=document.getElementsByTagName("head")[0],L=document.documentElement,M=a.Placeholders,N=document.getElementsByTagName("input"),O=document.getElementsByTagName("textarea"),P="false"===L.getAttribute(G),Q="false"!==L.getAttribute(H),R=document.createElement("style");R.type="text/css";var S=document.createTextNode("."+z+" {color:"+y+";}");R.styleSheet?R.styleSheet.cssText=S.nodeValue:R.appendChild(S),K.insertBefore(R,K.firstChild);for(var T,U,V=0,W=N.length+O.length;W>V;V++)U=V<N.length?N[V]:O[V-N.length],T=U.attributes.placeholder,T&&(T=T.nodeValue,T&&d(w,U.type)&&s(U));var X=setInterval(function(){for(var a=0,b=N.length+O.length;b>a;a++)U=a<N.length?N[a]:O[a-N.length],T=U.attributes.placeholder,T?(T=T.nodeValue,T&&d(w,U.type)&&(U.getAttribute(F)||s(U),(T!==U.getAttribute(B)||"password"===U.type&&!U.getAttribute(D))&&("password"===U.type&&!U.getAttribute(D)&&g(U,"text")&&U.setAttribute(D,"password"),U.value===U.getAttribute(B)&&(U.value=T),U.setAttribute(B,T)))):U.getAttribute(C)&&(k(U),U.removeAttribute(B));Q||clearInterval(X)},J);e(a,"beforeunload",function(){M.disable()})}}(this),function(a,b){"use strict";var c=a.fn.val,d=a.fn.prop;b.Placeholders.nativeSupport||(a.fn.val=function(a){var b=c.apply(this,arguments),d=this.eq(0).data("placeholder-value");return void 0===a&&this.eq(0).data("placeholder-active")&&b===d?"":b},a.fn.prop=function(a,b){return void 0===b&&this.eq(0).data("placeholder-active")&&"value"===a?"":d.apply(this,arguments)})}(jQuery,this);de.his.modules.CustomizePortalNotification = new function() { 4816 de.his.modules.ModuleRegistry.registerModule(this); 4817 4818 this.moduleName = "de.his.modules.CustomizePortalNotification"; 4819 4820 this.init = function() { 4821 } 4822 4823 this.closeCustomizePortalNotification = function() { 4824 var loginDiv = document.getElementById('portalCustomizationNotification'); 4825 if (loginDiv) { 4826 loginDiv.className = "noDisplay"; 4827 } 4828 return false; 4829 }; 4830 4831};use_package( "de.his.modules" ); 4832 4833de.his.modules.ScrollWithMe = new function() { 4834 var cssSelector = ".scrollWithMe", 4835 cssClassKeepSize = "scrollWithMe-keepSize", 4836 cssClass = "scrollWithMe-active"; 4837 4838 de.his.modules.ModuleRegistry.registerModule( this ).registerAjaxRefreshModule( this ); 4839 this.moduleName = "de.his.modules.ScrollWithMe"; 4840 4841 this.init = function(containers) { 4842 var containers = jQuery( cssSelector ); 4843 for ( var i = 0; i < containers.length; i++ ) { 4844 scrollWithMe(containers[i]); 4845 } 4846 }; 4847 4848 this.refresh = function() { 4849 de.his.modules.ScrollWithMe.init(); 4850 }; 4851 4852 this.refresSingleContainer = function(selector) { 4853 let single_element = jQuery(selector); 4854 scrollWithMe(single_element); 4855 }; 4856 4857 var scrollWithMe = function( element ) { 4858 //console.log("scroll : ", element); 4859 var container = jQuery( element ), 4860 containerLeft, 4861 ovContainerTop, 4862 containerWidth, 4863 cssConfig, 4864 scrollFunction, 4865 limitInt; 4866 //console.log("container scroll : ", container); 4867 if ( container.length > 0 ) { 4868 // containerLeft = container.offset().left; 4869 // containerWidth = container.width(); 4870 if( jQuery('.scrollWithMe-active').length ) { 4871 jQuery('.scrollWithMe-active').removeClass('scrollWithMe-active'); 4872 ovContainerTop = parseInt( container.offset().top ); 4873 jQuery('.scrollWithMe').addClass('scrollWithMe-active'); 4874 } 4875 else { 4876 ovContainerTop = parseInt( container.offset().top ); //parseInt to get whole number 4877 } 4878 4879 scrollFunction = function(){ 4880 var win = jQuery( window ), 4881 scrollTop = win.scrollTop(), 4882 scrollLeft = win.scrollLeft(), 4883 containerTop = parseInt( container.offset().top ), 4884 newContainerLeft; //parseInt to get whole number 4885 4886 if ( de.his.component.overlay && de.his.component.overlay.modalMode ) { 4887 //do nothing when overlay is open 4888 return; 4889 } 4890 4891 if ( !container.hasClass( cssClass ) ) { 4892 //scroller not active 4893 4894 if ( scrollTop > containerTop && !checkZoom(300) ) { 4895 // set var if container on top of window 4896 containerWidth = container.width(); 4897 containerLeft = container.offset().left; 4898 container.parent().css("padding-top", container.outerHeight(true)+2+"px"); 4899 container.addClass( cssClass ); 4900 4901 4902 //calculate the left PX when scrolling right in the browser 4903 newContainerLeft = containerLeft - scrollLeft 4904 newContainerLeft = newContainerLeft < 0 ? 0 : newContainerLeft; //don't let it go below 0 4905 4906 cssConfig = { 4907 left: newContainerLeft + "px" //apply new calculation 4908 }; 4909 4910 if ( container.hasClass( cssClassKeepSize ) ) { 4911 cssConfig.maxWidth = containerWidth; 4912 } 4913 container.css( cssConfig ); 4914 } 4915 4916 } else { 4917 //scroller is active 4918 if ( window.device && window.device.mobile() ) { 4919 //smartphone 4920 limitInt = ovContainerTop + 0; 4921 } else { 4922 limitInt = ovContainerTop - 20; //-20 to stop jumping when the browser size hits the boundary of the scroll trigger 4923 } 4924 //console.log("ovContainerTop scrollTop "+ovContainerTop+":"+scrollTop); 4925 limitInt = limitInt >= 0 ? limitInt : 0; //can be minus so set to 0 4926 if ( scrollTop <= ovContainerTop ) { 4927 container.removeClass( cssClass ); 4928 container.parent().css("padding-top", ""); 4929 4930 // Reset container values 4931 cssConfig = { 4932 left: '', 4933 maxWidth: '' 4934 }; 4935 container.css(cssConfig); 4936 } 4937 } 4938 }; 4939 4940 //find any containers with the selector 4941 var containers = jQuery( cssSelector );
4942 //console.log("scrollWithMe: ", containers); 4943 4944 de.his.modules.eventRegistry.addListener( "overlayOpen", function() { 4945 jQuery( containers ).each( function() { 4946 //jQuery( this ).removeClass( cssClass ); 4947 jQuery( this ).css('z-index','998'); 4948 } ); 4949 } ); 4950 4951 de.his.modules.eventRegistry.addListener( "overlayClose", function() { 4952 jQuery( containers ).each( function() { 4953 //jQuery( this ).removeClass( cssClass ); 4954 jQuery( this ).css('z-index','999'); 4955 } ); 4956 4957 } ); 4958 4959 //listener for scroll event 4960 jQuery( window ).off('scroll'); 4961 jQuery( window ).scroll( scrollFunction ); 4962 //listener for zoom event 4963 jQuery( window ).resize(handleScrollWithMeOnZoom); // prevent search overlay from hiding page content when zoom >= 300% 4964 4965 } 4966 }; 4967 4968 var checkZoom = function (zoomLevel) { 4969 var browserZoom = window.devicePixelRatio * 100; 4970 return browserZoom >= zoomLevel ? true : false; 4971 } 4972 4973 var handleScrollWithMeOnZoom = function () { 4974 var scrollWithMe = document.querySelector('.scrollWithMe'); 4975 var hisInOneTitle = document.getElementById('hisinoneTitle'); 4976 4977 if (scrollWithMe) { 4978 if (checkZoom(300)) { // Zoomlevel in % 4979 scrollWithMe.classList.remove("scrollWithMe-active") 4980 } else { 4981 // Do not apply style on on top of page, this would cause buttons to disappear above table 4982 if (!isElementInViewport(hisInOneTitle)) { 4983 scrollWithMe.classList.add("scrollWithMe-active") 4984 } 4985 } 4986 } 4987 } 4988 4989 var isElementInViewport = function (el) { 4990 var rect = el.getBoundingClientRect(); 4991 4992 return ( 4993 rect.top >= 0 && 4994 rect.left >= 0 && 4995 rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && 4996 rect.right <= (window.innerWidth || document.documentElement.clientWidth) 4997 ); 4998 } 4999};/** 5000 * RF Picklist 5001 */ 5002de.his.modules.HisinoneSelectBox = new function() { 5003 de.his.modules.ModuleRegistry 5004 .registerModule(this) 5005 .registerAjaxRefreshModule(this); 5006 this.moduleName = "de.his.modules.HisinoneSelectBox"; 5007 this.init = function() { 5008 //#113538 bugfix 5009 jQuery(".picklistShuttle, .picklistShuttleButtons").show(); 5010 }; 5011 5012 this.refresh = function() { 5013 this.init(); 5014 }; 5015 5016 // #308501 Barrierefreiheit: Ist das Listenfeld leer und wird dieses mit der Tastatur fokussiert, kann die Seite nicht mehr gescrollt werden 5017 jQuery(".picklistShuttle > select").on("focus", function(){ 5018 var selectionBox = this; 5019 selectionBox.addEventListener('keydown', (event) => { 5020 if(selectionBox.length === 0){ 5021 if (event.keyCode === 37 || event.keyCode === 38 || event.keyCode === 39 || event.keyCode === 40) { 5022 event.preventDefault(); 5023 event.stopPropagation(); 5024 } 5025 return; 5026 } 5027 }); 5028 }); 5029 5030};use_package("de.his.modules.iFrameCommunication"); 5031 5032/** 5033 * Author: wahrendorff Date: 08.06.2015 Zweck: ermöglicht der im iframe 5034 * eingebetteten untrusted Domain der HISinOne Hauptanwendung zu antworten. 5035 * 5036 */ 5037 5038de.his.modules.iFrameCommunication = new function() { 5039 de.his.modules.ModuleRegistry.registerModule(this) 5040 .registerAjaxRefreshModule(this); 5041 5042 this.moduleName = "de.his.modules.iFrameCommunication"; 5043 5044 var currentHost; 5045 var untrustedHost; 5046 5047 if (typeof String.prototype.startsWith !== "function") { 5048 // see below for better implementation! 5049 String.prototype.startsWith = function(str) { 5050 return this.indexOf(str) === 0; 5051 }; 5052 } 5053 5054 5055 var getMessages = function(type) { 5056 var messages = []; 5057 5058 jQuery("." + type + "_infobox ul.listMessages > li:not([postedtoparent])").each(function(index, elem) { 5059 var message = new Object(); 5060 message.text = jQuery(elem).text(); 5061 message.type = type; 5062 if (message.text !== "") { 5063 messages.push(message); 5064 } 5065 jQuery(elem).attr('postedtoparent', 'true'); 5066 }); 5067 5068 var title = ""; 5069 jQuery("." + type + "_infobox h2.messages_infobox_header:not([postedtoparent])").each(function(index, elem) { 5070 title = jQuery(elem).text(); 5071 jQuery(elem).attr('postedtoparent', 'true'); 5072 }); 5073 5074 title = title.trim(); 5075 if(title.charAt(title.length - 1) === ':'){ 5076 title = title.slice(0, -1); 5077 } 5078 5079 for(var message of messages){ 5080 message.title = title; 5081 } 5082 5083 console.log("getting " + type + " in iFrame: ", messages); 5084 return JSON.stringify(messages); 5085 }; 5086 5087 var receiveMessageInIframe = function(event) { 5088 // check is not needed because H1 can only be iframed by H1 5089 // also a check is not possible, 5090 // because there is no possibility to determine on which domain H1 is running 5091 5092 // if (event.origin !== "https://localhost:8443") { 5093 // return; 5094 // } 5095 if(typeof event.data !== 'string'){ 5096 // unerwartet. 5097 // Angular dev tools senden unentwegt ein Object als message, wenn kein Angular Kontext gefunden wird. 5098 // alles ablehnen, was kein String ist. 5099 return; 5100 } 5101 5102 console.log("receiving messages in iFrame: " + event.data); 5103 5104 if (event.data === "Hello") { 5105 event.source.postMessage("Hi, there!", event.origin); 5106 } 5107 if (event.data === "showMessages") { 5108 for(var type of ["error", "success", "info", "warning"]){ 5109 var messages = getMessages(type); 5110 if(typeof messages !== 'undefined' && messages.trim() !== "[]"){ 5111 event.source.postMessage(messages, event.origin); 5112 } 5113 } 5114 event.source.postMessage("resizeMe"); 5115 } 5116 }; 5117 5118 var receiveMessageInParent = function(event) { 5119 5120 if (event.origin !== currentHost && event.origin !== untrustedHost 5121 || typeof event.data !== 'string' || event.data.trim() === "") { 5122 // do not receive Messages if IFrame is neither untrusted domain nor 5123 // current host 5124 // this is an important security measure! 5125 // Do never remove! 5126 // console.log(event.origin+" !== "+ currentHost, event); 5127 // console.log("typeof "+event.data+" !== 'string' it is", typeof event.data); 5128 return; 5129 } 5130 5131 console.log("receiving messages in Parent: '" + event.data + "' type: "+(typeof event.data), event); 5132 5133 if(event.data == "resizeMe"){ 5134 de.his.modules.IframePortletResize.handleResizeWithPortalHelper(); 5135 return; 5136 } 5137 5138 if(event.data.startsWith("[") && event.data.endsWith("]")){ 5139 var messages = JSON.parse(event.data);
5140 messages.forEach(function(message, index) { 5141 console.log(message, index); 5142 }); 5143 5144 var messageTexts = []; 5145 if(messages.length > 0){ 5146 messages.forEach(message => messageTexts.push(message.text)); 5147 de.his.component.MessagesInfobox.showMessagesInfoboxWithTitle(messageTexts, messages[0].type, messages[0].title); 5148 } 5149 return; 5150 } 5151 5152 // do not show messages that do not comply with what we expect. 5153 console.log("message was not from this file and therefore ignored..."); 5154 return; 5155 5156 }; 5157 5158 var requestMessagesFromIframe = function(iFrameElement, iFrameHost) { 5159 console.log("request message from iframe: ",iFrameHost); 5160 iFrameElement.prop("contentWindow").postMessage("showMessages", iFrameHost); 5161 }; 5162 5163 this.init = function() { 5164 5165 if (self != top && jQuery("#hisinoneHeader").length == 0) { 5166 // Site is loaded in an iFrame 5167 console.log("init postMessages on iFrame..."); 5168 window.addEventListener("message", receiveMessageInIframe, false); 5169 } else { 5170 // Site is NOT loaded in an iFrame 5171 currentHost = window.location.origin;//de.his.common.ContextInformation.get("host"); 5172 untrustedHost = de.his.common.ContextInformation.get("untrustedHost"); 5173 console.log("currentHost: %s",currentHost); 5174 console.log("untrustedHost: %s",untrustedHost); 5175 jQuery("iframe").each( 5176 function() { 5177 if(jQuery(this).data('initialized') == 'true') return; 5178 jQuery(this).data('initialized','true'); 5179 var iFrameElement = jQuery(this); 5180 iFrameElement.on("load", function() { 5181 // check if an iFrame is loaded with Host or 5182 // UntrustedHost content 5183 var url = iFrameElement.attr("src"); 5184 if (typeof url == 'undefined' || url == "") { 5185 console.log("iframe url is not valid: ",url); 5186 return; 5187 } else if(url.startsWith("http")){ 5188 console.log("iFrame URL: %s", url); 5189 var urlArray = url.split("://"); 5190 var iFrameHostArray = urlArray[1].split("/"); 5191 // enthält den Port, wenn auch die url den Port enthält 5192 // Das Script im iFrame check die event.origin, in dieser werden Defaultports entfernt, 5193 // daher müssen wir die Defaultports beim message request auch entfernen 5194 // bei "Custom" Ports wie 8080, 8008 oder 8443 müssen die Ports beibehalten werden! 5195 var iFrameHost = urlArray[0]; 5196 var iFrameOriginPortArray = iFrameHostArray[0].split(":"); 5197 if(iFrameOriginPortArray[1] == "443" || iFrameOriginPortArray[1] == "80"){ 5198 console.log("remove default port(443||80) for iFrame Communication."); 5199 iFrameHost += "://" + iFrameOriginPortArray[0]; 5200 } else { 5201 // keep Port 5202 iFrameHost += "://" + iFrameHostArray[0]; 5203 } 5204 } else{ //in case "url" is a relative url 5205 iFrameHost = currentHost; 5206 } 5207 console.log("iFrameHost %s",iFrameHost); 5208 if (iFrameHost == currentHost 5209 || iFrameHost == untrustedHost) { 5210 5211 console.log("init iFrame postMessages on parent..."); 5212 window.addEventListener("message", receiveMessageInParent, false); 5213 setTimeout(function(){ 5214 requestMessagesFromIframe(iFrameElement, iFrameHost); 5215 }); 5216 } 5217 de.his.modules.eventRegistry.fireEvent( "iframe_loaded_" + iFrameElement.attr( "id" ) ); 5218 }); 5219 }); 5220 } 5221 } 5222 5223 this.refresh = function() { 5224 this.init(); 5225 this.resizeInParent(); 5226 } 5227 5228 this.resizeInParent = function(){ 5229 if(typeof parent !== "undefined"){ 5230 console.log("init resize in iframe on parent..."); 5231 try{ 5232 parent.de.his.modules.IframePortletResize.init(); 5233 } catch (e){ 5234 console.error(e); 5235 } 5236 5237 } 5238 } 5239 5240}; 5241/** 5242 * Author: Daniel Dziegielewski 5243 * Removes css class singleblock from divs with css classes roomconflict or personconflict 5244 */ 5245de.his.modules.removeSingleblock = new function() { 5246 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 5247 5248 this.moduleName = "de.his.modules.removeSingleblock"; 5249 5250 this.init = function() { 5251 jQuery(".singleblock.roomconflict").removeClass("singleblock"); 5252 jQuery(".singleblock.personconflict").removeClass("singleblock"); 5253 jQuery(".terminStyleClass.roomconflict").removeClass("roomconflict"); 5254 jQuery(".terminStyleClass.personconflict").removeClass("personconflict"); 5255 } 5256 5257 this.refresh = function() { 5258 this.init(); 5259 } 5260};/*! 5261 * jQuery Mousewheel 3.1.13 5262 * 5263 * Copyright jQuery Foundation and other contributors 5264 * Released under the MIT license 5265 * http://jquery.org/license 5266 */ 5267 5268(function (factory) { 5269 if ( typeof define === 'function' && define.amd ) { 5270 // AMD. Register as an anonymous module. 5271 define(['jquery'], factory); 5272 } else if (typeof exports === 'object') { 5273 // Node/CommonJS style for Browserify 5274 module.exports = factory; 5275 } else { 5276 // Browser globals 5277 factory(jQuery); 5278 } 5279}(function ($) { 5280 5281 var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], 5282 toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ? 5283 ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], 5284 slice = Array.prototype.slice,
vendor: 6,451 bytes, lines 5285-5458
5285 nullLowestDeltaTimeout, lowestDelta; 5286 5287 if ( $.event.fixHooks ) { 5288 for ( var i = toFix.length; i; ) { 5289 $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; 5290 } 5291 } 5292 5293 var special = $.event.special.mousewheel = { 5294 version: '3.1.12', 5295 5296 setup: function() { 5297 if ( this.addEventListener ) { 5298 for ( var i = toBind.length; i; ) { 5299 this.addEventListener( toBind[--i], handler, false ); 5300 } 5301 } else { 5302 this.onmousewheel = handler; 5303 } 5304 // Store the line height and page height for this particular element 5305 $.data(this, 'mousewheel-line-height', special.getLineHeight(this)); 5306 $.data(this, 'mousewheel-page-height', special.getPageHeight(this)); 5307 }, 5308 5309 teardown: function() { 5310 if ( this.removeEventListener ) { 5311 for ( var i = toBind.length; i; ) { 5312 this.removeEventListener( toBind[--i], handler, false ); 5313 } 5314 } else { 5315 this.onmousewheel = null; 5316 } 5317 // Clean up the data we added to the element 5318 $.removeData(this, 'mousewheel-line-height'); 5319 $.removeData(this, 'mousewheel-page-height'); 5320 }, 5321 5322 getLineHeight: function(elem) { 5323 var $elem = $(elem), 5324 $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent'](); 5325 if (!$parent.length) { 5326 $parent = $('body'); 5327 } 5328 return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16; 5329 }, 5330 5331 getPageHeight: function(elem) { 5332 return $(elem).height(); 5333 }, 5334 5335 settings: { 5336 adjustOldDeltas: true, // see shouldAdjustOldDeltas() below 5337 normalizeOffset: true // calls getBoundingClientRect for each event 5338 } 5339 }; 5340 5341 $.fn.extend({ 5342 mousewheel: function(fn) { 5343 return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); 5344 }, 5345 5346 unmousewheel: function(fn) { 5347 return this.unbind('mousewheel', fn); 5348 } 5349 }); 5350 5351 5352 function handler(event) { 5353 var orgEvent = event || window.event, 5354 args = slice.call(arguments, 1), 5355 delta = 0, 5356 deltaX = 0, 5357 deltaY = 0, 5358 absDelta = 0, 5359 offsetX = 0, 5360 offsetY = 0; 5361 event = $.event.fix(orgEvent); 5362 event.type = 'mousewheel'; 5363 5364 // Old school scrollwheel delta 5365 if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } 5366 if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } 5367 if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } 5368 if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } 5369 5370 // Firefox < 17 horizontal scrolling related to DOMMouseScroll event 5371 if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { 5372 deltaX = deltaY * -1; 5373 deltaY = 0; 5374 } 5375 5376 // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy 5377 delta = deltaY === 0 ? deltaX : deltaY; 5378 5379 // New school wheel delta (wheel event) 5380 if ( 'deltaY' in orgEvent ) { 5381 deltaY = orgEvent.deltaY * -1; 5382 delta = deltaY; 5383 } 5384 if ( 'deltaX' in orgEvent ) { 5385 deltaX = orgEvent.deltaX; 5386 if ( deltaY === 0 ) { delta = deltaX * -1; } 5387 } 5388 5389 // No change actually happened, no reason to go any further 5390 if ( deltaY === 0 && deltaX === 0 ) { return; } 5391 5392 // Need to convert lines and pages to pixels if we aren't already in pixels 5393 // There are three delta modes: 5394 // * deltaMode 0 is by pixels, nothing to do 5395 // * deltaMode 1 is by lines 5396 // * deltaMode 2 is by pages 5397 if ( orgEvent.deltaMode === 1 ) { 5398 var lineHeight = $.data(this, 'mousewheel-line-height'); 5399 delta *= lineHeight; 5400 deltaY *= lineHeight; 5401 deltaX *= lineHeight; 5402 } else if ( orgEvent.deltaMode === 2 ) { 5403 var pageHeight = $.data(this, 'mousewheel-page-height'); 5404 delta *= pageHeight; 5405 deltaY *= pageHeight; 5406 deltaX *= pageHeight; 5407 } 5408 5409 // Store lowest absolute delta to normalize the delta values 5410 absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); 5411 5412 if ( !lowestDelta || absDelta < lowestDelta ) { 5413 lowestDelta = absDelta; 5414 5415 // Adjust older deltas if necessary 5416 if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { 5417 lowestDelta /= 40; 5418 } 5419 } 5420 5421 // Adjust older deltas if necessary 5422 if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { 5423 // Divide all the things by 40! 5424 delta /= 40; 5425 deltaX /= 40; 5426 deltaY /= 40; 5427 } 5428 5429 // Get a whole, normalized value for the deltas 5430 delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta); 5431 deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta); 5432 deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta); 5433 5434 // Normalise offsetX and offsetY properties 5435 if ( special.settings.normalizeOffset && this.getBoundingClientRect ) { 5436 var boundingRect = this.getBoundingClientRect(); 5437 offsetX = event.clientX - boundingRect.left; 5438 offsetY = event.clientY - boundingRect.top; 5439 } 5440 5441 // Add information to the event object 5442 event.deltaX = deltaX; 5443 event.deltaY = deltaY; 5444 event.deltaFactor = lowestDelta; 5445 event.offsetX = offsetX; 5446 event.offsetY = offsetY; 5447 // Go ahead and set deltaMode to 0 since we converted to pixels 5448 // Although this is a little odd since we overwrite the deltaX/Y 5449 // properties with normalized deltas. 5450 event.deltaMode = 0; 5451 5452 // Add event and delta to the front of the arguments 5453 args.unshift(event, delta, deltaX, deltaY); 5454 5455 // Clearout lowestDelta after sometime to better 5456 // handle multiple device types that give different 5457 // a different lowestDelta 5458 // Ex: trackpad = 3 and mouse wheel = 120
5459 if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } 5460 nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); 5461 5462 return ($.event.dispatch || $.event.handle).apply(this, args); 5463 } 5464 5465 function nullLowestDelta() { 5466 lowestDelta = null; 5467 } 5468 5469 function shouldAdjustOldDeltas(orgEvent, absDelta) { 5470 // If this is an older event and the delta is divisable by 120, 5471 // then we are assuming that the browser is treating this as an 5472 // older mouse wheel event and that we should divide the deltas 5473 // by 40 to try and get a more usable deltaFactor. 5474 // Side note, this actually impacts the reported scroll distance 5475 // in older browsers and can cause scrolling to be slower than native. 5476 // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false. 5477 return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0; 5478 } 5479 5480})); 5481use_package("de.his.component"); 5482 5483de.his.component.Swipegesture = new function() { 5484 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 5485 this.moduleName = "de.his.component.Swipegesture"; 5486 this.init = function() { this.swipe(); }; 5487 5488 this.swipe = function(e) { 5489 let touchstartX = 0; 5490 let touchstartY = 0; 5491 let touchendX = 0; 5492 let touchendY = 0; 5493 let gestureZone = document.querySelectorAll('.menuItem'); 5494 let deleteStatus = false; 5495 5496 for (let i = 0; i < gestureZone.length; i++) { 5497 5498 gestureZone[i].addEventListener('touchstart', function(event) { 5499 touchstartX = event.changedTouches[0].screenX; 5500 touchstartY = event.changedTouches[0].screenY; 5501 }, false); 5502 5503 gestureZone[i].addEventListener('touchend', function(event) { 5504 touchendX = event.changedTouches[0].screenX; 5505 touchendY = event.changedTouches[0].screenY; 5506 handleGesture(this.querySelector('.menuWrap')); 5507 }, false); 5508 5509 gestureZone[i].addEventListener('touchmove', function(event) { 5510 if( deleteStatus == true ) { 5511 return false; 5512 } 5513 let touchMoveX = event.changedTouches[0].screenX; 5514 let newPosX = touchstartX - touchMoveX; 5515 if(newPosX <= 500 && newPosX >= 0) { 5516 jQuery(this).children('.menuWrap').css({transform: 'translateX('+-newPosX+'px)', opacity: 1-(newPosX/200)}); 5517 } else if ( newPosX <= 0 ) { 5518 jQuery(this).children('.menuWrap').css({transform: 'translateX(0px)', opacity: 1}); 5519 } 5520 }, false); 5521 5522 } 5523 5524 function handleGesture(item) { 5525 5526 if (touchendX < touchstartX && deleteStatus == false) { 5527 if(touchendX - touchstartX <= -100) { 5528 deleteStatus = true; 5529 jQuery(item).css({transform: '', opacity: ''}); 5530 item.classList.add('deleted'); 5531 jQuery(item).parent().animate({opacity: 0}, 1000); 5532 item.deleteTimer = setTimeout(function(){ 5533 deleteStatus = false; 5534 item.querySelector('.iconfont-delete').click(); 5535 }, 1000); 5536 } 5537 else { 5538 jQuery(item).css({transform: '', opacity: ''}); 5539 deleteStatus = false; 5540 item.classList.remove('deleted'); 5541 } 5542 } 5543 5544 if (touchendX > touchstartX || touchendY === touchstartY) { 5545 deleteStatus = false; 5546 jQuery(item).parent().stop().css({opacity: ''}); 5547 jQuery(item).css({transform: '', opacity: ''}); 5548 item.classList.remove('deleted'); 5549 clearTimeout(item.deleteTimer); 5550 } 5551 5552 /*if (touchendY <= touchstartY) { 5553 console.log('Swiped up'); 5554 } 5555 5556 if (touchendY >= touchstartY) { 5557 console.log('Swiped down'); 5558 } 5559 5560 if (touchendY === touchstartY) { 5561 console.log('Tap'); 5562 }*/ 5563 } 5564 } 5565 5566 5567 this.refresh = function() { 5568 this.init(); 5569 }; 5570};use_package( "de.his.common" ); 5571 5572de.his.common.mainnavigation = new function() { 5573 5574 de.his.modules.ModuleRegistry.registerModule( this ).registerAjaxRefreshModule( this ); 5575 this.moduleName = "de.his.common.mainnavigation"; 5576 5577 this.init = function() { 5578 mainnavigation(); 5579 }; 5580 5581 this.refresh = function() { 5582 if(!jQuery('.js-opennavoverlay').length){ 5583 de.his.common.mainnavigation.init(); 5584 } 5585 }; 5586 5587 /** 5588 * Höhe des Headers erst nach window.load berechenbar 5589 */ 5590 jQuery(window).on('load', function(){ 5591 jQuery('#hisinoneHeader').addClass('js-fixed').parent().css({paddingTop:jQuery('#hisinoneHeader').outerHeight()}); 5592 }); 5593 5594 var mainnavigation = function() { 5595 var position = 0; 5596 var resizeTimer; 5597 5598 clickEvent = "click"; 5599 /*if($html.hasClass('touch')) { 5600 clickEvent = 'touchstart'; 5601 }*/ 5602 5603 var $header = jQuery('#hisinoneHeader'); 5604 var $navToggle = jQuery('.navbar-toggle'); 5605 var $body = jQuery('body'); 5606 var $html = jQuery('html'); 5607 var $nav = jQuery('.topMenuContainer .nav'); 5608 var $window = jQuery(window); 5609 var $navLink = jQuery('.topMenuContainer .parentListItem > a'); 5610 var $navContainer = jQuery('.topMenuContainer'); 5611 var $closeBtn = jQuery('.closeButtonNavigationESC'); 5612 var innerScrollElement = ''; 5613 5614 $window.on('resize', function() { 5615 clearTimeout(resizeTimer); 5616 resizeTimer = setTimeout(function() { 5617 5618 checkScrollnav(); 5619 5620 if( $navToggle.css('display') == 'none' ) { 5621 position = 0; 5622 $nav.css('transform', ''); 5623 jQuery('.js-opennavoverlay').remove(); 5624 $body.removeClass('js-navOpen js-navOpenFooter'); 5625 $nav.find('.js-visible').removeClass('js-visible'); 5626 $nav.find('.js-hidden').removeClass('js-hidden'); 5627 $navContainer.css({minHeight:'', height:'', display:''}); 5628 $header.removeClass('js-fixed').parent().css({paddingTop:''}); 5629 } else { 5630 $header.addClass('js-fixed').parent().css({paddingTop:$header.outerHeight()}); 5631 } 5632 if( jQuery('#loginLinkElement').css('display') == 'none' && jQuery('#hisinoneHeader .loginStartPage').css('display') == 'none' ) { 5633 jQuery('#hisinoneHeader .loginStartPage').css({display:''}); 5634 } 5635 }, 250); 5636 }); 5637 5638 let navigationShown = true; 5639 let scrollPosition = 0; 5640 this.defaultTitle = $navToggle.attr('title'); //needs to be set outside of click event handler because title attr is temporarily removed on mouseenter in customtooltip 5641 5642 function showNavigation() { 5643 scrollPosition = window.pageYOffset; 5644 $body.css({top:-scrollPosition + 'px'}); 5645 5646 if( $navToggle.parents('#hisinoneFooter').length ) { 5647 $html.addClass('js-navOpen js-navOpenFooter'); 5648 } else { 5649 $html.addClass('js-navOpen'); 5650 } 5651 jQuery('<div class="js-opennavoverlay" />').appendTo('body'); 5652 5653 var newTitle = $navToggle.data('titletoggle'); 5654 $navToggle.attr('title', newTitle).attr('aria-label', newTitle).attr('id', 'mobileOnlyNavBar_open').attr('aria-expanded', 'true'); 5655 $navToggle.data('titletoggle'); 5656 outerClicksCloseMenuHandler(); 5657 } 5658 5659 function removeNavigation() { 5660 $html.removeClass('js-navOpen js-navOpenFooter'); 5661 window.scrollTo(0, scrollPosition); 5662 $body.css({top:''}); 5663 jQuery('.js-opennavoverlay').remove(); 5664 $navToggle.attr('title', this.defaultTitle).attr('aria-label', this.defaultTitle).attr('id', 'mobileOnlyNavBar').attr('aria-expanded', 'false'); 5665 position = 0; 5666 $nav.css('transform', 'translateX(0%)').find('li').removeClass('js-visible js-active js-hidden'); 5667 setTimeout(function(){ 5668 $header.removeClass('js-hide'); 5669 if( jQuery('.scrollWithMe').length || jQuery('[appscrollwithme]').length ) { 5670 var $scrollWithMe = jQuery('.scrollWithMe, [appscrollwithme]'); 5671 if( $scrollWithMe.hasClass('scrollWithMe-active') ) { 5672 var headerHeight = $header.outerHeight(); 5673 $scrollWithMe.css({top:headerHeight}); 5674 } 5675 } 5676 }); 5677 } 5678 5679 function outerClicksCloseMenuHandler(){ 5680 // hide slidedown menues when user clicks somewhere else in the page 5681 jQuery('.js-opennavoverlay,#hisinoneHeader,#hisinoneFooter').off(clickEvent).on(clickEvent, function (e) { 5682// console.log('clicked somewhere..', jQuery(e.target)); 5683 5684 if ( jQuery('html').hasClass('js-navOpen') && jQuery(e.target).closest('#topMenuContainerId').length == 0 5685 && !jQuery(e.target).hasClass("navbar-toggle") 5686 && !jQuery(e.target).hasClass("burger_navigation") 5687 && jQuery(e.target).is(':visible') ) { 5688 5689 $navToggle.trigger(clickEvent); 5690 5691 } 5692 }); 5693 } 5694 5695 $navToggle.off(clickEvent).on(clickEvent, function(){ 5696 navInit(); 5697 checkScrollbar(); 5698 var $this = jQuery(this); 5699 $navContainer.toggle('slide', 200); 5700 $this.toggleClass('js-open'); 5701 if (navigationShown) { 5702 showNavigation(); 5703 } else { 5704 removeNavigation(); 5705 } 5706 $this.trigger("updateTooltip"); 5707 closeNavigationButton(); 5708 navigationShown = !navigationShown; 5709 }); 5710 5711 $navLink.off(clickEvent).on(clickEvent, function(){ 5712 if( $navToggle.css('display') == 'block' ) { 5713 var $this = jQuery(this); 5714 $navContainer.find('.js-active').removeClass('js-active'); 5715 $this.closest('li').addClass('js-visible js-active'); 5716 $this.closest('li').parent().children('li:not(.js-visible)').addClass('js-hidden'); 5717 var activeHeight = $this.closest('li').children('ul').height(); 5718 if( jQuery('#searchMenuExtContainer_inNav').css('display') == 'block' ) { 5719 var mobileNavSearchHeight = jQuery('#searchMenuExtContainer_inNav').outerHeight(); 5720 activeHeight= activeHeight+mobileNavSearchHeight; 5721 } 5722 $closeBtn.css('top', activeHeight); 5723 $navContainer.scrollTop(0); 5724 position = position-100; 5725 $nav.css('transform', 'translateX('+position+'%)'); 5726 setTimeout(function(){ 5727 jQuery($this.next('ul').children('.navitem-headline').children()).focus(); 5728 },100); 5729 return false;
5730 } 5731 }); 5732 jQuery('.backButton').off(clickEvent).on(clickEvent, function(){ 5733 var $this = jQuery(this); 5734 $this.closest('.js-visible').parent().children('.js-hidden').removeClass('js-hidden'); 5735 $this.closest('.js-visible').removeClass('js-visible js-active'); 5736 $this.closest('.js-visible').addClass('js-active'); 5737 position = position+100; 5738 $nav.css('transform', 'translateX('+position+'%)'); 5739 if( $this.closest('.parentListItem').closest('ul').children('.navitem-headline').children().length ) { 5740 $this.closest('.parentListItem').closest('ul').children('.navitem-headline').children().focus(); 5741 var activeHeight = $this.closest('.js-visible').children('ul').height(); 5742 } 5743 else { 5744 $this.closest('.parentListItem').children('a').focus(); 5745 var activeHeight = $nav.height(); 5746 } 5747 if( jQuery('#searchMenuExtContainer_inNav').css('display') == 'block' ) { 5748 var mobileNavSearchHeight = jQuery('#searchMenuExtContainer_inNav').outerHeight(); 5749 activeHeight= activeHeight+mobileNavSearchHeight; 5750 } 5751 $closeBtn.css('top', activeHeight); 5752 return false; 5753 }); 5754// $body.off(clickEvent).on(clickEvent, '.js-opennavoverlay', function(){ 5755// $navToggle.trigger(clickEvent); 5756// }); 5757 5758 function navInit() { 5759 $navContainer.css({minHeight: '', height: ''}); 5760 var headerHeight = $header.outerHeight(); 5761 var footerHeight = jQuery('#hisinoneFooter').outerHeight(); 5762 var winHeight = window.innerHeight; 5763 5764 if( $navToggle.parents('#hisinoneFooter').length ) { 5765 var newNavHeight = winHeight - headerHeight-footerHeight; 5766 } else { 5767 var newNavHeight = winHeight - headerHeight; 5768 } 5769 $navContainer.css({height: newNavHeight + 'px', top:headerHeight}); 5770 } 5771 function checkScrollbar(){ 5772 var $body = jQuery("body"); 5773 var previousWidth = null; 5774 var currentWidth = $body.width(); 5775 if (currentWidth != previousWidth) { 5776 previousWidth = currentWidth; 5777 $body.css("overflow", "hidden"); 5778 var scrollBarWidth = $body.width() - currentWidth; 5779 $body.css("overflow", "auto"); 5780 $body.css("padding-right", scrollBarWidth + "px"); 5781 jQuery('#logoAndServicesHeader').css("padding-right", scrollBarWidth + "px"); 5782 $body.css("overflow", ""); 5783 } 5784 5785 }; 5786 5787 var old_scroll_top = 0, delta = 5; 5788 $window.on('scroll', function(e){ 5789 5790 var current_scroll_top = jQuery(document).scrollTop(); 5791 if( current_scroll_top == 0 ) { 5792 $header.removeClass('js-hide'); 5793 } 5794 if(Math.abs(old_scroll_top - current_scroll_top) <= delta) { 5795 return; 5796 } 5797 if( $navToggle.css('display') == 'block' ) { 5798 var scroll_delta = current_scroll_top - old_scroll_top; 5799 if( !$html.hasClass('js-navOpen') ){ 5800 if( scroll_delta <=0 ){ 5801 $header.removeClass('js-hide'); 5802 var headerHeight = $header.outerHeight(); 5803 if( jQuery('.scrollWithMe').length || jQuery('[appscrollwithme]').length ) { 5804 var $scrollWithMe = jQuery('.scrollWithMe, [appscrollwithme]'); 5805 if( $scrollWithMe.hasClass('scrollWithMe-active') ) { 5806 $scrollWithMe.css({top:headerHeight}); 5807 } else { 5808 $scrollWithMe.css({top:''}); 5809 } 5810 } 5811 // Wenn der sticky Tabellenheader voranden ist, dann die Höhe vom SeitenHeader um den Tabellenheader runterschieben beim Hochscrollen, auÃer der feste Tabellenheader befindet sich in einem festen Seitenbereich innerhalb welchem nochmal gescrollt werden kann (zwei vertikale Scrollbalken auf der Seite) 5812 if( jQuery('.tableStickyHeader').length) { 5813 jQuery('.tableStickyHeader').find('th').css({top:headerHeight}); 5814 5815 if( jQuery('.scrollwithmeWrapper').length ) { 5816 var scrollHeight = jQuery('.scrollwithmeWrapper').children('.scrollWithMe-active').outerHeight(); 5817 jQuery('.tableStickyHeader').find('th').css({top:scrollHeight+headerHeight}); 5818 } 5819 if( jQuery('.scrollWithMe').length ) { 5820 var scrollHeight = jQuery('.scrollWithMe').outerHeight(); 5821 jQuery('.tableStickyHeader').find('th').css({top:scrollHeight+headerHeight}); 5822 } 5823 $(innerScrollElement).find('th').css({top:0}); 5824 5825 } 5826 } 5827 else { 5828 if( navigator.webdriver != true && current_scroll_top > 100 && !$header.find('.widgetPanelDiv').length && $header.find('.popoverContainer').css('display') != 'block' ) { 5829 $header.addClass('js-hide'); 5830 } 5831 if( jQuery('.scrollWithMe-active').length ) { 5832 if( navigator.webdriver == true ) { 5833 var headerHeight = $header.outerHeight(); 5834 jQuery('.scrollWithMe-active').css({top:headerHeight}); 5835 } else { 5836 jQuery('.scrollWithMe-active').css({top:''}); 5837 } 5838 } 5839 if( jQuery('.tableStickyHeader').length ) { 5840 jQuery('.tableStickyHeader').find('th').css({top:''}); 5841 5842 if( jQuery('.scrollwithmeWrapper').length ) { 5843 var scrollHeight = jQuery('.scrollwithmeWrapper').children('.scrollWithMe-active').outerHeight(); 5844 jQuery('.tableStickyHeader').find('th').css({top:scrollHeight}); 5845 } 5846 if( jQuery('.scrollWithMe').length ) { 5847 var scrollHeight = jQuery('.scrollWithMe').outerHeight(); 5848 jQuery('.tableStickyHeader').find('th').css({top:scrollHeight}); 5849 } 5850 } 5851 } 5852 } 5853 5854 old_scroll_top = current_scroll_top; 5855 } 5856 }); 5857 5858 $('.tableStickyHeader').parent().on('scroll', function(e){ 5859 jQuery('.tableStickyHeader').find('th').css({top:0}); 5860 innerScrollElement = this; 5861 }); 5862 5863 let scrollTimer; 5864 5865 jQuery(window).on('scroll', function () { 5866 const $table = jQuery('bia-smart-treetable .tableStickyHeader'); 5867 const $rows = $table.find('thead tr'); 5868 5869 if ($rows.length > 0) { 5870 // Check if screen width > 768px 5871 const isLargeScreen = window.matchMedia('(min-width: 769px)').matches; 5872 5873 if (isLargeScreen) { 5874 let offsetTop = 0; 5875 $rows.each(function () { 5876 const $row = jQuery(this); 5877 $row.css({ 5878 position: 'sticky', 5879 top: offsetTop + 'px', 5880 'z-index': 1 5881 }); 5882 offsetTop += $row.outerHeight(); 5883 }); 5884 5885 $table.find('th').each(function () { 5886 this.style.position = ''; 5887 this.style.top = ''; 5888 this.style.zIndex = ''; 5889 }); 5890 } else { 5891 $rows.removeAttr('style'); 5892 $table.find('th').removeAttr('style'); 5893 } 5894 5895 clearTimeout(scrollTimer); 5896 scrollTimer = setTimeout(function () { 5897 jQuery(window).trigger('scrollStopped'); 5898 }, 150); 5899 } 5900 }); 5901 5902 jQuery(window).on('scrollStopped', function () { 5903 jQuery('bia-smart-treetable .tableStickyHeader').find('th').removeAttr('style'); 5904 }); 5905 5906 5907 window.addEventListener("orientationchange", function(){ 5908 if($navToggle.hasClass('js-open')) { 5909 setTimeout(function(){ 5910 navInit(); 5911 }, 100); 5912 } 5913 }); 5914 5915 5916 // LOGIN TOGGLE HEADER 5917 jQuery('.loginToggle').off(clickEvent).on(clickEvent, function(e){ 5918 e.preventDefault(); 5919 jQuery('.loginStartPage').slideToggle(); 5920 if(jQuery('.loginToggle').attr("aria-pressed") == "true"){ 5921 jQuery('.loginToggle').attr("aria-pressed", "false"); 5922 } else { 5923 jQuery('.loginToggle').attr("aria-pressed", "true"); 5924 const loginForm = jQuery('.loginStartPage').find('#loginForm'); 5925 const firstInputField = loginForm.find("input:visible").first(); 5926 if (firstInputField) { 5927 firstInputField.focus(); 5928 } 5929 } 5930 }); 5931 5932 function checkScrollnav() { 5933 if( jQuery('.navband').length != 0 ) { 5934 var initContainerWidth = jQuery('.navband')[0].scrollWidth; 5935 var initWrapWidth = jQuery('.navbandWrap').outerWidth()+10; 5936 if( initContainerWidth < initWrapWidth ) { 5937 jQuery('.navbandArrow').hide(); 5938 } else { 5939 jQuery('.navbandRight').show(); 5940 } 5941 } 5942 }checkScrollnav(); 5943 num = 1; 5944 jQuery('.navbandArrow').off('mouseenter').on('mouseenter', function(){ 5945 var $this = jQuery(this); 5946 incInterval= setInterval(function(){ 5947 if( $this.hasClass('navbandRight') ) { 5948 var pos = jQuery('.navband').scrollLeft() + num; 5949 } else { 5950 var pos = jQuery('.navband').scrollLeft() - num; 5951 } 5952 jQuery('.navband').scrollLeft(pos); 5953 var curPos = jQuery('.navband').scrollLeft(); 5954 var containerWidth = jQuery('.navband')[0].scrollWidth; 5955 var wrapWidth = jQuery('.navbandWrap').outerWidth(); 5956 var scrollWidth = containerWidth - wrapWidth; 5957 if( curPos > 0 ) { 5958 jQuery('.navbandLeft').show(); 5959 } 5960 if( curPos == 0 ) { 5961 jQuery('.navbandLeft').hide(); 5962 } 5963 if( curPos+5 >= scrollWidth ) { 5964 jQuery('.navbandRight').hide(); 5965 } 5966 if( curPos+5 < scrollWidth ) { 5967 jQuery('.navbandRight').show(); 5968 } 5969 num++; 5970 },50); 5971 }).mouseleave( function(){ 5972 clearInterval(incInterval); 5973 }); 5974 5975 // Hover Navigation Fix für Menüs mit vielen Einträgen #348539 5976 5977 jQuery('.navbandWrap').on('mouseenter', 'li.parentListItem', function () { 5978 const $ul = jQuery(this).children('ul[id^="navitem_"]'); 5979 if ($ul.length === 0) return; 5980 setTimeout(() => { 5981 const ulElement = $ul[0]; 5982 5983 if (!ulElement || ulElement.offsetParent === null) return; 5984 5985 const rect = ulElement.getBoundingClientRect(); 5986 const menuBottom = rect.top + rect.height; 5987 const viewportBottom = window.innerHeight; 5988 5989 if (menuBottom > viewportBottom) { 5990 ulElement.classList.add('menuCutoff'); 5991 } else { 5992 ulElement.classList.remove('menuCutoff'); 5993 } 5994 }, 500); 5995 }); 5996 5997 jQuery('.navbandWrap').on('mouseleave', 'li.parentListItem', function () { 5998 const $ul = jQuery(this).children('ul[id^="navitem_"]'); 5999 $ul.removeClass('menuCutoff'); 6000 }); 6001 6002 function closeNavigationButton(){ 6003 if( navigationShown ) { 6004 var activeHeight = $nav.height(); 6005 if( jQuery('#searchMenuExtContainer_inNav').css('display') == 'block' ) { 6006 var mobileNavSearchHeight = jQuery('#searchMenuExtContainer_inNav').outerHeight(); 6007 activeHeight= activeHeight+mobileNavSearchHeight; 6008 } 6009 $closeBtn.css('top', activeHeight); 6010 $closeBtn.addClass('simple-close-button-behavior'); 6011 } else { 6012 $closeBtn.removeClass('simple-close-button-behavior'); 6013 $navToggle.focus(); 6014 } 6015 $closeBtn.off('click').on('click', function(e){ 6016 e.preventDefault(); 6017 $navToggle.trigger('click'); 6018 }); 6019 } 6020 6021 function navigationLoopEvent(){ 6022 $closeBtn.off('keydown').on('keydown', function(e) { 6023 if (e.key === 'Tab' || e.keyCode === 9) { 6024 if( !$navContainer.find('.topMenuList').hasClass('js-hidden') ) { 6025 var $firstVisibleLink = $navContainer.find('.topMenuList a').first(); 6026 } else { 6027 var $firstVisibleLink = $navContainer.find('li.js-active').children('ul').find('a').first(); 6028 } 6029 $firstVisibleLink.focus(); 6030 e.preventDefault(); 6031 } 6032 }); 6033 }navigationLoopEvent(); 6034 6035 } 6036 6037 6038}; 6039 6040 6041 6042/*****************************************************************************/ 6043// Provides a jQuery plugin for a simple sticky component. 6044// The component scolls with the window until a given margin to the op is reached, then it is fixed. 6045// Author: Dennis Hörsch 6046// 6047// The component must have an Id! 6048// OPTIONS (required): 6049// - start: The distance from the top the effect should start 6050// - margin: The distance to the top in case the effect is 'on' 6051/** *************************************************************************** */ 6052(function(jQuery) { 6053 var stickyScrollables = []; 6054 6055 jQuery.fn.stickyScrollable = function(options) { 6056 var component = jQuery(this), 6057 6058 componentId = component.attr('id'), 6059 6060 // Store initial values 6061 top = component.css('top'), 6062 left = component.css('left'), 6063 right = component.css('right'), 6064 6065 scrollingBase = jQuery(options.scrollingBase ? options.scrollingBase : window), 6066 6067 componentScrollingCss = { 6068 position : 'absolute', 6069 top : options.start, 6070 left : left, 6071 right : right 6072 }, 6073 componentFixedCss = { 6074 position : 'fixed', 6075 top : options.margin, 6076 left : left, 6077 right : right 6078 }, 6079 6080 scrollingHandler = function() { 6081 var scroll = scrollingBase.scrollTop() + options.margin; 6082
6083 // Wenn das Scrolling kleiner als die gewünschte Abstand zum top, dann ist die component fixiert. 6084 // Ansonsten ist sie absolut positioniert, so dass sie mitscrollt. 6085 if (scroll < options.start) { 6086 component.css(componentScrollingCss); 6087 } else { 6088 component.css(componentFixedCss); 6089 } 6090 }; 6091 6092 unStickyScrollable(component, componentId, scrollingBase); 6093 6094 // First call to initialize position 6095 scrollingHandler(); 6096 6097 scrollingBase.scroll(scrollingHandler); 6098 6099 stickyScrollables[componentId] = { 6100 handler: scrollingHandler 6101 }; 6102 6103 return component; 6104 }; 6105 6106 var unStickyScrollable = function(component, componentId, scrollingBase) { 6107 var stickyScrollableData = stickyScrollables[componentId]; 6108 6109 if (stickyScrollableData) { 6110 scrollingBase.unbind('scroll', stickyScrollableData.handler); 6111 delete stickyScrollables[componentId]; 6112 } 6113 }; 6114}(jQuery));/*****************************************************************************/ 6115// Provides a jQuery plugin to 'auto close' a component. 6116// After a timeout the component fades out. If the mouse enters the component the fadings stops and the component is shown. On leaving the timeout starts again. 6117// Author: Dennis Hörsch 6118// 6119// The component must have an Id! 6120// OPTIONS (optiona): 6121// - timeout: default is 4000 ms 6122// - fadeOutTime: default is 2500 ms 6123// - fadeInTime: default is 500 ms 6124// - callbackOnHidden: no default 6125/** *************************************************************************** */ 6126(function(jQuery) { 6127 var defaultOptions = { 6128 timeout: 4000, 6129 fadeOutTime: 2500, 6130 fadeInTime: 500, 6131 callbackOnHidden: undefined 6132 }; 6133 6134 jQuery.fn.autoClosing = function(params) { 6135 if(jQuery('.messages-infobox-behavior.occassionalUser').length == 0){ 6136 var component = jQuery(this), 6137 options = jQuery.extend({}, defaultOptions, params), 6138 6139 createTimeout = function() { 6140 return setTimeout(function() { 6141 // component.fadeOut(options.fadeOutTime, fadeOutComplete); 6142 component.css({ 6143 marginRight: "-300px", 6144 opacity: 0, 6145 transition: "all 1s ease-in" 6146 }).addClass('hideWhenClosed'); 6147 setTimeout(fadeOutComplete, 1000); 6148 }, options.timeout) 6149 }, 6150 6151 fadeOutComplete = function() { 6152 component.unbind('mouseenter', mouseEnterHandler); 6153 component.unbind('mouseleave', mouseLeaveHandler); 6154 options.callbackOnHidden(); 6155 }, 6156 resetAutoClosing = function() { 6157 clearTimeout(autoClosingHandle); 6158 component.unbind('mouseenter', mouseEnterHandler); 6159 component.unbind('mouseleave', mouseLeaveHandler); 6160 6161 component.data('__autoClosing', null); 6162 component.data('__resetAutoClosing', null); 6163 }, 6164 6165 mouseEnterHandler = function() { 6166 clearTimeout(autoClosingHandle); 6167 component.stop().show().animate({'opacity': '1.0'}, options.fadeInTime); 6168 }, 6169 mouseLeaveHandler = function() { 6170 autoClosingHandle = createTimeout(); 6171 }, 6172 autoClosingHandle = createTimeout(); 6173 6174 options.timeout /= 2.0; 6175 options.fadeOutTime /= 2.0; 6176 6177 component.mouseenter(mouseEnterHandler); 6178 component.mouseleave(mouseLeaveHandler); 6179 6180 component.data('__autoClosing', true); 6181 component.data('__resetAutoClosing', resetAutoClosing); 6182 6183 return component; 6184 } 6185 }; 6186 6187 jQuery.fn.unAutoClosing = function() { 6188 var component = jQuery(this); 6189 if (component.data('__autoClosing')) { 6190 component.data('__resetAutoClosing')(); 6191 } 6192 return component; 6193 }; 6194}(jQuery));use_package("de.his.ajax"); 6195 6196/** 6197 * Re-initializes some modules after an AJAX request. 6198 * Usage: f:ajax onevent="de.his.ajax.Refresher.onEvent" onerror="de.his.ajax.Refresher.onError" 6199 * Is added automatically to all ajax-Behaviors, manually created or automatically, i.e. for refresh buttons. 6200 * 6201 * Modules to be refreshed need a method 'refresh'. 6202 * 6203 */ 6204de.his.ajax.Refresher = new function() { 6205 6206 this.onEvent = function(data) { 6207 switch (data.status) { 6208 /* status (JSF 2.1 spec, 14.4.1): 6209 * begin Occurs immediately before the request is sent. 6210 * complete Occurs immediately after the request has completed. 6211 * For successful requests, this is immediately before javax.faces.response is called. 6212 * For unsuccessful requests, this is immediately before the error handling callback is invoked. 6213 * success Occurs immediately after jsf.ajax.response has completed. 6214 */ 6215 case "begin": 6216 console.log("[.ajax] begin: %s", data.source.id); 6217 ajaxBegin(); 6218 break; 6219 case "complete": 6220 console.log("[.ajax] complete: %s", data.source.id); 6221 de.his.modules.eventRegistry.fireEvent("refresherComplete"); 6222 // hiermit werden fertige AJAX Calls global "sichtbar", sodass auf dieses Event reagiert werden kann 6223 // Dies ist beispielsweise beim messen der clientseitigen Performanz notwendig.
6224 jQuery(document).trigger('ajaxComplete'); 6225 break; 6226 case "success": 6227 if (isAjaxRedirect(data)) { 6228 console.log("[.ajax] success redirect: %s", data.source.id); 6229 break; 6230 } 6231 6232 console.log("[.ajax] success: %s", data.source.id); 6233 ajaxEnd(data); 6234 de.his.modules.eventRegistry.fireEvent("refresherSuccess"); 6235 break; 6236 } 6237 }; 6238 6239 var ajaxBegin = function() { 6240 de.his.modules.ModuleRegistry.indicateAjaxRequestStart(); 6241 }; 6242 6243 var ajaxEnd = function(data) { 6244 if (data.responseCode == 403) { // Access denied: force redirect, as a result the access-denied page is shown 6245 window.location = window.location; 6246 } 6247 de.his.modules.ModuleRegistry.refreshAll(data); 6248 }; 6249 6250 this.onError = function(data) { 6251 /* status (JSF 2.1 spec, 14.4.2): 6252 * httpError request status==null or request.status==undefined or request.status<200 or request.status >=300 6253 * serverError The Ajax response contains an âerrorâ element. 6254 * malformedXML The Ajax response does not follow the proper format. See Section 1.4 "XML Schema Definition for Partial Responses" 6255 * emptyResponse There was no Ajax response from the server. 6256 */ 6257 6258 // TODO: Refresh, ansonsten ist die Oberfläche / Serverzustand evtl. inkonsistent. 6259 // 6260 // Die JavaScript-Fehlermeldung wird per AJAX verschickt und serverseitig protokolliert. 6261 // Weil die Fehlermeldung sehr lang werden kann (z. B. kann ajax.responseText enthalten 6262 // sein), muss POST verwendet werden. 6263 6264 6265 // Fehler, die beim Verlassen der Seite auftreten unterdrücken 6266 if (isPageUnloading == true) { 6267 return; 6268 } 6269 6270 console.log("[.ajax] error: %s", data.source.id); 6271 var url = de.his.common.ContextInformation.get('context-path') + '/pages/cs/sys/error/error.faces?code=500&ajax=true'; 6272 var form = new FormData(); 6273 form.append('ajaxerror', JSON.stringify(data)); 6274 jQuery.ajax({ 6275 type : "POST", 6276 url : url, 6277 cache : false, 6278 contentType : false, 6279 processData : false, 6280 data : form, 6281 async : true, 6282 success : function(html) { 6283 // alert(JSON.stringify(data)); 6284 } 6285 }); 6286 disableWaitingBahaviour(); 6287 showErrorToUser(data); 6288 }; 6289 6290 this.onErrorIgnore = function(data) { 6291 console.log("[.ajax] errorignore: %s", data.source.id); 6292 disableWaitingBahaviour(); 6293 }; 6294 6295 this.wrapOnEvent = function(onevent) { 6296 return wrapInternal(this.onEvent, onevent); 6297 }; 6298 6299 this.wrapOnError = function(onevent) { 6300 return wrapInternal(this.onError, onevent); 6301 }; 6302 6303 var disableWaitingBahaviour = function(){ 6304 de.his.modules.Waiting.resetWaitingBehaviour(); 6305 } 6306 6307 var showErrorToUser = function(data){ 6308 var errorMessage = getErrorText(data.status); 6309 6310 if(data.status === "serverError"){ 6311 errorMessage += data.serverErrorMessage + " " + data.serverErrorMessage; 6312 } 6313 6314 de.his.component.MessagesInfobox.showMessagesInfobox(errorMessage,'error'); 6315 } 6316 6317 var wrapInternal = function(handler, onevent) { 6318 return function(data) { 6319 onevent(data); 6320 handler(data); 6321 }; 6322 }; 6323 6324 6325 var isAjaxRedirect = function(data) { 6326 return (data.responseCode == 200) && (data.responseText.contains("<redirect url=")); 6327 } 6328 6329 var errorTexts = { 6330 de:{ 6331 _title: "AJAX-Fehler:", 6332 malformedXML: "Das zurückgelieferte XML-Response-Objekt ist fehlerhaft aufgebaut.", 6333 serverError: "Auf dem Server ist ein Fehler aufgetreten.", 6334 clientError: "Das Javascript ist fehlerhaft.", 6335 httpError: "Ein unerwarteter Netzwerkfehler ist aufgetreten.", 6336 emptyResponse: "Die Antwort des Servers war leer.", 6337 _error: "Der Server antwortet nicht.", 6338 offline: "<div class='offlineContainer'>Ihre Internetverbindung ist unterbrochen, die Anwendung kann möglicherweise nicht vollständig genutzt werden.</div>" 6339 }, 6340 en: { 6341 _title: "AJAX-Error:", 6342 malformedXML: "XML response is malformed.", 6343 serverError: "Server returned an error.", 6344 clientError: "The Javascript has errors.", 6345 httpError: "An unexpected network failure occured.", 6346 emptyResponse: "Server response was empty.", 6347 _error: "The Server does not answer requests.", 6348 offline: "<div class='offlineContainer'>Your internet connection seems to be down, this application may not respond properly if no connection is established.</div>" 6349 } 6350 }; 6351 6352 var getErrorText = function(status){ 6353 var lang = de.his.common.LanguageHelper.currentLanguage(); 6354 6355 if( !errorTexts[lang] ){ 6356 //default language 6357 lang = "de"; 6358 } 6359 6360 return (errorTexts[lang][status] || errorTexts[lang]._error); 6361 }; 6362 6363 window.addEventListener("offline", function(e) { 6364 alert( getErrorText( "offline" ) ); 6365 }, false); 6366}; 6367 6368/** 6369 * Used i.e. in HIS_DEVELOPMENT-Modus to show a detailed error message. 6370 * @param data 6371 */ 6372de.his.ajax.Helper = new function() { 6373 this.callHandlerIfPhase = function(data, phase, handler, scope) { 6374 console.log("AJAX status: " + data.status); 6375 if (data.status === phase) { 6376 if(scope){ 6377 handler.apply(scope, data); 6378 }else{ 6379 handler(data); 6380 } 6381 } 6382 }; 6383 6384 this.debugAjaxRequest = function(data) { 6385 if (data.responseCode == 403) { // Access denied: Handled in refresh above 6386 return; 6387 } 6388 var debugText = ""; 6389 debugText += "<b>source.id:</b> " + data.source.id + "<br/>"; 6390 debugText += "<b>responseCode:</b> " + data.responseCode + "<br/>"; 6391 debugText += "<b>status:</b> " + data.status + "<br/>"; 6392 debugText += "<b>serverErrorName:</b> " + data.serverErrorName + "<br/>"; 6393 debugText += "<b>serverErrorMessage:</b> " + data.serverErrorMessage + "<br/>"; 6394 6395 debugText += "<b>responseText:</b><br/>" + data.responseText + "<br/>"; 6396 6397 alert("<h1>AJAX Error occured</h1>","Server is in HIS_DEVELOPMENT Mode and AJAX Error occured.<br/>You can ignore this message if you are not developing new AJAX features and just clicked any navigation link.<br/><br/>Here is your AJAX Error object:<br/><br/> "+debugText); 6398 }; 6399}; 6400 6401 6402/* 6403Die Möglichkeit schaffen, Verarbeitung zu unterdrücken, wenn die Seite gerade verlassen wird. 6404*/ 6405 6406var isPageUnloading = false;
6407 6408jQuery(window).on("beforeunload", 6409 function() { 6410 isPageUnloading = true; 6411 } 6412); 6413 6414use_package("de.his.ajax"); 6415 6416/** 6417 * JS-Funktionen zur Ajax-Funktion: Header einklappen 6418 */ 6419de.his.ajax.ToggleHeader = new function() { 6420 6421 var newValue, oldValue; 6422 6423 //Wenn das togglen des Header abgeschlossen ist 6424 this.processEvent = function(data) { 6425 6426 if (data.status == "success") { 6427 jQuery('#wrapper_no_background').toggleClass('reducedHeader'); 6428 6429 //This ugly hack is required as styleClass is not always refreshed when using an #{} EL to define the value 6430 //also: when it does change the value using the #{} EL it only does it once! 6431 //TODO: is this needed in versions > JSF 2.0 6432 var btn = jQuery('li.plusIconElement input.toggleIcon'); 6433 if(btn.length > 0 ){ 6434 if(!newValue && !oldValue){ 6435 if(btn.hasClass("minusIcon")){ 6436 oldValue = "minusIcon"; 6437 newValue = "plusIcon"; 6438 btn.removeClass(oldValue); 6439 btn.addClass(newValue); 6440 }else if(btn.hasClass("plusIcon")){ 6441 oldValue = "plusIcon"; 6442 newValue = "minusIcon"; 6443 btn.removeClass(oldValue); 6444 btn.addClass(newValue); 6445 } 6446 }else{ 6447 btn.removeClass(newValue); 6448 btn.addClass(oldValue); 6449 var a = oldValue; 6450 oldValue = newValue; 6451 newValue = a; 6452 } 6453 6454 } 6455 6456 setTimeout(function(){ 6457 jQuery('#hisinoneHeader').parent().css({paddingTop:jQuery('#hisinoneHeader').outerHeight()}); 6458 }); 6459 6460 } 6461 try { 6462 var fix = jQuery(".content_portal_hisinone_fixed"); 6463 if (fix && fix.length > 0) { 6464 resizeHeader(); 6465 } 6466 } catch (e) { 6467 //Nur bei fixem Layout vorhanden 6468 } 6469 }; 6470}; 6471use_package("de.his.common"); 6472 6473de.his.common.embedded = new function() { 6474 de.his.modules.ModuleRegistry.registerModule(this) 6475 .registerAjaxRefreshModule(this); 6476 this.moduleName = "de.his.common.embedded"; 6477 6478 this.init = function() { 6479 this.setCssClassIfHisinoneIsEmbedded(); 6480 }; 6481 6482 this.refresh = function() { 6483 this.setCssClassIfHisinoneIsEmbedded(); 6484 }; 6485 6486 /** 6487 * Setzt eine CSS-Klasse, wenn HISinOne in einem IFrame läuft 6488 */ 6489 this.setCssClassIfHisinoneIsEmbedded = function() { 6490 var body = jQuery("body"); 6491 try { 6492 if (window.self !== window.top) { 6493 body.addClass("embedded"); 6494 } 6495 } catch (e) { 6496 //Auch im Fehlerfall läuft HISinOne in einem IFrame 6497 body.addClass("embedded"); 6498 } 6499 }; 6500};use_package("de.his.common"); 6501 6502de.his.common.linkTargetAsOverlay = new function() { 6503 de.his.modules.ModuleRegistry.registerModule(this) 6504 .registerAjaxRefreshModule(this); 6505 this.moduleName = "de.his.common.linkTargetAsOverlay"; 6506 6507 this.init = function() { 6508 this.setLinkTargetAsOverlayOnClick(); 6509 }; 6510 6511 this.refresh = function() { 6512 this.setLinkTargetAsOverlayOnClick(); 6513 }; 6514 6515 /** 6516 * Setzt eine CSS-Klasse, wenn HISinOne in einem IFrame läuft 6517 */ 6518 this.setLinkTargetAsOverlayOnClick = function() { 6519 try { 6520 jQuery('a.targetAsPopup').off('click'); 6521 jQuery('a.targetAsPopup').on('click',function(){ 6522 console.log("targetAsPopup klick!"); 6523 var url = jQuery(this).attr('href'); 6524 var left = (screen.width/2)-(screen.width/4); 6525 var top = (screen.height/2)-(screen.height/4); 6526 var css = 'width=' + (screen.width/2) + ', height=' + (screen.height/2) + ', resizeable, scrollbars, top=' + top + ', left=' + left + ''; 6527 if(typeof(winRef) == 'undefined' || winRef.closed){ 6528 // neues Popup 6529 winRef = window.open(url, 'targetAsPopup', css); 6530 } else { 6531 // Erneuere die URL und hole Popup in Focus 6532 winRef.location.href = url; 6533 winRef.focus(); 6534 } 6535 return false; 6536 }); 6537 6538 jQuery('a.targetBrowserBack').off('click'); 6539 jQuery('a.targetBrowserBack').on('click', function(){ 6540 console.log("klick!"); 6541 window.history.back(); 6542 }); 6543 6544 jQuery('a.targetAsOverlay').off('click'); 6545 jQuery('a.targetAsOverlay').on('click', function(){ 6546 console.log("linkAsOverlay: Klick"); 6547 var iframeSrc = jQuery(this).attr('href'); 6548 var iframeTitle = jQuery(this).text(); 6549 console.log("iframeSrc: " + iframeSrc); 6550 console.log("iframeTitle: " + iframeTitle); 6551 6552 jQuery('#linkTargetAsOverlayForm').append('<input type="hidden" id="overlayTitle" name="overlayTitle" value="' + iframeTitle + '" />'); 6553 6554 jQuery('#linkTargetAsOverlaySrc').attr('value',iframeSrc) 6555 jQuery('#linkTargetAsOverlayForm').show(); 6556 jQuery('#linkTargetAsOverlayForm\\:linkTargetAsOverlayPlaceholder\\:overlayShowButton').hide(); 6557 jQuery('#linkTargetAsOverlayForm\\:linkTargetAsOverlayPlaceholder\\:overlayShowButton').click(); 6558 return false;
6559 }); 6560 6561 //Wurde das Overlay aktiviert? 6562 if (jQuery('#iframePlaceholder').length) { 6563 //Nur weiter machen, wenn es noch kein Iframe im Overlay gibt 6564 if (!jQuery('#linkTargetAsOverlayPlaceholderIframe').length) { 6565 //Title setzen 6566 var overlayTitle = jQuery('#overlayTitle').attr('value'); 6567 console.log("overlayTitle: " + overlayTitle); 6568 jQuery('#linkTargetAsOverlayForm\\:linkTargetAsOverlayPlaceholder\\:overlayPlaceholder .box_title h2').text(overlayTitle); 6569 6570 //Ziel-URL extrahieren 6571 var iframeSrc = jQuery('#linkTargetAsOverlaySrc').attr('value'); 6572 console.log("linkTargetAsOverlaySrc: " + iframeSrc); 6573 6574 //Höhe für Inhalt holen 6575 var overlayContentHeight = Math.floor(window.innerHeight * 0.80) - 181; 6576 console.log("overlayContentHeight: " + overlayContentHeight); 6577 6578 //IFrame hinzufügen 6579 var iframePlaceholder = jQuery('#iframePlaceholder'); 6580 iframePlaceholder.append('<iframe style="border:0px;width:100%;height:'+overlayContentHeight+'px" class="frame" id="linkTargetAsOverlayPlaceholderIframe" src="#" title="Overlay">Iframe</iframe>'); 6581 6582 //URL setzten 6583 jQuery('iframe#linkTargetAsOverlayPlaceholderIframe').attr('src', iframeSrc); 6584 6585 //Laden 6586 jQuery('iframe#linkTargetAsOverlayPlaceholderIframe').ready(function() { 6587 console.log("resizeIt"); 6588 //resizeIt(jQuery("#linkTargetAsOverlayPlaceholderIframe")); 6589 }); 6590 } 6591 } 6592 6593 } catch (e) { 6594 console.log(e) 6595 } 6596 }; 6597};use_package("de.his.common"); 6598 6599de.his.common.embedded = new function() { 6600 de.his.modules.ModuleRegistry.registerModule(this) 6601 .registerAjaxRefreshModule(this); 6602 this.moduleName = "de.his.common.portalUtil"; 6603 6604 this.init = function() { 6605 this.execFunctions(); 6606 }; 6607 this.refresh = function() { 6608 this.execFunctions(); 6609 }; 6610 6611 /** 6612 * Setzt eine CSS-Klasse, wenn HISinOne in einem IFrame läuft 6613 */ 6614 this.execFunctions = function() { 6615 try { 6616 //In HTML-Portlets eine Zurückfunktion ermöglichen - nur bei Mehrfachverwendung einer Portletverlinkung (Deeplink) nutzen 6617 jQuery(document).ready(function () { 6618 jQuery('a.targetBrowserBack').click(function(){ 6619 console.log("klick!"); 6620 window.history.back(); 6621 }); 6622 }); 6623 } catch (e) { 6624 console.log(e) 6625 } 6626 }; 6627};/** 6628 * Author: Evelyn Elsner 6629 * 6630 */ 6631de.his.modules.Menutabs = new function() { 6632 de.his.modules.ModuleRegistry 6633 .registerModule(this) 6634 .registerAjaxRefreshModule(this); 6635 6636 this.moduleName = "de.his.modules.Menutabs"; 6637 6638 this.init = function() { 6639 this.activeTabHandling(); 6640 jQuery('.tabButton.active').css('cursor','pointer'); 6641 }; 6642 6643 this.refresh = function() { 6644 this.activeTabHandling(); 6645 }; 6646 6647 this.activeTabHandling = function(){ 6648 if(!jQuery('.responsive_tab.mikronavi_submit > ul > li:first-child button.tabButton').hasClass('active') && jQuery(window).width() <= 768 || window.localStorage.getItem("firstLinkActivationCount") == 1){ 6649 window.localStorage.setItem("firstLinkActivationCount", 0); 6650 jQuery('.responsive_tab.mikronavi_submit ~ div, .responsive_tab.mikronavi_submit + h2').css('display', 'block'); 6651 jQuery('.responsive_tab.mikronavi_submit').css('display', 'none'); 6652 6653 jQuery('.backButtonTabSmallView').css('display', 'inline'); 6654 //jQuery('button.backButtonResponsive:not(.backButtonTabSmallView)').attr('onclick', "return false"); 6655 6656 if(jQuery('.backButtonTabSmallView').is(":visible")){ 6657 jQuery('.backButtonResponsive.submit.immediate').css('display', 'none'); 6658 } 6659 } 6660 if(window.localStorage.getItem("firstLinkActivationCount") == 0 && jQuery(window).width() > 768){ 6661 jQuery('.responsive_tab.mikronavi_submit').css('display', 'block'); 6662 jQuery('.backButtonTabSmallView').css('display', 'none'); 6663 jQuery('.backButtonResponsive.submit.immediate').css('display', 'inline-block'); 6664 } 6665 if (jQuery(window).width() <= 768 && jQuery('.responsive_tab.mikronavi_submit').css('display') == 'block') { 6666 jQuery('.responsive_tab.mikronavi_submit ~ div, .responsive_tab.mikronavi_submit + h2').css('display', 'none'); 6667 } 6668 6669 } 6670 6671 // Klick auf den ersten Tab, der standardmäÃig aktiv ist -> Nach Request soll noch bekannt sein, dass dieser geklickt wurde, deshalb Klick im Storage speichern 6672 jQuery('.responsive_tab.mikronavi_submit > ul > li:first-child button.tabButton').on("click", function(){ 6673 var firstLinkActivationCount = parseInt(window.localStorage.getItem("firstLinkActivationCount")) + 1; 6674 window.localStorage.setItem("firstLinkActivationCount", firstLinkActivationCount); 6675 }); 6676 6677 this.disableBackButton = function(){ 6678 if(jQuery('.responsive_tab.mikronavi_submit').is(":visible")){ 6679 jQuery('.backButtonTabSmallView').css('display', 'none'); 6680 } 6681 } 6682}; 6683 6684jQuery(window).resize(function() { 6685 if(jQuery(window).width() > 768){ 6686 jQuery('.responsive_tab.mikronavi_submit ~ div, .responsive_tab.mikronavi_submit + h2').css('display', 'block'); 6687 jQuery('.responsive_tab.mikronavi_submit').css('display', 'block'); 6688 jQuery('.backButtonResponsive.submit.immediate').css('display', 'inline-block'); 6689 6690 jQuery('.backButtonTabSmallView').css('display', 'none'); 6691 } 6692 else if(jQuery(window).width() <= 768 && jQuery('.responsive_tab.mikronavi_submit').css('display') == 'none'){ 6693 6694 jQuery('.responsive_tab.mikronavi_submit ~ div, .responsive_tab.mikronavi_submit + h2').css('display', 'block'); 6695 6696 } 6697 else{ 6698 jQuery('.responsive_tab.mikronavi_submit ~ div, .responsive_tab.mikronavi_submit + h2').css('display', 'none'); 6699 } 6700});/** 6701 * Author: Evelyn Elsner 6702 * 6703 */ 6704de.his.modules.LoginPassword = new function() { 6705 de.his.modules.ModuleRegistry.registerModule(this) 6706 .registerAjaxRefreshModule(this); 6707 6708 this.moduleName = "de.his.modules.LoginPassword"; 6709 6710 var showPasswordBtn = ""; 6711 var showPasswordBtnImg = ""; 6712 var lang = "de"; 6713 var newTitleDe = "Passwort verbergen"; 6714 var newTitleEn = "Hide password" 6715 var oldTitle = ""; 6716 6717 // Login-Portlet 6718 var pShowPasswordBtn = ""; 6719 var pShowPasswordBtnImg = ""; 6720 var pNewTitleDe = "Passwort verbergen"; 6721 var pNewTitleEn = "Hide password" 6722 var pOldTitle = ""; 6723 6724 // Access Denied Form 6725 var dShowPasswordBtn = ""; 6726 var dShowPasswordBtnImg = ""; 6727 var dNewTitleDe = "Passwort verbergen"; 6728 var dNewTitleEn = "Hide password" 6729 var dOldTitle = ""; 6730 6731 // Self Registration first Password 6732 var s1ShowPasswordBtn = ""; 6733 var s1ShowPasswordBtnImg = ""; 6734 var s1NewTitleDe = "Passwort verbergen"; 6735 var s1NewTitleEn = "Hide password" 6736 var s1OldTitle = ""; 6737 6738 // Self Registration second/repeated Password 6739 var s2ShowPasswordBtn = ""; 6740 var s2ShowPasswordBtnImg = ""; 6741 var s2NewTitleDe = "Passwort verbergen"; 6742 var s2NewTitleEn = "Hide password" 6743 var s2OldTitle = ""; 6744 6745 6746 this.init = function() { 6747 showPasswordBtn = jQuery('button[id$="showPassword"]'); 6748 showPasswordBtnImg = jQuery('button[id$="showPassword"].iconfont-eye'); 6749 oldTitle = jQuery('button[id$="showPassword"]').attr("title"); 6750 6751 pShowPasswordBtn = jQuery('button[id$="showPasswordPortlet"]'); 6752 pShowPasswordBtnImg = jQuery('button[id$="showPasswordPortlet"] > img'); 6753 pOldTitle = jQuery('button[id$="showPasswordPortlet"]').attr("title"); 6754 6755 dShowPasswordBtn = jQuery('button[id$="showPasswordAccessDenied"]'); 6756 dShowPasswordBtnImg = jQuery('button[id$="showPasswordAccessDenied"].iconfont-eye'); 6757 dOldTitle = jQuery('button[id$="showPasswordAccessDenied"]').attr("title"); 6758 6759 s1ShowPasswordBtn = jQuery('button[id$="showPassword1SelfRegistration"]'); 6760 s1ShowPasswordBtnImg = jQuery('button[id$="showPassword1SelfRegistration"] > img'); 6761 s1OldTitle = jQuery('button[id$="showPassword1SelfRegistration"]').attr("title"); 6762 6763 s2ShowPasswordBtn = jQuery('button[id$="showPassword2SelfRegistration"]'); 6764 s2ShowPasswordBtnImg = jQuery('button[id$="showPassword2SelfRegistration"] > img'); 6765 s2OldTitle = jQuery('button[id$="showPassword2SelfRegistration"]').attr("title"); 6766 6767 if(jQuery('select[id$=langselectbox]').attr("class") === "langSelector language_en"){ 6768 lang = "en"; 6769 }
6770 jQuery('button[id$="showPassword"]').off("click"); 6771 jQuery('button[id$="showPassword"]').on("click", function(){ 6772 var password = getPassword('#fdsa'); 6773 var type = setType(password); 6774 6775 if(type === "text"){ 6776 showPasswordBtnImg.attr("class", "iconfont_2023_06-eye_blocked submit_image showPasswordElement"); 6777 setBtnImgAttributes(showPasswordBtn, showPasswordBtnImg, newTitleDe, newTitleEn); 6778 } 6779 else{ 6780 setOldAttributes(showPasswordBtn, "iconfont-eye submit_image showPasswordElement", oldTitle); 6781 } 6782 }); 6783 6784 // Eye in Login-Portlet (mobile-login-form.xhtml) 6785 jQuery('button[id$="showPasswordPortlet"]').off("click"); 6786 jQuery('button[id$="showPasswordPortlet"]').on("click", function(){ 6787 var password = getPassword('input[id$="mobileLoginSubForm:fdsa"]'); 6788 var type = setType(password); 6789 6790 if(type === "text"){ 6791 pShowPasswordBtnImg.attr("src", "/HISinOne/images/icons/eye_blocked.svg"); 6792 setBtnImgAttributes(pShowPasswordBtn, pShowPasswordBtnImg, pNewTitleDe, pNewTitleEn); 6793 } 6794 else{ 6795 setOldAttributes(pShowPasswordBtn, pShowPasswordBtnImg, pOldTitle); 6796 } 6797 }); 6798 6799 // Eye in Access Denied (login-form.xhtml) 6800 jQuery('button[id$="showPasswordAccessDenied"]').off("click"); 6801 jQuery('button[id$="showPasswordAccessDenied"]').on("click", function(){ 6802 var password = getPassword('#accessDeniedForm > div > div > input[id$="fdsa"]'); 6803 var type = setType(password); 6804 6805 if(type === "text"){ 6806 dShowPasswordBtnImg.attr("class", "iconfont_2023_06-eye_blocked submit_image showPasswordAccessDenied"); 6807 setBtnImgAttributes(dShowPasswordBtn, dShowPasswordBtnImg, dNewTitleDe, dNewTitleEn); } 6808 else{ 6809 setOldAttributes(dShowPasswordBtn, "iconfont-eye submit_image showPasswordAccessDenied", dOldTitle); 6810 } 6811 }); 6812 6813 // Eye in self Registration Form (selfRegistrationForm.xhtml) 6814 jQuery('button[id$="showPassword1SelfRegistration"]').off("click"); 6815 jQuery('button[id$="showPassword1SelfRegistration"]').on("click", function(){ 6816 var password = getPassword('#selbstregistrierung > div > div > div > fieldset > div > div > input[id$="passwort1"]'); 6817 var type = setType(password); 6818 6819 if(type === "text"){ 6820 s1ShowPasswordBtnImg.attr("src", "/HISinOne/images/icons/eye_blocked.svg"); 6821 setBtnImgAttributes(s1ShowPasswordBtn, s1ShowPasswordBtnImg, s1NewTitleDe, s1NewTitleEn); } 6822 else{ 6823 setOldAttributes(s1ShowPasswordBtn, s1ShowPasswordBtnImg, s1OldTitle); 6824 } 6825 }); 6826 6827 // Second eye in self Registration Form (selfRegistrationForm.xhtml) 6828 jQuery('button[id$="showPassword2SelfRegistration"]').off("click"); 6829 jQuery('button[id$="showPassword2SelfRegistration"]').on("click", function(){ 6830 var password = getPassword('#selbstregistrierung > div > div > div > fieldset > div > div > input[id$="passwort2"]'); 6831 var type = setType(password); 6832 6833 if(type === "text"){ 6834 s2ShowPasswordBtnImg.attr("src", "/HISinOne/images/icons/eye_blocked.svg"); 6835 setBtnImgAttributes(s2ShowPasswordBtn, s2ShowPasswordBtnImg, s2NewTitleDe, s2NewTitleEn); } 6836 else{ 6837 setOldAttributes(s2ShowPasswordBtn, s2ShowPasswordBtnImg, s2OldTitle); 6838 } 6839 }); 6840 }; 6841 6842 this.refresh = function() { 6843 this.init(); 6844 }; 6845 6846 const getPassword = function(passwordId){ 6847 var password = document.querySelector(passwordId); 6848 return password; 6849 } 6850 6851 // toggle the type attribute 6852 const setType = function(password){ 6853 var type = password.getAttribute("type") === "password" ? "text" : "password"; 6854 password.setAttribute('type', type); 6855 return type; 6856 } 6857 6858 // toggle title and alt attributes 6859 const setBtnImgAttributes = function(button, buttonImg, titleDe, titleEn){ 6860 if(lang === "de"){ 6861 button.attr("title", titleDe); 6862 button.attr("aria-label", titleDe); 6863 if(buttonImg.toString().includes("iconfont")){ 6864 buttonImg.attr("alt", titleDe); 6865 } 6866 } 6867 else if(lang === "en"){ 6868 button.attr("title", titleEn); 6869 button.attr("aria-label", titleEn); 6870 if(buttonImg.toString().includes("iconfont")){ 6871 buttonImg.attr("alt", titleEn); 6872 } 6873 } 6874 button.trigger("updateTooltip"); 6875 } 6876 6877 const setOldAttributes = function(button, buttonImg, oldAttribute){ 6878 if(buttonImg.toString().includes("iconfont") === false){ 6879 button.attr("title", oldAttribute); 6880 button.attr("aria-label", oldAttribute); 6881 buttonImg.attr("alt", oldAttribute); 6882 buttonImg.attr("src", "/HISinOne/images/icons/eye.svg"); 6883 } 6884 else{ 6885 button.attr("title", oldAttribute); 6886 button.attr("aria-label", oldAttribute); 6887 button.attr("class", buttonImg); 6888 } 6889 button.trigger("updateTooltip"); 6890 } 6891};window.org=window.org||{};org.apache=org.apache||{};org.apache.myfaces=org.apache.myfaces||{};org.apache.myfaces.dateformat=org.apache.myfaces.dateformat||{};if(!org.apache.myfaces.dateformat.DateFormatSymbols){org.apache.myfaces.dateformat.DateFormatSymbols=function(){this.eras=new Array("BC","AD");this.months=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Undecimber");this.shortMonths=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Und");this.weekdays=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
6891ay","Saturday");this.shortWeekdays=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");this.ampms=new Array("AM","PM");this.zoneStrings=new Array(new Array(0,"long-name","short-name"));var A=new Date();A.setYear(A.getYear()-80);this.twoDigitYearStart=A;};org.apache.myfaces.dateformat.ParserContext=function(A){this.newIndex=0;this.invalid=false;this.firstDayOfWeek=A;this.ambigousYear=false;this.ambigousWeekYear=false;this.year=0;this.month=0;this.day=1;this.dayOfWeek=0;this.hour=0;this.hourAmpm;this.min=0;this.sec=0;this.ampm=0;this.weekYear=0;this.weekOfWeekYear=0;};org.apache.myfaces.dateformat.WeekDate=function(B,A){this.year=B;this.week=A;};org.apache.myfaces.dateformat.StringBuffer=function(A){if(A==null){this.str="";}else{this.str=A;}var B=org.apache.myfaces.dateformat.StringBuffer.prototype;B.append=function(C){this.str=this.str+C;};B.toString=function(){return this.str;};};org.apache.myfaces.dateformat.SimpleDateFormatter=function(C,B,A){this._construct(C,B,A);};var proto=org.apache.myfaces.dateformat.SimpleDateFormatter.prototype;proto.MSECS_PER_SEC=1000;proto.MSECS_PER_MIN=60*proto.MSECS_PER_SEC;proto.MSECS_PER_HOUR=60*proto.MSECS_PER_MIN;proto.MSECS_PER_DAY=24*proto.MSECS_PER_HOUR;proto.MSECS_PER_WEEK=7*proto.MSECS_PER_DAY;proto.MONTH_LEN=[0,31,59,90,120,151,181,212,243,273,304,334];proto._getIsoWeekDate=function(B){var I=B.getFullYear();var F=B.getMonth()+1;var J=B.getDate();var L,K,H,G,E,D,C,N,A;if(F<=2){L=I-1;K=Math.floor(L/4)-Math.floor(L/100)+Math.floor(L/400);H=Math.floor((L-1)/4)-Math.floor((L-1)/100)+Math.floor((L-1)/400);N=K-H;E=0;D=J-1+31*(F-1);}else{L=I;K=Math.floor(L/4)-Math.floor(L/100)+Math.floor(L/400);H=Math.floor((L-1)/4)-Math.floor((L-1)/100)+Math.floor((L-1)/400);N=K-H;E=N+1;D=J+Math.floor((153*(F-3)+2)/5)+58+N;}C=(L+K)%7;G=(D+C-E)%7;A=D+3-G;if(A<0){var M=53-Math.floor((C-N)/5);return new org.apache.myfaces.dateformat.WeekDate(I-1,M);}else{if(A>(364+N)){var M=1;return new org.apache.myfaces.dateformat.WeekDate(I+1,M);}else{var M=Math.floor(A/7)+1;return new org.apache.myfaces.dateformat.WeekDate(I,M);}}};proto._isLeapYear=function(A){return((A%4==0)&&(A%100!=0))||(A%400==0);};proto._dayOfWeek=function(B,E,A){E-=2;if(E<1){E+=12;--B;}var D=Math.floor(B/100);B%=100;var C=Math.floor((26*E-2)/10)+A+B+Math.floor(B/4)+Math.floor(D/4)+(5*D);var F=C%7;return F;};proto._getWeekDate=function(D,B){var I=D.getFullYear();var G=D.getMonth()+1;var J=D.getDate();var E=this._isLeapYear(I);var K=J+this.MONTH_LEN[G-1];if(E&&(G>2)){++K;}var M=this._dayOfWeek(I,1,1);var F=B-M;if(F>3){F-=7;}else{if(F<-3){F+=7;}}var L=K-1;if(L<F){var H=this._isLeapYear(I-1);if((F==3)||((F==2)&&H)){return new org.apache.myfaces.dateformat.WeekDate(I-1,53);}return new org.apache.myfaces.dateformat.WeekDate(I-1,52);}var C=(K-1-F);var A=Math.floor(C/7)+1;if((A<53)||(F==-3)||(F==-2&&E)){return new org.apache.myfaces.dateformat.WeekDate(I,A);}else{return new org.apache.myfaces.dateformat.WeekDate(I+1,1);}};proto._getStartOfWeekYear=function(E,A){var F=new Date(E,0,1,0,0,0);var C=F.getDay();var D=A-C;var B;if(D>=4){B=7-B;}else{if(D>=0){B=D;}else{if(D>=-3){B=D;}else{B=7+D;}}}var G=F.getTime()+(B*this.MSECS_PER_DAY);return G;};proto._getDateForWeekDate=function(H,C,I,D,E,F,A){var B=this._getStartOfWeekYear(H,A);var G=(C-1)*this.MSECS_PER_WEEK;G+=(I-1)*this.MSECS_PER_DAY;G+=D*this.MSECS_PER_HOUR;G+=E*this.MSECS_PER_MIN;G+=F*this.MSECS_PER_SEC;var J=new Date();J.setTime(B+G);return J;};proto._fullYearFromDate=function(A){if(A<1900){return A+1900;}else{return A;}};proto._createDateFromContext=function(B){var A;if(B.weekOfWeekYear!=0){A=this._getDateForWeekDate(B.weekYear,B.weekOfWeekYear,B.day,B.hour,B.min,B.sec,B.firstDayOfWeek);}else{A=new Date(B.year,B.month,B.day,B.hour,B.min,B.sec);}return A;};proto._substr=function(C,D,A){var B=C.substring(D);if(B.length<=A){return B;}else{return B.substring(0,A);}};proto._parseOps=function(C,J,A,D,E){var B=new org.apache.myfaces.dateformat.ParserContext(A);var N=0;var F=E.length;for(var H=0;(H<D.length)&&(N<F);++H){var I=D[H];var M=I.substring(0,2);var G=I.substring(2);if(M=="f:"){this._parsePattern(C,J,B,G,E,N);if((B.newIndex<0)||B.invalid){break;}N=B.newIndex;}else{if(M=="q:"||M=="l:"){var K=G.length;var L=this._substr(E,N,K);if(G!=L){B.invalid=true;break;}N+=K;}}}return B;};proto._parsePattern=function(B,H,A,E,D,K){var J=E.charAt(0);
6891var C=E.length;if(J=="y"){var I=this._parseNum(A,D,4,K);if((A.newIndex-K)<4){A.year=I;A.ambiguousYear=true;}else{A.year=I;A.ambiguousYear=false;}if(H){A.weekYear=A.year;A.ambiguousWeekYear=A.ambiguousYear;}}else{if(J=="x"){var I=this._parseNum(A,D,4,K);if((A.newIndex-K)<4){A.weekYear=I;A.ambiguousWeekYear=true;}else{A.weekYear=I;A.ambiguousWeekYear=false;}}else{if(J=="M"){if(C==3){var G=this._substr(D,K,3);var F=this._parseIndexOf(A,B.shortMonths,G);if(F!=-1){A.month=F;}}else{if(C>=4){var G=D.substring(K);var F=this._parsePrefixOf(A,B.months,G);if(F!=-1){A.month=F;}}else{A.month=this._parseNum(A,D,2,K)-1;}}}else{if(J=="d"){A.day=this._parseNum(A,D,2,K);}else{if(J=="E"){if(C<=3){var G=D.substring(K,K+3);var F=this._parseIndexOf(A,B.shortWeekdays,G);if(F!=-1){A.dayOfWeek=F;}}else{var G=D.substring(K);var F=this._parsePrefixOf(A,B.weekdays,G);if(F!=-1){A.dayOfWeek=F;}}}else{if(J=="H"){A.hour=this._parseNum(A,D,2,K);}else{if(J=="h"){A.hourAmpm=this._parseNum(A,D,2,K);}else{if(J=="m"){A.min=this._parseNum(A,D,2,K);}else{if(J=="s"){A.sec=this._parseNum(A,D,2,K);}else{if(J=="a"){A.ampm=this._parseString(A,D,K,B.ampms);}else{if(J=="w"){A.weekOfWeekYear=this._parseNum(A,D,2,K);}
6891else{A.invalid=true;}}}}}}}}}}}};proto._parseInt=function(C){var B=0;for(var A=0;A<C.length;A++){var D=C.charAt(A);if(D<"0"||D>"9"){return -1;}B=B*10+(D-"0");}return B;};proto._parseNum=function(F,B,D,A){var C=Math.min(D,B.length-A);for(var E=C;E>0;E--){var H=B.substring(A,A+E);var G=this._parseInt(H);if(G==-1){continue;}F.newIndex=A+E;return G;}F.newIndex=-1;F.invalid=true;return -1;};proto._parseIndexOf=function(B,E,D){for(var A=0;A<E.length;++A){var C=E[A];if(D==C){B.newIndex+=C.length;return A;}}B.invalid=true;B.newIndex=-1;return -1;};proto._parsePrefixOf=function(B,E,D){for(var A=0;A<E.length;++A){var C=E[A];if(D.indexOf(C)==0){B.newIndex+=C.length;return A;}}B.invalid=true;B.newIndex=-1;return -1;};proto._parseString=function(E,C,B,A){var D=C.substr(B);return this._parsePrefixOf(E,A,D);};proto._parsePostProcess=function(C,D){if(D.ambiguousYear){D.year+=1900;var B=this._createDateFromContext(D);var A=C.twoDigitYearStart;if(B.getTime()<A.getTime()){D.year+=100;}}if(D.year<=0){D.year=new Date().getFullYear();}if(D.hourAmpm>0){if(D.ampm==1){D.hour=D.hourAmpm+12;if(D.hour==24){D.hour=0;}}else{D.hour=D.hourAmpm;}}};proto._formatOps=function(C,I,A,D,E){var B=new org.apache.myfaces.dateformat.ParserContext(A);B.year=E.getFullYear();B.month=E.getMonth();B.day=E.getDate();B.dayOfWeek=E.getDay();B.hour=E.getHours();B.min=E.getMinutes();B.sec=E.getSeconds();B.ampm=(B.hour<12)?0:1;var J=this._getWeekDate(E,A);B.weekYear=J.year;B.weekOfWeekYear=J.week;var K=new org.apache.myfaces.dateformat.StringBuffer();for(var G=0;G<D.length;++G){var H=D[G];var L=H.substring(0,2);var F=H.substring(2);if(L=="f:"){this._formatPattern(C,B,F,I,K);if(B.invalid){break;}}else{if(L=="l:"){K.append(F);}else{if(L=="q:"){K.append(F);}}}}if(B.invalid){return null;}else{return K.toString();}};proto._formatPattern=function(E,G,F,B,D){var H=F.charAt(0);var C=F.length;if(H=="y"){if(!B){this._formatNum(G.year,C<=3?2:4,true,D);}else{this._formatNum(G.weekYear,C<=3?2:4,true,D);}}else{if(H=="x"){this._formatNum(G.weekYear,C<=3?2:4,true,D);}else{if(H=="M"){if(C==3){D.append(E.shortMonths[G.month]);}else{if(C>=4){D.append(E.months[G.month]);}else{this._formatNum(G.month+1,C,false,D);}}}else{if(H=="d"){this._formatNum(G.day,C,false,D);}else{if(H=="E"){if(C<=3){D.append(E.shortWeekdays[G.dayOfWeek]);}else{D.append(E.weekdays[G.dayOfWeek]);}}else{if(H=="H"){this._formatNum(G.hour,C,false,D);}else{if(H=="h"){var A=G.hour;if(A==0){A=12;}else{if(A>12){A=A-12;}}this._formatNum(A,C,false,D);}else{if(H=="m"){this._formatNum(G.min,C,false,D);}else{if(H=="s"){this._formatNum(G.sec,C,false,D);}else{if(H=="a"){D.append(E.ampms[G.ampm]);}else{if(H=="w"){this._formatNum(G.weekOfWeekYear,C,false,D);}else{G.invalid=true;}}}}}}}}}}}};proto._formatNum=function(B,C,E,A){var D=""+B;while(D.length<C){D="0"+D;}if(E&&D.length>C){D=D.substr(D.length-C);}A.append(D);};proto._appendToArray=function(B,A){B[B.length]=A;};proto._isLetter=function(A){if((A>="a")&&(A<="z")){return true;}if((A>="A")&&(A<="Z")){return true;}return false;};proto._analysePattern=function(F){var D=0;var A=F.length;var H=0;var E=null;var G=false;var C=new Array();while(D<A){var I=F.charAt(D);var B;if(D<A-1){B=F.charAt(D+1);}else{B=0;}if(I=="'"&&H!="\\"){if(E!=null){this._appendToArray(C,E.toString());E=null;}G=!G;}else{if(G){if(E==null){E=new org.apache.myfaces.dateformat.StringBuffer("q:");}E.append(I);}else{if(I=="\\"&&H!="\\"){}else{if(E==null){if(this._isLetter(I)){E=new org.apache.myfaces.dateformat.StringBuffer("f:");}else{E=new org.apache.myfaces.dateformat.StringBuffer("l:");}}E.append(I);if(I!=B){this._appendToArray(C,E.toString());E=null;}}}}D++;H=I;}if(E!=null){this._appendToArray(C,E.toString());}return C;};proto._hasWeekPattern=function(E){var C=false;var A=false;for(var B=0;B<E.length;++B){var D=E[B];C=C||(D.indexOf("f:ww")==0);A=A||(D.indexOf("f:xx")==0);}return C&&!A;};proto._construct=function(C,B,A){if(B==null){this.symbols=new org.apache.myfaces.dateformat.DateFormatSymbols();}else{this.symbols=B;}this.ops=this._analysePattern(C);this.yearIsWeekYear=this._hasWeekPattern(this.ops);if(A!=null){this.firstDayOfWeek=A;}else{this.firstDayOfWeek=1;}};proto.setFirstDayOfWeek=function(A){this.firstDayOfWeek=A;};proto.parse=function(A){if((A==null)||(A.length==0)){return null;}var B=this._parseOps(this.symbols,this.yearIsWeekYear,this.firstDayOfWeek,this.ops,A);if(B.invalid){return null;}this._parsePostProcess(this.symbols,B);return this._createDateFromContext(B);};proto.format=function(A){return this._formatOps(this.symbols,this.yearIsWeekYear,this.firstDayOfWeek,this.ops,A);};proto.getWeekDate=function(A){return this._getWeekDate(A,this.firstDayOfWeek);};proto.getDateForWeekDate=function(A){return this._getDateForWeekDate(A.year,A.week,1,0,0,0,this.firstDayOfWeek);};}// based on code written by Tan Ling Wee on 2 Dec 2001 6892// last updated 20 June 2003 6893// email : [email protected] 6894// 6895// Modified to be completely object-oriented, CSS based and using proper DOM-access functions 6896// @author Martin Marinschek 6897// @author Sylvain Vieujot 6898 6899//we reserve the namespace correctly 6900window.org = window.org || {}; 6901org.apache = org.apache || {}; 6902org.apache.myfaces = org.apache.myfaces || {}; 6903 6904if (!org.apache.myfaces.PopupCalendar) { 6905 org.apache.myfaces.CalendarInitData = function () { 6906 // x position (-1 if to appear below control) 6907 this.fixedX = -1; 6908 6909 // y position (-1 if to appear below control) 6910 this.fixedY = -1; 6911 6912 // 0 - sunday ; 1 - monday (aka firstDayOfWeek) 6913 this.startAt = 1; 6914 6915 // 0 - don't show; 1 - show 6916 this.showWeekNumber = 1; 6917 6918 // 0 - don't show; 1 - show 6919 this.showToday = 1; 6920 6921 // directory for images ... e.g. this.imgDir="/img/" 6922 this.imgDir = "images/"; 6923 6924 this.imgDirSuffix = ""; 6925 6926 this.themePrefix = "jscalendar-DB"; 6927 6928 this.gotoString = "Go To Current Month"; 6929 this.todayString = "Today is"; 6930 this.todayDateFormat = null; 6931 this.weekString = "Wk"; 6932 this.scrollLeftMessage = "Click to scroll to previous month. Hold mouse button to scroll automatically."; 6933 this.scrollRightMessage = "Click to scroll to next month. Hold mouse button to scroll automatically."; 6934 this.selectMonthMessage = "Click to select a month."; 6935 this.selectYearMessage = "Click to select a year."; 6936 this.selectDateMessage = "Select [date] as date."; // do not replace [date], it will be replaced by date. 6937 6938 this.popupLeft = false;
6939 6940 this.monthName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); 6941 this.dayName = this.startAt == 0 ? new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat") : new Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); 6942 6943 this.selectMode = "day"; 6944 6945 }; 6946 6947 org.apache.myfaces.DateParts = function (sec, min, hour, date, month, year) { 6948 this.sec = sec; 6949 this.min = min; 6950 this.hour = hour; 6951 this.date = date; 6952 this.month = month; 6953 this.year = year; 6954 }; 6955 6956 org.apache.myfaces.HolidayRec = function (d, m, y, desc) { 6957 this.d = d; 6958 this.m = m; 6959 this.y = y; 6960 this.desc = desc; 6961 }; 6962 6963 org.apache.myfaces.PopupCalendar = function () { 6964 this.idPrefix = "org.apache.myfaces.PopupCalendar"; 6965 6966 this.selectedDate = new org.apache.myfaces.DateParts(0, 0, 0, 0, 0, 0); 6967 this.saveSelectedDate = new org.apache.myfaces.DateParts(0, 0, 0, 0, 0, 0); 6968 6969 this.monthConstructed = false; 6970 this.yearConstructed = false; 6971 this.intervalID1 = null; 6972 this.intervalID2 = null; 6973 this.timeoutID1 = null; 6974 this.timeoutID2 = null; 6975 this.ctlToPlaceValue = null; 6976 this.ctlNow = null; 6977 this.containerCtl = null; 6978 this.dateFormat = "MM/dd/yyyy"; 6979 this.nStartingYear = null; 6980 this.bPageLoaded = false; 6981 6982 // Detect whether the browser is Microsoft Internet Explorer. 6983 // Testing for the presence of document.all is not sufficient, as Opera provides that. 6984 // However hopefully nothing but IE implements ActiveX.. 6985 // it is only needed to test for ie6 and before ie7 and quirks mode 6986 // do not expose the bleed through bug anymore 6987 this.ieVersion = this.getInternetExplorerVersion(); 6988 this.ie6 = this.ieVersion != -1 && this.ieVersion < 7; 6989 6990 this.dom = document.getElementById; 6991 this.ns4 = document.layers; 6992 this.dateFormatSymbols = new org.apache.myfaces.dateformat.DateFormatSymbols(); 6993 this.initData = new org.apache.myfaces.CalendarInitData(); 6994 this.today = new Date(); 6995 this.dateNow = this.today.getDate(); 6996 this.monthNow = this.today.getMonth(); 6997 this.yearNow = this.today.getFullYear(); 6998 6999 // list of images to be preloaded from the server 7000 this.imgSrc = new Array("drop1.gif", "drop2.gif", "left1.gif", "left2.gif", "right1.gif", "right2.gif"); 7001 this.img = new Array(); 7002 7003 //elements which need to change their dynamical 7004 //representation over time 7005 this.calendarDiv; 7006 this.selectMonthDiv; 7007 this.selectYearDiv; 7008 this.todaySpan = null; 7009 this.captionSpan = null; 7010 this.contentSpan = null; 7011 this.acceptMonthSpan = null; 7012 this.closeCalendarSpan = null; 7013 this.monthSpan = null; 7014 this.yearSpan = null 7015 this.changeMonthImg = null; 7016 this.changeYearImg = null; 7017 7018 this.holidaysCounter = 0; 7019 this.holidays = new Array(); 7020 7021 this.bClickOnCalendar = false; 7022 this.bCalendarHidden = true; 7023 7024 this.myFacesCtlType = "x:inputCalendar"; 7025 this.inputDateClientId; 7026 }; 7027 7028//http://msdn.microsoft.com/en-us/library/ms537509%28v=vs.85%29.aspx 7029 org.apache.myfaces.PopupCalendar.prototype.getInternetExplorerVersion = function () 7030 // Returns the version of Internet Explorer or a -1 7031 // (indicating the use of another browser). 7032 { 7033 var rv = -1; // Return value assumes failure. 7034 if (navigator.appName == 'Microsoft Internet Explorer') { 7035 var ua = navigator.userAgent; 7036 var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 7037 if (re.exec(ua) != null) 7038 rv = parseFloat(RegExp.$1); 7039 } 7040 return rv; 7041 }; 7042 7043 org.apache.myfaces.PopupCalendar.prototype._MSECS_PER_DAY = 24 * 60 * 60 * 1000; 7044 7045 /** 7046 popups always have to be 7047 at the dom level nowhere else 7048 */ 7049 org.apache.myfaces.PopupCalendar.prototype._fixPopupDomOrder = function (overDiv) { 7050 if (document.body != overDiv.parentNode) { 7051 overDiv.parentNode.removeChild(overDiv); 7052 document.body.appendChild(overDiv); 7053 } 7054 }; 7055 7056// IE bug workaround: hide background controls under the specified div. 7057 org.apache.myfaces.PopupCalendar.prototype._showPopupPostProcess = function (overDiv) { 7058 7059 //ie6 detection over object inspections 7060 if (this.ie6) { 7061 // The iframe created here is a hack to work around an IE bug. In IE, 7062 // "windowed controls" (esp selectboxes) do not respect the z-index 7063 // setting of "non-windowed controls", meaning they will be drawn on 7064 // top of components that they should theoretically be underneath. 7065 // However a selectbox will NOT be drawn on top of an iframe, so the 7066 // workaround is to create an iframe with no content, then in function 7067 // _recalculateElement position the iframe under the "popup" div to 7068 // "mask out" the unwanted elements. 7069 var iframe = document.getElementById(overDiv.id + "_IFRAME"); 7070 7071 if (iframe == null) { 7072 // the source attribute is to avoid a IE error message about non secure content on https connections 7073 iframe = document.createElement("iframe"); 7074 iframe.setAttribute("id", overDiv.id + "_IFRAME"); 7075 iframe.setAttribute("src", "javascript:false;"); 7076 7077 //HIS_FIX_BEGIN 7078 jQuery(iframe).css({ 7079 "visibility": "hidden", 7080 "position": "absolute",
7081 "top": "0px", 7082 "left": "0px" 7083 }); 7084// Element.setStyle(iframe, "visibility:hidden; position: absolute; top:0px;left:0px;"); 7085 7086 //we can append it lazily since we are late here anyway and everything is rendered 7087 document.body.appendChild(iframe); 7088 } 7089 7090 // now put the iframe at the appropriate location, and make it visible. 7091 this._recalculateElement(overDiv); 7092 } 7093 }; 7094 7095// IE bug workaround: hide background controls under the specified div; see _showPopupPostProcess. 7096// This should be called whenever a popup div is moved. 7097 org.apache.myfaces.PopupCalendar.prototype._recalculateElement = function (overDiv) { 7098 if (this.ie6) { 7099 var iframe = document.getElementById(overDiv.id + "_IFRAME"); 7100 7101 if (iframe) { 7102 // ok, there is a "masking iframe" associated with this div, so make its 7103 // size and position match the div exactly, and set its z-index to just 7104 // below the div. This hack blocks IE selectboxes from being drawn on top 7105 // of the div. 7106 7107 overDiv.style.zIndex = 98; 7108 7109 iframe.style.zIndex = overDiv.style.zIndex - 1; 7110 iframe.style.width = overDiv.offsetWidth; 7111 iframe.style.height = overDiv.offsetHeight; 7112 iframe.style.top = overDiv.style.top; 7113 iframe.style.left = overDiv.style.left; 7114 iframe.style.display = "block"; 7115 iframe.style.visibility = "visible"; 7116 /*we have to set an explicit visible otherwise it wont work*/ 7117 } 7118 } 7119 }; 7120 7121// IE bug workaround: unhide background controls that are beneath the specified div; see _showPopupPostProcess. 7122// Note that although this is called _showeElement, it is called when the popup is being *hidden*, 7123// in order to *show* the underlying controls again. 7124// we also reallign the floating div 7125 org.apache.myfaces.PopupCalendar.prototype._hidePopupPostProcess = function (overDiv) { 7126 7127 if (this.ie6) { 7128 var iframe = document.getElementById(overDiv.id + "_IFRAME"); 7129 if (iframe) iframe.style.display = "none"; 7130 } 7131 }; 7132 7133 org.apache.myfaces.PopupCalendar.prototype.addHoliday = function (d, m, y, desc) { 7134 this.holidays[this.holidaysCounter++] = new org.apache.myfaces.HolidayRec(d, m, y, desc); 7135 }; 7136 7137 org.apache.myfaces.PopupCalendar.prototype._swapImage = function (srcImg, destImg) { 7138 7139 if (srcImg) 7140 srcImg.setAttribute("src", this.initData.imgDir + destImg + this.initData.imgDirSuffix); 7141 }; 7142 7143 org.apache.myfaces.PopupCalendar.prototype._keypresshandler = function () { 7144 // This method is intended for use on IE browsers only; they are the only 7145 // browsers that define window.event and window.event.keyCode. 7146 // Q: Why is this done only for IE? 7147 if (window["event"] && window.event["keyCode"] && (window.event.keyCode == 27)) { 7148 this._hideCalendar(); 7149 } 7150 }; 7151 7152 org.apache.myfaces.PopupCalendar.prototype._clickhandler = function () { 7153 if (!this.bClickOnCalendar) { 7154 this._hideCalendar(); 7155 } 7156 7157 this.bClickOnCalendar = false; 7158 }; 7159 7160 org.apache.myfaces.PopupCalendar.prototype._isDaySelectable = function () { 7161 return (this.initData.selectMode == "day"); 7162 }; 7163 7164 org.apache.myfaces.PopupCalendar.prototype._isWeekSelectable = function () { 7165 return (this.initData.selectMode == "week"); 7166 }; 7167 7168 org.apache.myfaces.PopupCalendar.prototype._isMonthSelectable = function () { 7169 return (this.initData.selectMode == "month"); 7170 }; 7171 7172 org.apache.myfaces.PopupCalendar.prototype.init = function (containerCtl) { 7173 if (this.dom) { 7174 //HIS_FIX_BEGIN #306351 7175 if(containerCtl===null){ 7176 console.warn("Container is null. Cannot initiate popcalendar!"); 7177 return; 7178 } 7179 //HIS_FIX_END #306351 7180 if (!this.calendarDiv) { 7181 for (var i = 0; i < this.imgSrc.length; i++) { 7182 // force preload of all images, so that when DOM nodes have their src set to 7183 // the name of this image, it has already been loaded from the server. 7184 this.img[i] = new Image; 7185 this.img[i].src = this.initData.imgDir + this.imgSrc[i] + this.initData.imgDirSuffix; 7186 } 7187 7188 this.containerCtl = containerCtl; 7189 7190 this.calendarDiv = document.createElement("div"); 7191 this.calendarDiv.id = containerCtl.id + "_calendarDiv"; 7192 this.calendarDiv.className = this.initData.themePrefix + "-div-style"; 7193 7194 //HIS_FIX_BEGIN 7195 var that = this; 7196 jQuery(this.calendarDiv).on("click", function() { 7197 that.bClickOnCalendar = true; 7198 }); 7199// Event.observe(this.calendarDiv, "click", function () { 7200// this.bClickOnCalendar = true; 7201// }.bind(this), false); 7202 //HIS_FIX_END 7203 7204 this.containerCtl.appendChild(this.calendarDiv); 7205 7206 var mainTable = document.createElement("table"); 7207 7208 //HIS_FIX_BEGIN 7209 jQuery(mainTable).css({ 7210 "width": ((that.initData.showWeekNumber == 1) ? 250 : 220) + "px" 7211 });
7212// Element.setStyle(mainTable, "width:" + ((this.initData.showWeekNumber == 1) ? 250 : 220) + "px;"); 7213 mainTable.className = this.initData.themePrefix + "-table-style"; 7214 //HIS_FIX_END 7215 7216 this.calendarDiv.appendChild(mainTable); 7217 7218 //This is necessary for IE. If you don't create a tbody element, the table will never show up! 7219 var mainBody = document.createElement("tbody"); 7220 mainTable.appendChild(mainBody); 7221 7222 var mainRow = document.createElement("tr"); 7223 mainRow.className = this.initData.themePrefix + "-title-background-style"; 7224 7225 mainBody.appendChild(mainRow); 7226 7227 var mainCell = document.createElement("td"); 7228 7229 mainRow.appendChild(mainCell); 7230 7231 var contentTable = document.createElement("table"); 7232 7233 //HIS_FIX_BEGIN 7234 jQuery(contentTable).css({ 7235 "width": ((that.initData.showWeekNumber == 1) ? 248 : 218) + "px" 7236 }); 7237// Element.setStyle(contentTable, "width:" + ((this.initData.showWeekNumber == 1) ? 248 : 218) + "px;"); 7238 //HIS_FIX_END 7239 7240 var contentBody = document.createElement("tbody"); 7241 contentTable.appendChild(contentBody); 7242 7243 mainCell.appendChild(contentTable); 7244 7245 var headerRow = document.createElement("tr"); 7246 contentBody.appendChild(headerRow); 7247 7248 var captionCell = document.createElement("td"); 7249 captionCell.className = this.initData.themePrefix + "-title-style"; 7250 headerRow.appendChild(captionCell); 7251 7252 this.captionSpan = document.createElement("span"); 7253 captionCell.appendChild(this.captionSpan); 7254 7255 if (this._isMonthSelectable()) { 7256 var acceptMonthCell = document.createElement("td"); 7257 7258 //HIS_FIX_BEGIN 7259 jQuery(acceptMonthCell).css("text-align", "right"); 7260// Element.setStyle(acceptMonthCell, "text-align:right;"); 7261 //HIS_FIX_END 7262 headerRow.appendChild(acceptMonthCell); 7263 7264 var acceptMonthLink = document.createElement("a"); 7265 acceptMonthLink.setAttribute("href", "#"); 7266 7267 //HIS_FIX_BEGIN 7268 jQuery(acceptMonthLink).on("click", function(event){ 7269 that.selectedDate.date = 1; // force first of the selected month 7270 that._closeCalendar(); 7271 event.preventDefault(); 7272 event.stopPropagation() 7273 }); 7274// Event.observe(acceptMonthLink, "click", function (event) { 7275// this.selectedDate.date = 1; // force first of the selected month 7276// this._closeCalendar(); 7277// Event.stop(event); 7278// }.bindAsEventListener(this), false); 7279 //HIS_FIX_END 7280 7281 acceptMonthCell.appendChild(acceptMonthLink); 7282 this.acceptMonthSpan = document.createElement("span"); 7283 this.acceptMonthSpan.appendChild(document.createTextNode("Y")); 7284 7285 acceptMonthLink.appendChild(this.acceptMonthSpan); 7286 } 7287 7288 var closeButtonCell = document.createElement("td"); 7289 //HIS_FIX_BEGIN 7290 jQuery(closeButtonCell).css("text-align", "right"); 7291// Element.setStyle(closeButtonCell, "text-align:right;"); 7292 //HIS_FIX_END 7293 headerRow.appendChild(closeButtonCell); 7294 7295 var closeCalendarLink = document.createElement("a"); 7296 closeCalendarLink.setAttribute("href", "#"); 7297 7298 //HIS_FIX_BEGIN 7299 jQuery(closeCalendarLink).on("click", function(event){ 7300 that._hideCalendar(); 7301 event.preventDefault(); 7302 event.stopPropagation(); 7303 }); 7304// Event.observe(closeCalendarLink, "click", function (event) {
7305// this._hideCalendar(); 7306// Event.stop(event); 7307// }.bindAsEventListener(this), false); 7308 //HIS_FIX_END 7309 7310 closeButtonCell.appendChild(closeCalendarLink); 7311 7312 this.closeCalendarSpan = document.createElement("span"); 7313 7314 closeCalendarLink.appendChild(this.closeCalendarSpan); 7315 7316 var contentRow = document.createElement("tr"); 7317 mainBody.appendChild(contentRow); 7318 7319 var contentCell = document.createElement("td"); 7320 contentCell.className = this.initData.themePrefix + "-body-style"; 7321 contentRow.appendChild(contentCell); 7322 7323 this.contentSpan = document.createElement("span"); 7324 contentCell.appendChild(this.contentSpan); 7325 7326 if (this.initData.showToday == 1) { 7327 var todayRow = document.createElement("tr"); 7328 todayRow.className = this.initData.themePrefix + "-today-style"; 7329 mainBody.appendChild(todayRow); 7330 7331 var todayCell = document.createElement("td"); 7332 todayCell.className = this.initData.themePrefix + "-today-lbl-style"; 7333 todayRow.appendChild(todayCell); 7334 7335 this.todaySpan = document.createElement("span"); 7336 todayCell.appendChild(this.todaySpan); 7337 } 7338 7339 this.selectMonthDiv = document.createElement("div"); 7340 this.selectMonthDiv.id = this.containerCtl.id + "_selectMonthDiv"; 7341 this.selectMonthDiv.className = this.initData.themePrefix + "-div-style"; 7342 7343 this.containerCtl.appendChild(this.selectMonthDiv); 7344 7345 this.selectYearDiv = document.createElement("div"); 7346 this.selectYearDiv.id = this.containerCtl.id + "_selectYearDiv"; 7347 this.selectYearDiv.className = this.initData.themePrefix + "-div-style"; 7348 7349 this.containerCtl.appendChild(this.selectYearDiv); 7350 7351 // Catch global keypresses and clicks, so that entering data into any field 7352 // outside the calendar, or clicking anywhere outside the calendar, will 7353 // close it. 7354 // 7355 // This is ugly, as it's quite a load on the client to check this for every 7356 // keystroke/click. It would be nice to find an alternative...maybe register 7357 // these listeners only when a calendar is open? 7358 7359 //HIS_FIX_BEGIN 7360 jQuery(document).on("keypress", function(){ 7361 that._keypresshandler(); 7362 }); 7363// Event.observe(document, "keypress", this._keypresshandler.bind(this), false); 7364 jQuery(document).on("click", function(){ 7365 that._clickhandler(); 7366 }); 7367// Event.observe(document, "click", this._clickhandler.bind(this), false); 7368 //HIS_FIX_END 7369 } 7370 } 7371 7372 if (!this.ns4) { 7373 /* Instead use getFullYear() */ 7374 /*if (!this.ie6) 7375 this.yearNow += 1900;*/ 7376 7377 this._hideCalendar(); 7378 7379 this.monthConstructed = false; 7380 this.yearConstructed = false; 7381 7382 if (this.initData.showToday == 1) { 7383 // TODO this.dateFormatSymbols is probably never set at this point. 7384 this.todayDateFormatter = new org.apache.myfaces.dateformat.SimpleDateFormatter( 7385 this.initData.todayDateFormat ? this.initData.todayDateFormat : this.dateFormat, 7386 this.dateFormatSymbols, 7387 this.initData.startAt); 7388 7389 this.todaySpan.appendChild(document.createTextNode(this.initData.todayString + " ")) 7390 7391 var todayLink = document.createElement("a"); 7392 todayLink.className = this.initData.themePrefix + "-today-style"; 7393 todayLink.setAttribute("title", this.initData.gotoString); 7394 todayLink.setAttribute("href", "#"); 7395 todayLink.appendChild(document.createTextNode(this._todayIsDate(
7395))); 7396 7397 //HIS_FIX_BEGIN 7398 jQuery(todayLink).on("click", function(event){ 7399 that.selectedDate.month = that.monthNow; 7400 that.selectedDate.year = that.yearNow; 7401 that._constructCalendar(); 7402 event.preventDefault(); 7403 event.stopPropagation(); 7404 }); 7405// Event.observe(todayLink, "click", function (event) { 7406// this.selectedDate.month = this.monthNow; 7407// this.selectedDate.year = this.yearNow; 7408// this._constructCalendar(); 7409// Event.stop(event); 7410// }.bindAsEventListener(this), false); 7411 7412 jQuery(todayLink).on("mousemove", function(event){ 7413 window.status = that.initData.gotoString; 7414 }); 7415// Event.observe(todayLink, "mousemove", function () { 7416// window.status = this.initData.gotoString; 7417// }.bind(this), false); 7418 7419 jQuery(todayLink).on("mouseout", function(event){ 7420 window.status = ""; 7421 }); 7422// Event.observe(todayLink, "mouseout", function () { 7423// window.status = ""; 7424// }.bind(this), false); 7425 //HIS_FIX_END 7426 7427 this.todaySpan.appendChild(todayLink); 7428 } 7429 7430 this._appendNavToCaption("left"); 7431 this._appendNavToCaption("right"); 7432 7433 this.monthSpan = document.createElement("span"); 7434 this.monthSpan.className = this.initData.themePrefix + "-title-control-normal-style"; 7435 7436 //HIS_FIX_BEGIN 7437 jQuery(that.monthSpan).on("mouseover", function(event){ 7438 that._swapImage(that.changeMonthImg, "drop2.gif"); 7439 that.monthSpan.className = that.initData.themePrefix + "-title-control-select-style"; 7440 window.status = that.selectMonthMessage; 7441 }); 7442// Event.observe(this.monthSpan, "mouseover", function (event) { 7443// this._swapImage(this.changeMonthImg, "drop2.gif"); 7444// this.monthSpan.className = this.initData.themePrefix + "-title-control-select-style"; 7445// window.status = this.selectMonthMessage; 7446// }.bindAsEventListener(this), false); 7447 7448 jQuery(that.monthSpan).on("mouseout", function(event){ 7449 that._swapImage(that.changeMonthImg, "drop1.gif"); 7450 that.monthSpan.className = that.initData.themePrefix + "-title-control-normal-style"; 7451 window.status = ""; 7452 }); 7453// Event.observe(this.monthSpan, "mouseout", function (event) { 7454// this._swapImage(this.changeMonthImg, "drop1.gif"); 7455// this.monthSpan.className = this.initData.themePrefix + "-title-control-normal-style";
7456// window.status = ""; 7457// }.bindAsEventListener(this), false); 7458 7459 jQuery(that.monthSpan).on("click", function(event){ 7460 that._popUpMonth(); 7461 event.preventDefault(); 7462 event.stopPropagation(); 7463 }); 7464// Event.observe(this.monthSpan, "click", function (event) { 7465// this._popUpMonth(); 7466// Event.stop(event); 7467// }.bind(this), false); 7468 //HIS_FIX_END 7469 7470 this.captionSpan.appendChild(this.monthSpan); 7471 this._appendNbsp(this.captionSpan); 7472 7473 this.yearSpan = document.createElement("span"); 7474 this.yearSpan.className = this.initData.themePrefix + "-title-control-normal-style"; 7475 7476 //HIS_FIX_BEGIN 7477 jQuery(that.yearSpan).on("mouseover", function(event){ 7478 that._swapImage(that.changeYearImg, "drop2.gif"); 7479 that.yearSpan.className = that.initData.themePrefix + "-title-control-select-style"; 7480 window.status = that.selectYearMessage; 7481 }); 7482// Event.observe(this.yearSpan, "mouseover", function (event) { 7483// this._swapImage(this.changeYearImg, "drop2.gif"); 7484// this.yearSpan.className = this.initData.themePrefix + "-title-control-select-style"; 7485// window.status = this.selectYearMessage; 7486// }.bindAsEventListener(this), false); 7487 7488 jQuery(that.yearSpan).on("mouseout", function(event){ 7489 that._swapImage(that.changeYearImg, "drop1.gif"); 7490 that.yearSpan.className = that.initData.themePrefix + "-title-control-normal-style"; 7491 window.status = ""; 7492 }); 7493// Event.observe(this.yearSpan, "mouseout", function (event) { 7494// this._swapImage(this.changeYearImg, "drop1.gif"); 7495// this.yearSpan.className = this.initData.themePrefix + "-title-control-normal-style";
7496// window.status = ""; 7497// }.bindAsEventListener(this), false); 7498 7499 jQuery(that.yearSpan).on("click", function(event){ 7500 that._popUpYear(); 7501 event.preventDefault(); 7502 event.stopPropagation(); 7503 }); 7504// Event.observe(this.yearSpan, "click", function (event) { 7505// this._popUpYear(); 7506// Event.stop(event); 7507// }.bind(this), false); 7508 //HIS_FIX_END 7509 7510 this.captionSpan.appendChild(this.yearSpan); 7511 this._appendNbsp(this.captionSpan); 7512 7513 this.bPageLoaded = true; 7514 7515 } 7516 }; 7517 7518 org.apache.myfaces.PopupCalendar.prototype._appendNavToCaption = function (direction) { 7519 var imgLeft = document.createElement("img"); 7520 imgLeft.setAttribute("src", this.initData.imgDir + direction + "1.gif" + this.initData.imgDirSuffix); 7521 imgLeft.setAttribute("width", "10px"); 7522 imgLeft.setAttribute("height", "11px"); 7523 //HIS_FIX_BEGIN 7524 jQuery(imgLeft).css("border", "0px"); 7525// Element.setStyle(imgLeft, "border:0px;"); 7526 //HIS_FIX_END 7527 7528 var spanLeft = document.createElement("span"); 7529 7530 this._createControl(direction, spanLeft, imgLeft); 7531 7532 this._appendNbsp(spanLeft); 7533 spanLeft.appendChild(imgLeft); 7534 this._appendNbsp(spanLeft); 7535 this.captionSpan.appendChild(spanLeft); 7536 this._appendNbsp(spanLeft); 7537 }; 7538 7539 org.apache.myfaces.PopupCalendar.prototype._createControl = function (direction, spanLeft, imgLeft) { 7540 spanLeft.className = this.initData.themePrefix + "-title-control-normal-style"; 7541 7542 //HIS_FIX_BEGIN 7543 var that = this; 7544 jQuery(spanLeft).on("mouseover", function(event){ 7545 that._swapImage(imgLeft, direction + "2.gif"); 7546 spanLeft.className = that.initData.themePrefix + "-title-control-select-style"; 7547 if (direction == "left") { 7548 window.status = that.scrollLeftMessage; 7549 } 7550 else { 7551 window.status = that.scrollRightMessage; 7552 } 7553 });
7554// Event.observe(spanLeft, "mouseover", function (event) { 7555// this._swapImage(imgLeft, direction + "2.gif"); 7556// spanLeft.className = this.initData.themePrefix + "-title-control-select-style"; 7557// if (direction == "left") { 7558// window.status = this.scrollLeftMessage; 7559// } 7560// else { 7561// window.status = this.scrollRightMessage; 7562// } 7563// }.bindAsEventListener(this), false); 7564 7565 jQuery(spanLeft).on("click", function(){ 7566 if (direction == "left") { 7567 that._decMonth(); 7568 } 7569 else { 7570 that._incMonth(); 7571 } 7572 }); 7573// Event.observe(spanLeft, "click", function () { 7574// if (direction == "left") { 7575// this._decMonth(); 7576// } 7577// else { 7578// this._incMonth(); 7579// } 7580// }.bind(this), false); 7581 7582 7583 jQuery(spanLeft).on("mouseout", function(){ 7584 clearInterval(that.intervalID1); 7585 that._swapImage(imgLeft, direction + "1.gif"); 7586 spanLeft.className = "" + that.initData.themePrefix + "-title-control-normal-style"; 7587 window.status = ""; 7588 });
7589// Event.observe(spanLeft, "mouseout", function (event) { 7590// clearInterval(this.intervalID1); 7591// this._swapImage(imgLeft, direction + "1.gif"); 7592// spanLeft.className = "" + this.initData.themePrefix + "-title-control-normal-style"; 7593// window.status = ""; 7594// }.bindAsEventListener(this), false); 7595 7596 jQuery(spanLeft).on("mousedown", function(){ 7597 clearTimeout(that.timeoutID1); 7598 that.timeoutID1 = setTimeout((function () { 7599 if (direction == "left") { 7600 that._startDecMonth(); 7601 } 7602 else { 7603 that._startIncMonth(); 7604 } 7605 }).bind(this), 500) 7606 }); 7607// Event.observe(spanLeft, "mousedown", function () { 7608// clearTimeout(this.timeoutID1); 7609// this.timeoutID1 = setTimeout((function () { 7610// if (direction == "left") { 7611// this._startDecMonth(); 7612// } 7613// else { 7614// this._startIncMonth(); 7615// } 7616// }).bind(this), 500) 7617// }.bind(this), false); 7618 7619 jQuery(spanLeft).on("mouseup", function(){ 7620 clearTimeout(that.timeoutID1); 7621 clearInterval(that.intervalID1); 7622 });
7623// Event.observe(spanLeft, "mouseup", function () { 7624// clearTimeout(this.timeoutID1); 7625// clearInterval(this.intervalID1); 7626// }.bind(this), false); 7627 //HIS_FIX_END 7628 }; 7629 7630 org.apache.myfaces.PopupCalendar.prototype._appendNbsp = function (element) { 7631 if (element) 7632 element.appendChild(document.createTextNode(String.fromCharCode(160))); 7633 }; 7634 7635 org.apache.myfaces.PopupCalendar.prototype._todayIsDate = function () { 7636 return this.todayDateFormatter.format(this.today); 7637 }; 7638 7639 org.apache.myfaces.PopupCalendar.prototype._hideCalendar = function () { 7640 this.calendarDiv.classList.add("jscalendar-hidden"); 7641 this.calendarDiv.classList.remove("jscalendar-visible"); 7642 this.bCalendarHidden = true; 7643 if (this.selectMonthDiv.style != null) { 7644 this.selectMonthDiv.classList.add("jscalendar-hidden"); 7645 this.selectMonthDiv.classList.remove("calendar-visible"); 7646 } 7647 if (this.selectYearDiv.style != null) { 7648 this.selectYearDiv.classList.add("jscalendar-hidden"); 7649 this.selectYearDiv.classList.remove("jscalendar-visible"); 7650 } 7651 7652 this._hidePopupPostProcess(this.selectMonthDiv); 7653 this._hidePopupPostProcess(this.selectYearDiv); 7654 this._hidePopupPostProcess(this.calendarDiv); 7655 }; 7656 7657 org.apache.myfaces.PopupCalendar.prototype._padZero = function (num) { 7658 return (num < 10) ? '0' + num : num; 7659 }; 7660 7661 org.apache.myfaces.PopupCalendar.prototype._constructDate = function (d, m, y) { 7662 var date = new Date(y, m, d, this.selectedDate.hour, this.selectedDate.min, this.selectedDate.sec); 7663 return this.stdDateFormatter.format(date); 7664 }; 7665 7666 org.apache.myfaces.PopupCalendar.prototype._closeCalendar = function () { 7667 this._hideCalendar(); 7668 7669 if (this.myFacesCtlType != "x:inputDate") { 7670 this.ctlToPlaceValue.value = this._constructDate(this.selectedDate.date, this.selectedDate.month, this.selectedDate.year) 7671 var onchange = this.ctlToPlaceValue.getAttribute("onchange"); 7672 if (onchange) { 7673 this.ctlToPlaceValue.onchange(); 7674 } 7675 } 7676 else { 7677 document.getElementById(this.myFacesInputDateClientId + ".day").value = this.selectedDate.date; 7678 document.getElementById(this.myFacesInputDateClientId + ".month").value = this.selectedDate.month + 1; 7679 document.getElementById(this.myFacesInputDateClientId + ".year").value = this.selectedDate.year; 7680 } 7681 }; 7682 7683 /*** Month Pulldown ***/ 7684 7685 org.apache.myfaces.PopupCalendar.prototype._startDecMonth = function () { 7686 this.intervalID1 = setInterval((function () { 7687 this._decMonth(); 7688 }).bind(this), 80); 7689 }; 7690 7691 org.apache.myfaces.PopupCalendar.prototype._startIncMonth = function () { 7692 this.intervalID1 = setInterval((function () { 7693 this._incMonth(); 7694 }).bind(this), 80); 7695 }; 7696 7697 org.apache.myfaces.PopupCalendar.prototype._incMonth = function () { 7698 this.selectedDate.month = this.selectedDate.month + 1; 7699 if (this.selectedDate.month > 11) { 7700 this.selectedDate.month = 0; 7701 this.selectedDate.year++; 7702 } 7703 this._constructCalendar(); 7704 }; 7705 7706 org.apache.myfaces.PopupCalendar.prototype._decMonth = function () { 7707 this.selectedDate.month = this.selectedDate.month - 1; 7708 if (this.selectedDate.month < 0) { 7709 this.selectedDate.month = 11; 7710 this.selectedDate.year--; 7711 } 7712 this._constructCalendar() 7713 }; 7714 7715 org.apache.myfaces.PopupCalendar.prototype._removeAllChildren = function (element) { 7716 while (element && element.hasChildNodes()) 7717 element.removeChild(element.lastChild); 7718 }; 7719 7720 org.apache.myfaces.PopupCalendar.prototype._constructMonth = function () { 7721 this._popDownYear(); 7722 if (!this.monthConstructed) { 7723 7724 var selectMonthTable = document.createElement("table"); 7725 //HIS_FIX_BEGIN 7726 jQuery(selectMonthTable).css({ 7727 "width": "70px", 7728 "border-collapse": "collapse" 7729 }); 7730// Element.setStyle(selectMonthTable, "width:70px;border-collapse:collapse;"); 7731 //HIS_FIX_END 7732 selectMonthTable.className = this.initData.themePrefix + "-dropdown-style"; 7733 7734 this._removeAllChildren(this.selectMonthDiv); 7735 7736 this.selectMonthDiv.appendChild(selectMonthTable); 7737 7738 //HIS_FIX_BEGIN 7739 var that = this; 7740 jQuery(selectMonthTable).on("mouseover", function(){ 7741 clearTimeout(that.timeoutID1); 7742 }); 7743// Event.observe(selectMonthTable, "mouseover", function () { 7744// clearTimeout(this.timeoutID1); 7745// }.bind(this), false); 7746 7747 jQuery(selectMonthTable).on("mouseout", function(event){ 7748 clearTimeout(that.timeoutID1); 7749 that.timeoutID1 = setTimeout((function () { 7750 that._popDownMonth() 7751 }).bind(this), 100); 7752 event.preventDefault(); 7753 event.stopPropagation(); 7754 }); 7755// Event.observe(selectMonthTable, "mouseout", function (event) { 7756// clearTimeout(this.timeoutID1); 7757// this.timeoutID1 = setTimeout((function () { 7758// this._popDownMonth() 7759// }).bind(this), 100); 7760// Event.stop(event); 7761// }.bindAsEventListener(this), false); 7762 //HIS_FIX_END 7763 7764 var selectMonthTableBody = document.createElement("tbody"); 7765 selectMonthTable.appendChild(selectMonthTableBody); 7766 7767 for (i = 0; i < 12; i++) { 7768 var sName = this.initData.monthName[i]; 7769 7770 var sNameNode = null; 7771 7772 if (i == this.selectedDate.month) { 7773 sNameNode = document.createElement("span"); 7774 //HIS_FIX_BEGIN 7775 jQuery(sNameNode).css("font-weight", "bold"); 7776// Element.setStyle(sNameNode, "font-weight:bold;"); 7777 //HIS_FIX_END 7778 sNameNode.appendChild(document.createTextNode(sName)); 7779 sNameNode.setAttribute("userData", i); 7780 } 7781 else { 7782 sNameNode = document.createTextNode(sName); 7783 } 7784 7785 var monthRow = document.createElement("tr"); 7786 selectMonthTableBody.appendChild(monthRow); 7787 7788 var monthCell = document.createElement("td"); 7789 monthCell.setAttribute("userData", i); 7790 monthRow.appendChild(monthCell); 7791 7792 //HIS_FIX_BEGIN 7793 jQuery(monthCell).on("mouseover", function(event){ 7794 event.target.className = that.initData.themePrefix + "-dropdown-select-style"; 7795 }); 7796// Event.observe(monthCell, "mouseover", function (event) { 7797// Event.element(event).className = this.initData.themePrefix + "-dropdown-select-style";
7798// }.bind(this), false); 7799 7800 jQuery(monthCell).on("mouseout", function(event){ 7801 event.target.className = that.initData.themePrefix + "-dropdown-normal-style"; 7802 }); 7803// Event.observe(monthCell, "mouseout", function (event) { 7804// Event.element(event).className = this.initData.themePrefix + "-dropdown-normal-style"; 7805// }.bind(this), false); 7806 7807 jQuery(monthCell).on("click", function(event){ 7808 that.monthConstructed = false; 7809 that.selectedDate.month = parseInt(event.target.getAttribute("userData"), 10); 7810 that._constructCalendar(); 7811 that._popDownMonth(); 7812 event.preventDefault(); 7813 event.stopPropagation(); 7814 }); 7815// Event.observe(monthCell, "click", function (event) { 7816// this.monthConstructed = false; 7817// this.selectedDate.month = parseInt(Event.element(event).getAttribute("userData"), 10); 7818// this._constructCalendar(); 7819// this._popDownMonth(); 7820// Event.stop(event); 7821// }.bindAsEventListener(this), false); 7822 //HIS_FIX_END 7823 7824 this._appendNbsp(monthCell); 7825 monthCell.appendChild(sNameNode); 7826 this._appendNbsp(monthCell); 7827 } 7828 7829 this.monthConstructed = true; 7830 } 7831 }; 7832 7833 org.apache.myfaces.PopupCalendar.prototype._popUpMonth = function () { 7834 this._constructMonth() 7835 this._fixPopupDomOrder(this.selectMonthDiv); 7836 if (this.dom || this.ie6) { 7837 this.selectMonthDiv.classList.remove("jscalendar-hidden"); 7838 this.selectMonthDiv.classList.add("jscalendar-visible"); 7839 } else { 7840 this.selectMonthDiv.classList.remove("jscalendar-hidden"); 7841 this.selectMonthDiv.classList.add("jscalendar-visible"); 7842 } 7843 this.selectMonthDiv.style.left = parseInt(this._formatInt(this.calendarDiv.style.left), 10) + 50 + "px"; 7844 this.selectMonthDiv.style.top = parseInt(this._formatInt(this.calendarDiv.style.top), 10) + 26 + "px"; 7845 7846 this._showPopupPostProcess(this.selectMonthDiv); 7847 }; 7848 7849 org.apache.myfaces.PopupCalendar.prototype._popDownMonth = function () { 7850 this.selectMonthDiv.classList.add("jscalendar-hidden"); 7851 this.selectMonthDiv.classList.remove("jscalendar-visible"); 7852 this._hidePopupPostProcess(this.selectMonthDiv); 7853 }; 7854 7855 /*** Year Pulldown ***/ 7856 7857 org.apache.myfaces.PopupCalendar.prototype._incYear = function () { 7858 for (var i = 0; i < 7; i++) { 7859 var newYear = (i + this.nStartingYear) + 1; 7860 7861 this._createAndAddYear(newYear, i); 7862 } 7863 this.nStartingYear++; 7864 this.bClickOnCalendar = true; 7865 }; 7866 7867 org.apache.myfaces.PopupCalendar.prototype._createAndAddYear = function (newYear, i) { 7868 var parentNode = document.getElementById(this.containerCtl.getAttribute("id") + "y" + i); 7869 7870 this._removeAllChildren(parentNode); 7871 7872 if (newYear == this.selectedDate.year) { 7873 this._appendNbsp(parentNode); 7874 var newYearSpan = document.createElement("span"); 7875 newYearSpan.setAttribute("userData", newYear); 7876 newYearSpan.appendChild(document.createTextNode(newYear)); 7877 parentNode.appendChild(newYearSpan); 7878 this._appendNbsp(parentNode); 7879 } 7880 else { 7881 this._appendNbsp(parentNode); 7882 parentNode.appendChild(document.createTextNode(newYear)); 7883 this._appendNbsp(parentNode); 7884 } 7885 7886 parentNode.setAttribute("userData", newYear); 7887 }; 7888 7889 org.apache.myfaces.PopupCalendar.prototype._decYear = function () { 7890 for (i = 0; i < 7; i++) { 7891 var newYear = (i + this.nStartingYear) - 1; 7892 7893 this._createAndAddYear(newYear, i); 7894 } 7895 this.nStartingYear--; 7896 this.bClickOnCalendar = true; 7897 }; 7898 7899 org.apache.myfaces.PopupCalendar.prototype._constructYear = function () { 7900 this._popDownMonth(); 7901 var sHTML = ""; 7902 if (!this.yearConstructed) { 7903 7904 var selectYearTable = document.createElement("table"); 7905 //HIS_FIX_BEGIN 7906 jQuery(selectYearTable).css({ 7907 "width": "44px", 7908 "border-collapse": "collapse" 7909 }); 7910// Element.setStyle(selectYearTable, "width:44px;border-collapse:collapse;"); 7911 //HIS_FIX_END 7912 selectYearTable.className = this.initData.themePrefix + "-dropdown-style"; 7913 7914 this._removeAllChildren(this.selectYearDiv); 7915 7916 this.selectYearDiv.appendChild(selectYearTable); 7917 7918 //HIS_FIX_BEGIN 7919 var that = this; 7920 jQuery(selectYearTable).on("mouseover", function(event){ 7921 clearTimeout(that.timeoutID2); 7922 }); 7923// Event.observe(selectYearTable, "mouseover", function (event) { 7924// clearTimeout(this.timeoutID2); 7925// }.bind(this), false); 7926 7927 jQuery(selectYearTable).on("mouseout", function(event){ 7928 clearTimeout(that.timeoutID2); 7929 that.timeoutID2 = setTimeout((function () { 7930 that._popDownYear() 7931 }).bind(this), 100); 7932 event.preventDefault(); 7933 event.stopPropagation(); 7934 }); 7935// Event.observe(selectYearTable, "mouseout", function (event) { 7936// clearTimeout(this.timeoutID2); 7937// this.timeoutID2 = setTimeout((function () { 7938// this._popDownYear() 7939// }).bind(this), 100); 7940// Event.stop(event); 7941// }.bindAsEventListener(this), false); 7942 //HIS_FIX_END 7943 7944 var selectYearTableBody = document.createElement("tbody"); 7945 selectYearTable.appendChild(selectYearTableBody); 7946 7947 var selectYearRowMinus = document.createElement("tr"); 7948 selectYearTableBody.appendChild(selectYearRowMinus); 7949 7950 var selectYearCellMinus = document.createElement("td"); 7951 selectYearCellMinus.setAttribute("align", "center"); 7952 7953 selectYearCellMinus.appendChild(document.createTextNode("-")); 7954 7955 selectYearRowMinus.appendChild(selectYearCellMinus); 7956 7957 //HIS_FIX_BEGIN 7958 jQuery(selectYearCellMinus).on("mouseover", function(event){ 7959 event.target.className = that.initData.themePrefix + "-dropdown-select-style"; 7960 }); 7961// Event.observe(selectYearCellMinus, "mouseover", function (event) { 7962// Event.element(event).className = this.initData.themePrefix + "-dropdown-select-style";
7963// }.bindAsEventListener(this), false); 7964 7965 jQuery(selectYearCellMinus).on("mouseout", function(event){ 7966 clearInterval(that.intervalID1); 7967 event.target.className = that.initData.themePrefix + "-dropdown-normal-style"; 7968 }); 7969// Event.observe(selectYearCellMinus, "mouseout", function (event) { 7970// clearInterval(this.intervalID1); 7971// Event.element(event).className = this.initData.themePrefix + "-dropdown-normal-style"; 7972// }.bindAsEventListener(this), false); 7973 7974 7975 jQuery(selectYearCellMinus).on("mousedown touchstart", function(event){ 7976 clearInterval(that.intervalID1); 7977 that.intervalID1 = setInterval((function () { 7978 that._decYear(); 7979 }).bind(this), 30); 7980 event.preventDefault(); 7981 event.stopPropagation(); 7982 }); 7983// Event.observe(selectYearCellMinus, "mousedown", function (event) { 7984// clearInterval(this.intervalID1); 7985// this.intervalID1 = setInterval((function () { 7986// this._decYear(); 7987// }).bind(this), 30); 7988// Event.stop(event); 7989// }.bindAsEventListener(this), false); 7990 7991 jQuery(selectYearCellMinus).on("mouseup touchend", function(event){ 7992 clearInterval(that.intervalID1); 7993 event.preventDefault(); 7994 event.stopPropagation(); 7995 }); 7996// Event.observe(selectYearCellMinus, "mouseup", function (event) { 7997// clearInterval(this.intervalID1); 7998// Event.stop(event); 7999// }.bindAsEventListener(this), false); 8000 //HIS_FIX_END 8001 8002 //sHTML = "<tr><td align='center' onmouseover='this.className=\""+this.initData.themePrefix+"-dropdown-select-style\"' onmouseout='clearInterval(this.intervalID1); this.className=\""+this.initData.themePrefix+"-dropdown-normal-style\"' onmousedown='clearInterval(this.intervalID1);this.intervalID1=setInterval(\"_decYear()\",30)' onmouseup='clearInterval(this.intervalID1)'>-</td></tr>"; 8003 8004 this.nStartingYear = this.selectedDate.year - 3; 8005 var j = 0; 8006 for (i = this.selectedDate.year - 3; i <= (this.selectedDate.year + 3); i++) { 8007 var sName = i; 8008 8009 var sNameNode = null; 8010 8011 if (i == this.selectedDate.year) { 8012 sNameNode = document.createElement("span"); 8013 //HIS_FIX_BEGIN 8014 jQuery(sNameNode).css("font-weight", "bold"); 8015// Element.setStyle(sNameNode, "font-weight:bold;"); 8016 //HIS_FIX_END 8017 sNameNode.appendChild(document.createTextNode(sName)); 8018 sNameNode.setAttribute("userData", sName); 8019 } 8020 else { 8021 sNameNode = document.createTextNode(sName); 8022 } 8023 8024 var yearRow = document.createElement("tr"); 8025 selectYearTableBody.appendChild(yearRow); 8026 8027 var yearCell = document.createElement("td"); 8028 yearCell.setAttribute("userData", sName); 8029 yearCell.setAttribute("id", this.containerCtl.getAttribute("id") + "y" + j); 8030 yearRow.appendChild(yearCell); 8031 8032 //HIS_FIX_BEGIN 8033 jQuery(yearCell).on("mouseover", function(event){ 8034 event.target.className = that.initData.themePrefix + "-dropdown-select-style"; 8035 }); 8036// Event.observe(yearCell, "mouseover", function (event) { 8037// Event.element(event).className = this.initData.themePrefix + "-dropdown-select-style"; 8038// }.bind(this), false); 8039 8040 jQuery(yearCell).on("mouseout", function(event){ 8041 event.target.className = that.initData.themePrefix + "-dropdown-normal-style"; 8042 }); 8043// Event.observe(yearCell, "mouseout", function (event) { 8044// Event.element(event).className = this.initData.themePrefix + "-dropdown-normal-style";
8045// }.bind(this), false); 8046 8047 jQuery(yearCell).on("click", function(event){ 8048 var elem = event.target; 8049 var sYear = null; 8050 that.selectedDate.year = parseInt(that._formatInt(elem.getAttribute("userData"), 10)); 8051 that.yearConstructed = false; 8052 that._popDownYear(); 8053 that._constructCalendar(); 8054 event.preventDefault(); 8055 event.stopPropagation(); 8056 }); 8057// Event.observe(yearCell, "click", function (event) { 8058// var elem = Event.element(event); 8059// var sYear = null; 8060// this.selectedDate.year = parseInt(this._formatInt(elem.getAttribute("userData"), 10)); 8061// this.yearConstructed = false; 8062// this._popDownYear(); 8063// this._constructCalendar(); 8064// Event.stop(event); 8065// }.bindAsEventListener(this), false); 8066 //HIS_FIX_END 8067 8068 this._appendNbsp(yearCell); 8069 yearCell.appendChild(sNameNode); 8070 this._appendNbsp(yearCell); 8071 j++; 8072 } 8073 8074 var selectYearRowPlus = document.createElement("tr"); 8075 selectYearTableBody.appendChild(selectYearRowPlus); 8076 8077 var selectYearCellPlus = document.createElement("td"); 8078 selectYearCellPlus.setAttribute("align", "center"); 8079 8080 selectYearCellPlus.appendChild(document.createTextNode("+")); 8081 8082 selectYearRowPlus.appendChild(selectYearCellPlus); 8083 8084 //HIS_FIX_BEGIN 8085 jQuery(selectYearCellPlus).on("mouseover", function(event){ 8086 event.target.className = that.initData.themePrefix + "-dropdown-select-style"; 8087 }); 8088// Event.observe(selectYearCellPlus, "mouseover", function (event) { 8089// Event.element(event).className = this.initData.themePrefix + "-dropdown-select-style"; 8090// }.bindAsEventListener(this), false); 8091 8092 jQuery(selectYearCellPlus).on("mouseout", function(event){ 8093 clearInterval(that.intervalID2); 8094 event.target.className = that.initData.themePrefix + "-dropdown-normal-style"; 8095 }); 8096// Event.observe(selectYearCellPlus, "mouseout", function (event) { 8097// clearInterval(this.intervalID2); 8098// Event.element(event).className = this.initData.themePrefix + "-dropdown-normal-style";
8099// }.bindAsEventListener(this), false); 8100 8101 jQuery(selectYearCellPlus).on("mousedown touchstart", function(event){ 8102 clearInterval(that.intervalID2); 8103 that.intervalID2 = setInterval((function () { 8104 that._incYear(); 8105 }).bind(this), 30); 8106 }); 8107// Event.observe(selectYearCellPlus, "mousedown", function (event) { 8108// clearInterval(this.intervalID2); 8109// this.intervalID2 = setInterval((function () { 8110// this._incYear(); 8111// }).bind(this), 30); 8112// }.bindAsEventListener(this), false); 8113 8114 jQuery(selectYearCellPlus).on("mouseup touchend", function(event){ 8115 clearInterval(that.intervalID2); 8116 }); 8117// Event.observe(selectYearCellPlus, "mouseup", function (event) { 8118// clearInterval(this.intervalID2); 8119// }.bindAsEventListener(this), false); 8120 //HIS_FIX_END 8121 8122 this.yearConstructed = true; 8123 } 8124 }; 8125 8126 org.apache.myfaces.PopupCalendar.prototype._popDownYear = function () { 8127 clearInterval(this.intervalID1); 8128 clearTimeout(this.timeoutID1); 8129 clearInterval(this.intervalID2); 8130 clearTimeout(this.timeoutID2); 8131 this.selectYearDiv.classList.add("jscalendar-hidden"); 8132 this.selectYearDiv.classList.remove("jscalendar-visible"); 8133 this._hidePopupPostProcess(this.selectYearDiv); 8134 }; 8135 8136 org.apache.myfaces.PopupCalendar.prototype._popUpYear = function () { 8137 var leftOffset; 8138 this._fixPopupDomOrder(this.selectYearDiv); 8139 this._constructYear(); 8140 if (this.dom || this.ie6) { 8141 this.selectYearDiv.classList.remove("jscalendar-hidden"); 8142 this.selectYearDiv.classList.add("jscalendar-visible"); 8143 } else { 8144 this.selectYearDiv.classList.remove("jscalendar-hidden"); 8145 this.selectYearDiv.classList.add("jscalendar-visible"); 8146 } 8147 leftOffset = parseInt(this._formatInt(this.calendarDiv.style.left), 10) + this.yearSpan.offsetLeft; 8148 if (this.ie6) 8149 leftOffset += 6; 8150 this.selectYearDiv.style.left = leftOffset + "px"; 8151 this.selectYearDiv.style.top = parseInt(this._formatInt(this.calendarDiv.style.top), 10) + 26 + "px"; 8152 8153 this._showPopupPostProcess(this.selectYearDiv); 8154 }; 8155 8156 org.apache.myfaces.PopupCalendar.prototype._appendCell = function (parentElement, value) { 8157 var cell = document.createElement("td"); 8158 //HIS_FIX_BEGIN 8159 jQuery(cell).css("text-align", "right"); 8160// Element.setStyle(cell, "text-align:right;"); 8161 //HIS_FIX_END 8162 8163 if (value && value != "") { 8164 cell.appendChild(document.createTextNode(value)); 8165 } 8166 else { 8167 this._appendNbsp(cell); 8168 } 8169 8170 parentElement.appendChild(cell); 8171 }; 8172 8173 org.apache.myfaces.PopupCalendar.prototype._getDateStyle = function (datePointer) { 8174 var sStyle = this.initData.themePrefix + "-normal-day-style"; 8175 //regular day 8176 8177 if ((datePointer == this.dateNow) && 8178 (this.selectedDate.month == this.monthNow) && (this.selectedDate.year == this.yearNow)) //today 8179 { 8180 sStyle = this.initData.themePrefix + "-current-day-style"; 8181 } 8182 else if (this.dayPointer % 7 == (this.initData.startAt * -1) + 1) //end-of-the-week day 8183 { 8184 sStyle = this.initData.themePrefix + "-end-of-weekday-style"; 8185 } 8186 8187 //selected day 8188 if ((datePointer == this.saveSelectedDate.date) && 8189 (this.selectedDate.month == this.saveSelectedDate.month) && 8190 (this.selectedDate.year == this.saveSelectedDate.year)) { 8191 sStyle += " " + this.initData.themePrefix + "-selected-day-style"; 8192 } 8193 8194 for (k = 0; k < this.holidaysCounter; k++) { 8195 if ((parseInt(this._formatInt(this.holidays[k].d), 10) == datePointer) && (parseInt(this._formatInt(this.holidays[k].m), 10) == (this.selectedDate.month + 1))) { 8196 if ((parseInt(this._formatInt(this.holidays[k].y), 10) == 0) || ((parseInt(this._formatInt(this.holidays[k].y), 10) == this.selectedDate.year) && (parseInt(this._formatInt(this.holidays[k].y), 10) != 0))) { 8197 sStyle += " " + this.initData.themePrefix + "-holiday-style"; 8198 } 8199 } 8200 } 8201 8202 return sStyle; 8203 }; 8204 8205 org.apache.myfaces.PopupCalendar.prototype._getHolidayHint = function (datePointer) { 8206 var sHint = ""; 8207 for (k = 0; k < this.holidaysCounter; k++) { 8208 if ((parseInt(this._formatInt(this.holidays[k].d), 10) == datePointer) && (parseInt(this._formatInt(this.holidays[k].m), 10) == (this.selectedDate.month + 1))) { 8209 if ((parseInt(this._formatInt(this.holidays[k].y), 10) == 0) || ((parseInt(this._formatInt(this.holidays[k].y), 10) == this.selectedDate.year) && (parseInt(this._formatInt(this.holidays[k].y), 10) != 0))) { 8210 sHint += sHint == "" ? this.holidays[k].desc : "\n" + this.holidays[k].desc; 8211 } 8212 } 8213 } 8214 8215 return sHint; 8216 }; 8217 8218 org.apache.myfaces.PopupCalendar.prototype._addWeekCell = function (currentRow, startDate, weekSelectable, sNormalStyle, sSelectStyle) { 8219 var cell = document.createElement("td"); 8220 //HIS_FIX_BEGIN 8221 jQuery(cell).css("text-align", "right"); 8222// Element.setStyle(cell, "text-align:right;"); 8223 //HIS_FIX_END 8224 8225 var weekDate = this.stdDateFormatter.getWeekDate(startDate); 8226 if (weekSelectable) { 8227 var link = document.createElement("a"); 8228 link.className = sNormalStyle; 8229 link.sNormalStyle = sNormalStyle; 8230 link.sSelectStyle = sSelectStyle; 8231 link.setAttribute("href", "#"); 8232 link.appendChild(document.createTextNode(weekDate.week + " ")); 8233 8234 link.dateObj = this.stdDateFormatter.getDateForWeekDate(weekDate); 8235 8236 cell.appendChild(link); 8237 8238 //HIS_FIX_BEGIN 8239 var that = this; 8240 jQuery(link).on("mousemove", function(event){ 8241 window.status = that.initData.selectDateMessage.replace( 8242 "[date]", 8243 that._constructDate(link.dateObj)); 8244 }); 8245// Event.observe(link, "mousemove", function (event) { 8246// window.status = this.initData.selectDateMessage.replace( 8247// "[date]", 8248// this._constructDate(link.dateObj)); 8249// }.bindAsEventListener(this), false); 8250 8251 jQuery(link).on("mouseout", function(event){ 8252 var elem = event.target; 8253 elem.className = elem.sNormalStyle; 8254 window.status = ""; 8255 }); 8256// Event.observe(link, "mouseout", function (event) { 8257// var elem = Event.element(event); 8258// elem.className = elem.sNormalStyle; 8259// window.status = ""; 8260// }.bindAsEventListener(this), false); 8261 8262 jQuery(link).on("click", function(event){ 8263 var elem = event.target; 8264 that.selectedDate.year = elem.dateObj.getFullYear(); 8265 that.selectedDate.month = elem.dateObj.getMonth(); 8266 that.selectedDate.date = elem.dateObj.getDate();
8267 that._closeCalendar(); 8268 event.preventDefault(); 8269 event.stopPropagation(); 8270 }); 8271// Event.observe(link, "click", function (event) { 8272// var elem = Event.element(event); 8273// this.selectedDate.year = elem.dateObj.getFullYear(); 8274// this.selectedDate.month = elem.dateObj.getMonth(); 8275// this.selectedDate.date = elem.dateObj.getDate(); 8276// this._closeCalendar(); 8277// Event.stop(event); 8278// }.bindAsEventListener(this), false); 8279 8280 jQuery(link).on("mouseover", function(event){ 8281 var elem = event.target; 8282 elem.className = elem.sSelectStyle; 8283 }); 8284// Event.observe(link, "mouseover", function (event) { 8285// var elem = Event.element(event); 8286// elem.className = elem.sSelectStyle; 8287// }.bindAsEventListener(this), false); 8288 //HIS_FIX_END 8289 } 8290 else { 8291 var span = document.createElement("span"); 8292 span.className = sNormalStyle; 8293 span.appendChild(document.createTextNode(weekDate.week + " ")); 8294 cell.appendChild(span); 8295 } 8296 8297 currentRow.appendChild(cell); 8298 }; 8299 8300 org.apache.myfaces.PopupCalendar.prototype._constructCalendar = function () { 8301 var aNumDays = Array(31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); 8302 8303 var dateMessage; 8304 var startDate = new Date(this.selectedDate.year, this.selectedDate.month, 1); 8305 var numDaysInMonth = null; 8306 8307 if (this.selectedDate.month == 1) { 8308 // to compute the number of days in february, select first day of march, 8309 // subtract 24 hours then query the day-of-the-month. 8310 var msecs = new Date(this.selectedDate.year, this.selectedDate.month + 1, 1).getTime(); 8311 var endDate = new Date(msecs - this._MSECS_PER_DAY); 8312 numDaysInMonth = endDate.getDate(); 8313 } 8314 else { 8315 numDaysInMonth = aNumDays[this.selectedDate.month]; 8316 } 8317 8318 this.datePointer = 0; 8319 this.dayPointer = startDate.getDay() - this.initData.startAt; 8320 8321 if (this.dayPointer < 0) 8322 this.dayPointer = 6; 8323 8324 this._removeAllChildren(this.contentSpan); 8325 8326 var contentTable = document.createElement("table"); 8327 //HIS_FIX_BEGIN 8328 jQuery(contentTable).css("border", "0px"); 8329// Element.setStyle(contentTable, "border:0px;"); 8330 //HIS_FIX_END 8331 contentTable.className = this.initData.themePrefix + "-body-style"; 8332 8333 this.contentSpan.appendChild(contentTable); 8334 8335 var contentBody = document.createElement("tbody"); 8336 contentTable.appendChild(contentBody); 8337 8338 var contentRow = document.createElement("tr"); 8339 contentBody.appendChild(contentRow); 8340 8341 if (this.initData.showWeekNumber == 1) { 8342 var showWeekNumberCell = document.createElement("td"); 8343 //HIS_FIX_BEGIN 8344 jQuery(showWeekNumberCell).css({ 8345 "width": "27px", 8346 "font-weight": "bold" 8347 }); 8348// Element.setStyle(showWeekNumberCell, "width:27px;font-weight:bold;"); 8349 //HIS_FIX_END 8350 8351 contentRow.appendChild(showWeekNumberCell); 8352 8353 showWeekNumberCell.appendChild(document.createTextNode(this.initData.weekString)); 8354 8355 var dividerCell = document.createElement("td"); 8356 //HIS_FIX_BEGIN 8357 jQuery(dividerCell).css("width", "1px"); 8358// Element.setStyle(dividerCell, "width:1px;"); 8359 //HIS_FIX_END 8360 if (this.ie6) //fix for https://issues.apache.org/jira/browse/TOMAHAWK-1184 8361 dividerCell.setAttribute("rowSpan", "7"); 8362 else 8363 dividerCell.setAttribute("rowspan", "7"); 8364 dividerCell.className = this.initData.themePrefix + "-weeknumber-div-style"; 8365 8366 contentRow.appendChild(dividerCell); 8367 8368 var dividerImg = document.createElement("img"); 8369 dividerImg.setAttribute("src", this.initData.imgDir + "divider.gif" + this.initData.imgDirSuffix); 8370 //HIS_FIX_BEGIN 8371 jQuery(dividerImg).css("width", "1px"); 8372// Element.setStyle(dividerImg, "width:1px;"); 8373 //HIS_FIX_END 8374 dividerCell.appendChild(dividerImg); 8375 } 8376 8377 for (i = 0; i < 7; i++) { 8378 var dayNameCell = document.createElement("td"); 8379 //HIS_FIX_BEGIN 8380 jQuery(dayNameCell).css({ 8381 "width": "27px", 8382 "text-align": "right", 8383 "font-weight": "bold" 8384 }); 8385// Element.setStyle(dayNameCell, "width:27px;text-align:right;font-weight:bold;"); 8386 //HIS_FIX_END 8387 contentRow.appendChild(dayNameCell); 8388 8389 dayNameCell.appendChild(document.createTextNode(this.initData.dayName[i])); 8390 } 8391 8392 var currentRow = document.createElement("tr"); 8393 contentBody.appendChild(currentRow); 8394 8395 var weekSelectable = this._isWeekSelectable(); 8396 var sWeekNormalStyle = this.initData.themePrefix + "-normal-week-style"; 8397 var sWeekSelectStyle = sWeekNormalStyle + " " + this.initData.themePrefix + "-would-be-selected-week-style"; 8398 8399 if (this.initData.showWeekNumber == 1) {
8400 this._addWeekCell(currentRow, startDate, weekSelectable, sWeekNormalStyle, sWeekSelectStyle); 8401 } 8402 8403 for (var i = 1; i <= this.dayPointer; i++) { 8404 this._appendCell(currentRow); 8405 } 8406 8407 for (this.datePointer = 1; this.datePointer <= numDaysInMonth; this.datePointer++) { 8408 this.dayPointer++; 8409 var dateCell = document.createElement("td"); 8410 //HIS_FIX_BEGIN 8411 jQuery(dateCell).css("text-align", "right"); 8412// Element.setStyle(dateCell, "text-align:right;"); 8413 //HIS_FIX_END 8414 8415 currentRow.appendChild(dateCell); 8416 8417 var sStyle = this._getDateStyle(this.datePointer); 8418 var sHint = this._getHolidayHint(this.datePointer); 8419 8420 var sSelectStyle = sStyle + " " + this.initData.themePrefix + "-would-be-selected-day-style"; 8421 var sNormalStyle = sStyle; 8422 8423 if (this._isDaySelectable()) { 8424 8425 var dateLink = document.createElement("a"); 8426 dateLink.className = sStyle; 8427 dateLink.setAttribute("href", "#"); 8428 dateLink.setAttribute("title", sHint); 8429 8430 dateLink.sNormalStyle = sNormalStyle; 8431 dateLink.sSelectStyle = sSelectStyle; 8432 dateLink.datePointer = this.datePointer; 8433 8434 dateCell.appendChild(dateLink); 8435 8436 //HIS_FIX_BEGIN 8437 var that = this; 8438 jQuery(dateLink).on("mousemove", function(event){ 8439 window.status = that.initData.selectDateMessage.replace("[date]", that._constructDate(this.datePointer, that.selectedDate.month, that.selectedDate.year)); 8440 }); 8441// Event.observe(dateLink, "mousemove", function (event) { 8442// window.status = this.initData.selectDateMessage.replace("[date]", this._constructDate(this.datePointer, this.selectedDate.month, this.selectedDate.year)); 8443// }.bindAsEventListener(this), false); 8444 8445 jQuery(dateLink).on("mouseout", function(event){ 8446 var elem = event.target; 8447 elem.className = elem.sNormalStyle; 8448 window.status = ""; 8449 }); 8450// Event.observe(dateLink, "mouseout", function (event) { 8451// var elem = Event.element(event); 8452// elem.className = elem.sNormalStyle; 8453// window.status = ""; 8454// }.bindAsEventListener(this), false); 8455 8456 jQuery(dateLink).on("click", function(event){ 8457 var elem = event.target; 8458 that.selectedDate.date = elem.datePointer; 8459 that._closeCalendar(); 8460 event.preventDefault(); 8461 event.stopPropagation(); 8462 }); 8463// Event.observe(dateLink, "click", function (event) { 8464// var elem = Event.element(event); 8465// this.selectedDate.date = elem.datePointer; 8466// this._closeCalendar(); 8467// Event.stop(event); 8468// }.bindAsEventListener(this), false); 8469 8470 jQuery(dateLink).on("mouseover", function(event){ 8471 var elem = event.target; 8472 elem.className = elem.sSelectStyle; 8473 }); 8474// Event.observe(dateLink, "mouseover", function (event) { 8475// var elem = Event.element(event); 8476// elem.className = elem.sSelectStyle; 8477// }.bindAsEventListener(this), false); 8478 //HIS_FIX_END 8479 8480 this._appendNbsp(dateLink); 8481 dateLink.appendChild(document.createTextNode(this.datePointer)); 8482 this._appendNbsp(dateLink); 8483 } 8484 else { 8485 var dateSpan = document.createElement("span"); 8486 dateCell.appendChild(dateSpan); 8487 8488 dateSpan.appendChild(document.createTextNode(this.datePointer)); 8489 dateSpan.className = sStyle; 8490 dateSpan.setAttribute("title", sHint); 8491 } 8492 8493 if ((this.dayPointer + this.initData.startAt) % 7 == this.initData.startAt) { 8494 currentRow = document.createElement("tr"); 8495 contentBody.appendChild(currentRow); 8496 8497 if ((this.initData.showWeekNumber == 1) && (this.datePointer < numDaysInMonth)) { 8498 var startDate = new Date(this.selectedDate.year, this.selectedDate.month, this.datePointer + 1);
8499 this._addWeekCell(currentRow, startDate, weekSelectable, sWeekNormalStyle, sWeekSelectStyle); 8500 } 8501 } 8502 } 8503 8504 this._removeAllChildren(this.monthSpan); 8505 8506 this._appendNbsp(this.monthSpan); 8507 this.monthSpan.appendChild(document.createTextNode(this.initData.monthName[this.selectedDate.month])); 8508 this._appendNbsp(this.monthSpan); 8509 8510 this.changeMonthImg = document.createElement("img"); 8511 this.changeMonthImg.setAttribute("src", this.initData.imgDir + "drop1.gif" + this.initData.imgDirSuffix); 8512 this.changeMonthImg.setAttribute("width", "12px"); 8513 this.changeMonthImg.setAttribute("height", "10px"); 8514 //HIS_FIX_BEGIN 8515 jQuery(that.changeMonthImg).css("border", "0px"); 8516// Element.setStyle(this.changeMonthImg, "border:0px;"); 8517 //HIS_FIX_END 8518 8519 this.monthSpan.appendChild(this.changeMonthImg); 8520 8521 // Year dropdown list (YYYY plus dropdown icon) 8522 this._removeAllChildren(this.yearSpan); 8523 this._appendNbsp(this.yearSpan); 8524 this.yearSpan.appendChild(document.createTextNode(this.selectedDate.year)); 8525 this._appendNbsp(this.yearSpan); 8526 this.changeYearImg = document.createElement("img"); 8527 this.changeYearImg.setAttribute("src", this.initData.imgDir + "drop1.gif" + this.initData.imgDirSuffix); 8528 this.changeYearImg.setAttribute("width", "12px"); 8529 this.changeYearImg.setAttribute("height", "10px"); 8530 //HIS_FIX_BEGIN 8531 jQuery(that.changeYearImg).css("border", "0px"); 8532// Element.setStyle(this.changeYearImg, "border:0px;"); 8533 //HIS_FIX_END 8534 this.yearSpan.appendChild(this.changeYearImg); 8535 8536 // Accept Month icon 8537 if (this.acceptMonthSpan) { 8538 this._removeAllChildren(this.acceptMonthSpan); 8539 var acceptMonthImg = document.createElement("img"); 8540 acceptMonthImg.setAttribute("src", this.initData.imgDir + "accept.gif" + this.initData.imgDirSuffix); 8541 acceptMonthImg.setAttribute("width", "15px"); 8542 acceptMonthImg.setAttribute("height", "13px"); 8543 //HIS_FIX_BEGIN 8544 jQuery(acceptMonthImg).css("border", "0px"); 8545// Element.setStyle(acceptMonthImg, "border:0px;"); 8546 //HIS_FIX_END 8547 acceptMonthImg.setAttribute("alt", "Accept the current month selection"); 8548 this.acceptMonthSpan.appendChild(acceptMonthImg); 8549 } 8550 8551 // Close Popup icon 8552 this._removeAllChildren(this.closeCalendarSpan); 8553 var closeButtonImg = document.createElement("img"); 8554 closeButtonImg.setAttribute("src", this.initData.imgDir + "close.gif" + this.initData.imgDirSuffix); 8555 closeButtonImg.setAttribute("width", "15px"); 8556 closeButtonImg.setAttribute("height", "13px"); 8557 //HIS_FIX_BEGIN 8558 jQuery(closeButtonImg).css("border", "0px"); 8559// Element.setStyle(closeButtonImg, "border:0px;"); 8560 //HIS_FIX_END 8561 var language = de.his.common.LanguageHelper.currentLanguage(); 8562 if (language == "de") { 8563 closeButtonImg.setAttribute("alt", "Kalender schlieÃen"); 8564 } 8565 else{ 8566 closeButtonImg.setAttribute("alt", "Close calendar"); 8567 } 8568 this.closeCalendarSpan.appendChild(closeButtonImg); 8569 8570 this._recalculateElement(this.calendarDiv); 8571 }; 8572 8573 org.apache.myfaces.PopupCalendar.prototype._popUpCalendar = function (ctl, ctl2, format) { 8574 if (!this.bPageLoaded) { 8575 // The user has clicked a button before the initialisation of this 8576 // class has completed. Just ignore the click.. 8577 return; 8578 } 8579 8580 if (!this.calendarDiv.classList.contains("calendar-visible")) { 8581 this.ctlToPlaceValue = ctl2; 8582 this.dateFormat = format; 8583 8584 this.stdDateFormatter = new org.apache.myfaces.dateformat.SimpleDateFormatter( 8585 this.dateFormat, this.dateFormatSymbols, this.initData.startAt); 8586 var dateSelected = this.stdDateFormatter.parse(ctl2.value); 8587 8588 if (dateSelected) { 8589 this.selectedDate.sec = dateSelected.getSeconds(); 8590 this.selectedDate.min = dateSelected.getMinutes(); 8591 this.selectedDate.hour = dateSelected.getHours(); 8592 this.selectedDate.date = dateSelected.getDate(); 8593 this.selectedDate.month = dateSelected.getMonth(); 8594 8595 //https://issues.apache.org/jira/browse/TOMAHAWK-1595 8596 //http://de.selfhtml.org/javascript/objekte/date.htm#get_year 8597 var fullYear = dateSelected.getFullYear; 8598 var yearDetermined = parseInt(((fullYear) ? dateSelected.getFullYear() : dateSelected.getYear()), 10); 8599 8600 if (!fullYear && yearDetermined < 1000) { 8601 yearDetermined = yearDetermined + 1900; 8602 } 8603 8604 this.selectedDate.year = yearDetermined; 8605 } 8606 else { 8607 this.selectedDate.date = this.dateNow; 8608 this.selectedDate.month = this.monthNow; 8609 this.selectedDate.year = this.yearNow; 8610 } 8611 8612 this._popUpCalendar_Show(ctl); 8613 } 8614 else {
8615 this._hideCalendar(); 8616 if (this.ctlNow != ctl) { 8617 this._popUpCalendar(ctl, ctl2, format); 8618 } 8619 } 8620 this.ctlNow = ctl; 8621 }; 8622 8623 org.apache.myfaces.PopupCalendar.prototype._popUpCalendarForInputDate = function (clientId, format) { 8624 if (this.bPageLoaded) { 8625 this.myFacesCtlType = "x:inputDate"; 8626 this.myFacesInputDateClientId = clientId; 8627 this.dateFormat = format; 8628 8629 //Init stdDateFormatter 8630 this.stdDateFormatter = new org.apache.myfaces.dateformat.SimpleDateFormatter( 8631 this.dateFormat, this.dateFormatSymbols, this.initData.startAt); 8632 8633 this.selectedDate.date = document.getElementById(clientId + ".day").value != "" ? parseInt(this._formatInt(document.getElementById(clientId + ".day").value), 10) : this.dateNow; 8634 this.selectedDate.month = document.getElementById(clientId + ".month").value != "-1" ? parseInt(this._formatInt(document.getElementById(clientId + ".month").value), 10) - 1 : this.monthNow; 8635 this.selectedDate.year = document.getElementById(clientId + ".year").value != "" ? parseInt(this._formatInt(document.getElementById(clientId + ".year").value), 10) : this.yearNow; 8636 this.ctlNow = document.getElementById(clientId + ".day"); 8637 this._popUpCalendar_Show(document.getElementById(clientId + ".day")); 8638 } 8639 }; 8640 8641 org.apache.myfaces.PopupCalendar.prototype._getStyle = function (ctl, property) { 8642 var value = null; 8643 8644 // local style 8645 if (ctl.style[property]) { 8646 value = ctl.style[property]; 8647 } 8648 // IE syntax 8649 else if (ctl.currentStyle && ctl.currentStyle[property]) { 8650 value = ctl.currentStyle[property]; 8651 } 8652 // DOM syntax 8653 else if (document.defaultView && document.defaultView.getComputedStyle) { 8654 var computed = document.defaultView.getComputedStyle(ctl, ''); 8655 8656 if (computed && computed.getPropertyValue(property)) { 8657 value = computed.getPropertyValue(property); 8658 } 8659 } 8660 return value; 8661 }; 8662 8663 org.apache.myfaces.PopupCalendar.prototype._popUpCalendar_Show = function (ctl) { 8664 this.saveSelectedDate.date = this.selectedDate.date; 8665 this.saveSelectedDate.month = this.selectedDate.month; 8666 this.saveSelectedDate.year = this.selectedDate.year; 8667 8668 var leftpos = 0; 8669 var toppos = 0; 8670 8671 var aTag = ctl; 8672 var aCSSPosition = null; 8673 var aTagPositioningisAbsolute = false; 8674 // Added try-catch to the next loop (MYFACES-870) 8675 try { 8676 8677 do { 8678 aTag = aTag.offsetParent; 8679 leftpos += aTag.offsetLeft; 8680 toppos += aTag.offsetTop; 8681 } 8682 while ((null != aTag.offsetParent ) && ('undefined' != aTag.offsetParent )); 8683 } 8684 catch (ex) { 8685 // ignore 8686 } 8687 8688 var leftScrollOffset = 0; 8689 var topScrollOffset = 0; 8690 8691 aTag = ctl; 8692 // Added try-catch (MYFACES-870) 8693 try { 8694 do { 8695 if ('undefined' != typeof(aTag.scrollLeft) && null != aTag.scrollLeft) 8696 leftScrollOffset += parseInt(aTag.scrollLeft); 8697 if ('undefined' != typeof(aTag.scrollTop) && null != aTag.scrollTop) 8698 topScrollOffset += parseInt(aTag.scrollTop); 8699 8700 aTag = aTag.parentNode; 8701 } 8702 while ((aTag.tagName.toUpperCase() != "BODY") && (aTag.tagName.toUpperCase() != "HTML")); 8703 //while ('undefined' != typeof(aTag) && null != aTag); 8704 } 8705 catch (ex) { 8706 // ignore 8707 } 8708 8709 // needs to be called before positioning, otherwise the width won't be correct 8710 this._constructCalendar(1, this.selectedDate.month, this.selectedDate.year); 8711 8712 var bodyRect = this._getVisibleBodyRectangle(); 8713 var cal = this.calendarDiv; 8714 8715 var top = 0; 8716 var left = 0 8717 8718 top = ctl.offsetTop + toppos - topScrollOffset + ctl.offsetHeight + 2; 8719 left = ctl.offsetLeft + leftpos - leftScrollOffset; 8720 8721 if (this.initData.popupLeft) { 8722 left -= cal.offsetWidth; 8723 } 8724 // use document.body.offsetWidth to get width without any scrollbar 8725 if (left + cal.offsetWidth > document.body.offsetWidth) { 8726 left = document.body.offsetWidth - cal.offsetWidth; 8727 } 8728 if (top + cal.offsetHeight > bodyRect.bottom) { 8729 top = bodyRect.bottom - cal.offsetHeight; 8730 } 8731 if (left < bodyRect.left) { 8732 left = bodyRect.left; 8733 } 8734 if (top < bodyRect.top) { 8735 top = bodyRect.top; 8736 } 8737 8738 /*we have to remap the popup so that we can handle the positioning in a neutral way*/ 8739 if (this.calendarDiv.parentNode != document.body) { 8740 this.calendarDiv.parentNode.removeChild(this.calendarDiv); 8741 document.body.appendChild(this.calendarDiv); 8742 } 8743 8744 this.calendarDiv.style.left = this.initData.fixedX == -1 ? left + "px" : this.initData.fixedX; 8745 this.calendarDiv.style.top = this.initData.fixedY == -1 ? top + "px" : this.initData.fixedY; 8746 8747 if (this.dom || this.ie6) { 8748 this.calendarDiv.classList.remove("jscalendar-hidden"); 8749 this.calendarDiv.classList.add("jscalendar-visible"); 8750 } else { 8751 this.calendarDiv.classList.remove("jscalendar-hidden"); 8752 this.calendarDiv.classList.add("jscalendar-visible"); 8753 } 8754 this.bCalendarHidden = false;
8755 8756 setTimeout((function () { 8757 this._showPopupPostProcess(this.calendarDiv); 8758 }).bind(this), 200); 8759 8760 this._showPopupPostProcess(this.calendarDiv); 8761 8762 this.bClickOnCalendar = true; 8763 }; 8764 8765 org.apache.myfaces.PopupCalendar.prototype._getVisibleBodyRectangle = function () { 8766 var visibleRect = new org.apache.myfaces.Rectangle(); 8767 8768 if (typeof window.pageYOffset != "undefined") { 8769 //Most non IE 8770 visibleRect.top = window.pageYOffset; 8771 visibleRect.left = window.pageXOffset; 8772 } 8773 else if (document.body && document.body.scrollTop) { 8774 //IE 6 strict mode 8775 visibleRect.top = document.body.scrollTop; 8776 visibleRect.left = document.body.scrollLeft; 8777 } 8778 else if (document.documentElement && document.documentElement.scrollTop) { 8779 //Older IE 8780 visibleRect.top = document.documentElement.scrollTop; 8781 visibleRect.left = document.documentElement.scrollLeft; 8782 } 8783 8784 if (window.innerWidth != undefined) { 8785 //Most non-IE 8786 visibleRect.right = visibleRect.left + window.innerWidth; 8787 visibleRect.bottom = visibleRect.top + window.innerHeight; 8788 } 8789 else if (document.documentElement && document.documentElement.clientHeight) { 8790 //IE 6 strict mode 8791 visibleRect.right = visibleRect.left + document.documentElement.clientWidth; 8792 visibleRect.bottom = visibleRect.top + document.documentElement.clientHeight; 8793 } 8794 else if (document.body && document.body.clientHeight) { 8795 //IE 4 compatible 8796 visibleRect.right = visibleRect.left + document.body.clientWidth; 8797 visibleRect.bottom = visibleRect.top + document.body.clientHeight; 8798 } 8799 return visibleRect; 8800 }; 8801 8802 org.apache.myfaces.PopupCalendar.prototype._formatInt = function (str) { 8803 8804 if (typeof str == 'string') { 8805 8806 //truncate 0 for number less than 10 8807 if (str.charAt && str.charAt(0) == "0") { // <----- Change, added str.charAt for method availability detection (MYFACES) 8808 return str.charAt(1); 8809 } 8810 8811 } 8812 return str; 8813 8814 }; 8815 8816 org.apache.myfaces.Rectangle = function() { 8817 this.top = 0; 8818 this.left = 0; 8819 this.bottom = 0; 8820 this.right = 0; 8821 }; 8822 8823} 8824/* 8825 * Licensed to the Apache Software Foundation (ASF) under one 8826 * or more contributor license agreements. See the NOTICE file 8827 * distributed with this work for additional information 8828 * regarding copyright ownership. The ASF licenses this file 8829 * to you under the Apache License, Version 2.0 (the 8830 * "License"); you may not use this file except in compliance 8831 * with the License. You may obtain a copy of the License at 8832 * 8833 * http://www.apache.org/licenses/LICENSE-2.0 8834 * 8835 * Unless required by applicable law or agreed to in writing, 8836 * software distributed under the License is distributed on an 8837 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8838 * KIND, either express or implied. See the License for the 8839 * specific language governing permissions and limitations 8840 * under the License. 8841 */ 8842 8843/** 8844 * @author Bruno Aranda (latest modification by $Author: dziegielewski#his.de $) 8845 * @version $Revision: 1.3 $ $Date: 2016/04/18 11:50:34 $ 8846 */ 8847 8848window.org = window.org || {}; 8849org.apache = org.apache || {}; 8850org.apache.myfaces = org.apache.myfaces || {}; 8851 8852if (!org.apache.myfaces.Picklist) { 8853 org.apache.myfaces.Picklist = {}; 8854 8855// moves all the items to the selected list 8856 org.apache.myfaces.Picklist.addAllToSelected = function (availableListId, selectedListId, hiddenId) { 8857 var availableList = document.getElementById(availableListId); 8858 var selectedList = document.getElementById(selectedListId); 8859 8860 org.apache.myfaces.Picklist.moveAll(availableList, selectedList, hiddenId); 8861 org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId); 8862 }; 8863 8864// removes all the items from the selected list 8865 org.apache.myfaces.Picklist.removeAllFromSelected = function (availableListId, selectedListId, hiddenId) { 8866 var availableList = document.getElementById(availableListId); 8867 var selectedList = document.getElementById(selectedListId); 8868 8869 org.apache.myfaces.Picklist.moveAll(selectedList, availableList, hiddenId); 8870 org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId); 8871 }; 8872 8873// moves an item to the selected list 8874 org.apache.myfaces.Picklist.addToSelected = function (availableListId, selectedListId, hiddenId) { 8875 var availableList = document.getElementById(availableListId); 8876 var selectedList = document.getElementById(selectedListId); 8877 8878 org.apache.myfaces.Picklist.move(availableList, selectedList, hiddenId); 8879 org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId); 8880 }; 8881 8882// removes an item from the selected list 8883 org.apache.myfaces.Picklist.removeFromSelected = function (availableListId, selectedListId, hiddenId) { 8884 var availableList = document.getElementById(availableListId); 8885 var selectedList = document.getElementById(selectedListId); 8886 8887 org.apache.myfaces.Picklist.move(selectedList, availableList, hiddenId); 8888 org.apache.myfaces.Picklist.updateHidden(selectedList, hiddenId); 8889 }; 8890 8891 org.apache.myfaces.Picklist.move = function (fromList, toList, hiddenId) { 8892 // Return, if no items selected 8893 var selectedIndex = fromList.selectedIndex; 8894 if (selectedIndex < 0) { 8895 return; 8896 } 8897 8898 var tLen = toList.options.length;
8899 // Decremental loop, so the index is not affected in the moves 8900 for (var i = fromList.options.length - 1; i >= 0; i--) { 8901 if (fromList.options[i].selected) { 8902 toList.options.add(new Option(fromList.options[i].text),tLen); 8903 toList.options[tLen].value = fromList.options[i].value; 8904 fromList.options[i] = null; 8905 } 8906 } 8907 8908 updateAriaDescribedBy(fromList, toList); 8909 }; 8910 8911 org.apache.myfaces.Picklist.moveAll = function (fromList, toList, hiddenId) { 8912 8913 var tLen = toList.options.length; 8914 // Decremental loop, so the index is not affected in the moves 8915 for (var i = fromList.options.length - 1; i >= 0; i--) { 8916 toList.options.add(new Option(fromList.options[i].text),tLen); 8917 toList.options[tLen].value = fromList.options[i].value; 8918 fromList.options[i] = null; 8919 } 8920 }; 8921 8922// Selection - invoked on submit 8923 org.apache.myfaces.Picklist.updateHidden = function(selectedList, hiddenId) { 8924 var hiddenField = document.getElementById(hiddenId); 8925 8926 var arrValues = new Array(selectedList.options.length); 8927 for (var i = 0; i < selectedList.options.length; i++) { 8928 arrValues[i] = selectedList.options[i].value; 8929 } 8930 //https://issues.apache.org/jira/browse/TOMAHAWK-1653 8931 //we set a neutral divider string, which allows 8932 //comma and other dividiers to be used 8933 hiddenField.value = arrValues.join("|MFVAL_DIV|"); 8934 }; 8935 8936 updateAriaDescribedBy = function (fromList, toList) { 8937 var ariaDescribedTextFromList = document.getElementById(fromList.id); 8938 var ariaDescribedTextToList = document.getElementById(toList.id); 8939 if(ariaDescribedTextFromList.children.length > 0){ 8940 ariaDescribedTextFromList.removeAttribute("aria-describedby"); 8941 } 8942 else{ 8943 ariaDescribedTextFromList.setAttribute("aria-describedby",fromList.id + "_emptyDescription"); 8944 } 8945 if(ariaDescribedTextToList.children.length > 0){ 8946 ariaDescribedTextToList.removeAttribute("aria-describedby"); 8947 } 8948 else{ 8949 ariaDescribedTextToList.setAttribute("aria-describedby", toList.id + "_emptyDescription"); 8950 8951 } 8952 } 8953}use_package('de.his.component'); 8954/** 8955* Iframe sichtbar machen, wenn der Inhalt fertig ist. 8956* Bis dahin wird ein Warte-Icon angezeigt 8957* 8958* @autor [email protected], [email protected] 8959*/ 8960 8961 8962/** 8963 * Funktionen ausführen, wenn die Seite fertig geladen ist 8964 */ 8965de.his.modules.IframeVisibility = new function() { 8966 de.his.modules.ModuleRegistry 8967 .registerModule(this) 8968 .registerAjaxRefreshModule(this); 8969 8970 this.moduleName = "de.his.modules.IframeVisibility"; 8971 8972 this.init = function() { 8973 8974 jQuery('.frameWrapper-behavior > iframe').each(function(){ 8975 var iFrame = jQuery(this); 8976 if(!iFrame.data('initialized')){ 8977 8978 iFrame.data('initialized','true'); 8979 //console.log("iFrame initialized.. ", iFrame); 8980 8981 iFrame.on("load", function() { 8982 //console.log("iFrame remove loadingAnimation event.. ", id); 8983 iFrame.siblings(".loadingAnimationContainer").remove(); 8984 iFrame.siblings(".frameloaderBackground").remove(); 8985 8986 // reload portlet periodically 8987 var iframeWrapper = iFrame.parent(); 8988 var reload = iframeWrapper.data("portlet-reload"); 8989 if(reload !== false){ 8990 setReloadTimer(reload, iFrame); 8991 } 8992 }); 8993 } else { 8994 console.log("iFrame already initialized.. ",iFrame.attr("id")); 8995 8996 iFrame.on("load", function() { 8997 // might need to be removed again when sitting in a lazy loaded collapesible Filedset 8998 iFrame.siblings(".loadingAnimationContainer").remove(); 8999 iFrame.siblings(".frameloaderBackground").remove(); 9000 }); 9001 } 9002 try { 9003 // Check if loading was complete before we set the load event 9004 var iframeDoc = iFrame[0].contentDocument || iFrame[0].contentWindow.document; 9005 9006 if (iframeDoc && iframeDoc.readyState == 'complete') { 9007 iFrame.siblings(".loadingAnimationContainer").remove();
9008 iFrame.siblings(".frameloaderBackground").remove(); 9009 } 9010 } catch (error) { 9011 console.log("Fehler beim Zugriff auf das Dokument ", error); 9012 } 9013 }); 9014 9015 }; 9016 9017 var setReloadTimer = function(reload, iFrame){ 9018 setTimeout(function() { 9019 console.log("refreshing iFrame "+iFrame.attr('id')); 9020 iFrame.attr('src', iFrame.parent().data('src')); 9021 setReloadTimer(reload,iFrame); 9022 }, reload); 9023 } 9024 9025 this.refresh = function() { 9026 this.init(); 9027 }; 9028 9029}; 9030use_package('de.his.modules'); 9031/** 9032* Portlets die in einem IFrame laufen sollen sich automatisch in der 9033* Höhe anpassen 9034* 9035* @author [email protected] 9036* @author [email protected] 9037*/ 9038 9039/** 9040 * Funktionen ausführen, wenn die Seite fertig geladen ist 9041 */ 9042de.his.modules.IframePortletResize = new function() { 9043 de.his.modules.ModuleRegistry 9044 .registerModule(this) 9045 .registerAjaxRefreshModule(this); 9046 9047 this.moduleName = "de.his.modules.IframePortletResize"; 9048 9049 var self = this; 9050 9051 this.init = function() { 9052 console.log("IframePortletResize init"); 9053 this.handleEvents(); 9054 }; 9055 9056 this.refresh = function() { 9057 self.handleResizeWithPortalHelper(); 9058 }; 9059 9060 this.handleEvents = function (){ 9061// console.log("IframePortletResize handleEvents"); 9062 9063 this.handleResizeWithPortalHelper(); 9064 this.handleWindowResizeEvent(); 9065 9066 //this.handleAjaxLoading(); // perfect! 9067 9068 } 9069 9070 this.handleWindowResizeEvent = function(){ 9071 var timer = 0; 9072 var delay = function(fn, ms) { 9073 return function(...args) { 9074 clearTimeout(timer); 9075 timer = setTimeout(fn.bind(this, ...args), ms || 0); 9076 } 9077 }; 9078 jQuery(window).resize(delay(function(evt){ 9079 self.handleResizeWithPortalHelper(); 9080 }, 400)); 9081 } 9082 9083 this.handleResizeWithPortalHelper = function(){ 9084 console.log("handleResizeWithPortalHelper"); 9085 jQuery("iframe").each(function(index){ 9086 var $iframe = jQuery(this); 9087 var autoResize = $iframe.parent().data("portlet-auto-resize"); 9088 console.log("handleResizeWithPortalHelper Autoresize? " + autoResize); 9089 9090 if($iframe.parent().hasClass('frameWrapper') && autoResize){ 9091 9092 9093 // keine iFramePortlets von fremden Seiten resizen 9094 try{ 9095 var host = de.his.common.ContextInformation.get("host"); 9096 var urlParts = host.split(":"); 9097 var serverUrl = urlParts[0]+":"+urlParts[1]; 9098 console.log("host is: "+serverUrl); 9099 if($iframe.attr('src').startsWith(serverUrl)){ 9100 console.log(serverUrl+" is local url..."); 9101 local = true; 9102 }else{ 9103 // keine iFramePortlets von fremden Seiten resizen 9104 if(!$iframe.hasClass('fullIframePage')){ 9105 local = false;
9106 console.log("IframePortletResize "+$iframe.attr( "id" )+" wird nicht resized."); 9107 return; 9108 } 9109 } 9110 }catch(e){ 9111 // IE < 12 9112 var host = de.his.common.ContextInformation.get("host"); 9113 if($iframe.attr('src').substr(0,host.length) === host){ 9114 local = true; 9115 }else{ 9116 if(!$iframe.hasClass('fullIframePage')){ 9117 local = false; 9118 return; 9119 } 9120 } 9121 9122 } 9123 9124 console.log("IframePortletResize resize "+$iframe.attr( "id" )); 9125 9126 if( $iframe.data( "his-iframe-loaded" ) ) { 9127 if(autoResize){ 9128 $iframe.css("height",""); 9129 } 9130 //portaHelper.js function 9131 resizeIt( $iframe ); 9132 } else { 9133 de.his.modules.eventRegistry.destroyEvent( "iframe_loaded_" + $iframe.attr( "id" )); 9134 de.his.modules.eventRegistry.addListener( "iframe_loaded_" + $iframe.attr( "id" ), function() { 9135 if(autoResize){ 9136 $iframe.css("height",""); 9137 } 9138 //portaHelper.js function 9139 resizeIt( $iframe ); 9140 $iframe.data( "his-iframe-loaded", true ); 9141 } ); 9142 try { 9143 // Check if loading was complete before we set the load event 9144 var iframeDoc = $iframe[0].contentDocument || $iframe[0].contentWindow.document; 9145 if ( iframeDoc.readyState == 'complete' ) { 9146 if ( autoResize ) { 9147 $iframe.css("height",""); 9148 } 9149 9150 //portaHelper.js function 9151 resizeIt( $iframe ); 9152 $iframe.data( "his-iframe-loaded", true ); 9153 } 9154 } catch (error) { 9155 console.log("Fehler beim Zugriff auf das Dokument ", error); 9156 } 9157 } 9158 } 9159 }); 9160 }; 9161 9162 /** 9163 * START EXPERIMENTAL AJAX LOADING OF PORTLETS (WORKING!) 9164 */ 9165 9166// this.handleAjaxLoading = function(){ 9167// console.log("load iframe with ajax..."); 9168// // load iFrame via AJAX. 9169// jQuery(".frameWrapper").each(function(index){ 9170// 9171// var elem = jQuery(this); 9172// var autoResize = elem.data("portlet-auto-resize"); 9173// var portletReload = elem.data("portlet-reload"); // data-portlet-reload="900000" 9174// 9175// if(!autoResize || typeof autoResize === 'undefined'){ 9176// elem.css('height','460px'); 9177// elem.css('overflow-x','auto'); 9178// } 9179// self.loadPortlet(elem); 9180// 9181// // TODO: reload mechanism 9182// 9183// }); 9184// }; 9185// 9186// this.loadPortlet = function(wrapperElement){ 9187// var url = wrapperElement.data("src"); 9188// jQuery.ajax({ 9189// type: 'GET', 9190// url: url, 9191// success : function(response){ 9192// // only use body content 9193// var data = response.replace('<body', '<body><div id="fakebody"').replace('</body>','</div></body>'); 9194// var body = jQuery(data).filter('#fakebody'); 9195// wrapperElement.html(body); 9196// console.log("Successful loaded portlet."); 9197// }, 9198// error : function(response,b,c){ 9199// console.error("Error loading Portlet with ID "+wrapperElement.attr('id')+": " + c); 9200// } 9201// }); 9202// } 9203 9204 /** 9205 * END EXPERIMENTAL AJAX LOADING OF PORTLETS (WORKING!) 9206 */ 9207}; 9208window.org=window.org||{};org.apache=org.apache||{};org.apache.myfaces=org.apache.myfaces||{};if(!org.apache.myfaces.Tree){org.apache.myfaces.Tree=function(){};org.apache.myfaces.Tree.treeNavClick=function(F,L,H,G,K,I,C,J,D){var E=document.getElementById(F);var M=E.style.display;if(M=="none"){M="block";org.apache.myfaces.CookieLib.setCookieAttrib(J,D,"x");}else{M="none";org.apache.myfaces.CookieLib.setCookieAttrib(J,D,"c");}E.style.display=M;if(L!=""){var B=document.getElementById(L);if(B.src.indexOf(H)>=0){B.src=G;}else{B.src=H;}}if(K!=""){var A=document.getElementById(K);if(A.src.indexOf(I)>=0){A.src=C;}else{A.src=I;}}};}window.org=window.org||{};org.apache=org.apache||{};org.apache.myfaces=org.apache.myfaces||{};if(!org.apache.myfaces.CookieLib){org.apache.myfaces.CookieLib=function(){};org.apache.myfaces.CookieLib.COOKIE_DELIM=";";org.apache.myfaces.CookieLib.COOKIE_KEYVAL="=";org.apache.myfaces.CookieLib.ATTRIB_DELIM=";";org.apache.myfaces.CookieLib.ATTRIB_KEYVAL="=";org.apache.myfaces.CookieLib.getRawCookie=function(C){var B=org.apache.myfaces.CookieLib;var D=C+B.COOKIE_KEYVAL;if(document.cookie){if(document.cookie.length>0){var E=document.cookie.indexOf(D);if(E!=-1){E+=D.length;var A=document.cookie.indexOf(B.COOKIE_DELIM,E);if(A==-1){A=document.cookie.length;}return unescape(document.cookie.substring(E,A));}}}return null;};org.apache.myfaces.CookieLib.setCookieAttrib=function(E,C,A){var B=org.apache.myfaces.CookieLib;var D=B.getCookie(E);D[C]=A;B.setCookie(E,D);};org.apache.myfaces.CookieLib.getCookieAttrib=function(D,B){var A=org.apache.myfaces.CookieLib;var C=A.getCookie(D);return C[B];};org.apache.myfaces.CookieLib.getCookie=function(H){var E=org.apache.myfaces.CookieLib;var G=new Array();var B=E.getRawCookie(H);if(typeof (B)!="undefined"&&B!=null){var C=B.split(E.ATTRIB_DELIM);for(var D=0;D<C.length;D++){var F=C[D].indexOf(E.ATTRIB_KEYVAL);var A=C[D].substring(0,F);var I=C[D].substring(F+1);G[A]=I;}}return G;};org.apache.myfaces.CookieLib.setCookie=function(F,E){var B=org.apache.myfaces.CookieLib;var D="";for(var A in E){var C=E[A];if(typeof (C)!="undefined"&&C!=null&&C!=""&&typeof (C)!="function"){if(A.indexOf(B.ATTRIB_KEYVAL)<0&&C.indexOf(B.ATTRIB_KEYVAL)<0&&A.indexOf(B.ATTRIB_DELIM)<0&&C.indexOf(B.ATTRIB_DELIM)<0){D+=((D=="")?""
9208:B.ATTRIB_DELIM);D+=(A+B.ATTRIB_KEYVAL+C);}else{alert("Cookie attribute name and/or value contains a delimeter ("+B.ATTRIB_KEYVAL+" or "+B.ATTRIB_DELIM+").");}}}document.cookie=F+B.COOKIE_KEYVAL+escape(D);};}use_package("de.his.validation"); 9209 9210/** 9211 * Initialisiert die clientseitige Validierung via Parsley.js 9212 * Zu validierende Felder werden durch .parsleyValidation erkannt. Zusätzlich ist eine CSS Klasse am Feld gesetzt, welche den Namen 9213 * des entsprechenden Validators enthält. Dieser Name wird geparst und via dat- Attribut an das Feld geschrieben. 9214 * FIXME Ein setzen der data- Attribute via ApplyMetaData wäre schöner, jedoch hat das nicht überall funktioniert 9215 * (wie zB klenke/klenke!, rolle: gebührenadmin, navigation Begründete Antragstypen bearbeiten, beliebiges Element bearbeiten, Auf der 9216 * Detailseite in der unteren Tabelle "Absoluter Betrag, Minimal, Maximal" werden eigentlich validiert) 9217 * 9218 * Hier werden auch die Klassen bei Fehler/Erfolg gesetzt: 9219 * Fehler, am Input: validation-failed inputError 9220 * Fehler, am Label: labelError 9221 * Erfolg, am Input: validation-passed 9222 * Erolg, am Label: keine! 9223 * 9224 */ 9225 9226de.his.validation.initParsleyValidation = new function() { 9227 de.his.modules.ModuleRegistry 9228 .registerModule(this) 9229 .registerAjaxRefreshModule(this); 9230 9231 this.moduleName = "de.his.validation.initParsleyValidation"; 9232 9233 var self = this; 9234 9235 this.init = function() { 9236 this.initValidation(); 9237 this.setParsleyLocale(); 9238 } 9239 9240 //Am refresh Modul regestrieren, damit auch Felder validiert werden, welche durch AJAX hinzukommen! 9241 this.refresh = function() { 9242 this.init(); 9243 } 9244 9245 this.initValidation = function () { 9246 jQuery('.parsleyValidation').each(function() { 9247 var field = jQuery(this); 9248 var validatorId = self.getValidationIdentifier(field); 9249 field.attr("data-parsley-" + validatorId, ""); 9250 var form = field.closest("form") 9251 9252 if (form && form.attr('data-validataion-enabled') && !form.attr('data-initialized-parsley')) { 9253 // die tatsächliche technische Initialisierung des Formulars erfolgt hier. Hier kann auch die Konfiguration 9254 // der Validierung erfolgen (wann soll Validierung ausgelöst werden, welche Klassen sollen gesetzt werden usw...) 9255 form.parsley({ 9256 trigger: "focusout", 9257 triggerAfterFailure: "input", 9258 errorsMessagesDisabled: true, 9259 successClass: "validation-passed", 9260 errorClass: "validation-failed inputError", 9261 errorsWrapper: '<div></div>', 9262 errorTemplate: '<div class="errortext"></div>', 9263 errorsContainer: function (field) { 9264 //Damit sagen wir parsley, dass die Fehlermeldung an das Elternelement des Felds gehängt werden soll. 9265 // Sonst wird es direkt hinter das Feld gehängt, wodurch Hilfe/Info Buttons sich verschieben! 9266 return self.findCorrectParent(field.$element); 9267 } 9268 }); 9269 9270 // Wenn eine Validierung fehlschlägt, soll das label des Feldes eine entsprechende Klasse erhalten 9271 // FIXME Aktuell hat parsley.js hier noch keine Möglichkeit das direkt zu stylen, vielleicht in Zukunft? 9272 jQuery(form).parsley().on('field:error', function (fieldInstance) { 9273 var fieldId = fieldInstance.$element.attr("id"); 9274 var label = document.getElementById(fieldId + "Label"); 9275 if (label && !label.classList.contains('labelError')) { 9276 label.classList.add('labelError'); 9277 } 9278 9279 /* 9280 * Fehlermeldungen werden hier manuell angezeigt. Dadurch ist es uns möglich den Namen des Labels 9281 * vor die Fehlermeldung zu schreiben. 9282 */ 9283 var parent = self.findCorrectParent(fieldInstance.$element); 9284 var fieldErrorElement = jQuery(parent).find('.errortext'); 9285 if (!fieldErrorElement.length) { 9286 var fieldMessages = fieldInstance.getErrorsMessages(); 9287 if (fieldMessages) { 9288 var labelText = ""; 9289 if (label) { 9290 labelText = label.innerText + ": "; 9291 } 9292 var msg = labelText + fieldMessages; 9293 fieldInstance.addError('fieldError', {message: msg, assert: true, updateClass: true}); 9294 } 9295 } 9296 }); 9297 9298 // Wird ein Fehler vom Nutzer korrigiert, soll das Label keine Fehler Klasse mehr haben. 9299 jQuery(form).parsley().on('field:success', function (fieldInstance) { 9300 var fieldId = fieldInstance.$element.attr("id"); 9301 var label = document.getElementById(fieldId + "Label"); 9302 if (label && label.classList.contains('labelError')) { 9303 label.classList.remove('labelError'); 9304 } 9305 // weil wir die Fehlermeldungen manuell anzeigen, müssen diese auch manuell wieder entfernt werden! 9306 fieldInstance.removeError("fieldError", {updateClass: true}); 9307 }); 9308 9309 // Formular als initialisiert markieren. 9310 form.attr("data-initialized-parsley", "true"); 9311 } 9312 }); 9313 } 9314 9315 /** 9316 * Suche die in den Eltern Elementen nach einen übegreifenden Container, welcher auch Hilfe Buttons usw enthält. 9317 * Dieser wird dann genutzt um die Fehlermeldung anzuhängen. Sonst werden Hilfe Buttons usw. verschoben! 9318 */ 9319 this.findCorrectParent = function(fieldInstance) { 9320 var parent; 9321 var parentTagName; 9322 9323 // Suche die in den Eltern Elementen nach einen übegreifenden Container, welcher auch 9324 // Hilfe Buttons usw enthält. Dieser wird dann genutzt um die Fehlermeldung anzuhängen. Sonst 9325 // werden Hilfe Buttons usw. verschoben! 9326 for (var i = 0; i < 3; i++) { 9327 parent = fieldInstance.parent(); 9328 parentTagName = parent[0].tagName; 9329 if (parentTagName.toLowerCase() == "div" || parentTagName.toLowerCase() == "td") { 9330 return parent; 9331 } 9332 9333 fieldInstance = parent; 9334 } 9335 } 9336 9337 /** 9338 * Parst aus den CSS Klassen des Feldes den Namen des Validators für dieses Feld. Die entsprechende CSS Klasse wurde 9339 * zuvor von ApplyMetadata auf dem Server gesetzt. 9340 */ 9341 this.getValidationIdentifier = function(field) { 9342 var classes = field.attr("class"); 9343 var classArr = classes.split(" "); 9344 var arrayLength = classArr.length; 9345 //FIXME aktuell wird eine CSS Klasse .parsleyValidation_VALIDATORIDENTIFIER gesetzt. Mit String Operationen wird hier der 9346 //Identifier bestimmt. Geht das evtl. eleganter? 9347 for (var i = 0; i < arrayLength; i++) { 9348 var currentStr = classArr[i]; 9349 if (currentStr && currentStr.startsWith("parsleyValidation_")) { 9350 var currentStrArr = currentStr.split("_", 2); 9351 if (currentStrArr.length > 1) { 9352 return currentStrArr[1]; 9353 } 9354 } 9355 } 9356 }; 9357 9358 /** 9359 * Setzt das aktuelle locale in Parsley. Dadurch werden dann später die korrekten Fehlermeldungen der Validierung 9360 * angezeigt. 9361 */ 9362 this.setParsleyLocale = function() { 9363 var lang = de.his.common.LanguageHelper.currentLanguage(); 9364 if (lang == "de") { 9365 Parsley.setLocale("de"); 9366 } else { 9367 Parsley.setLocale("en"); 9368 } 9369 }; 9370}; 9371// Validation errors messages for Parsley 9372// Load this after Parsley 9373 9374Parsley.addMessages('de', { 9375 defaultMessage: "Die Eingabe scheint nicht korrekt zu sein.", 9376 type: { 9377 email: "Die Eingabe muss eine gültige E-Mail-Adresse sein.", 9378 url: "Die Eingabe muss eine gültige URL sein.", 9379 number: "Die Eingabe muss eine Zahl sein.", 9380 integer: "Die Eingabe muss eine Zahl sein.", 9381 digits: "Die Eingabe darf nur Ziffern enthalten.",
9382 alphanum: "Die Eingabe muss alphanumerisch sein." 9383 }, 9384 notblank: "Die Eingabe darf nicht leer sein.", 9385 required: "Dies ist ein Pflichtfeld.", 9386 pattern: "Die Eingabe scheint ungültig zu sein.", 9387 min: "Die Eingabe muss gröÃer oder gleich %s sein.", 9388 max: "Die Eingabe muss kleiner oder gleich %s sein.", 9389 range: "Die Eingabe muss zwischen %s und %s liegen.", 9390 minlength: "Die Eingabe ist zu kurz. Es müssen mindestens %s Zeichen eingegeben werden.", 9391 maxlength: "Die Eingabe ist zu lang. Es dürfen höchstens %s Zeichen eingegeben werden.", 9392 length: "Die Länge der Eingabe ist ungültig. Es müssen zwischen %s und %s Zeichen eingegeben werden.", 9393 mincheck: "Wählen Sie mindestens %s Angaben aus.", 9394 maxcheck: "Wählen Sie maximal %s Angaben aus.", 9395 check: "Wählen Sie zwischen %s und %s Angaben.", 9396 equalto: "Dieses Feld muss dem anderen entsprechen." 9397}); 9398 9399//FIXME das setLocale sollte wahrscheinlich eher in die initParsleyValidation.js und auch variable sein, abhängig vom aktuellem locale. 9400//Parsley.setLocale('de'); 9401/** 9402 * Author: [email protected] 9403 * 9404 * device.js (below) must be included before this file 9405 * https://github.com/matthewhudson/device.js 9406 * 9407 * note: 9408 * add ?deviceDetails=true to URL in order to print device height and width 9409 * 9410 */ 9411 9412 9413(function(){ 9414 9415 if(!navigator.cookieEnabled){ 9416 console.info("cookies must be enabled"); 9417 return false; 9418 } 9419 9420 var forceDeviceSessionName = "hisforcedevice"; 9421 var actualDeviceSessionName = "hisactualdevice"; 9422 9423 //output the device height and width if the URL contains ?deviceDetails=true 9424 var urlParam = de.his.common.Util.getQueryParam("deviceDetails"), 9425 actualDevice = window.sessionStorage.getItem(actualDeviceSessionName), 9426 forcedDevice = window.sessionStorage.getItem(forceDeviceSessionName); 9427 9428 if(urlParam == "true"){ 9429 //print the width and height of device 9430 alert(window.innerWidth + " x " + window.innerHeight); 9431 } 9432 9433 if(forcedDevice){ 9434 //TODO: following replaces all classes with {mobile|tablet|desktop|etc} - what about "ios mobile portrait" etc 9435 jQuery("html").attr("class", forcedDevice); 9436 } 9437 9438 if(!device.desktop() && forcedDevice != "desktop"){ 9439 jQuery("a.forceDeviceLink[device-data='desktop']").css("display", "block"); 9440 }else if(actualDevice){ 9441 //if actual device has been set in the sessionStorage - then allow a return back to the actual device 9442 jQuery("a.forceDeviceLink[device-data=" + actualDevice + "]").css("display", "block"); 9443 } 9444 9445 9446 //function used to disable responsive design when user clicks the desired link 9447 jQuery("a.forceDeviceLink").on("click", function(){ 9448 9449 //device.js 9450 var ad, //actual device 9451 url = window.location.href, 9452 forceDevice = jQuery(this).attr("device-data"), 9453 forceDeviceUrl = "wantDevice=" + forceDevice, 9454 currentParam = de.his.common.Util.getQueryParam( "wantDevice" ); 9455 9456 if(device.desktop()){ 9457 ad = "desktop"; 9458 }else if(device.mobile()){ 9459 ad = "mobile"; 9460 }else if(device.tablet()){ 9461 ad = "tablet"; 9462 } 9463 9464 //save the device to force to - i.e. desktop 9465 window.sessionStorage.setItem(forceDeviceSessionName, forceDevice); 9466 //save the actual device - i.e mobile 9467 window.sessionStorage.setItem(actualDeviceSessionName, ad); 9468 9469 9470 if(currentParam){ 9471 //replace anyting in url already 9472 url = url.replace("wantDevice="+currentParam, forceDeviceUrl); 9473 }else{ 9474 url = url + (url.indexOf("?") >= 0 ? "&" + forceDeviceUrl : "?" + forceDeviceUrl); 9475 //url = url + "&device=desktop"; 9476 } 9477 9478 window.location = url; 9479 }); 9480 9481 9482})();/** 9483* [email protected] 9484* by setting custom or predefined (img-xs, img-l) media queries this plugin with change the image to fit the current viewport in a responsive manner. 9485* 9486* usage: <img data-sizes="img-xs, img-s, img-m, img-l, img-xl" 9487* data-srcset="http://placehold.it/60%26text=xs, 9488* http://placehold.it/60%26text=s, 9489* http://placehold.it/60%26text=m, 9490* http://placehold.it/60%26text=l, 9491* http://placehold.it/60%26text=xl" /> 9492* 9493* note: if two sizes are a match then the first wins. 9494* 9495* possible sizes: 9496* 9497* "img-xs": "(max-width:767px)", 9498* "img-s": "(max-width:991px)", 9499* "img-m": "(max-width:1199px)", 9500* "img-l": "(max-width:1920px)", 9501* "img-xl": "(min-width : 1921px)" 9502* 9503* 9504*/ 9505 9506(function(){ 9507 9508 var presets = { 9509 "img-xs": "(max-width:767px)", 9510 "img-s": "(max-width:991px)", 9511 "img-m": "(max-width:1199px)", 9512 "img-l": "(max-width:1920px)", 9513 "img-xl": "(min-width : 1921px)" 9514 } 9515 9516 var imgs = jQuery("img[data-srcset]"); 9517 9518 var reponsiveImages = function(){ 9519 imgs.hide(); //hide all images 9520 var sizes = [], img = {}, src = [], media, size; 9521 //first iterate through all the image tags that were found 9522 for(var i = 0, l = imgs.length; i<l; i++){ 9523 img = jQuery(imgs[i]); 9524 sizes = img.attr("data-sizes").split(","); 9525 src = img.attr("data-srcset").split(","); 9526 //per image tag, iterate through the sizes defined in each tag 9527 for(var ii = 0, ll = sizes.length;ii<ll; ii++){ 9528 size = sizes[ii].trim(); 9529 //if the size is defined using a preset such as img-xs or img-l - convert it to the corresponding media query 9530 if(size.indexOf("img-") >= 0){ 9531 media = presets[size]; 9532 }else{ 9533 //preset wasn't used but a direct media query 9534 media = size; 9535 }
9536 console.info(media, window.matchMedia(media)); 9537 if(window.matchMedia(media).matches){ 9538 //set the correct src url and show the correct image 9539 img.attr("src", src[ii].trim()); 9540 img.show(); 9541 return; 9542 } 9543 } 9544 } 9545 9546 } 9547 9548 //auto recall when windows changes size 9549 jQuery(window).resize(reponsiveImages); 9550 9551 //initial call 9552 reponsiveImages(); 9553 9554})();/*! 9555 * @author Steven Masala [[email protected]] 9556 * Github: https://github.com/smasala/responsive-tables-js 9557 * @license MIT https://tldrlegal.com/license/mit-license 9558 * Responsive Tables 9559 * @version 0.1.5 9560 * 9561 * usage: give any table you want to work responsively, the CSS class "responsive". 9562 */ 9563 9564( function( root, factory ) { 9565 "use strict"; 9566 9567 if ( typeof define === "function" && define.amd ) { 9568 define( [ "jquery" ], function( $ ) { 9569 return factory( root, root.document, $ ); 9570 } ); 9571 } else { 9572 return factory( root, root.document, root.jQuery ); 9573 } 9574 9575} )( this, function( window, document, $ ) { 9576 "use strict"; 9577 9578 if ( window.responsiveTables ) { 9579 console.error( "window.responsiveTables is already defined globally", window.responsiveTables ); 9580 return; 9581 } 9582 9583 var responsiveTables = { 9584 9585 version: "0.1.5", 9586 9587 titleTpl: function( data ) { 9588 return "<span data-type='responsive'>" + data + "</span>"; 9589 }, 9590 9591 /** 9592 * @method init 9593 * @param selector {String} optional - pass if you wish to update tables that do not meet the selector: table.responsive 9594 * @param force {Boolean} [default=false] - optional - set true to reiterate over previous converted tables 9595 */ 9596 init: function( selector, force ) { 9597 var me = this, 9598 tables = $( selector ? selector : "table.responsive" ), 9599 table, ths, th, trs, tds, td, text, it; //for later 9600 9601 if ( tables.length > 0 ) { 9602 9603 for ( var i = 0, l = tables.length; i < l; i++ ) { 9604 //iterate over each table 9605 table = $( tables[ i ] ); 9606 if ( table.attr( "data-type" ) && !force ) { 9607 //ignore this table 9608 continue; 9609 } 9610 table.attr( "data-type", "responsive" ); 9611 //get all the table header for the give table 9612 ths = table.find( "th" ); 9613 trs = table.find( "tr" ); 9614 //iterate over all trs 9615 for ( var ii = 0, ll = trs.length; ii < ll; ii++ ) { 9616 //find tds and iterate 9617 tds = $( trs[ ii ] ).find( "td" ); 9618 for ( var iii = 0, lll = tds.length; iii < lll; iii++ ) { 9619 //for each td - find the correct heading 9620 th = ths[ iii ]; 9621 it = $( tds[ iii ] ); 9622 //get the text content 9623 text = th.textContent || text.innerText || ""; 9624 if ( force ) { 9625 it.find( "span[data-type='responsive']" ).remove(); 9626 } 9627 //prepend td with the correct template 9628 td = it.prepend( me.titleTpl( text ) ); 9629 } 9630 } 9631 } 9632 } 9633 } 9634 9635 }; 9636 9637 //define globally 9638 window.responsiveTables = responsiveTables; 9639 return responsiveTables; 9640} );use_package("de.his.component.ResponsiveTables"); 9641/** 9642* Author:[email protected] 9643* Plugin/helper for tables to make them more responsive 9644*/ 9645//overlayOpen 9646 9647de.his.component.ResponsiveTables = new function() { 9648 9649 de.his.modules.ModuleRegistry 9650 .registerModule(this) 9651 .registerAjaxRefreshModule(this); 9652 9653 this.moduleName = "de.his.component.ResponsiveTables"; 9654 9655 this.init = function(){ 9656 var tables = jQuery("table.table:not(.disableResponsiveLabels):not([data-responsive=true])"); 9657 9658 var table, ths, trs; 9659 for(var x = 0, xl = tables.length; x<xl; x++){ 9660 table = jQuery(tables[x]); 9661 table.attr("data-responsive", true); 9662 //find tableHeaders 9663 ths = table.find("> thead > tr > th"); //.css("display", "none"); 9664 //table rows in the body of the table 9665 trs = table.find("> tbody > tr"); 9666 9667 var tds = [], 9668 label, 9669 th, td; 9670 9671 for(var i = 0, l = trs.length; i<l; i++){ 9672 tds = jQuery(trs[i]).find("> td"); 9673 for(var ii = 0, ll = tds.length; ii<ll; ii++){ 9674 td = tds[ii]; 9675 th = ths[ii]; 9676 if(th){ 9677 // innerHTML damit auch HTML Elemente, wie Popup Buttons angezeigt werden können! 9678 label = th.innerHTML; 9679 9680 var ariaHide =""; 9681 if(jQuery(window).width() > 768) { 9682 ariaHide ="aria-hidden='true'" 9683 } 9684 jQuery(td).prepend("<span data-type='responsive'" + ariaHide + ">" + label + "</span>").find('[id*="filterSelectOneMenu"], [id*="filterInput"], [id*="resetFilter"], [id*="filterRefresh"], [class*="headerExtSelectOneMenu"]').remove(); 9685 /** inline-table requires content of the td will collapse (used for responsive tables) **/ 9686 9687 if(!jQuery(td).html()){ 9688 jQuery(td).html(" "); 9689 } 9690 9691 9692 9693 } 9694 9695 } 9696 } 9697 } 9698 9699 jQuery(window).resize(function() { 9700 9701 setTimeout(function(){ 9702 if(jQuery(window).width() <= 768){ 9703 $("span[data-type='responsive']").removeAttr('aria-hidden'); 9704 } 9705 else{ 9706 $("span[data-type='responsive']").attr('aria-hidden', 'true'); 9707 } 9708 },800); 9709 }); 9710 9711 setTimeout(function(){ 9712 jQuery('.frozenCol_2').each(function(){ 9713 var $this = jQuery(this); 9714 var thWidth = $this.find('th:nth-child(1)').outerWidth(); 9715 $this.find('td:nth-child(2), th:nth-child(2)').css({left: thWidth}); 9716 }); 9717 jQuery('.frozenCol_3').each(function(){ 9718 var $this2 = jQuery(this); 9719 var thWidth2 = $this2.find('th:nth-child(1)').outerWidth(); 9720 $this2.find('td:nth-child(2), th:nth-child(2)').css({left: thWidth2}); 9721 var $this3 = jQuery(this); 9722 var thWidth3 = $this3.find('th:nth-child(1)').outerWidth() + $this3.find('th:nth-child(2)').outerWidth(); 9723 $this3.find('td:nth-child(3), th:nth-child(3)').css({left: thWidth3}); 9724 }); 9725 },200); 9726 9727 jQuery('.frozenCol_3, .frozenCol_2, .frozenCol').each(function(){ 9728 var $this = jQuery(this); 9729 if( $this.find('.overflowAuto').length && $this.find('.virtualTableScroll').length == 0 ) { 9730 $this.append(' <div class="virtualTableScrollWrap"><div class="virtualTableScroll"><div class="virtualTableScroll-handler"></div></div></div> '); 9731 9732 var $table = $this.find('.overflowAuto').find('table'); 9733 var overflowWidth = $this.find('.overflowAuto').width();
9734 var tableWidth = $table.width(); 9735 var scrollWidth = tableWidth-overflowWidth 9736 $this.find( ".virtualTableScroll" ).slider({ 9737 create: function() { 9738 if( overflowWidth >= tableWidth || $this.hasClass('tableStickyHeader') ) { 9739 $this.find( ".virtualTableScroll" ).slider( "destroy" ); 9740 $this.find('.virtualTableScrollWrap').remove(); 9741 } 9742 }, 9743 slide: function( event, ui ) { 9744 virtualScroller = (scrollWidth/100)*ui.value; 9745 $this.find('.overflowAuto').scrollLeft(virtualScroller); 9746 } 9747 }); 9748 9749 var $handle = $this.find( ".ui-slider-handle" ); 9750 $this.find('.overflowAuto').scroll(function(e){ 9751 scroller = (jQuery(this).scrollLeft()/scrollWidth)*100; 9752 $handle.css({left:scroller+'%'}); 9753 }); 9754 9755 // Virtual Scrollbar ausblenden wenn der horizontale Browserscrollbalken sichtbar ist 9756 var tableHeight = $table.outerHeight(); 9757 var tableTop = $table.offset().top; 9758 var windowHeight = jQuery(window).height(); 9759 var old_scroll_top = 0; 9760 jQuery(window).scroll(function(){ 9761 var current_scroll_top = $(document).scrollTop(); 9762 var scroll_delta = current_scroll_top - old_scroll_top; 9763 var scrollbarInView = (tableHeight +tableTop )- windowHeight >= current_scroll_top; 9764 if( scroll_delta <=0 ){ 9765 if( scrollbarInView ) { 9766 $this.find( ".virtualTableScrollWrap" ).removeClass('js-hidden'); 9767 } 9768 } 9769 else { 9770 if( current_scroll_top >= 200 ){ 9771 if( !scrollbarInView ) { 9772 $this.find( ".virtualTableScrollWrap" ).addClass('js-hidden'); 9773 } 9774 } 9775 } 9776 9777 old_scroll_top = current_scroll_top; 9778 }); 9779 9780 } 9781 9782 9783 }); 9784 9785 }; 9786 9787 this.refresh = this.init; 9788 9789}; 9790 9791/* 9792 * alert.js - javascript alert replacement v2.4 9793 * 9794 * (c) 2009-2011 Naden Badalgogtapeh - http://www.naden.de/blog/javascript-alert 9795 * 9796 */ 9797 9798// Datei wurde angepasst, um den Top wert nicht zu setzen, da er die Alert-box ausÃerhalb des sichtbaren Bereichs anzeigt. 9799// Alert box wird nun anhand unseres CSS's positioniert. Zum Finden des auskommentieren Codes Suche in der Datei nach: A.style.top 9800 9801window.alert=function(){var H=2.4;var D={button_title:"OK",callback:function(){},left:-1,top:-1,width:-1,height:-1,modal:true,timeout:0};if(arguments.length==2&&typeof arguments[1]=="object"){D=J(arguments[1],D)}else{if(arguments.length==3){D=J(arguments[2],D)}}window.alert_callback=D.callback;if(arguments.length==1||(arguments.length==2&&typeof arguments[1]!="string")){arguments=["",arguments[0]]}var A=document.getElementById("alert");if(A){document.body.removeChild(A)}if(D.modal){var F=document.createElement("DIV");F.id="alert-modal";F.className="alert-modal";document.body.appendChild(F)}A=document.createElement("DIV");A.id=A.className="alert";document.body.appendChild(A);A.innerHTML=(arguments[0]==""?"":'<div class="title">'+arguments[0]+"</div>")+'<div class="body">'+arguments[1]+'</div><div class="button"><a href="" onclick="var _m3423=document.getElementById(\'alert-modal\');if(_m3423)document.body.removeChild(_m3423);document.body.removeChild(document.getElementById(\'alert\'));alert_callback();return false;">'+D.button_title+"</a></div>";var B=G(),K=Math.max(I(arguments[0]),I(arguments[1]))*6,C=0,E=0;if(D.width==-1){D.width=K}else{C=D.width;K=0}if(D.left==-1){D.left=parseInt((B[0]+B[2]-K-C)/2)}A.style.display="block";if(D.top==-1){D.top=parseInt(((B[1]+B[3]-(D.height==-1?0:(D.height/2)))/2)-(A.pixelHeight||A.offsetHeight))}A.style.width=D.width+"px";if(D.height>0){A.style.height=D.height+"px"}/*A.style.left=D.left+"px";A.style.top=D.top+50+"px";*/function J(M,L){for(var N in L){if(N in M){continue}M[N]=L[N]}return M}function I(O){var P=O.split("<br />");if(P.length<=1){P=O.split("<br>")}if(P.length<=1){return O.replace(/<(?:.|\s)*?>/g,"").length}var L=0;for(var N=0;N<P.length;N++){var M=P[N].replace(/<(?:.|\s)*?>/g,"");if(M.length>L){L=M.length}}return L}function G(){var M=0,N=0,L=0,O=0;if(typeof window.innerWidth=="number"){M=window.innerWidth;N=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){M=document.documentElement.clientWidth;N=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){M=document.body.clientWidth;N=document.body.clientHeight}}}if(typeof window.pageYOffset=="number"){O=window.pageYOffset;L=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){O=document.body.scrollTop;L=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){O=document.documentElement.scrollTop;L=document.documentElement.scrollLeft}}}return[L,O,M,N]}}; 'use strict'; 9802 9803use_package("de.his.component"); 9804 9805de.his.component.PrimeFacesSelectOneMenu = new function() { 9806 de.his.modules.ModuleRegistry 9807 .registerModule(this) 9808 .registerAjaxRefreshModule(this); 9809 this.moduleName = "de.his.component.PrimeFacesSelectOneMenu"; 9810 const setAriaActivedescendant = true; 9811 const setAriaOwns = true; 9812 9813 this.init = function() { 9814 if (window.PrimeFaces) { 9815 PrimeFaces.widget.SelectOneMenu(); 9816 PrimeFaces.animationEnabled = false;
9817 } 9818 } 9819 this.refresh = function() { 9820 this.init(); 9821 }; 9822 9823 if (window.PrimeFaces) { 9824 /// START PrimeFaces-Komponente /// 9825 PrimeFaces.widget.SelectOneMenu = PrimeFaces.widget.DeferredWidget.extend({ 9826 9827 /** 9828 * @override 9829 * @inheritdoc 9830 * @param {PrimeFaces.PartialWidgetCfg<TCfg>} cfg 9831 */ 9832 init: function(cfg) { 9833 this._super(cfg); 9834 9835 this.panelId = this.jqId + '_panel'; 9836 this.input = $(this.jqId + '_input'); 9837 this.focusInput = $(this.jqId + '_focus'); 9838 this.label = this.jq.find('.ui-selectonemenu-label'); 9839 9840 this.panel = $(this.panelId); 9841 this.disabled = this.jq.hasClass('ui-state-disabled'); 9842 this.itemsWrapper = this.panel.children('.ui-selectonemenu-items-wrapper'); 9843 this.options = this.input.find('option'); 9844 this.cfg.effect = this.cfg.effect||'fade'; 9845 9846 this.cfg.effectSpeed = this.cfg.effectSpeed||'normal'; 9847 this.cfg.autoWidth = this.cfg.autoWidth === false ? false : true; 9848 this.cfg.dynamic = this.cfg.dynamic === true ? true : false; 9849 this.cfg.appendTo = PrimeFaces.utils.resolveAppendTo(this, this.panel); 9850 this.cfg.renderPanelContentOnClient = this.cfg.renderPanelContentOnClient === true; 9851 this.isDynamicLoaded = false; 9852 this.isOpenedByKeydown = false; 9853 this.defaultTooltip = this.jq.attr('title'); 9854 9855 if(this.cfg.dynamic || (this.itemsWrapper.children().length === 0)) { 9856 var selectedOption = this.options.filter(':selected'), 9857 labelVal = this.cfg.editable ? this.label.val() : selectedOption.text(); 9858 9859 this.setLabel(labelVal); 9860 } 9861 else { 9862 this.initContents(); 9863 this.bindItemEvents(); 9864 } 9865 9866 //triggers 9867 this.triggers = this.jq.find(".ui-selectonemenu-label"); 9868 9869 //mark trigger and descandants of trigger as a trigger for a primefaces overlay 9870 this.triggers.data('primefaces-overlay-target', true).find('*').data('primefaces-overlay-target', true); 9871 9872 if(!this.disabled) { 9873 this.bindEvents(); 9874 9875 this.transition = PrimeFaces.utils.registerCSSTransition(this.panel, 'ui-connected-overlay'); 9876 } 9877 9878 // see #7602 9879 if (PrimeFaces.env.isTouchable(this.cfg)) { 9880 this.focusInput.attr('readonly', true); 9881 } 9882 9883 //this.renderDeferred(); 9884 //this._render(); // this.renderDeferred ist eine Performancebremse (durch den Zugriff auf :visible) und bei uns scheinbar unnötig 9885 }, 9886 9887 /** 9888 * Finds and initializes the DOM elements that make up this widget. 9889 * @private 9890 */ 9891 initContents: function() { 9892 this.itemsContainer = this.itemsWrapper.children('.ui-selectonemenu-items'); 9893 this.items = this.itemsContainer.find('.ui-selectonemenu-item'); 9894 this.optGroupsSize = this.itemsContainer.children('li.ui-selectonemenu-item-group').length; 9895 this.itemsWithGroup = this.itemsContainer.find(".ui-selectonemenu-item, .ui-selectonemenu-item-group"); 9896 9897 var $this = this, 9898 selectedOption = this.options.filter(':selected'), 9899 highlightedItem = this.items.eq(this.options.index(selectedOption)); 9900 9901 //disable options 9902 this.options.filter(':disabled').each(function() { 9903 $this.items.eq($(this).index()).addClass('ui-state-disabled'); 9904 }); 9905 9906 //activate selected 9907 if(this.cfg.editable) { 9908 var customInputVal = this.label.val(); 9909 9910 //predefined input 9911 if(customInputVal === selectedOption.text()) { 9912 this.highlightItem(highlightedItem); 9913 } 9914 //custom input 9915 else { 9916 this.items.eq(0).addClass('ui-state-highlight'); 9917 this.customInput = true; 9918 this.customInputVal = customInputVal; 9919 } 9920 } 9921 else { 9922 this.highlightItem(highlightedItem); 9923 } 9924 9925 if(this.cfg.syncTooltip) { 9926 this.syncTitle(selectedOption); 9927 } 9928 9929 //pfs metadata 9930 this.input.data(PrimeFaces.CLIENT_ID_DATA, this.id); 9931 9932 //for Screen Readers 9933 for(var i = 0; i < this.items.length; i++) { 9934 this.items.eq(i).attr('id', this.id + '_' + i); 9935 } 9936 9937 var highlightedItemId = highlightedItem.attr('id'); 9938 var helptextId = this.jq.attr('aria-describedby'); 9939 this.jq.attr('aria-owns', this.itemsContainer.attr('id')); 9940 if (helptextId) { 9941 this.focusInput.attr('aria-autocomplete', 'list') 9942 .attr('aria-activedescendant', highlightedItemId) 9943 .attr('aria-describedby', helptextId + ' ' + highlightedItemId) // Fix für Vorlesen der Hinweistexte (#332530) 9944 .attr('aria-disabled', this.disabled); 9945 } else { 9946 this.focusInput.attr('aria-autocomplete', 'list') 9947 .attr('aria-activedescendant', highlightedItemId) 9948 .attr('aria-describedby', highlightedItemId) 9949 .attr('aria-disabled', this.disabled); 9950 } 9951 this.itemsContainer.attr('aria-activedescendant', highlightedItemId); 9952 }, 9953 9954 /** 9955 * @include 9956 * @override 9957 * @protected 9958 * @inheritdoc 9959 */ 9960 _render: function() { 9961 var contentStyle = this.jq.attr('style'), 9962 hasWidth = contentStyle && contentStyle.indexOf('width') != -1; 9963 9964 if(this.cfg.autoWidth && !hasWidth) { 9965 this.jq.css('width', this.input.outerWidth() + 'px'); 9966 } 9967 }, 9968 9969 /** 9970 * @override 9971 * @inheritdoc
9972 * @param {PrimeFaces.PartialWidgetCfg<TCfg>} cfg 9973 */ 9974 refresh: function(cfg) { 9975 this.panelWidthAdjusted = false; 9976 this.items = null; 9977 9978 this._super(cfg); 9979 }, 9980 9981 /** 9982 * Adjust the width of the overlay panel. 9983 * @private 9984 */ 9985 alignPanelWidth: function() { 9986 //align panel and container 9987 if(!this.panelWidthAdjusted) { 9988 var jqWidth = this.jq.outerWidth(); 9989 if(this.panel.outerWidth() < jqWidth) { 9990 this.panel.width(jqWidth); 9991 } 9992 else { 9993 this.panel.width(this.panel.width()); 9994 } 9995 9996 this.panelWidthAdjusted = true; 9997 } 9998 }, 9999 10000 /** 10001 * Sets up all event listeners required by this widget. 10002 * @private 10003 */ 10004 bindEvents: function() { 10005 var $this = this; 10006 10007 // Screen Reader(JAWS) hack on Chrome 10008 if(PrimeFaces.env.browser.webkit) { 10009 this.input.on('focus', function(){ 10010 setTimeout(function(){ 10011 $this.focusInput.trigger('focus.ui-selectonemenu'); 10012 },2); 10013 }); 10014 } 10015 10016 //Triggers 10017 this.triggers.on("mouseenter", function() { 10018 if(!$this.jq.hasClass('ui-state-focus')) { 10019 $this.jq.addClass('ui-state-hover'); 10020 } 10021 }) 10022 .on("mouseleave", function() { 10023 $this.jq.removeClass('ui-state-hover'); 10024 }) 10025 .on("click", function(e) { 10026 if($this.panel.is(":hidden")) { 10027 $this.show(); 10028 } 10029 else { 10030 $this.hide(); 10031 10032 $this.revert(); 10033 $this.changeAriaValue($this.getActiveItem()); 10034 } 10035 10036 $this.jq.removeClass('ui-state-hover'); 10037 $this.focusInput.trigger('focus.ui-selectonemenu'); 10038 e.preventDefault(); 10039 }); 10040 10041 this.focusInput.on('focus.ui-selectonemenu', function(e) { 10042 $this.jq.addClass('ui-state-focus'); 10043 if(!$this.cfg.dynamic && !$this.items) { 10044 $this.callHandleMethod($this.handleTabKey(), e); 10045 } 10046 var item = Array.from($this.items).filter(elem => { 10047 return elem.classList.contains('ui-state-highlight'); 10048 }); 10049 }) 10050 .on('blur.ui-selectonemenu', function(){ 10051 $this.jq.removeClass('ui-state-focus'); 10052 $this.callBehavior('blur'); 10053 }); 10054 10055 //onchange handler for editable input 10056 if(this.cfg.editable) { 10057 this.label.on('change', function(e) { 10058 $this.triggerChange(true); 10059 $this.callHandleMethod($this.handleLabelChange, e); 10060 }); 10061 } 10062 10063 // fixes missing label after Chrome autofills selects or Screenreader Selection from HTML-Select 10064 this.input.off('change').on("change",function(e){ 10065 var value = $this.cfg.editable ? $this.label.val() : $this.getSelectedLabel(); 10066 $this.setLabel(value); 10067 10068 if($this.panel.is(":visible")){ 10069 $this.hide(); 10070 } 10071 }); 10072 10073 //key bindings 10074 this.bindKeyEvents(); 10075 }, 10076 10077 /** 10078 * Sets up the event listeners for the selectable items. 10079 * @private 10080 */ 10081 bindItemEvents: function() { 10082 var $this = this; 10083 if(!this.items) { 10084 return; 10085 } 10086 10087 //Items 10088 this.items.filter(':not(.ui-state-disabled)').on('mouseover.selectonemenu', function() { 10089 var el = $(this); 10090 10091 if(!el.hasClass('ui-state-highlight')) 10092 $(this).addClass('ui-state-hover'); 10093 }) 10094 .on('mouseout.selectonemenu', function() { 10095 $(this).removeClass('ui-state-hover'); 10096 }) 10097 .on('click.selectonemenu', function() { 10098 $this.revert(); 10099 $this.selectItem($(this)); 10100 $this.changeAriaValue($(this)); 10101 }); 10102 }, 10103 10104 /** 10105 * Sets up all panel event listeners 10106 * @private 10107 */ 10108 bindPanelEvents: function() { 10109 var $this = this; 10110
10111 this.hideOverlayHandler = PrimeFaces.utils.registerHideOverlayHandler(this, 'mousedown.' + this.id + '_hide', this.panel, 10112 function() { return $this.label; }, 10113 function(e, eventTarget) { 10114 if(e.target.nodeName === "HTML") { 10115 // verhindert das einklappen bei Betätigung der Scrollbars. 10116 return; 10117 } 10118 if(!($this.panel.is(eventTarget) || $this.panel.has(eventTarget).length > 0)) { 10119 $this.panel.hide(); 10120 setTimeout(function() { 10121 $this.revert(); 10122 $this.changeAriaValue($this.getActiveItem()); 10123 }, 2); 10124 } 10125 }); 10126 10127 this.resizeHandler = PrimeFaces.utils.registerResizeHandler(this, 'resize.' + this.id + '_hide', this.panel, function() { 10128 $this.handleViewportChange(); 10129 }); 10130 10131 // GitHub #1173/#4609 keep panel with select while scrolling 10132 this.scrollHandler = PrimeFaces.utils.registerConnectedOverlayScrollHandler(this, 'scroll.' + this.id + '_hide', this.jq, function() { 10133 $this.handleViewportChange(); 10134 }); 10135 }, 10136 10137 /** 10138 * Fired when the browser viewport is resized or scrolled. In Mobile environment we don't want to hider the overlay 10139 * we want to re-align it. This is because on some mobile browser the popup may force the browser to trigger a 10140 * resize immediately and close the overlay. See GitHub #7075. 10141 * @private 10142 */ 10143 handleViewportChange: function() { 10144 if (PrimeFaces.env.mobile) { 10145 this.alignPanel(); 10146 } else { 10147 this.hide(); 10148 } 10149 }, 10150 10151 /** 10152 * Unbind all panel event listeners 10153 * @private 10154 */ 10155 unbindPanelEvents: function() { 10156 if (this.hideOverlayHandler) { 10157 this.hideOverlayHandler.unbind(); 10158 } 10159 10160 if (this.resizeHandler) { 10161 this.resizeHandler.unbind(); 10162 } 10163 10164 if (this.scrollHandler) { 10165 this.scrollHandler.unbind(); 10166 } 10167 }, 10168 10169 /** 10170 * Removes some event listeners when this widget was disabled. 10171 * @private 10172 */ 10173 unbindEvents: function() { 10174 if (this.items) { 10175 this.items.off(); 10176 } 10177 this.triggers.off(); 10178 this.input.off(); 10179 this.focusInput.off(); 10180 this.label.off(); 10181 }, 10182 10183 /** 10184 * Unselect the selected item, if any, and select the `please select` option. 10185 */ 10186 revert: function() { 10187 if(this.cfg.editable && this.customInput) { 10188 this.setLabel(this.customInputVal); 10189 this.items.filter('.ui-state-active').removeClass('ui-state-active'); 10190 this.items.eq(0).addClass('ui-state-active'); 10191 } 10192 else { 10193 this.highlightItem(this.items.eq(this.options.index(this.preShowValue))); 10194 } 10195 }, 10196 10197 /** 10198 * Highlight the given selectable option. 10199 * @private 10200 * @param {JQuery} item Option to highlight. 10201 */ 10202 highlightItem: function(item) { 10203 this.items.attr('aria-selected', false); 10204 this.items.filter('.ui-state-highlight').removeClass('ui-state-highlight'); 10205 10206 if(item.length > 0) { 10207 item.addClass('ui-state-highlight'); 10208 item.attr('aria-selected', true); 10209 this.setLabel(item.data('label')); 10210 var _this = this; 10211 setTimeout(function() { 10212 if( _this.isOpenedByKeydown ) { 10213 _this.focusTooltip(); 10214 } 10215 },100) 10216 } 10217 }, 10218 10219 focusTooltip: function() { 10220 if (/Edg/.test(navigator.userAgent)) { 10221 console.log("no focus tooltip for edge"); 10222 return; 10223 } 10224 // Fokus-Tooltips auch bei der Auswahlliste anzeigen 10225 var item = this.getActiveItem(); 10226 var athis = this; 10227 setTimeout(function(){ 10228 var title = item.attr('title'); 10229 item.attr('data-title',title); 10230 if (title !== undefined && title.trim() !== '' ) { 10231 jQuery('.focusTooltip').remove(); 10232 jQuery('body').append('<span class="focusTooltip"></span>'); 10233 jQuery('.focusTooltip').text(title); 10234 10235 if( jQuery('.ui-selectonemenu-filter-container').is(':visible') ) { 10236 var rect = item[0].getBoundingClientRect(); 10237 var thisHeight = item.outerHeight(); 10238 } else { 10239 var rect = athis.jq[0].getBoundingClientRect(); 10240 var thisHeight = jQuery(athis.jq[0]).outerHeight(); 10241 } 10242 jQuery('.focusTooltip').css({ 10243 left: rect.left + 'px', 10244 top: rect.top + thisHeight + 'px' 10245 }); 10246 10247 var ftWidth = jQuery('.focusTooltip').outerWidth(); 10248 var rightPosition = ftWidth + rect.left; 10249 var winWidth = jQuery(window).width(); 10250 var newLeftPosition = rect.left - (rightPosition - winWidth); 10251 10252 if (rightPosition >= winWidth) { 10253 jQuery('.focusTooltip').css({ 10254 left: newLeftPosition + 'px' 10255 }); 10256 } 10257 } 10258 },200); 10259 }, 10260 10261 /** 10262 * Triggers the event listeners when the value of this widget changed. 10263 * @private 10264 * @param {boolean} edited Whether the value was edited by the user. If it was, checks which option is now selected. 10265 */ 10266 triggerChange: function(edited) { 10267 this.changed = false;
10268 10269 this.input.trigger('change'); 10270 10271 if(!edited) { 10272 this.value = this.options.filter(':selected').val(); 10273 } 10274 }, 10275 10276 /** 10277 * Callback for when the user selects an item with the mouse. 10278 * @private 10279 * @param {JQuery} item The option to select. 10280 * @param {boolean} silent `true` to suppress triggering event listeners, or `false` otherwise. 10281 */ 10282 selectItem: function(item, silent) { 10283 // HIS-Patch 10284 //index nach neuer Sortierung finden 10285 var newIndex; 10286 this.items.each(function(i, el ){ 10287 if( item.attr('data-itemValue') == jQuery(el).attr('data-itemValue') ) { 10288 newIndex = i; 10289 } 10290 }); 10291 var selectedOption = this.options.eq(newIndex), 10292 currentOption = this.options.filter(':selected'), 10293 sameOption = selectedOption.val() == currentOption.val(), 10294 shouldChange = null; 10295 10296 if(this.cfg.editable) { 10297 shouldChange = (!sameOption)||(selectedOption.text() != this.label.val()); 10298 } 10299 else { 10300 shouldChange = !sameOption; 10301 } 10302 10303 if(shouldChange) { 10304 this.highlightItem(item); 10305 this.input.val(selectedOption.val()); 10306 10307 if(!silent) { 10308 this.triggerChange(); 10309 } 10310 10311 if(this.cfg.editable) { 10312 this.customInput = false; 10313 } 10314 10315 if(this.cfg.syncTooltip) { 10316 this.syncTitle(selectedOption); 10317 } 10318 } 10319 10320 if(!silent) { 10321 // HIS-Patch um ajax auch bei Auswahl des gleichen Elements aus zu lösen. 10322 // behebt Probleme mit Suchsets, Auswahl gleiches Suchset resetet Ãnderungen 10323 this.input.trigger("selectitem"); 10324 this.callBehavior('itemSelect'); 10325 this.focusInput.trigger('focus'); 10326 // update tooltip after selection change with keyboard too 10327 this.focusTooltip(); 10328 } 10329 10330 if(this.panel.is(':visible')) { 10331 this.hide(); 10332 } 10333 10334 // wenn SOM in Tableheader als Filter refresh button triggern 10335 if( this.id.contains('filterSelectOneMenu') && this.input.attr('onkeydown') ) { 10336 var refreshBtnId = this.input.attr('onkeydown').split("'")[1]; 10337 refreshBtnId = refreshBtnId.replace( /(:|\.|\[|\]|,|=|@)/g, "\\$1" ); 10338 jQuery('#'+refreshBtnId).trigger('click'); 10339 } 10340 10341 }, 10342 10343 /** 10344 * Adjust the value of the title attribute to match selected option. 10345 * @private 10346 * @param {JQuery} option The option that was selected. 10347 */ 10348 syncTitle: function(option) { 10349 var optionTitle = this.items.eq(option.index()).attr('data-title') || this.items.eq(option.index()).attr('title'); 10350 if(optionTitle && optionTitle.trim().length > 0) { 10351 this.jq.attr('title', optionTitle); 10352 } 10353 else { 10354 this.jq.attr('title', this.defaultTooltip); 10355 } 10356 }, 10357 10358 /** 10359 * Finds the index of the given selectable option. 10360 * @param {JQuery} item One of the available selectable options. 10361 * @return {number} The index of the given item. 10362 */ 10363 resolveItemIndex: function(item) { 10364 if(this.optGroupsSize === 0) 10365 return item.index(); 10366 else 10367 return item.index() - item.prevAll('li.ui-selectonemenu-item-group').length; 10368 }, 10369 10370 /** 10371 * Sets up the event listeners for all keyboard related events other than the overlay panel, such as pressing space 10372 * to bring up the overlay panel. 10373 * @private 10374 */ 10375 bindKeyEvents: function() { 10376 var $this = this; 10377 10378 this.focusInput.on('keydown.ui-selectonemenu', function(e) { 10379 var keyCode = $.ui.keyCode, 10380 key = e.which; 10381 10382 switch(key) { 10383 case keyCode.UP: 10384 case keyCode.LEFT: 10385 if (e.altKey) { 10386 $this.handleEscapeKey(e); 10387 } else { 10388 $this.callHandleMethod($this.highlightPrev, e); 10389 } 10390 break; 10391 10392 case keyCode.DOWN: 10393 // Pfeiltaste nach unten soll Auswahlfeld öffnen 10394 if ($this.panel.is(":hidden")) { 10395 $this.show(); 10396 $this.isOpenedByKeydown = true; 10397 $this.focusTooltip(); 10398 } else { 10399 $this.callHandleMethod($this.highlightNext, e); 10400 } 10401 break; 10402 10403 case keyCode.RIGHT: 10404 $this.callHandleMethod($this.highlightNext, e); 10405 break; 10406 10407 case keyCode.ENTER: 10408 $this.handleEnterKey(e); 10409 break; 10410 10411 case keyCode.TAB: 10412 $this.handleTabKey(); 10413 break; 10414 10415 case keyCode.ESCAPE: 10416 $this.handleEscapeKey(e); 10417 break; 10418 10419 case keyCode.SPACE: 10420 $this.handleSpaceKey(e); 10421 break; 10422 10423 case keyCode.BACKSPACE: 10424 $this.handleDelete(e); 10425 break; 10426 case keyCode.DELETE: 10427 $this.handleDelete(e); 10428 break; 10429 } 10430 }) 10431 .on('keyup.ui-selectonemenu', function(e) { 10432 var keyCode = $.ui.keyCode, 10433 key = e.which; 10434 10435 switch(key) { 10436 case keyCode.UP: 10437 case keyCode.LEFT: 10438 case keyCode.DOWN: 10439 case keyCode.RIGHT: 10440 case keyCode.ENTER: 10441 case keyCode.TAB: 10442 case keyCode.ESCAPE: 10443 case keyCode.SPACE: 10444 case keyCode.HOME: 10445 case keyCode.PAGE_DOWN: 10446 case keyCode.PAGE_UP: 10447 case keyCode.END: 10448 case keyCode.DELETE: 10449 case 16: //shift 10450 case 17: //keyCode.CONTROL: 10451 case 18: //keyCode.ALT: 10452 case 19: //Pause/Break: 10453 case 20: //capslock: 10454 case 44: //Print Screen: 10455 case 45: //Insert: 10456 case 91: //left window or cmd: 10457 case 92: //right window: 10458 case 93: //right cmd: 10459 case 144: //num lock: 10460 case 145: //scroll lock: 10461 break; 10462 10463 default: 10464 //function keys (F1,F2 etc.) 10465 if(key >= 112 && key <= 123) { 10466 break; 10467 } 10468 10469 var matchedOptions = null, 10470 metaKey = e.metaKey||e.ctrlKey||e.altKey; 10471 10472 if(!metaKey) { 10473 clearTimeout($this.searchTimer); 10474 10475 // #4682: check for word match 10476 var text = $(this).val(); 10477 matchedOptions = $this.matchOptions(text); 10478 if(matchedOptions.length) { 10479 var matchIndex = matchedOptions[0].index; 10480 var highlightItem = $this.items.eq(matchIndex); 10481 if($this.panel.is(':hidden')) { 10482 $this.selectItem(highlightItem); 10483 } 10484 else { 10485 $this.highlightItem(highlightItem); 10486 PrimeFaces.scrollInView($this.itemsWrapper, highlightItem); 10487 } 10488 } else { 10489 // #4682: check for first letter match 10490 text = String.fromCharCode(key).toLowerCase(); 10491 // find all options with the same first letter 10492 matchedOptions = $this.matchOptions(text); 10493 if(matchedOptions.length) { 10494 var selectedIndex = -1; 10495
10496 // is current selection one of our matches? 10497 matchedOptions.each(function() { 10498 var option = $(this); 10499 var currentIndex = option[0].index; 10500 var currentItem = $this.items.eq(currentIndex); 10501 if (currentItem.hasClass('ui-state-highlight')) { 10502 selectedIndex = currentIndex; 10503 return false; 10504 } 10505 }); 10506 10507 matchedOptions.each(function() { 10508 var option = $(this); 10509 var currentIndex = option[0].index; 10510 var currentItem = $this.items.eq(currentIndex); 10511 10512 // select next item after the current selection 10513 if (currentIndex > selectedIndex) { 10514 if($this.panel.is(':hidden')) { 10515 $this.selectItem(currentItem); 10516 } 10517 else { 10518 $this.highlightItem(currentItem); 10519 PrimeFaces.scrollInView($this.itemsWrapper, currentItem); 10520 } 10521 return false; 10522 } 10523 }); 10524 } 10525 } 10526 10527 $this.searchTimer = setTimeout(function(){ 10528 $this.focusInput.val(''); 10529 }, 1000); 10530 } 10531 break; 10532 } 10533 }); 10534 }, 10535 10536 /** 10537 * Finds all options that match the given search string. 10538 * @private 10539 * @param {string} text The search string against which to match the options. 10540 * @return {JQuery} All selectable options that match (contain) the given search string. 10541 */ 10542 matchOptions: function(text) { 10543 if(!text) { 10544 return false; 10545 } 10546 return this.options.filter(function() { 10547 var option = $(this); 10548 if(option.is(':disabled')) { 10549 return false; 10550 } 10551 if(option.text().toLowerCase().indexOf(text.toLowerCase()) !== 0) { 10552 return false; 10553 } 10554 return true; 10555 }); 10556 }, 10557 10558 /** 10559 * Sets up the event listeners for the filter input in the overlay panel. 10560 * @private 10561 */ 10562 bindFilterEvents: function() { 10563 var $this = this; 10564 10565 this.filterInput.on('keyup.ui-selectonemenu', function(e) { 10566 var keyCode = $.ui.keyCode, 10567 key = e.which; 10568 10569 switch(key) { 10570 case keyCode.UP: 10571 case keyCode.LEFT: 10572 case keyCode.DOWN: 10573 case keyCode.RIGHT: 10574 case keyCode.ENTER: 10575 case keyCode.TAB: 10576 case keyCode.ESCAPE: 10577 case keyCode.SPACE: 10578 case keyCode.HOME: 10579 case keyCode.PAGE_DOWN: 10580 case keyCode.PAGE_UP: 10581 case keyCode.END: 10582 case 16: //shift 10583 case 17: //keyCode.CONTROL: 10584 case 18: //keyCode.ALT: 10585 case 91: //left window or cmd: 10586 case 92: //right window: 10587 case 93: //right cmd: 10588 case 20: //capslock: 10589 break; 10590 10591 default: 10592 //function keys (F1,F2 etc.) 10593 if(key >= 112 && key <= 123) { 10594 break; 10595 } 10596 10597 var metaKey = e.metaKey||e.ctrlKey; 10598 10599 if(!metaKey) { 10600 $this.filter($(this).val()); 10601 } 10602 break; 10603 } 10604 }) 10605 .on('keydown.ui-selectonemenu',function(e) { 10606 var keyCode = $.ui.keyCode, 10607 key = e.which; 10608 10609 switch(key) { 10610 case keyCode.UP: 10611 $this.highlightPrev(e); 10612 break; 10613 10614 case keyCode.DOWN: 10615 $this.highlightNext(e); 10616 break; 10617 10618 case keyCode.ENTER: 10619 $this.handleEnterKey(e); 10620 break; 10621 10622 case keyCode.TAB: 10623 $this.handleTabKey(); 10624 break; 10625 10626 case keyCode.ESCAPE: 10627 $this.handleEscapeKey(e); 10628 break; 10629 10630 case keyCode.SPACE: 10631 $this.handleSpaceKey(e); 10632 break; 10633 10634 case keyCode.HOME: 10635 $this.handleHomeKey(); 10636 break; 10637 case keyCode.END: 10638 $this.handleEndKey(); 10639 break; 10640 case keyCode.PAGE_DOWN: 10641 $this.handlePageDownKey(e); 10642 break; 10643 case keyCode.PAGE_UP: 10644 $this.handlePageUpKey(e); 10645 break; 10646 10647 default: 10648 break; 10649 } 10650 }).on('paste.ui-selectonemenu', function() { 10651 setTimeout(function(){ 10652 $this.filter($this.filterInput.val()); 10653 },2); 10654 }); 10655 }, 10656 10657 /** 10658 * Highlights the next option after the currently highlighted option in the overlay panel. 10659 * @private 10660 * @param {JQuery.TriggeredEvent} event The event of the keypress. 10661 */ 10662 highlightNext: function(event) { 10663 var activeItem = this.getActiveItem(), 10664 next = this.panel.is(':hidden') ? activeItem.nextAll(':not(.ui-state-disabled,.ui-selectonemenu-item-group):first') 10665 : activeItem.nextAll(':not(.ui-state-disabled,.ui-selectonemenu-item-group):visible:first'); 10666 10667 if(event.altKey) { 10668 this.show(); 10669 } 10670 else { 10671 if(next.length === 1) { 10672 if(this.panel.is(':hidden')) { 10673 this.selectItem(next); 10674 } 10675 else { 10676 this.highlightItem(next); 10677 PrimeFaces.scrollInView(this.itemsWrapper, next); 10678 this.focusInput.focus(); 10679 } 10680 this.changeAriaValue(next); 10681 } 10682 else { 10683 this.focusInput.focus(); 10684 } 10685 } 10686 10687 event.preventDefault(); 10688 }, 10689 10690 /** 10691 * Highlights the previous option before the currently highlighted option in the overlay panel. 10692 * @private 10693 * @param {JQuery.TriggeredEvent} event The event of the keypress. 10694 */ 10695 highlightPrev: function(event) { 10696 var activeItem = this.getActiveItem(), 10697 prev = this.panel.is(':hidden') ? activeItem.prevAll(':not(.ui-state-disabled,.ui-selectonemenu-item-group):first') 10698 : activeItem.prevAll(':not(.ui-state-disabled,.ui-selectonemenu-item-group):visible:first'); 10699 10700 if(prev.length === 1) { 10701 if(this.panel.is(':hidden')) { 10702 this.selectItem(prev); 10703 } 10704 else { 10705 this.highlightItem(prev); 10706 PrimeFaces.scrollInView(this.itemsWrapper, prev); 10707 this.focusInput.focus(); 10708 } 10709 this.changeAriaValue(prev); 10710 } 10711 else { 10712 this.filterInput.focus(); 10713 } 10714 10715 event.preventDefault(); 10716 }, 10717 10718 /** 10719 * Callback for when the enter key was pressed. Brings up the overlay panel or accepts the highlighted option. 10720 * @private 10721 * @param {JQuery.TriggeredEvent} event The event of the keypress. 10722 */ 10723 handleEnterKey: function(event) { 10724 if(this.panel.is(':visible')) { 10725 this.selectItem(this.getActiveItem()); 10726 event.preventDefault(); 10727 event.stopPropagation(); 10728 } else { 10729 return true; 10730 } 10731 }, 10732 10733 /** 10734 * Callback for when the space key was pressed. Brings up or hides the overlay panel. 10735 * @private 10736 * @param {JQuery.TriggeredEvent} event The event of the keypress. 10737 */ 10738 handleSpaceKey: function(event) { 10739 var target = $(event.target); 10740 10741 if(target.is('input') && target.hasClass('ui-selectonemenu-filter')) { 10742 return; 10743 } 10744 10745 if(this.panel.is(":hidden")) { 10746 this.show(); 10747 } 10748 else { 10749 this.hide(); 10750 10751 this.revert(); 10752 this.changeAriaValue(this.getActiveItem()); 10753 } 10754 10755 event.preventDefault(); 10756 }, 10757 10758 /** 10759 * Callback for when the escape key was pressed. Hides the overlay panel. 10760 * @private 10761 * @param {JQuery.TriggeredEvent} event The event of the keypress. 10762 */ 10763 handleEscapeKey: function(event) { 10764 if(this.panel.is(':visible')) { 10765 this.revert(); 10766 this.hide(); 10767 } 10768 10769 event.preventDefault(); 10770 }, 10771 10772 /** 10773 * Callback for when the tab key was pressed. Selects the next option. 10774 * @private 10775 */ 10776 handleTabKey: function() { 10777 if(this.panel.is(':visible')) { 10778 this.selectItem(this.getActiveItem()); 10779 } 10780 }, 10781 10782 /**
10783 * Callback that adjusts the label, invoked when the selected option has changed. 10784 * @private 10785 * @param {JQuery.TriggeredEvent} event The event that triggered the change. 10786 */ 10787 handleLabelChange: function(event) { 10788 this.customInput = true; 10789 this.customInputVal = $(event.target).val(); 10790 this.items.filter('.ui-state-active').removeClass('ui-state-active'); 10791 this.items.eq(0).addClass('ui-state-active'); 10792 }, 10793 10794 handleEndKey:function() { 10795 var item = this.items.last(); 10796 this.highlightItem(item); 10797 PrimeFaces.scrollInView(this.itemsWrapper, item); 10798 }, 10799 handleHomeKey:function() { 10800 var item = this.items.first(); 10801 this.highlightItem(item); 10802 PrimeFaces.scrollInView(this.itemsWrapper, item); 10803 }, 10804 handlePageUpKey:function(b) { 10805 var item = this.items.filter('.ui-state-highlight').prevAll().eq(2); 10806 if(item.length != 1) { 10807 item = this.items.first(); 10808 } 10809 this.highlightItem(item); 10810 PrimeFaces.scrollInView(this.itemsWrapper, item); 10811 b.preventDefault(); 10812 }, 10813 handlePageDownKey:function(b) { 10814 var item = this.items.filter('.ui-state-highlight').nextAll().eq(2); 10815 if(item.length != 1) { 10816 item = this.items.last(); 10817 } 10818 this.highlightItem(item); 10819 PrimeFaces.scrollInView(this.itemsWrapper, item); 10820 b.preventDefault(); 10821 }, 10822 // Event für Rück und Entf Taste bei fokus 10823 handleDelete:function (b) { 10824 this.show(); 10825 this.setLabel(' '); 10826 this.filterInput.val(''); 10827 b.preventDefault(); 10828 }, 10829 10830 /** 10831 * Brings up the overlay panel with the available selectable options. 10832 */ 10833 show: function() { 10834 this.callHandleMethod(this._show, null); 10835 }, 10836 10837 /** 10838 * Brings up the overlay panel with the available selectable options. Compared this `show`, this does not ensure 10839 * the the overlay panel is loaded already (when dynamic loading is enabled). 10840 * @private 10841 */ 10842 _show: function() { 10843 var $this = this; 10844 10845 if (this.transition) { 10846 this.transition.show({ 10847 onEnter: function() { 10848 $this.panel.css('z-index', 100 + PrimeFaces.nextZindex()); 10849 $this.alignPanel(); 10850 de.his.component.customtooltip.initHovertooltip(); 10851 }, 10852 onEntered: function() { 10853 $this.bindPanelEvents(); 10854 10855 //value before panel is shown 10856 $this.preShowValue = $this.options.filter(':selected'); 10857 $this.jq.attr('aria-expanded', true); 10858 10859 PrimeFaces.scrollInView($this.itemsWrapper, $this.getActiveItem()); 10860 10861 if ($this.cfg.filter) { 10862 $this.focusFilter(10); 10863 } 10864 } 10865 }); 10866 } 10867 }, 10868 10869 /** 10870 * Hides the overlay panel with the available selectable options. 10871 */ 10872 hide: function() { 10873 if (this.panel.is(':visible') && this.transition) { 10874 var $this = this; 10875 $this.isOpenedByKeydown = false; 10876 this.transition.hide({ 10877 onExit: function() { 10878 $this.unbindPanelEvents(); 10879 }, 10880 onExited: function() { 10881 $this.panel.css('z-index', ''); 10882 $this.jq.attr('aria-expanded', false); 10883 jQuery('.focusTooltip').remove(); 10884 } 10885 }); 10886 } 10887 }, 10888 10889 /** 10890 * Puts focus on this widget. 10891 */ 10892 focus: function() { 10893 this.focusInput.trigger('focus'); 10894 }, 10895 10896 /** 10897 * Puts focus on the filter input in the overlay panel. 10898 * @param {number} [timeout] Amount of time in milliseconds to wait before attempting to focus the input. 10899 */ 10900 focusFilter: function(timeout) { 10901 if(timeout) { 10902 var $this = this; 10903 setTimeout(function() { 10904 $this.focusFilter(); 10905 }, timeout); 10906 } 10907 else { 10908 this.filterInput.trigger('focus'); 10909 } 10910 }, 10911 10912 /** 10913 * Removes focus from this widget. 10914 */ 10915 blur: function() { 10916 this.focusInput.trigger("blur"); 10917
10918 this.callBehavior('blur'); 10919 }, 10920 10921 /** 10922 * Disables this widget so that the user cannot select any option. 10923 */ 10924 disable: function() { 10925 if (!this.disabled) { 10926 this.disabled = true; 10927 this.jq.addClass('ui-state-disabled'); 10928 this.input.attr('disabled', 'disabled'); 10929 if(this.cfg.editable) { 10930 this.label.attr('disabled', 'disabled'); 10931 } 10932 this.unbindEvents(); 10933 } 10934 }, 10935 10936 /** 10937 * Enables this widget so that the user can select an option. 10938 */ 10939 enable: function() { 10940 if (this.disabled) { 10941 this.disabled = false; 10942 this.jq.removeClass('ui-state-disabled'); 10943 this.input.removeAttr('disabled'); 10944 if(this.cfg.editable) { 10945 this.label.removeAttr('disabled'); 10946 } 10947 10948 this.bindEvents(); 10949 this.bindItemEvents(); 10950 } 10951 }, 10952 10953 /** 10954 * Align the overlay panel with the available selectable options so that is is positioned next to the the button. 10955 */ 10956 alignPanel: function() { 10957 this.alignPanelWidth(); 10958 10959 if(this.panel.parent().is(this.jq)) { 10960 this.panel.css({ 10961 left: '0px', 10962 top: this.jq.innerHeight() + 'px', 10963 'transform-origin': 'center top' 10964 }); 10965 } 10966 else { 10967 this.panel.css({left:'0px', top:'0px', 'transform-origin': 'center top'}).position({ 10968 my: 'left top' 10969 ,at: 'left bottom' 10970 ,of: this.jq 10971 ,collision: 'flipfit' 10972 ,using: function(pos, directions) { 10973 $(this).css('transform-origin', 'center ' + directions.vertical).css(pos); 10974 } 10975 }); 10976 } 10977 }, 10978 10979 /** 10980 * Sets the label text that indicates the currently selected item to the item with the given value. 10981 * @private 10982 * @param {string} value Value of the item that was selected. 10983 */ 10984 setLabel: function(value) { 10985 var displayedLabel = this.getLabelToDisplay(value); 10986 10987 if (this.cfg.editable) { 10988 if (value === ' ') 10989 this.label.val(''); 10990 else 10991 this.label.val(displayedLabel); 10992 10993 var hasPlaceholder = this.label[0].hasAttribute('placeholder'); 10994 this.updatePlaceholderClass((hasPlaceholder && value === ' ')); 10995 } 10996 else if (this.cfg.alwaysDisplayLabel && this.cfg.label) { 10997 this.label.text(this.cfg.label); 10998 } 10999 else { 11000 var labelText = this.label.data('placeholder'); 11001 if (labelText == null || labelText == "") { 11002 labelText = ' '; 11003 } 11004 11005 this.updatePlaceholderClass((value === ' ' && labelText !== ' ')); 11006 11007 if (value === ' ') { 11008 if (labelText != ' ') { 11009 this.label.text(labelText); 11010 } else { 11011 this.label.html(labelText); 11012 } 11013 } 11014 else { 11015 this.label.removeClass('ui-state-disabled'); 11016 11017 var option = null; 11018 if(this.items) { 11019 var selectedItem = this.items.filter('[data-label="' + $.escapeSelector(value) + '"]'); 11020 option = this.options.eq(this.resolveItemIndex(selectedItem)); 11021 } 11022 else { 11023 option = this.options.filter(':selected'); 11024 } 11025 11026 if (option && option.data('escape') === false) { 11027 this.label.html(displayedLabel); 11028 } else { 11029 this.label.text(displayedLabel); 11030 } 11031 } 11032 } 11033 }, 11034 11035 /** 11036 * Selects the option with the given value. 11037 * @param {string} value Value of the option to select. 11038 */ 11039 selectValue: function(value) { 11040 if(!this.items || this.items.length === 0) { 11041 this.callHandleMethod(null, null); 11042 } 11043 11044 var option = this.options.filter('[value="' + $.escapeSelector(value) + '"]'); 11045 11046 this.selectItem(this.items.eq(option.index()), true); 11047 }, 11048 11049 /** 11050 * Resets the input. 11051 * @param {boolean} silent `true` to suppress triggering event listeners, or `false` otherwise. 11052 */ 11053 resetValue: function(silent) { 11054 if(!this.items || this.items.length === 0) { 11055 this.callHandleMethod(null, null); 11056 } 11057 11058 var option = this.options.filter('[value=""]'); 11059 if (option.length === 0) { 11060 // if no empty value option found, fallback to first in list like JSF default 11061 option = this.options.eq(0); 11062 } 11063 this.selectItem(this.items.eq(option.index()), silent); 11064 }, 11065 11066 /** 11067 * Finds the element for the currently select option of this select one menu. 11068 * @return {JQuery} The DOM element that represents the currently selected option. 11069 */ 11070 getActiveItem: function() { 11071 return this.items.filter('.ui-state-highlight'); 11072 }, 11073 11074 /** 11075 * Finds and stores the filter function which is to be used for filtering the options of this select one menu. 11076 * @private 11077 */ 11078 setupFilterMatcher: function() { 11079 this.cfg.filterMatchMode = this.cfg.filterMatchMode||'startsWith'; 11080 this.filterMatchers = { 11081 'startsWith': this.startsWithFilter 11082 ,'contains': this.containsFilter 11083 ,'endsWith': this.endsWithFilter 11084 ,'custom': this.cfg.filterFunction 11085 }; 11086 11087 this.filterMatcher = this.filterMatchers[this.cfg.filterMatchMode]; 11088 }, 11089 11090 /** 11091 * Implementation of a `PrimeFaces.widget.SelectOneMenu.FilterFunction` that matches the given option when it starts 11092 * with the given search text. 11093 * @param {string} value Text of an option. 11094 * @param {string} filter Value of the filter. 11095 * @return {boolean} `true` when the text of the options starts with the filter value, or `false` otherwise. 11096 */ 11097 startsWithFilter: function(value, filter) { 11098 return value.indexOf(filter) === 0; 11099 }, 11100 11101 /** 11102 * Implementation of a `PrimeFaces.widget.SelectOneMenu.FilterFunction` that matches the given option when it 11103 * contains the given search text. 11104 * @param {string} value Text of an option. 11105 * @param {string} filter Value of the filter. 11106 * @return {boolean} `true` when the text of the contains the filter value, or `false` otherwise. 11107 */ 11108 containsFilter: function(value, filter) { 11109 return value.indexOf(filter) !== -1; 11110 }, 11111 11112 /** 11113 * Implementation of a `PrimeFaces.widget.SelectOneMenu.FilterFunction` that matches the given option when it ends 11114 * with the given search text. 11115 * @param {string} value Text of an option. 11116 * @param {string} filter Value of the filter. 11117 * @return {boolean} `true` when the text of the options ends with the filter value, or `false` otherwise. 11118 */ 11119 endsWithFilter: function(value, filter) { 11120 return value.indexOf(filter, value.length - filter.length) !== -1; 11121 }, 11122 11123 /** 11124 * Filters the available options in the overlay panel by the given search value. Note that this does not bring up 11125 * the overlay panel, use `show` for that. 11126 * @param {string} value A value against which the available options are matched. 11127 */ 11128 filter: function(value) { 11129 11130 var filterListStart = []; 11131 var filterListRest = []; 11132 var filtered = false;
11133 var filterGroupResult = []; 11134 11135 this.cfg.initialHeight = this.cfg.initialHeight||this.itemsWrapper.height(); 11136 var filterValue = this.cfg.caseSensitive ? PrimeFaces.trim(value) : PrimeFaces.trim(value).toLowerCase(); 11137 11138 if(filterValue === '') { 11139 11140 // HIS-Patch 11141 // Alle Listeneinträge in vorheriger Reihenfolge ausgeben 11142 //Array.from(this.items).forEach(li => this.itemsContainer.append(li)); 11143 var items = this.optGroupsSize == 0 ? this.items : this.itemsWithGroup; 11144 Array.from(items).forEach(li => this.itemsContainer.append(li)); 11145 11146 11147 this.items.filter(':hidden').show(); 11148 this.itemsContainer.children('.ui-selectonemenu-item-group').show(); 11149 } 11150 else { 11151 var hide = []; 11152 var show = []; 11153 11154 /*for(var i = 0; i < this.options.length; i++) { 11155 var option = this.options.eq(i),*/ 11156 var itemLength = this.optGroupsSize == 0 ? this.options.length : this.itemsWithGroup.length; 11157 for (var i = 0; i < itemLength; i++ ) { 11158 var option = this.optGroupsSize == 0 ? this.options.eq(i) : this.itemsWithGroup.eq(i), 11159 itemLabel = this.cfg.caseSensitive ? option.text() : option.text().toLowerCase(), 11160 //item = this.items.eq(i); 11161 item = this.optGroupsSize == 0 ? this.items.eq(i) : this.itemsWithGroup.eq(i); 11162 11163 if(item.hasClass('ui-noselection-option')) { 11164 hide.push(item); 11165 } 11166 else { 11167 /*if(this.filterMatcher(itemLabel, filterValue)) { 11168 // HIS-Patch 11169 // Gefilterte Einträge in Arrays aufteilen, "startsWith" und "contains" 11170 if(itemLabel.indexOf(filterValue) === 0) { 11171 filterListStart.push(item); 11172 } else { 11173 filterListRest.push(item); 11174 }*/ 11175 if(this.optGroupsSize == 0) { 11176 if (this.filterMatcher(itemLabel, filterValue)) { 11177 // HIS-Patch 11178 // Gefilterte Einträge in Arrays aufteilen, erst "startsWith" und dann "contains" 11179 if(itemLabel.indexOf(filterValue) === 0) { 11180 filterListStart.push(item); 11181 } else { 11182 filterListRest.push(item); 11183 } 11184 11185 show.push(item); 11186 //} 11187 } 11188 else { 11189 hide.push(item); 11190 } 11191 } 11192 else { 11193 // Items den Gruppen zuordnen 11194 if( item.hasClass('ui-selectonemenu-item-group') ) { 11195 var _this = this; 11196 11197 // Wenn keiner Gruppe zugeordnet 11198 if( !item.prevAll().hasClass('ui-selectonemenu-item-group') ) { 11199 item.prevAll().each(function(){ 11200 var $this = jQuery(this); 11201 var ing = _this.cfg.caseSensitive ? $this.text() : $this.text().toLowerCase(); 11202 if (_this.filterMatcher(ing, filterValue)) { 11203 $this.show(); 11204 } 11205 else { 11206 $this.hide(); 11207 } 11208 }); 11209 } 11210 11211 // innerhalb der Gruppen Filtern 11212 var itemsByGroup = item.nextUntil('.ui-selectonemenu-item-group'); 11213 var groupResult = {group: null,items: null}; 11214 var filterGroupStart = []; 11215 var filterGroupRest = []; 11216 itemsByGroup.each(function(){ 11217 var $this = jQuery(this); 11218 var ibg = _this.cfg.caseSensitive ? $this.text() : $this.text().toLowerCase(); 11219 if (_this.filterMatcher(ibg, filterValue)) { 11220 11221 if( groupResult.group != itemLabel ) { 11222 groupResult = {group:itemLabel}; 11223 } 11224 if(ibg.indexOf(filterValue) === 0) { 11225 filterGroupStart.push($this); 11226 } else { 11227 filterGroupRest.push($this); 11228 } 11229 $this.show(); 11230 } else { 11231 $this.hide(); 11232 } 11233 }); 11234 11235 if( groupResult.group == itemLabel ) { 11236 groupResult = {group:itemLabel, items:filterGroupStart.concat(filterGroupRest)}
11236; 11237 groupResult.items.unshift(item); 11238 filterGroupResult.push(groupResult); 11239 } 11240 11241 11242 if ( this.cfg.caseSensitive ? item.text() : item.text().toLowerCase() == groupResult.group ) { 11243 item.show(); 11244 } else { 11245 item.hide(); 11246 } 11247 } 11248 11249 } 11250 11251 } 11252 } 11253 11254 $.each(hide, function(i, o) { o.hide(); }); 11255 $.each(show, function(i, o) { o.show(); }); 11256 hide = []; 11257 show = []; 11258 11259 11260 // HIS-Patch 11261 if(this.optGroupsSize == 0) { 11262 var filterResult = filterListStart.concat(filterListRest); 11263 if( filterResult.length > 0 ) { 11264 filtered = true; 11265 filterResult.forEach(li => this.itemsContainer.append(li)); 11266 this.highlightItem(filterResult[0]); 11267 PrimeFaces.scrollInView(this.itemsWrapper, filterResult[0]); 11268 } 11269 } else { 11270 if( filterGroupResult.length > 0 ) { 11271 filtered = true; 11272 filterGroupResult.forEach(fgr => fgr.items.forEach(li => this.itemsContainer.append(li)) ); 11273 this.highlightItem(filterGroupResult[0].items[1]); 11274 PrimeFaces.scrollInView(this.itemsWrapper, filterGroupResult[0].items[0]); 11275 } 11276 11277 } 11278 11279 11280 11281 //Toggle groups 11282 var groups = this.itemsContainer.children('.ui-selectonemenu-item-group'); 11283 for(var g = 0; g < groups.length; g++) { 11284 var group = groups.eq(g); 11285 11286 if(g === (groups.length - 1)) { 11287 if(group.nextAll().filter(':visible').length === 0) 11288 hide.push(group); 11289 else 11290 show.push(group); 11291 } 11292 else { 11293 if(group.nextUntil('.ui-selectonemenu-item-group').filter(':visible').length === 0) 11294 hide.push(group); 11295 else 11296 show.push(group); 11297 } 11298 } 11299 11300 $.each(hide, function(i, o) { o.hide(); }); 11301 $.each(show, function(i, o) { o.show(); }); 11302 } 11303 11304 var firstVisibleItem = this.items.filter(':visible:not(.ui-state-disabled):first'); 11305 if(firstVisibleItem.length && !filtered) { 11306 this.highlightItem(firstVisibleItem); 11307 } 11308 filtered = false; 11309 if(this.itemsContainer.height() < this.cfg.initialHeight) { 11310 this.itemsWrapper.css('height', 'auto'); 11311 } 11312 else { 11313 this.itemsWrapper.height(this.cfg.initialHeight); 11314 } 11315 11316 this.alignPanel(); 11317 }, 11318 11319 /** 11320 * Finds the value of the currently selected item, if any. 11321 * @return {string} The value of the currently selected item. Empty string if none is selected. 11322 */ 11323 getSelectedValue: function() { 11324 return this.input.val(); 11325 }, 11326 11327 /** 11328 * Finds the label of the currently selected item, if any. 11329 * @return {string} The label of the currently selected item. Empty string if none is selected. 11330 */ 11331 getSelectedLabel: function() { 11332 return this.options.filter(':selected').text(); 11333 }, 11334 11335 /** 11336 * Finds the label of the option with the given value. 11337 * @private 11338 * @param {string} value The value of a selectable option. 11339 * @return {string} The label of the option with the given value. 11340 */ 11341 getLabelToDisplay: function(value) { 11342 if(this.cfg.labelTemplate && value !== ' ') { 11343 return this.cfg.labelTemplate.replace('{0}', value); 11344 } 11345 return String(value); 11346 }, 11347 11348 /** 11349 * Adjusts the value of the aria attributes for the given selectable option. 11350 * @private 11351 * @param {JQuery} item An option for which to set the aria attributes. 11352 */ 11353 changeAriaValue: function (item) { 11354 var itemId = item.attr('id'); 11355 11356 this.focusInput.attr('aria-activedescendant', itemId) 11357 .attr('aria-describedby', itemId); 11358 this.itemsContainer.attr('aria-activedescendant', itemId); 11359 }, 11360 11361 /** 11362 * Loads the overlay panel with the selectable options, if dynamic mode is enabled. 11363 * @private 11364 */ 11365 dynamicPanelLoad: function() { 11366 var $this = this, 11367 options = { 11368 source: this.id, 11369 process: this.id, 11370 update: this.id, 11371 global: false, 11372 params: [{name: this.id + '_dynamicload', value: true}], 11373 onsuccess: function(responseXML, status, xhr) { 11374 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 11375 widget: $this, 11376 handle: function(content) { 11377 var $content = $($.parseHTML(content)); 11378 11379 var $ul = $content.filter('ul'); 11380 $this.itemsWrapper.empty(); 11381 $this.itemsWrapper.append($ul); 11382 11383 var $select = $content.filter('select'); 11384 $this.input.replaceWith($select); 11385 } 11386 }); 11387 11388 return true; 11389 }, 11390 oncomplete: function(xhr, status, args, data) { 11391 $this.isDynamicLoaded = true; 11392 $this.input = $($this.jqId + '_input'); 11393 $this.options = $this.input.children('option'); 11394 11395 $this.renderPanelContentFromHiddenSelect(false); 11396 11397 $this.initContents(); 11398 $this.bindItemEvents(); 11399 } 11400 }; 11401 11402 PrimeFaces.ajax.Request.handle(options); 11403 }, 11404 11405 /** 11406 * Invokes the given method after making sure that the overlay panel was loaded (in case dynamic mode is enabled). 11407 * @private 11408 * @param {(this: PrimeFaces.widget.SelectOneMenu, event: JQuery.TriggeredEvent) => void} handleMethod Callback method to 11409 * invoke after the dynamic overlay panel was loaded. 11410 * @param {JQuery.TriggeredEvent} event An event that is passed to the callback. 11411 */ 11412 callHandleMethod: function(handleMethod, event) { 11413 var $this = this; 11414 if(this.cfg.dynamic && !this.isDynamicLoaded) { 11415 this.dynamicPanelLoad(); 11416 11417 var interval = setInterval(function() { 11418 if($this.isDynamicLoaded) { 11419 if (handleMethod) { 11420 handleMethod.call($this, event); 11421 } 11422 11423 clearInterval(interval); 11424 } 11425 }, 10); 11426 } 11427 else { 11428 this.renderPanelContentFromHiddenSelect(true); 11429 11430 if (handleMethod) { 11431 handleMethod.call(this, event); 11432 } 11433 } 11434 }, 11435 11436 /**
11437 * Renders panel content based on hidden select. 11438 * @private 11439 * @param {boolean} initContentsAndBindItemEvents `true` to call {@link initContents} and {@link bindItemEvents} 11440 * after rendering, `false` otherwise. 11441 */ 11442 renderPanelContentFromHiddenSelect: function(initContentsAndBindItemEvents) { 11443 if (this.cfg.renderPanelContentOnClient && this.itemsWrapper.children().length === 0) { 11444 11445 //filter 11446 if (this.cfg.filter) { 11447 this.cfg.initialHeight = this.itemsWrapper.height(); 11448 this.setupFilterMatcher(); 11449 this.filterInput = this.panel.find('> div.ui-selectonemenu-filter-container > input.ui-selectonemenu-filter'); 11450 PrimeFaces.skinInput(this.filterInput); 11451 11452 this.bindFilterEvents(); 11453 } 11454 11455 PrimeFaces.utils.registerDynamicOverlay(this, this.panel, this.id + '_panel'); 11456 11457 var panelContent = jQuery('<ul/>').attr('id', this.id + '_items').addClass('ui-selectonemenu-items ui-selectonemenu-list ui-widget-content ui-widget ui-corner-all ui-helper-reset').attr('role', 'listbox'); 11458 panelContent.append(this.renderSelectItems(this.input)).html(); 11459 11460 this.itemsWrapper.append(panelContent); 11461 11462 if (initContentsAndBindItemEvents) { 11463 this.initContents(); 11464 this.bindItemEvents(); 11465 } 11466 } 11467 }, 11468 11469 /** 11470 * Renders panel HTML-code for all select items. 11471 * @private 11472 * @param {JQuery} parentItem A parent item (select, optgroup) for which to render HTML code. 11473 * @param {boolean} [isGrouped] Indicated whether the elements of the parent item should be marked as grouped. 11474 * @return {string} The rendered HTML string. 11475 */ 11476 renderSelectItems: function(parentItem, isGrouped) { 11477 var $this = this; 11478 var content = new Array(); 11479 isGrouped = isGrouped || false; 11480 11481 var opts = parentItem.children("option, optgroup"); 11482 opts.each(function(index, element) { 11483 content.push($this.renderSelectItem(element, isGrouped)); 11484 }); 11485 return content; 11486 }, 11487 11488 /** 11489 * Renders panel HTML code for one select item (group). 11490 * @private 11491 * @param {JQuery} item An option (group) for which to render HTML code. 11492 * @param {boolean} [isGrouped] Indicates whether the item is part of a group. 11493 * @return {string} The rendered HTML string. 11494 */ 11495 renderSelectItem: function(item, isGrouped) { 11496 var content = ""; 11497 var $item = $(item); 11498 var label; 11499 var title = $item.data("title"); 11500 var escape = $item.data("escape"); 11501 var cssClass; 11502 11503 if (item.tagName === "OPTGROUP") { 11504 label = $item.attr("label"); 11505 if (escape) { 11506 label = $("<div>").text(label).html(); 11507 } 11508 cssClass = "ui-selectonemenu-item-group ui-corner-all"; 11509 } 11510 else { //OPTION 11511 if (escape) { 11512 label = $item.html(); 11513 if ($item.text() === " ") { 11514 label = $item.text(); 11515 } 11516 } 11517 else { 11518 label = $item.text(); 11519 } 11520 cssClass = "ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all"; 11521 if (isGrouped) { 11522 cssClass += " ui-selectonemenu-item-group-children"; 11523 } 11524 } 11525 11526 var dataLabel = label.replace(/(<([^>]+)>)/gi, "").replaceAll('"', '"'); 11527 var dataValue = $item[0].value; 11528 if ($item.data("noselection-option")) { 11529 cssClass += " ui-noselection-option"; 11530 } 11531 11532 var $li = jQuery('<li data-label="'+dataLabel+'">'+label+'</li>'); 11533 $li.addClass(cssClass).attr('tabindex', '-1').attr('role', 'option').attr('title', title).attr('data-itemValue', dataValue); 11534 11535 if ($item.is(':disabled')) { 11536 $li.attr('disabled','disabled'); 11537 } 11538 if (item.tagName === "OPTGROUP") { 11539 var arr; 11540 var li; 11541 this.renderSelectItems($item, true).forEach(function(el){ 11542 arr += el.prop('outerHTML'); 11543 }); 11544 li = $li.prop('outerHTML'); 11545 li += arr; 11546 $li = jQuery(li).filter(function(){ return this.nodeValue != 'undefined'; }); 11547 } 11548 return $li; 11549 11550 }, 11551 11552 11553 /** 11554 * Updates the style class of the label that indicates the currently selected item. 11555 * @param {boolean} add `true` if a placeholder should be displayed, or `false` otherwise. 11556 */ 11557 updatePlaceholderClass: function(add) { 11558 if (add) { 11559 this.label.addClass('ui-selectonemenu-label-placeholder'); 11560 } 11561 else { 11562 this.label.removeClass('ui-selectonemenu-label-placeholder'); 11563 } 11564 } 11565 11566 }); 11567 } 11568}; 11569 'use strict'; 11570 11571use_package("de.his.component"); 11572 11573de.his.component.PrimeAccordeon = new function() { 11574 de.his.modules.ModuleRegistry 11575 .registerModule(this) 11576 .registerAjaxRefreshModule(this); 11577 this.moduleName = "de.his.component.PrimeAccordeon"; 11578 11579 11580 this.init = function() { 11581 if (window.PrimeFaces) { 11582 PrimeFaces.widget.AccordionPanel(); 11583 } 11584 } 11585 11586 this.refresh = function() { 11587 this.init(); 11588 }; 11589 11590 if (window.PrimeFaces) { 11591 /// START PrimeFaces-Komponente /// 11592 PrimeFaces.widget.AccordionPanel = PrimeFaces.widget.DeferredWidget.extend({ 11593 11594 /** 11595 * @override 11596 * @inheritdoc
11597 * @param {PrimeFaces.PartialWidgetCfg<TCfg>} cfg 11598 */ 11599 init(cfg) { 11600 this._super(cfg); 11601 11602 this.stateHolder = $(this.jqId + '_active'); 11603 this.headers = this.jq.children('.ui-accordion-header'); 11604 this.panels = this.jq.children('.ui-accordion-content'); 11605 this.cfg.rtl = this.jq.hasClass('ui-accordion-rtl'); 11606 this.cfg.expandedIcon = 'ui-icon-triangle-1-s'; 11607 this.cfg.collapsedIcon = this.cfg.rtl ? 'ui-icon-triangle-1-w' : 'ui-icon-triangle-1-e'; 11608 11609 this.initActive(); 11610 this.bindEvents(); 11611 11612 if (this.cfg.dynamic && this.cfg.cache) { 11613 this.markLoadedPanels(); 11614 } 11615 }, 11616 11617 /** 11618 * Called when this accordion panel is initialized. Reads the selected panels from the saved state, see also 11619 * `saveState`. 11620 * @private 11621 */ 11622 initActive() { 11623 var stateHolderVal = this.stateHolder.val(); 11624 if (this.cfg.multiple) { 11625 this.cfg.active = []; 11626 11627 if (stateHolderVal != null && stateHolderVal.length > 0) { 11628 var activated = this.stateHolder.val().split(','); 11629 for (const active of activated) { 11630 this.cfg.active.push(active); 11631 } 11632 } 11633 } 11634 else if (stateHolderVal != null) { 11635 this.cfg.active = this.stateHolder.val(); 11636 } 11637 11638 this.headers.each(function() { 11639 var containerId = PrimeFaces.escapeClientId(this.id.replace('_header', '')); 11640 if ($(containerId + ' .ui-state-error').length > 0 || $(containerId + ' .ui-message-error-detail').length > 0) { 11641 $(this).addClass('ui-state-error'); 11642 } else { 11643 $(this).removeClass('ui-state-error'); 11644 } 11645 }); 11646 }, 11647 11648 /** 11649 * Binds all event listeners required by this accordion panel. 11650 * @private 11651 */ 11652 bindEvents() { 11653 var $this = this; 11654 11655 this.headers.on("mouseover", function() { 11656 var element = $(this); 11657 if (!element.hasClass('ui-state-active') && !element.hasClass('ui-state-disabled')) { 11658 element.addClass('ui-state-hover'); 11659 } 11660 }).on("mouseout", function() { 11661 var element = $(this); 11662 if (!element.hasClass('ui-state-active') && !element.hasClass('ui-state-disabled')) { 11663 element.removeClass('ui-state-hover'); 11664 } 11665 }).on("click", function(e) { 11666 var header = $(this); 11667 if (!header.hasClass('ui-state-disabled')) { 11668 var tabIndex = $this.headers.index(header); 11669 11670 if (header.hasClass('ui-state-active')) { 11671 $this.unselect(tabIndex); 11672 } 11673 else { 11674 $this.select(tabIndex); 11675 header.trigger('focus.accordion'); 11676 11677 if ($this.cfg.scrollIntoView) { 11678 // 300 ms delay is so the content actually exists that we are trying to scroll to 11679 PrimeFaces.queueTask(function() { 11680 header.next()[0].scrollIntoView({ 11681 behavior: "smooth", 11682 block: $this.cfg.scrollIntoView, 11683 inline: "center" 11684 }); 11685 }, 300); 11686 } 11687 } 11688 } 11689 11690 e.preventDefault(); 11691 }); 11692 11693 this.bindKeyEvents(); 11694 }, 11695 11696 /** 11697 * Sets up all event listeners for keyboard interactions. 11698 * @private 11699 */ 11700 bindKeyEvents() { 11701 var $this = this; 11702 this.headers.on({ 11703 'focus.accordion': function() { 11704 $(this).addClass('ui-tabs-outline'); 11705 }, 11706 'blur.accordion': function() { 11707 $(this).removeClass('ui-tabs-outline'); 11708 }, 11709 'keydown.accordion': function(e) { 11710 var currentHeader = $(this); 11711 var index = 0; 11712 switch (e.code) { 11713 case 'Enter': 11714 case 'NumpadEnter': 11715 case 'Space': 11716 currentHeader.trigger('click'); 11717 e.preventDefault(); 11718 break; 11719 case 'PageUp': 11720 case 'Home': 11721 $this.headers.first().trigger('focus'); 11722 e.preventDefault(); 11723 break; 11724 case 'PageDown': 11725 case 'End': 11726 $this.headers.last().trigger('focus'); 11727 e.preventDefault(); 11728 break; 11729 case 'ArrowDown': 11730 index = $this.headers.index(currentHeader) + 1; 11731 while (index < $this.headers.length && !$this.headers.eq(index).is(':visible')) { 11732 index++; 11733 } 11734 if (index < $this.headers.length) { 11735 $this.headers.eq(index).trigger('focus'); 11736 } 11737 e.preventDefault(); 11738 break; 11739 11740 case 'ArrowUp': 11741 index = $this.headers.index(currentHeader) - 1; 11742 while (index < $this.headers.length && !$this.headers.eq(index).is(':visible')) { 11743 index--; 11744 } 11745 if (index >= 0) { 11746 $this.headers.eq(index).trigger('focus'); 11747 } 11748 e.preventDefault(); 11749 break; 11750 }; 11751 } 11752 }); 11753 }, 11754 11755 /** 11756 * Marks the currently active panels as loaded; their content does not need to be retrieved from the server anymore. 11757 * @private 11758 */ 11759 markLoadedPanels() { 11760 const markPanelAsLoaded = (index) => { 11761 if (index >= 0) { 11762 this.markAsLoaded(this.panels.eq(index)); 11763 } 11764 }; 11765 11766 if (this.cfg.multiple) { 11767 this.cfg.active.forEach(markPanelAsLoaded); 11768 } else { 11769 markPanelAsLoaded(this.cfg.active); 11770 } 11771 }, 11772 11773 /** 11774 * Activates (opens) the tab with given index. This may fail by returning `false`, such 11775 * as when a callback is registered that prevent the tab from being opened. 11776 * @param {number} index 0-based index of the tab to open. Must not be out of range. 11777 * @return {boolean} `true` when the given panel is now active, `false` otherwise. 11778 */ 11779 select(index) { 11780 var panel = this.panels.eq(index), 11781 header = panel.prev(); 11782 11783 // don't select already selected panel 11784 if (header.hasClass('ui-state-active')) { 11785 return; 11786 } 11787 11788 //Call user onTabChange callback 11789 if (this.cfg.onTabChange) { 11790 var result = this.cfg.onTabChange.call(this, panel); 11791 if (result === false) 11792 return false;
11793 } 11794 11795 var shouldLoad = this.cfg.dynamic && !this.isLoaded(panel); 11796 11797 let key = header.attr('data-key') ?? index; 11798 11799 //update state 11800 if (this.cfg.multiple) 11801 this.addToSelection(key); 11802 else 11803 this.cfg.active = key; 11804 11805 this.saveState(); 11806 11807 if (shouldLoad) { 11808 this.loadDynamicTab(panel); 11809 } 11810 else if (this.cfg.controlled) { 11811 this.fireTabChangeEvent(panel); 11812 } 11813 else { 11814 this.show(panel); 11815 this.fireTabChangeEvent(panel); 11816 } 11817 11818 return true; 11819 }, 11820 11821 /** 11822 * Activates (opens) all the tabs if multiple mode is enabled and the first tab in single mode. 11823 */ 11824 selectAll() { 11825 var $this = this; 11826 this.panels.each(function(index) { 11827 $this.select(index); 11828 11829 if (!$this.cfg.multiple) { 11830 return false; // breaks 11831 } 11832 }); 11833 }, 11834 11835 /** 11836 * Deactivates (closes) the tab with given index. 11837 * @param {number} index 0-based index of the tab to close. Must not be out of range. 11838 */ 11839 unselect(index) { 11840 var panel = this.panels.eq(index), 11841 header = panel.prev(); 11842 11843 // don't unselect already unselected panel 11844 if (!header.hasClass('ui-state-active')) { 11845 return; 11846 } 11847 11848 if (!this.cfg.controlled) { 11849 this.hide(index); 11850 } 11851 11852 this.fireTabCloseEvent(index); 11853 }, 11854 11855 /** 11856 * Deactivates (closes) all the tabs. 11857 */ 11858 unselectAll() { 11859 var $this = this; 11860 this.panels.each(function(index) { 11861 $this.unselect(index); 11862 }); 11863 }, 11864 11865 /** 11866 * Hides other panels and makes the given panel visible, such as by adding or removing the appropriate CSS classes. 11867 * @private 11868 * @param {JQuery} panel A tab panel to show. 11869 */ 11870 show(panel) { 11871 // HIS-Patch 11872 // waiting initialisieren 11873 de.his.modules.Waiting.executeShortWaiting(); 11874 var $this = this; 11875 //deactivate current 11876 if (!this.cfg.multiple) { 11877 var oldHeader = this.headers.filter('.ui-state-active'); 11878 oldHeader.children('.ui-icon').removeClass(this.cfg.expandedIcon).addClass(this.cfg.collapsedIcon); 11879 oldHeader.attr('aria-expanded', false).removeClass('ui-state-active') 11880 .next().attr('aria-hidden', true).slideUp(this.cfg.toggleSpeed, function() { 11881 if ($this.cfg.onTabClose) 11882 $this.cfg.onTabClose.call($this, panel); 11883 }); 11884 } 11885 11886 //activate selected 11887 var newHeader = panel.prev(); 11888 newHeader.attr('aria-expanded', true).addClass('ui-state-active').removeClass('ui-state-hover') 11889 .children('.ui-icon').removeClass(this.cfg.collapsedIcon).addClass(this.cfg.expandedIcon); 11890 11891 panel.attr('aria-hidden', false).slideDown(this.cfg.toggleSpeed, function() { 11892 $this.postTabShow(panel); 11893 }); 11894 // HIS-Patch 11895 // waiting refreshen 11896 de.his.modules.Waiting.refresh(); 11897 }, 11898 11899 /** 11900 * Hides one of the panels of this accordion. 11901 * @private 11902 * @param {number} index 0-based index of the panel to hide. 11903 */ 11904 hide(index) { 11905 // HIS-Patch 11906 // waiting initialisieren 11907 de.his.modules.Waiting.executeShortWaiting(); 11908 var $this = this, 11909 panel = this.panels.eq(index), 11910 header = panel.prev(); 11911 11912 header.attr('aria-expanded', false).children('.ui-icon').removeClass(this.cfg.expandedIcon).addClass(this.cfg.collapsedIcon); 11913 header.removeClass('ui-state-active'); 11914 panel.attr('aria-hidden', true).slideUp(this.cfg.toggleSpeed, function() { 11915 if ($this.cfg.onTabClose) 11916 $this.cfg.onTabClose.call($this, panel); 11917 }); 11918 11919 let key = header.attr('data-key') ?? index; 11920 11921 this.removeFromSelection(key); 11922 this.saveState(); 11923 // HIS-Patch 11924 // waiting refreshen 11925 de.his.modules.Waiting.refresh(); 11926 }, 11927 11928 /** 11929 * The content of a tab panel may be loaded dynamically on demand via AJAX. This method loads the content of the 11930 * given tab. Make sure to check first that this widget has got a dynamic tab panel (see 11931 * {@link AccordionPanelCfg.dynamic}) and that the given tab panel is not loaded already (see {@link isLoaded}). 11932 * @param {JQuery} panel A tab panel to load. 11933 */ 11934 loadDynamicTab(panel) { 11935 var $this = this, 11936 options = { 11937 source: this.id, 11938 process: this.id, 11939 update: this.id,
11940 ignoreAutoUpdate: true, 11941 params: [ 11942 { name: this.id + '_contentLoad', value: true }, 11943 { name: this.id + '_currentTab', value: panel.attr('id') }, 11944 { name: this.id + '_tabindex', value: parseInt(panel.index() / 2) }, 11945 { name: this.id + '_active', value: this.cfg.active } // #13551: normally set through hidden state input but necessary here for accordion not wrapped in form 11946 ], 11947 onsuccess: function(responseXML, status, xhr) { 11948 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 11949 widget: $this, 11950 handle: function(content) { 11951 panel.html(content); 11952 11953 if (this.cfg.cache) { 11954 this.markAsLoaded(panel); 11955 } 11956 } 11957 }); 11958 11959 return true; 11960 }, 11961 oncomplete: function() { 11962 $this.show(panel); 11963 } 11964 }; 11965 11966 if (this.hasBehavior('tabChange')) { 11967 this.callBehavior('tabChange', options); 11968 } 11969 else { 11970 PrimeFaces.ajax.Request.handle(options); 11971 } 11972 }, 11973 11974 /** 11975 * Handles the event listeners and behaviors when switching to a different tab. 11976 * @private 11977 * @param {JQueryStatic} panel The tab which is now active. 11978 */ 11979 fireTabChangeEvent(panel) { 11980 if (this.hasBehavior('tabChange')) { 11981 var ext = { 11982 params: [ 11983 { name: this.id + '_currentTab', value: panel.attr('id') }, 11984 { name: this.id + '_tabindex', value: parseInt(panel.index() / 2) } 11985 ] 11986 }; 11987 11988 if (this.cfg.controlled) { 11989 var $this = this; 11990 ext.oncomplete = function(xhr, status, args, data) { 11991 if (args.access && !args.validationFailed) { 11992 $this.show(panel); 11993 } 11994 }; 11995 } 11996 11997 this.callBehavior('tabChange', ext); 11998 } 11999 else if (this.cfg.multiViewState) { 12000 var options = { 12001 source: this.id, 12002 partialSubmit: true, 12003 process: this.id, 12004 ignoreAutoUpdate: true, 12005 global: false, 12006 params: [ 12007 { name: this.id + '_skipChildren', value: true }, 12008 { name: this.id + '_currentTab', value: panel.attr('id') }, 12009 { name: this.id + '_tabindex', value: parseInt(panel.index() / 2) } 12010 ] 12011 }; 12012 12013 PrimeFaces.ajax.Request.handle(options); 12014 } 12015 }, 12016 12017 /** 12018 * Handles the event listeners and behaviors when a tab was closed. 12019 * @private 12020 * @param {number} index 0-based index of the closed tab. 12021 */ 12022 fireTabCloseEvent(index) { 12023 var panel = this.panels.eq(index); 12024 if (this.hasBehavior('tabClose')) { 12025 var ext = { 12026 params: [ 12027 { name: this.id + '_currentTab', value: panel.attr('id') }, 12028 { name: this.id + '_tabindex', value: parseInt(index) } 12029 ] 12030 }; 12031 12032 if (this.cfg.controlled) { 12033 var $this = this; 12034 ext.oncomplete = function(xhr, status, args, data) { 12035 if (args.access && !args.validationFailed) { 12036 $this.hide(index); 12037 } 12038 }; 12039 } 12040 12041 this.callBehavior('tabClose', ext); 12042 } 12043 else if (this.cfg.multiViewState) { 12044 var options = { 12045 source: this.id, 12046 partialSubmit: true, 12047 process: this.id,
12048 ignoreAutoUpdate: true, 12049 global: false, 12050 params: [ 12051 { name: this.id + '_skipChildren', value: true }, 12052 { name: this.id + '_currentTab', value: panel.attr('id') }, 12053 { name: this.id + '_tabindex', value: parseInt(index) } 12054 ] 12055 }; 12056 12057 PrimeFaces.ajax.Request.handle(options); 12058 } 12059 }, 12060 12061 /** 12062 * When loading tab content dynamically, marks the content as loaded. 12063 * @private 12064 * @param {JQuery} panel A panel of this accordion that was loaded. 12065 */ 12066 markAsLoaded(panel) { 12067 panel.data('loaded', true); 12068 }, 12069 12070 /** 12071 * The content of a tab panel may be loaded dynamically on demand via AJAX. This method checks whether the content 12072 * of a tab panel is currently loaded. 12073 * @param {JQuery} panel A tab panel to check. 12074 * @return {boolean} `true` if the content of the tab panel is loaded, `false` otherwise. 12075 */ 12076 isLoaded(panel) { 12077 return panel.data('loaded') === true; 12078 }, 12079 12080 /** 12081 * Adds the given panel node to the list of currently selected nodes. 12082 * @private 12083 * @param {string} nodeId ID of a panel node. 12084 */ 12085 addToSelection(nodeId) { 12086 this.cfg.active.push(nodeId); 12087 }, 12088 12089 /** 12090 * Removes the given panel node from the list of currently selected nodes. 12091 * @private 12092 * @param {string} nodeId ID of a panel node. 12093 */ 12094 removeFromSelection(nodeId) { 12095 this.cfg.active = $.grep(this.cfg.active, function(r) { 12096 return r != nodeId; 12097 }); 12098 }, 12099 12100 /** 12101 * Saves the current state of this widget, used for example to preserve the state during AJAX updates. 12102 * @private 12103 */ 12104 saveState() { 12105 if (this.cfg.multiple) 12106 this.stateHolder.val(this.cfg.active.join(',')); 12107 else 12108 this.stateHolder.val(this.cfg.active); 12109 }, 12110 12111 /** 12112 * Handles event listeners and behaviors when switching to a different tab. 12113 * @private 12114 * @param {JQuery} newPanel The new tab the is shown. 12115 */ 12116 postTabShow(newPanel) { 12117 //Call user onTabShow callback 12118 if (this.cfg.onTabShow) { 12119 this.cfg.onTabShow.call(this, newPanel); 12120 } 12121 12122 PrimeFaces.invokeDeferredRenders(this.id); 12123 } 12124 12125 }); 12126 } 12127}; 'use strict'; 12128 12129use_package("de.his.component"); 12130 12131de.his.component.PrimeTreetable = new function() { 12132 de.his.modules.ModuleRegistry 12133 .registerModule(this) 12134 .registerAjaxRefreshModule(this); 12135 this.moduleName = "de.his.component.PrimeTreetable"; 12136 12137 var defaultAriaLabel = ''; 12138 var initialized = false; 12139 12140 this.init = function() { 12141 if (window.PrimeFaces) { 12142 PrimeFaces.widget.TreeTable(); 12143 } 12144 } 12145 12146 this.refresh = function() { 12147 this.init(); 12148 }; 12149 12150 if (window.PrimeFaces) { 12151 /// START PrimeFaces-Komponente /// 12152 PrimeFaces.widget.TreeTable = PrimeFaces.widget.DeferredWidget.extend({ 12153 12154 /** 12155 * Map between the sort order names and the multiplier for the comparator. 12156 * @protected 12157 * @type {Record<PrimeFaces.widget.DataTable.SortOrder, -1 | 0 | 1>} 12158 */ 12159 SORT_ORDER: { 12160 ASCENDING: 1, 12161 DESCENDING: -1, 12162 UNSORTED: 0 12163 }, 12164 12165 /** 12166 * @override 12167 * @inheritdoc 12168 * @param {PrimeFaces.PartialWidgetCfg<TCfg>} cfg 12169 */ 12170 init: function(cfg) { 12171 this._super(cfg); 12172 this.thead = $(this.jqId + '_head'); 12173 this.tbody = $(this.jqId + '_data'); 12174 this.cfg.expandMode = this.cfg.expandMode||"children"; 12175 12176 this.renderDeferred(); 12177 12178 this.markActiveNode(); 12179 de.his.component.TreetableFocus.lastClickedButtonHandler(); 12180 }, 12181 12182 markActiveNode: function() { 12183 var theTreeContainer = $(this.jqId); 12184 markVisibleTreeNodes(theTreeContainer); 12185 }, 12186 12187 /** 12188 * @include 12189 * @override 12190 * @protected 12191 * @inheritdoc 12192 */ 12193 _render: function() { 12194 if(this.cfg.scrollable) { 12195 this.setupScrolling(); 12196 } 12197 12198 if(this.cfg.filter) { 12199 this.setupFiltering(); 12200 } 12201 12202 if(this.cfg.resizableColumns) { 12203 this.resizableStateHolder = $(this.jqId + '_resizableColumnState'); 12204 this.resizableState = []; 12205 12206 if(this.resizableStateHolder.attr('value')) { 12207 this.resizableState = this.resizableStateHolder.val().split(','); 12208 } 12209 12210 this.setupResizableColumns(); 12211 } 12212 12213 if(this.cfg.stickyHeader) { 12214 this.setupStickyHeader(); 12215 } 12216 12217 if(this.cfg.editable) { 12218 this.bindEditEvents(); 12219 } 12220 12221 this.bindEvents(); 12222 }, 12223 12224 /** 12225 * @override 12226 * @inheritdoc
12227 * @param {PrimeFaces.PartialWidgetCfg<TCfg>} cfg 12228 */ 12229 refresh: function(cfg) { 12230 this.columnWidthsFixed = false; 12231 this.scrollStateVal = this.scrollStateHolder ? this.scrollStateHolder.val() : null; 12232 12233 this._super(cfg); 12234 }, 12235 12236 /** 12237 * Sets up all event listeners that are required by this widget. 12238 * @private 12239 */ 12240 bindEvents: function() { 12241 var $this = this, 12242 treeTogglerSelector = '> tr > td > .ui-treetable-toggler'; 12243 12244 jQuery('.treetableBreadcrumb').off('click', '.treetableBreadcrumb-node:not(.previous):not(:last)').on('click', '.treetableBreadcrumb-node:not(.previous):not(:last)', function(){ 12245 var $this = jQuery(this); 12246 var dataRk = $this.attr('data-rk'); 12247 12248 $this.closest('.ui-treetable').find('.ui-widget-content[data-rk="' + dataRk + '"]').find('.ui-treetable-toggler').trigger('click'); 12249 }); 12250 12251 // Ein Klick auf den zurück-Button entspricht einem schlieÃenden click auf dem Aktiven Knoten 12252 jQuery('.breadcrumb-container').off('click', '.breadcrumbBack').on('click', '.breadcrumbBack', function(){ 12253 var backButton = jQuery(this); 12254 var breadcrumbContainer = backButton.closest('.breadcrumb-container'); 12255 var dataRk = breadcrumbContainer.attr('data-activeNodeKey'); 12256 var toggler = backButton.closest('.ui-treetable').find('.ui-widget-content[data-rk="' + dataRk + '"]').find('.ui-treetable-toggler'); 12257 $this.handleToggleClick(toggler, true); 12258 }); 12259 12260 jQuery('.breadcrumb-container').off('focus', '.breadcrumbBack').on('focus', '.breadcrumbBack', function(){ 12261 var $this = jQuery(this); 12262 var language = de.his.common.LanguageHelper.currentLanguage(); 12263 if (language == "de") { 12264 this.defaultAriaLabel = 'Zurück zu'; 12265 if(jQuery('ul.treetableBreadcrumb')[0].children.length > 2){ 12266 var goBackToBreadcrumb = $this.closest('.ui-treetable').find('ul.treetableBreadcrumb')[0]?.children[jQuery('ul.treetableBreadcrumb')[0].children.length - 2]; 12267 $this.attr('aria-label', this.defaultAriaLabel + ' ' + goBackToBreadcrumb.children[0]?.innerHTML); 12268 $this.attr('title', this.defaultAriaLabel + ' ' + goBackToBreadcrumb.children[0]?.innerHTML); 12269 } 12270 else{ 12271 $this.attr('aria-label', 'Zurück'); 12272 $this.attr('title', 'Zurück'); 12273 } 12274 } 12275 else{ 12276 this.defaultAriaLabel = 'Back to'; 12277 if(jQuery('ul.treetableBreadcrumb')[0].children.length > 2){ 12278 var goBackToBreadcrumb = $this.closest('.ui-treetable').find('ul.treetableBreadcrumb')[0]?.children[jQuery('ul.treetableBreadcrumb')[0].children.length - 2]; 12279 $this.attr('aria-label', this.defaultAriaLabel + ' ' + goBackToBreadcrumb.children[0]?.innerHTML); 12280 $this.attr('title', this.defaultAriaLabel + ' ' + goBackToBreadcrumb.children[0]?.innerHTML); 12281 } 12282 else{ 12283 $this.attr('aria-label', 'Back'); 12284 $this.attr('title', 'Back'); 12285 } 12286 } 12287 }); 12288 12289 jQuery('.breadcrumb-container').off('focusout', '.breadcrumbBack').on('focusout', '.breadcrumbBack', function(){ 12290 var $this = jQuery(this); 12291 $this.removeAttr('aria-label'); 12292 $this.removeAttr('title'); 12293 }); 12294 12295 var droplistOpened = false; 12296 12297 document.addEventListener('click', function(event) { 12298 var droplistMenu = document.querySelector('.treetableBreadcrumb .droplist-menu'); 12299 // Check if menu is visible 12300 var isVisible = droplistMenu && droplistMenu.offsetParent !== null; 12301 12302 // If the menu has just become visible, set the flag and return early (donât try to close it yet) 12303 if (isVisible && !droplistOpened) { 12304 droplistOpened = true; 12305 return; 12306 } 12307 // Now, if it's already opened and user clicked outside, close it 12308 if (droplistOpened && droplistMenu && !droplistMenu.contains(event.target)) { 12309 $this.closeDroplistMenu(); 12310 droplistOpened = false; 12311 } 12312 }); 12313 12314 // Tree: expand and collapse 12315 this.tbody.off('click.treeTable-toggle', treeTogglerSelector) 12316 .on('click.treeTable-toggle', treeTogglerSelector, null, function(e) { 12317 if (this.classList.contains('tileToggler')) { 12318 $this.handleToggleClick($(this).prev(), false); 12319 } else { 12320 $this.handleToggleClick($(this), false); 12321 } 12322 }); 12323 12324 //selection 12325 if(this.cfg.selectionMode) { 12326 this.jqSelection = $(this.jqId + '_selection'); 12327 var selectionValue = this.jqSelection.val(); 12328 this.selections = selectionValue === "" ? [] : selectionValue.split(','); 12329 this.cfg.disabledTextSelection = this.cfg.disabledTextSelection === false ? false : true; 12330 12331 this.bindSelectionEvents(); 12332 } 12333 12334 if(this.cfg.sorting) { 12335 this.bindSortEvents(); 12336 } 12337 12338 if(this.cfg.paginator) { 12339 this.cfg.paginator.paginate = function(newState) { 12340 $this.handlePagination(newState); 12341 }; 12342 12343 this.paginator = new PrimeFaces.widget.Paginator(this.cfg.paginator); 12344 this.paginator.bindSwipeEvents(this.jq, this.cfg); 12345 } 12346 }, 12347 12348 setFrozenColumns: function(node){ 12349 var treetable = node.closest('div.ui-treetable'); 12350 if( treetable.parents('.frozenCol_2').length > 0 ) { 12351 var thWidth = treetable.find('th:nth-child(1)').outerWidth(); 12352 treetable.find('td:nth-child(2), th:nth-child(2)').css({left: thWidth}); 12353 } 12354 if( treetable.parents('.frozenCol_3').length > 0 ) { 12355 var thWidth2 = treetable.find('th:nth-child(1)').outerWidth(); 12356 treetable.find('td:nth-child(2), th:nth-child(2)').css({left: thWidth2}); 12357 var thWidth3 = treetable.find('th:nth-child(1)').outerWidth() + treetable.find('th:nth-child(2)').outerWidth(); 12358 treetable.find('td:nth-child(3), th:nth-child(3)').css({left: thWidth3}); 12359 } 12360 }, 12361 12362 // Beim Klick auf einen Krümel, bzw. beim initialen SchlieÃen alle noch geöffneten tieferen Knoten schlieÃen 12363 collapseExpandedChildren: async function(jQThis, node) { 12364 let childrenToCollapse = []; 12365 for(let closedNode of node.nextAll('tr[aria-expanded="true"]')){ 12366 if(closedNode.ariaExpanded == 'true'){ 12367 childrenToCollapse.push($(closedNode)); 12368 } 12369 } 12370 12371 if (childrenToCollapse.length > 0) { 12372 await jQThis.collapseNode(node, true); 12373 } 12374 }, 12375 12376 /** 12377 * Sets up all event listeners required for the standard filters. Also skins the filter inputs. 12378 * @private 12379 */ 12380 setupFiltering: function() { 12381 var $this = this, 12382 filterColumns = this.thead.find('> tr > th.ui-filter-column'); 12383 this.cfg.filterEvent = this.cfg.filterEvent||'keyup'; 12384 this.cfg.filterDelay = this.cfg.filterDelay||300; 12385 12386 filterColumns.children('.ui-column-filter').each(function() { 12387 var filter = $(this); 12388 12389 if(filter.is('input:text')) { 12390 PrimeFaces.skinInput(filter); 12391 $this.bindTextFilter(filter); 12392 } 12393 else { 12394 PrimeFaces.skinSelect(filter); 12395 $this.bindChangeFilter(filter); 12396 } 12397 }); 12398 }, 12399 12400 /** 12401 * Clear the filter input of this tree table and shows all rows again. 12402 */ 12403 clearFilters: function() { 12404 this.thead.find('> tr > th.ui-filter-column > .ui-column-filter').val(''); 12405 this.thead.find('> tr > th.ui-filter-column > .ui-column-customfilter').each(function() { 12406 var widgetElement = $(this).find('.ui-widget'); 12407 if (widgetElement.length > 0) { 12408 var widget = PrimeFaces.getWidgetById(widgetElement.attr('id')); 12409 if (widget && typeof widget.resetValue === 'function') { 12410 widget.resetValue(true); 12411 } 12412 else { 12413 $(this).find(':input').val(''); 12414 } 12415 } 12416 else { 12417 $(this).find(':input').val(''); 12418 } 12419 }); 12420 12421 $(this.jqId + '\\:globalFilter').val(''); 12422 this.filter(); 12423 }, 12424 12425 /** 12426 * Sets up the event listeners required for filtering this tree table, filtering either when enter is pressed or 12427 * when the {@link TreeTableCfg.filterEvent|configured event} occurs. 12428 * @private 12429 * @param {JQuery} filter The filter input field. 12430 */ 12431 bindTextFilter: function(filter) { 12432 if(this.cfg.filterEvent === 'enter') 12433 this.bindEnterKeyFilter(filter); 12434 else 12435 this.bindFilterEvent(filter); 12436 12437 // #7562 draggable columns cannot be filtered with touch 12438 if (PrimeFaces.env.isTouchable(this.cfg)) { 12439 filter.on('touchstart', function(e) { 12440 e.stopPropagation(); 12441 }); 12442 } 12443 }, 12444 12445 /** 12446 * Sets up the event listeners required for filtering this tree table when the filter input has changed. 12447 * @private 12448 * @param {JQuery} filter The filter input field. 12449 */ 12450 bindChangeFilter: function(filter) { 12451 var $this = this; 12452 12453 filter.on('change', function() { 12454 $this.filter(); 12455 }); 12456 }, 12457 12458 /** 12459 * Sets up the event listeners required for filtering this tree table when the enter key is pressed. 12460 * @private 12461 * @param {JQuery} filter The filter input field. 12462 */ 12463 bindEnterKeyFilter: function(filter) { 12464 var $this = this; 12465 12466 filter.on('keydown', PrimeFaces.utils.blockEnterKey) 12467 .on('keyup', function(e) { 12468 var key = e.which, 12469 keyCode = $.ui.keyCode; 12470 12471 if(key === keyCode.ENTER) { 12472 $this.filter(); 12473 12474 e.preventDefault(); 12475 } 12476 }); 12477 }, 12478 12479 /** 12480 * Sets up the event listeners required for filtering this tree table. 12481 * @private 12482 * @param {JQuery} filter The filter input field. 12483 */ 12484 bindFilterEvent: function(filter) { 12485 var $this = this; 12486 12487 //prevent form submit on enter key 12488 filter.on('keydown.treeTable-blockenter', PrimeFaces.utils.blockEnterKey) 12489 .on(this.cfg.filterEvent + '.treeTable', function(e) { 12490 if($this.filterTimeout) { 12491 clearTimeout($this.filterTimeout); 12492 } 12493 12494 $this.filterTimeout = setTimeout(function() { 12495 $this.filter(); 12496 $this.filterTimeout = null; 12497 }, 12498 $this.cfg.filterDelay); 12499 }); 12500 }, 12501 12502 /** 12503 * Reads the current value of the filter input and performs a filtering operation. Sends an AJAX requests to the 12504 * server and updates this tree table with the result. Also invokes the appropriate behaviors. 12505 */ 12506 filter: function() { 12507 var $this = this, 12508 options = { 12509 source: this.id, 12510 update: this.id, 12511 process: this.id, 12512 formId: this.getParentFormId(), 12513 params: [{name: this.id + '_filtering', value: true}, 12514 {name: this.id + '_encodeFeature', value: true}], 12515 onsuccess: function(responseXML, status, xhr) { 12516 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 12517 widget: $this, 12518 handle: function(content) { 12519 this.tbody.html(content); 12520 } 12521 }); 12522 12523 return true; 12524 }, 12525 oncomplete: function(xhr, status, args, data) { 12526 var paginator = $this.getPaginator(); 12527 if(args && args.totalRecords) { 12528 if(paginator) { 12529 paginator.setTotalRecords(args.totalRecords); 12530 } 12531 } 12532 } 12533 }; 12534 12535 if(this.hasBehavior('filter')) { 12536 this.callBehavior('filter', options); 12537 } 12538 else { 12539 PrimeFaces.ajax.Request.handle(options); 12540 } 12541 }, 12542 12543 /** 12544 * Handles a pagination event by updating this tree table and invoking the appropriate behaviors. 12545 * @private 12546 * @param {PrimeFaces.widget.Paginator.PaginationState} newState The new pagination state to apply. 12547 */ 12548 handlePagination: function(newState) { 12549 var $this = this, 12550 options = { 12551 source: this.id, 12552 update: this.id, 12553 process: this.id, 12554 params: [ 12555 {name: this.id + '_pagination', value: true}, 12556 {name: this.id + '_first', value: newState.first}, 12557 {name: this.id + '_rows', value: newState.rows} 12558 ], 12559 onsuccess: function(responseXML, status, xhr) { 12560 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 12561 widget: $this, 12562 handle: function(content) { 12563 this.tbody.html(content); 12564 } 12565 }); 12566 12567 return true; 12568 }, 12569 oncomplete: function() { 12570 $this.paginator.cfg.page = newState.page; 12571 $this.paginator.updateUI(); 12572 12573 var treeTable = $this.jq.closest('.ui-treetable.ui-widget'); 12574 markVisibleTreeNodes(treeTable); 12575 12576 hideWaiting(); 12577 } 12578 }; 12579 12580 if(this.hasBehavior('page')) { 12581 this.callBehavior('page', options); 12582 } 12583 else { 12584 PrimeFaces.ajax.Request.handle(options); 12585 } 12586 }, 12587 12588 /** 12589 * Returns the paginator instance if any is exists. 12590 * @return {PrimeFaces.widget.Paginator | undefined} The paginator instance for this widget, or `undefined` if 12591 * paging is not enabled. 12592 */ 12593 getPaginator: function() { 12594 return this.paginator; 12595 }, 12596 12597 /** 12598 * Sets up all events listeners required for selecting one or multiple rows of this tree table. 12599 * @private 12600 */ 12601 bindSelectionEvents: function() { 12602 var $this = this, 12603 rowSelector = '> tr.ui-treetable-selectable-node'; 12604 12605 this.tbody.off('mouseenter.treeTable mouseleave.treeTable click.treeTable', rowSelector) 12606 .on('mouseenter.treeTable', rowSelector, null, function(e) { 12607 $(this).addClass('ui-state-hover'); 12608 }) 12609 .on('mouseleave.treeTable', rowSelector, null, function(e) { 12610 $(this).removeClass('ui-state-hover'); 12611 }) 12612 .on('click.treeTable', rowSelector, null, function(e) { 12613 $this.onRowClick(e, $(this)); 12614 }); 12615 12616 if(this.isCheckboxSelection()) { 12617 var checkboxSelector = this.cfg.nativeElements ? '> tr.ui-treetable-selectable-node > td:first-child :checkbox': 12618 '> tr.ui-treetable-selectable-node > td:first-child div.ui-chkbox-box'; 12619 12620 this.tbody.off('click.treeTable-checkbox mouseenter.treeTable-checkbox mouseleave.treeTable-checkbox', checkboxSelector) 12621 .on('mouseenter.treeTable-checkbox', checkboxSelector, null, function(e) { 12622 $(this).addClass('ui-state-hover'); 12623 }) 12624 .on('mouseleave.treeTable-checkbox', checkboxSelector, null, function(e) { 12625 $(this).removeClass('ui-state-hover'); 12626 }) 12627 .on('click.treeTable-checkbox', checkboxSelector, null, function(e) { 12628 var node = $(this).closest('tr.ui-treetable-selectable-node'); 12629 $this.toggleCheckboxNode(node); 12630 }); 12631 12632 12633 //initial partial selected visuals 12634 if(this.cfg.nativeElements) { 12635 this.indeterminateNodes(this.tbody.children('tr.ui-treetable-partialselected')); 12636 } 12637 } 12638 }, 12639 12640 /** 12641 * Sets up all events listeners required for sorting the rows of this tree table. 12642 * @private 12643 */ 12644 bindSortEvents: function() { 12645 var $this = this, 12646 hasAriaSort = false;
12647 12648 this.cfg.multiSort = this.cfg.multiSort||false; 12649 this.cfg.allowUnsorting = this.cfg.allowUnsorting||false; 12650 this.sortMeta = []; 12651 12652 //aria messages 12653 this.ascMessage = "Aufsteigend sortiert"; 12654 this.descMessage = "Absteigend sortiert"; 12655 if (this.cfg.allowUnsorting) { 12656 this.otherMessage = "Unsortiert"; 12657 } 12658 else { 12659 this.otherMessage = "Aufsteigend"; 12660 } 12661 12662 this.sortableColumns = this.thead.find('> tr > th.ui-sortable-column'); 12663 12664 this.sortableColumns.each(function() { 12665 var columnHeader = $(this), 12666 columnHeaderId = columnHeader.attr('id'), 12667 sortIcon = columnHeader.children('span.ui-sortable-column-icon'), 12668 sortOrder = null, 12669 ariaLabel = columnHeader.attr('aria-label'); 12670 12671 if (sortIcon.hasClass('ui-icon-triangle-1-n')) { 12672 sortOrder = $this.SORT_ORDER.ASCENDING; 12673 columnHeader.attr('aria-label', $this.getSortMessage(this.descMessage)); 12674 if (!hasAriaSort) { 12675 columnHeader.attr('aria-sort', 'ascending'); 12676 hasAriaSort = true; 12677 } 12678 } 12679 else if (sortIcon.hasClass('ui-icon-triangle-1-s')) { 12680 sortOrder = $this.SORT_ORDER.DESCENDING; 12681 columnHeader.attr('aria-label', $this.getSortMessage(this.otherMessage)); 12682 if (!hasAriaSort) { 12683 columnHeader.attr('aria-sort', 'descending'); 12684 hasAriaSort = true; 12685 } 12686 } 12687 else { 12688 sortOrder = $this.SORT_ORDER.UNSORTED; 12689 columnHeader.attr('aria-label', $this.getSortMessage(this.ascMessage)); 12690 if (!hasAriaSort) { 12691 columnHeader.attr('aria-sort', 'other'); 12692 hasAriaSort = true; 12693 } 12694 } 12695 12696 columnHeader.data('sortorder', sortOrder); 12697 12698 if ($this.cfg.multiSort && $this.cfg.sortMetaOrder) { 12699 var resolvedSortMetaIndex = $.inArray(columnHeaderId, $this.cfg.sortMetaOrder); 12700 12701 $this.sortMeta[resolvedSortMetaIndex] = { 12702 col: columnHeaderId, 12703 order: sortOrder 12704 }; 12705 } 12706 }); 12707 12708 this.sortableColumns.on('mouseenter.treeTable', function() { 12709 $(this).addClass('ui-state-hover'); 12710 }) 12711 .on('mouseleave.treeTable', function() { 12712 $(this).removeClass('ui-state-hover'); 12713 }) 12714 .on('click.treeTable', function(e, metaKeyOn){ 12715 if(!$this.shouldSort(e, this)) { 12716 return; 12717 } 12718 12719 PrimeFaces.clearSelection(); 12720 12721 var columnHeader = $(this), 12722 sortOrderData = columnHeader.data('sortorder'), 12723 sortOrder = (sortOrderData === $this.SORT_ORDER.UNSORTED) ? $this.SORT_ORDER.ASCENDING : 12724 (sortOrderData === $this.SORT_ORDER.ASCENDING) ? $this.SORT_ORDER.DESCENDING : 12725 $this.cfg.allowUnsorting ? $this.SORT_ORDER.UNSORTED : $this.SORT_ORDER.ASCENDING, 12726 metaKey = e.metaKey || e.ctrlKey || metaKeyOn; 12727 12728 if (!$this.cfg.multiSort || !metaKey) { 12729 $this.sortMeta = []; 12730 } 12731 12732 $this.addSortMeta({ 12733 col: columnHeader.attr('id'), 12734 order: sortOrder 12735 }); 12736 12737 $this.sort(columnHeader, sortOrder, $this.cfg.multiSort && metaKey); 12738 }) 12739 .on('keydown.treeTable', function(e, metaKeyOn){ 12740 // Enter-Event 12741 if(e.keyCode === 13){ 12742 if(!$this.shouldSort(e, this)) { 12743 return; 12744 } 12745 12746 PrimeFaces.clearSelection(); 12747 12748 var columnHeader = $(this), 12749 sortOrderData = columnHeader.data('sortorder'), 12750 sortOrder = (sortOrderData === $this.SORT_ORDER.UNSORTED) ? $this.SORT_ORDER.ASCENDING : 12751 (sortOrderData === $this.SORT_ORDER.ASCENDING) ? $this.SORT_ORDER.DESCENDING : 12752 $this.cfg.allowUnsorting ? $this.SORT_ORDER.UNSORTED : $this.SORT_ORDER.ASCENDING, 12753 metaKey = e.metaKey || e.ctrlKey || metaKeyOn; 12754 12755 if (!$this.cfg.multiSort || !metaKey) { 12756 $this.sortMeta = []; 12757 } 12758 12759 $this.addSortMeta({ 12760 col: columnHeader.attr('id'), 12761 order: sortOrder 12762 }); 12763 $this.sort(columnHeader, sortOrder, $this.cfg.multiSort && metaKey); 12764 12765 } 12766 }); 12767 12768 $this.updateSortPriorityIndicators(); 12769 }, 12770 12771 /** 12772 * @override 12773 * @inheritdoc 12774 * @param {PrimeFaces.widget.ContextMenu} menuWidget 12775 * @param {PrimeFaces.widget.TreeTable} targetWidget 12776 * @param {string} targetId 12777 * @param {PrimeFaces.widget.ContextMenuCfg} cfg 12778 */ 12779 bindContextMenu : function(menuWidget, targetWidget, targetId, cfg) { 12780 var targetSelector = targetId + ' .ui-treetable-data > ' + (cfg.nodeType ? 'tr.ui-treetable-selectable-node.' + cfg.nodeType : 'tr.ui-treetable-selectable-node'); 12781 var targetEvent = cfg.event + '.treetable'; 12782 12783 $(document).off(targetEvent, targetSelector).on(targetEvent, targetSelector, null, function(e) { 12784 targetWidget.onRowRightClick(e, $(this)); 12785 menuWidget.show(e); 12786 }); 12787 }, 12788 12789 setupStickyBreadcrumb: function() { 12790 const $hisinoneHeader = jQuery('#hisinoneHeader'); 12791 const hisinoneHeaderHeight = $hisinoneHeader.outerHeight(); 12792 12793 jQuery(window).on('scroll', function(e){ 12794 /* 12795 * Get parent element of breadcrumb container (e.g. studyPlannerTree) to get position of the breadcrumb. 12796 * Can't use breadcrumb position because it will move and is initially 0, because it's display non. 12797 * Needs to be updated because the height of page changes on usage of collapsible panel and helptexts 12798 */ 12799 const breadcrumbParentContainerPos = jQuery('.breadcrumb-container').parent().offset().top; 12800 const current_scroll_top = jQuery(document).scrollTop(); 12801 12802 if(current_scroll_top <= breadcrumbParentContainerPos) { 12803 // scrolling above the container 12804 jQuery('.breadcrumb-container').css({ 12805 'top': 0, 12806 'border-radius': '7px' 12807 }); 12808 12809 } else if ($hisinoneHeader.hasClass('js-hide')) { 12810 //scrolling with header hidden 12811 jQuery('.breadcrumb-container').css({ 12812 'top': 0, 12813 'border-radius': '0 0 7px 7px' 12814 }); 12815 } else { 12816 //scrolling with header visible 12817 jQuery('.breadcrumb-container').css({ 12818 'top': hisinoneHeaderHeight + 'px', 12819 'border-radius': '0 0 7px 7px' 12820 }); 12821 } 12822 }); 12823 }, 12824 12825 /** 12826 * Sets up the CSS and event listeners for the sticky header feature, if it is enabled. 12827 * @private 12828 */ 12829 setupStickyHeader: function() { 12830 var table = this.thead.parent(), 12831 offset = table.offset(), 12832 win = $(window), 12833 $this = this; 12834
12835 this.stickyContainer = $('<div class="ui-treetable ui-treetable-sticky ui-widget"><table></table></div>'); 12836 this.clone = this.thead.clone(false); 12837 this.stickyContainer.children('table').append(this.thead); 12838 table.append(this.clone); 12839 12840 this.stickyContainer.css({ 12841 position: 'absolute', 12842 width: table.outerWidth() + 'px', 12843 top: offset.top + 'px', 12844 left: offset.left + 'px', 12845 'z-index': PrimeFaces.nextZindex() 12846 }); 12847 12848 this.jq.prepend(this.stickyContainer); 12849 12850 if(this.cfg.resizableColumns) { 12851 this.relativeHeight = 0; 12852 } 12853 12854 PrimeFaces.utils.registerScrollHandler(this, 'scroll.' + this.id + '_align', function() { 12855 var scrollTop = win.scrollTop(), 12856 tableOffset = table.offset(); 12857 12858 if(scrollTop > tableOffset.top) { 12859 $this.stickyContainer.css({ 12860 'position': 'fixed', 12861 'top': '0px' 12862 }) 12863 .addClass('ui-shadow ui-sticky'); 12864 12865 if($this.cfg.resizableColumns) { 12866 $this.relativeHeight = scrollTop - tableOffset.top; 12867 } 12868 12869 if(scrollTop >= (tableOffset.top + $this.tbody.height())) 12870 $this.stickyContainer.hide(); 12871 else 12872 $this.stickyContainer.show(); 12873 } 12874 else { 12875 $this.stickyContainer.css({ 12876 'position': 'absolute', 12877 'top': tableOffset.top + 'px' 12878 }) 12879 .removeClass('ui-shadow ui-sticky'); 12880 12881 if($this.stickyContainer.is(':hidden')) { 12882 $this.stickyContainer.show(); 12883 } 12884 12885 if($this.cfg.resizableColumns) { 12886 $this.relativeHeight = 0; 12887 } 12888 } 12889 }); 12890 12891 PrimeFaces.utils.registerResizeHandler(this, 'resize.sticky-' + this.id, null, function(e) { 12892 var _delay = e.data.delay || 0; 12893 12894 if (_delay !== null && typeof _delay === 'number' && _delay > -1) { 12895 if ($this.resizeTimeout) { 12896 clearTimeout($this.resizeTimeout); 12897 } 12898 12899 $this.stickyContainer.hide(); 12900 $this.resizeTimeout = setTimeout(function() { 12901// $this.stickyContainer.css('left', orginTableContent.offset().left + 'px'); 12902 $this.stickyContainer.width(table.outerWidth()); 12903 $this.stickyContainer.show(); 12904 }, _delay); 12905 } 12906 else { 12907 $this.stickyContainer.width(table.outerWidth()); 12908 } 12909 }, { delay: null }); 12910 12911 //filter support 12912 this.clone.find('.ui-column-filter').prop('disabled', true); 12913 }, 12914 12915 /** 12916 * Sets up all events listeners required for editing entire rows or individual cells. 12917 * @private 12918 */ 12919 bindEditEvents: function() { 12920 var $this = this; 12921 this.cfg.cellSeparator = this.cfg.cellSeparator||' ', 12922 this.cfg.saveOnCellBlur = (this.cfg.saveOnCellBlur === false) ? false : true; 12923 12924 if(this.cfg.editMode === 'row') { 12925 var rowEditorSelector = '> tr > td > div.ui-row-editor'; 12926 this.tbody.off('click.treetable', rowEditorSelector) 12927 .on('click.treetable', rowEditorSelector, null, function(e) { 12928 var element = $(e.target), 12929 row = element.closest('tr'); 12930 12931 if(element.hasClass('ui-icon-pencil')) { 12932 $this.switchToRowEdit(row); 12933 element.hide().siblings().show(); 12934 } 12935 else if(element.hasClass('ui-icon-check')) { 12936 $this.saveRowEdit(row); 12937 } 12938 else if(element.hasClass('ui-icon-close')) { 12939 $this.cancelRowEdit(row); 12940 } 12941 12942 e.preventDefault(); 12943 }); 12944 } 12945 else if(this.cfg.editMode === 'cell') { 12946 var cellSelector = '> tr > td.ui-editable-column'; 12947 var editEvent = (this.cfg.editInitEvent !== 'click') ? this.cfg.editInitEvent + '.treetable-cell click.treetable-cell' : 'click.treetable-cell'; 12948 12949 this.tbody.off(editEvent, cellSelector) 12950 .on(editEvent, cellSelector, null, function(e) { 12951 if(!$(e.target).is('span.ui-treetable-toggler.ui-c')) { 12952 var item = $(this); 12953 var cell = item.hasClass('ui-editable-column') ? item : item.closest('.ui-editable-column'); 12954 12955 if(!cell.hasClass('ui-cell-editing') && e.type === $this.cfg.editInitEvent) { 12956 $this.showCellEditor($(this)); 12957 } 12958 } 12959 }); 12960 12961 // save/cancel on mouseup to queue the event request before whatever was clicked reacts 12962 $(document).off('mouseup.treetable-cell-blur' + this.id) 12963 .on('mouseup.treetable-cell-blur' + this.id, function(e) { 12964 // ignore if not editing 12965 if(!$this.currentCell) 12966 return; 12967 12968 var currentCell = $($this.currentCell); 12969 var target = $(e.target); 12970 12971 // ignore clicks inside edited cell 12972 if(currentCell.is(target) || currentCell.has(target).length) 12973 return; 12974 12975 // ignore clicks inside input overlays like calendar popups etc 12976 var ignoredOverlay = '.ui-input-overlay, .ui-editor-popup, #keypad-div, .ui-colorpicker-container'; 12977 // and menus - in case smth like menubutton is inside the table 12978 ignoredOverlay += ', .ui-datepicker-buttonpane, .ui-menuitem, .ui-menuitem-link'; 12979 // and blockers 12980 ignoredOverlay += ', .ui-blockui, .blockUI'; 12981 if(target.is(ignoredOverlay) || target.closest(ignoredOverlay).length) 12982 return; 12983 12984 if($.datepicker._datepickerShowing || $('.p-datepicker-panel:visible').length) 12985 return; 12986 12987 if($this.cfg.saveOnCellBlur) 12988 $this.saveCell($this.currentCell); 12989 else 12990 $this.doCellEditCancelRequest($this.currentCell); 12991 }); 12992 } 12993 }, 12994 12995 /** 12996 * Sort this tree table by the given column, either in ascending or descending order. 12997 * @param {JQuery} columnHeader A column to sort by, must be a TH element of the THEAD. 12998 * @param {PrimeFaces.widget.TreeTable.SortOrder} order Whether to sort the rows in ascending or descending order. 12999 * @param {boolean} multi `true` if sorting by multiple columns is enabled, or `false` otherwise. 13000 */ 13001 sort: function(columnHeader, order, multi) { 13002 var $this = this, 13003 options = { 13004 source: this.id, 13005 update: this.id, 13006 process: this.id, 13007 formId: this.getParentFormId(), 13008 params: [ 13009 {name: this.id + '_sorting', value: true} 13010 ], 13011 onsuccess: function(responseXML, status, xhr) { 13012 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 13013 widget: $this, 13014 handle: function(content) { 13015 this.tbody.html(content); 13016 13017 if(!multi) { 13018 columnHeader.siblings().filter('.ui-state-active').removeData('sortorder').removeClass('ui-state-active') 13019 .find('.ui-sortable-column-icon').removeClass('ui-icon-triangle-1-n ui-icon-triangle-1-s'); 13020 columnHeader.siblings().attr('aria-label', $this.get
13020SortMessage($this.otherMessage)); 13021 } 13022 13023 columnHeader.addClass('ui-state-active').data('sortorder', order); 13024 var sortIcon = columnHeader.find('.ui-sortable-column-icon'); 13025 if (order === $this.SORT_ORDER.DESCENDING) { 13026 sortIcon.removeClass('ui-icon-triangle-1-n').addClass('ui-icon-triangle-1-s'); 13027 columnHeader.attr('aria-sort', 'none').attr('aria-label', $this.getSortMessage($this.descMessage) + '. Sortierung aufheben'); 13028 $(PrimeFaces.escapeClientId(columnHeader.attr('id') + '_clone')).attr('aria-sort', 'other') 13029 .attr('aria-label', $this.getSortMessage($this.descMessage)); 13030 } else if (order === $this.SORT_ORDER.ASCENDING) { 13031 sortIcon.removeClass('ui-icon-triangle-1-s').addClass('ui-icon-triangle-1-n'); 13032 columnHeader.attr('aria-sort', 'descending').attr('aria-label', $this.getSortMessage($this.ascMessage)); 13033 $(PrimeFaces.escapeClientId(columnHeader.attr('id') + '_clone')).attr('aria-sort', 'descending') 13034 .attr('aria-label', $this.getSortMessage($this.ascMessage)); 13035 } else { 13036 sortIcon.removeClass('ui-icon-triangle-1-s').addClass('ui-icon-carat-2-n-s'); 13037 columnHeader.removeClass('ui-state-active ').attr('aria-sort', 'ascending') 13038 .attr('aria-label', $this.getSortMessage($this.otherMessage)); 13039 $(PrimeFaces.escapeClientId(columnHeader.attr('id') + '_clone')).attr('aria-sort', 'ascending') 13040 .attr('aria-label', $this.getSortMessage($this.otherMessage)); 13041 } 13042 13043 $this.updateSortPriorityIndicators(); 13044 } 13045 }); 13046 13047 return true; 13048 }, 13049 oncomplete: function(xhr, status, args, data) { 13050 if($this.cfg.selectionMode && args.selection) { 13051 $this.selections = args.selection.split(','); 13052 $this.writeSelections(); 13053 } 13054 } 13055 }; 13056 13057 options.params.push({name: this.id + '_sortKey', value: $this.joinSortMetaOption('col')}); 13058 options.params.push({name: this.id + '_sortDir', value: $this.joinSortMetaOption('order')}); 13059 13060 if(this.hasBehavior('sort')) { 13061 this.callBehavior('sort', options); 13062 } 13063 else { 13064 PrimeFaces.ajax.Request.handle(options); 13065 } 13066 }, 13067 13068 /** 13069 * Handles a click on a tree toggle 13070 * Expands or Collapses depending on the current state 13071 * In small mode, always expand unless it is a back-button click 13072 * @param target the clicked button element 13073 * @param {boolean} fromBackButton true if it is a back-button click 13074 */ 13075 handleToggleClick: function(target, fromBackButton = false) { 13076 var $this = this; 13077 var toggler = $(target); 13078 var node = toggler.closest('tr'); 13079 13080 if(!node.data('processing')) { 13081 node.data('processing', true); 13082 //jQuery('.treeTableSmallAnimation')[0].classList.remove('noDisplay'); 13083 13084 if(toggler.hasClass('ui-icon-triangle-1-e')) { 13085 $this.expandNode(node); 13086 } 13087 else{ 13088 if (window.innerWidth <= 768 && !fromBackButton) { 13089 // Bei Tiles soll bei einem direkten click immer in das Tile eingestiegen werden 13090 $this.expandNode(node); 13091 } else { 13092 $this.collapseNode(node); 13093 } 13094 } 13095 //$this.setupStickyBreadcrumb(); 13096 toggleStickyButton(); 13097 13098 var statetitle = toggler.attr('data-statetitle'), 13099 // toggler.attr('title') is empty onclick because on mousenter/focus it will be replaced by data-title in customtooltips. 13100 title = toggler.attr('title') || toggler.attr('data-title'); 13101 toggler.attr('title', statetitle).attr('aria-label', statetitle).attr('data-statetitle', title); 13102 toggler.trigger("updateTooltip"); 13103 } 13104 }, 13105 13106 13107 /** 13108 * Expands the given row of this tree table. 13109 * @param {JQuery} node A node to expand, must be a TR element. 13110 */ 13111 expandNode: function(node) { 13112 var $this = this, 13113 nodeKey = node.attr('data-rk'), 13114 options = { 13115 source: this.id, 13116 process: this.id, 13117 update: this.id, 13118 params: [
13119 {name: this.id + '_expand', value: nodeKey} 13120 ], 13121 onsuccess: function(responseXML, status, xhr) { 13122 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 13123 widget: $this, 13124 handle: function(content) { 13125 if($this.cfg.expandMode === "self") 13126 node.replaceWith(content); 13127 else 13128 node.after(content); 13129 13130 node.find('.ui-treetable-toggler:first').addClass('ui-icon-triangle-1-s').removeClass('ui-icon-triangle-1-e'); 13131 node.attr('aria-expanded', true); 13132 $this.indeterminateNodes($this.tbody.children('tr.ui-treetable-partialselected')); 13133 13134 if(this.cfg.scrollable) { 13135 this.alignScrollBody(); 13136 } 13137 } 13138 }); 13139 13140 var treeTable = node.closest('.ui-treetable.ui-widget'); 13141 markVisibleTreeNodes(treeTable); 13142 return true; 13143 }, 13144 oncomplete: async function() { 13145 node.data('processing', false); 13146 $this.updateVerticalScroll(); 13147 $this.setFrozenColumns(node); 13148 13149 hideWaiting(); 13150 13151 de.his.component.customtooltip.init(); 13152 de.his.component.popup.refresh(); 13153 de.his.component.TabableLink?.init(); 13154 } 13155 }; 13156 if(this.hasBehavior('expand')) { 13157 this.callBehavior('expand', options); 13158 } 13159 else { 13160 PrimeFaces.ajax.Request.handle(options); 13161 } 13162 }, 13163 13164 /** 13165 * Collapses the given row of this tree table. 13166 * @param {JQuery} node A node to collapse, must be a TR element. 13167 */ 13168 collapseNode: async function(node) { 13169 var $this = this, 13170 nodeKey = node.attr('data-rk'), 13171 nextNodes = node.nextAll(); 13172 13173 for(var i = 0; i < nextNodes.length; i++) { 13174 var nextNode = nextNodes.eq(i), 13175 nextNodeRowKey = nextNode.attr('data-rk'); 13176 13177 if(nextNodeRowKey.indexOf(nodeKey) !== -1) { 13178 nextNode.remove(); 13179 } 13180 else { 13181 break; 13182 } 13183 } 13184 13185 node.attr('aria-expanded', false).find('.ui-treetable-toggler:first').addClass('ui-icon-triangle-1-e').removeClass('ui-icon-triangle-1-s'); 13186 node.data('processing', false); 13187 13188 if(this.cfg.scrollable) { 13189 this.alignScrollBody(); 13190 } 13191 13192 var options = { 13193 source: this.id, 13194 process: this.id, 13195 update: this.id, 13196 params: [ 13197 {name: this.id + '_collapse', value: nodeKey} 13198 ], 13199 onsuccess: function(responseXML, status, xhr) { 13200 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 13201 widget: $this, 13202 handle: function(content) { 13203 // do nothing 13204 } 13205 }); 13206 13207 var treeTable = node.closest('.ui-treetable.ui-widget'); 13208 markVisibleTreeNodes(treeTable); 13209 13210 return true; 13211 }, 13212 oncomplete: async function() { 13213 $this.updateVerticalScroll(); 13214 $this.setFrozenColumns(node); 13215 13216 hideWaiting(); 13217 } 13218 }; 13219 13220 if(this.hasBehavior('collapse')) { 13221 this.callBehavior('collapse', options); 13222 } 13223 else { 13224 //need to wait until every node is collapsed, otherwise we got issues with navigation 13225 await PrimeFaces.ajax.Request.handle(options); 13226 } 13227 }, 13228 13229 13230 /** 13231 * Callback for when a row was clicked. Selects or unselects the row, if that feature is enabled. 13232 * @private 13233 * @param {JQuery.TriggeredEvent} event The click event that occurred. 13234 * @param {JQuery} node The node that was clicked. 13235 */ 13236 onRowClick: function(event, node) { 13237 if($(event.target).is('td,span:not(.ui-c)')) { 13238 var selected = node.hasClass('ui-state-highlight'), 13239 metaKey = event.metaKey||event.ctrlKey,
13240 shiftKey = event.shiftKey; 13241 13242 if(this.isCheckboxSelection()) { 13243 this.toggleCheckboxNode(node); 13244 } 13245 else { 13246 if(selected && metaKey) { 13247 this.unselectNode(node); 13248 } 13249 else { 13250 if(this.isSingleSelection()||(this.isMultipleSelection() && !metaKey)) { 13251 this.unselectAllNodes(); 13252 } 13253 13254 if(this.isMultipleSelection() && shiftKey) { 13255 this.selectNodesInRange(node); 13256 } 13257 else { 13258 this.selectNode(node); 13259 this.cursorNode = node; 13260 } 13261 } 13262 } 13263 13264 if(this.cfg.disabledTextSelection) { 13265 PrimeFaces.clearSelection(); 13266 } 13267 } 13268 }, 13269 13270 /** 13271 * Callback for when a right click was performed on a node. Selects or unselects the row, if that feature is 13272 * enabled. 13273 * @private 13274 * @param {JQuery.TriggeredEvent} event The click event that occurred. 13275 * @param {JQuery} node The node that was clicked. 13276 */ 13277 onRowRightClick: function(event, node) { 13278 var selected = node.hasClass('ui-state-highlight'), 13279 nodeKey = node.attr('data-rk'); 13280 13281 if(this.isCheckboxSelection()) { 13282 if(!selected) { 13283 this.toggleCheckboxNode(node); 13284 } 13285 } 13286 else { 13287 if(this.isSingleSelection() || !selected ) { 13288 this.unselectAllNodes(); 13289 } 13290 this.selectNode(node); 13291 } 13292 13293 this.fireSelectEvent(nodeKey, 'contextMenu'); 13294 13295 if(this.cfg.disabledTextSelection) { 13296 PrimeFaces.clearSelection(); 13297 } 13298 }, 13299 13300 /** 13301 * Sends a select event on server side to invoke a select listener if defined. 13302 * @private 13303 * @param {string} nodeKey The key of the node that was selected. 13304 * @param {string} behaviorEvent Name of the event to fire. 13305 */ 13306 fireSelectEvent: function(nodeKey, behaviorEvent) { 13307 if(this.hasBehavior(behaviorEvent)) { 13308 var ext = { 13309 params: [{name: this.id + '_instantSelection', value: nodeKey} 13310 ] 13311 }; 13312 13313 this.callBehavior(behaviorEvent, ext); 13314 } 13315 }, 13316 13317 /** 13318 * Selects the given row. The {@link TreeTableCfg.selectionMode} must not be set to `checkbox`. 13319 * @param {JQuery} node A row to select, must be a TR element. 13320 * @param {boolean} [silent] If set to `true`, does not trigger event listeners. 13321 */ 13322 selectNode: function(node, silent) { 13323 var nodeKey = node.attr('data-rk'); 13324 13325 node.removeClass('ui-treetable-partialselected').addClass('ui-state-highlight').attr('aria-selected', true); 13326 this.addToSelection(nodeKey); 13327 this.writeSelections(); 13328 13329 if(this.isCheckboxSelection()) { 13330 if(this.cfg.nativeElements) 13331 node.find('> td:first-child > :checkbox').prop('checked', true).prop('indeterminate', false).addClass('ui-state-active'); 13332 else 13333 node.find('> td:first-child > div.ui-chkbox > div.ui-chkbox-box').addClass('ui-state-active').children('span.ui-chkbox-icon').removeClass('ui-icon-blank ui-icon-minus').addClass('ui-icon-check'); 13334 } 13335 13336 if(!silent) { 13337 this.fireSelectNodeEvent(nodeKey); 13338 } 13339 }, 13340 13341 /** 13342 * Unselects the given row. The {@link TreeTableCfg.selectionMode} must not be set to `checkbox`. 13343 * @param {JQuery} node A row to unselect, must be a TR element. 13344 * @param {boolean} [silent] If set to `true`, does not trigger event listeners. 13345 */ 13346 unselectNode: function(node, silent) { 13347 var nodeKey = node.attr('data-rk'); 13348 13349 node.removeClass('ui-state-highlight ui-treetable-partialselected').attr('aria-selected', false); 13350 this.removeSelection(nodeKey); 13351 this.writeSelections(); 13352 13353 if(this.isCheckboxSelection()) { 13354 if(this.cfg.nativeElements) 13355 node.find('> td:first-child > :checkbox').prop('checked', false).prop('indeterminate', false).removeClass('ui-state-active'); 13356 else 13357 node.find('> td:first-child > div.ui-chkbox > div.ui-chkbox-box').removeClass('ui-state-active').children('span.ui-chkbox-icon').addClass('ui-icon-blank').removeClass('ui-icon-check ui-icon-minus'); 13358 } 13359 13360 if(!silent) { 13361 this.fireUnselectNodeEvent(nodeKey); 13362 } 13363 }, 13364 13365 /** 13366 * Unselects all selected rows. The {@link TreeTableCfg.selectionMode} must not be set to `checkbox`. 13367 */ 13368 unselectAllNodes: function() { 13369 var selectedNodes = this.tbody.children('tr.ui-state-highlight'); 13370 for(var i = 0; i < selectedNodes.length; i++) { 13371 this.unselectNode(selectedNodes.eq(i), true); 13372 } 13373 13374 this.selections = []; 13375 this.writeSelections(); 13376 }, 13377 13378 /** 13379 * Selects all rows between the current row and the row that was just clicked. Used for multiple selections while 13380 * the shift key is pressed. 13381 * @private 13382 * @param {JQuery} node A row that was just clicked. 13383 */ 13384 selectNodesInRange: function(node) { 13385 if(this.cursorNode) { 13386 this.unselectAllNodes(); 13387 13388 var currentNodeIndex = node.index(), 13389 cursorNodeIndex = this.cursorNode.index(), 13390 startIndex = (currentNodeIndex > cursorNodeIndex) ? cursorNodeIndex : currentNodeIndex, 13391 endIndex = (currentNodeIndex > cursorNodeIndex) ? (currentNodeIndex + 1) : (cursorNodeIndex + 1), 13392 nodes = this.tbody.children(); 13393 13394 for(var i = startIndex ; i < endIndex; i++) { 13395 this.selectNode(nodes.eq(i), true); 13396 } 13397 } 13398 else { 13399 this.selectNode(node); 13400 } 13401 }, 13402 13403 /** 13404 * Sets the `indeterminate` attribute of the given rows to `true`. 13405 * @private 13406 * @param {JQuery} nodes List of rows to process. 13407 */ 13408 indeterminateNodes: function(nodes) { 13409 for(var i = 0; i < nodes.length; i++) { 13410 nodes.eq(i).find('> td:first-child > :checkbox').prop('indeterminate', true); 13411 } 13412 }, 13413 13414 /** 13415 * When the {@link TreeTableCfg.selectionMode} is set to `checkbox`: select the given row if is is currently 13416 * unselected, or unselects it otherwise. 13417 * @param {JQuery} node A row to toggle, must be a TR element. 13418 */ 13419 toggleCheckboxNode: function(node) { 13420 var selected = node.hasClass('ui-state-highlight'), 13421 rowKey = node.data('rk'); 13422 13423 //toggle itself 13424 if(selected) 13425 this.unselectNode(node, true); 13426 else 13427 this.selectNode(node, true); 13428 13429 //propagate down 13430 var descendants = this.getDescendants(node); 13431 for(var i = 0;
13431 i < descendants.length; i++) { 13432 var descendant = descendants[i]; 13433 if(selected) 13434 this.unselectNode(descendant, true); 13435 else 13436 this.selectNode(descendant, true); 13437 } 13438 13439 if(selected) { 13440 this.removeDescendantsFromSelection(node.data('rk')); 13441 } 13442 13443 //propagate up 13444 var parentNode = this.getParent(node); 13445 if(parentNode) { 13446 this.propagateUp(parentNode); 13447 } 13448 13449 this.writeSelections(); 13450 13451 if(selected) 13452 this.fireUnselectNodeEvent(rowKey); 13453 else 13454 this.fireSelectNodeEvent(rowKey); 13455 }, 13456 13457 /** 13458 * Finds all descendants of the given row, i.e. all children, grandchildren etc. 13459 * @param {JQuery} node A node for which to get the descendants. 13460 * @return {JQuery} The descendants of the given row. An empty jQuery instance in case the row does not have 13461 * descendants. 13462 */ 13463 getDescendants: function(node) { 13464 var nodeKey = node.attr('data-rk'), 13465 nextNodes = node.nextAll(), 13466 descendants = []; 13467 13468 for(var i = 0; i < nextNodes.length; i++) { 13469 var nextNode = nextNodes.eq(i), 13470 nextNodeRowKey = nextNode.attr('data-rk'); 13471 13472 if(nextNodeRowKey.indexOf(nodeKey) != -1) { 13473 descendants.push(nextNode); 13474 } 13475 else { 13476 break; 13477 } 13478 } 13479 13480 return descendants; 13481 }, 13482 13483 /** 13484 * Finds the children of the given row. 13485 * @param {JQuery} node A row for which to find the children. 13486 * @return {JQuery} The children of the given row. An empty jQuery instance in case the row does not have children. 13487 */ 13488 getChildren: function(node) { 13489 var nodeKey = node.attr('data-rk'), 13490 nextNodes = node.nextAll(), 13491 children = []; 13492 13493 for(var i = 0; i < nextNodes.length; i++) { 13494 var nextNode = nextNodes.eq(i), 13495 nextNodeParentKey = nextNode.attr('data-prk'); 13496 13497 if(nextNodeParentKey === nodeKey) { 13498 children.push(nextNode); 13499 } 13500 } 13501 13502 return children; 13503 }, 13504 13505 /** 13506 * Propagates a select or unselect event up to the parents of the given row. 13507 * @private 13508 * @param {JQuery} node A node that was selected or unselected. 13509 */ 13510 propagateUp: function(node) { 13511 var children = this.getChildren(node), 13512 allSelected = true, 13513 partialSelected = false, 13514 checkbox = this.cfg.nativeElements ? node.find('> td:first-child > :checkbox') : 13515 node.find('> td:first-child > div.ui-chkbox > div.ui-chkbox-box > span.ui-chkbox-icon'); 13516 13517 for(var i = 0; i < children.length; i++) { 13518 var child = children[i], 13519 childSelected = child.hasClass('ui-state-highlight'); 13520 13521 allSelected = allSelected&&childSelected; 13522 partialSelected = partialSelected||childSelected||child.hasClass('ui-treetable-partialselected'); 13523 } 13524 13525 if(allSelected) { 13526 node.removeClass('ui-treetable-partialselected'); 13527 this.selectNode(node, true); 13528 } 13529 else if(partialSelected) { 13530 node.removeClass('ui-state-highlight').addClass('ui-treetable-partialselected'); 13531 13532 if(this.cfg.nativeElements) 13533 checkbox.prop('indeterminate', true).removeClass('ui-state-active'); 13534 else 13535 checkbox.removeClass('ui-icon-blank ui-icon-check').addClass('ui-icon-minus').closest('.ui-chkbox-box').removeClass('ui-state-active'); 13536 13537 this.removeSelection(node.attr('data-rk')); 13538 } 13539 else { 13540 node.removeClass('ui-state-highlight ui-treetable-partialselected'); 13541 13542 if(this.cfg.nativeElements) 13543 checkbox.prop('indeterminate', false).prop('checked', false).removeClass('ui-state-active'); 13544 else 13545 checkbox.addClass('ui-icon-blank').removeClass('ui-icon-check ui-icon-minus').closest('.ui-chkbox-box').removeClass('ui-state-active'); 13546 13547 this.removeSelection(node.attr('data-rk')); 13548 } 13549 13550 var parent = this.getParent(node); 13551 if(parent) {
13552 this.propagateUp(parent); 13553 } 13554 }, 13555 13556 /** 13557 * Finds the parent row of the given row of this tree table. 13558 * @param {JQuery} node A row for which to find the parent. 13559 * @return {JQuery | null} The parent of the given row, or `null` if it does not have a parent. 13560 */ 13561 getParent: function(node) { 13562 var parent = $(this.jqId + '_node_' + node.attr('data-prk')); 13563 13564 return parent.length === 1 ? parent : null; 13565 }, 13566 13567 /** 13568 * Removes all children of the given row from the list of currently selected rows. 13569 * @private 13570 * @param {string} rowKey A row with children that were unselected. 13571 */ 13572 removeDescendantsFromSelection: function(rowKey) { 13573 this.selections = $.grep(this.selections, function(value) { 13574 return value.indexOf(rowKey + '_') !== 0; 13575 }); 13576 }, 13577 13578 /** 13579 * Removes the given row from the list of currenlty selected rows. 13580 * @param {string} nodeKey A row that was unselected. 13581 */ 13582 removeSelection: function(nodeKey) { 13583 this.selections = $.grep(this.selections, function(value) { 13584 return value !== nodeKey; 13585 }); 13586 }, 13587 13588 /** 13589 * Adds the given row to the list of currently selected rows. 13590 * @private 13591 * @param {string} rowKey A row that was selected. 13592 */ 13593 addToSelection: function(rowKey) { 13594 if(!this.isSelected(rowKey)) { 13595 this.selections.push(rowKey); 13596 } 13597 }, 13598 13599 /** 13600 * Checks whether the given row is currently selected. 13601 * @param {string} nodeKey Key of a row to check. 13602 * @return {boolean} Whether the given row is selected. 13603 */ 13604 isSelected: function(nodeKey) { 13605 return PrimeFaces.inArray(this.selections, nodeKey); 13606 }, 13607 13608 /** 13609 * Checks whether only a single row of this tree table can be selected via clicking. 13610 * @return {boolean} `true` if the {@link TreeTableCfg.selectionMode} is set to `single`, or `false` otherwise. 13611 */ 13612 isSingleSelection: function() { 13613 return this.cfg.selectionMode == 'single'; 13614 }, 13615 13616 /** 13617 * Checks whether multiple rows of this tree table may be selected. 13618 * @return {boolean} `true` if the {@link TreeTableCfg.selectionMode} is set to `multiple`, or `false` otherwise. 13619 */ 13620 isMultipleSelection: function() { 13621 return this.cfg.selectionMode == 'multiple'; 13622 }, 13623 13624 /** 13625 * Checks whether rows of this tree table are selected via checkboxes. 13626 * @return {boolean} `true` if the {@link TreeTableCfg.selectionMode} is set to `checkbox`, or `false` otherwise. 13627 */ 13628 isCheckboxSelection: function() { 13629 return this.cfg.selectionMode == 'checkbox'; 13630 }, 13631 13632 /** 13633 * Saves the currently selected rows in the hidden input field. 13634 * @private 13635 */ 13636 writeSelections: function() { 13637 this.jqSelection.val(this.selections.join(',')); 13638 }, 13639 13640 /** 13641 * Callback for when a node was selected. Invokes the appropriate behaviors. 13642 * @private 13643 * @param {string} nodeKey Key of the row that was selected. 13644 */ 13645 fireSelectNodeEvent: function(nodeKey) { 13646 if(this.isCheckboxSelection()) { 13647 var $this = this, 13648 options = { 13649 source: this.id, 13650 process: this.id 13651 }; 13652 13653 options.params = [ 13654 {name: this.id + '_instantSelection', value: nodeKey} 13655 ]; 13656 13657 options.oncomplete = function(xhr, status, args, data) { 13658 if(args.descendantRowKeys && args.descendantRowKeys !== '') { 13659 var rowKeys = args.descendantRowKeys.split(','); 13660 for(var i = 0; i < rowKeys.length; i++) { 13661 $this.addToSelection(rowKeys[i]); 13662 } 13663 $this.writeSelections(); 13664 } 13665 } 13666 13667 if(this.hasBehavior('select')) { 13668 this.callBehavior('select', options); 13669 } 13670 else { 13671 PrimeFaces.ajax.Request.handle(options); 13672 } 13673 } 13674 else { 13675 this.fireSelectEvent(nodeKey, 'select'); 13676 } 13677 }, 13678 13679 /** 13680 * Callback for when a node was unselected. Invokes the appropriate behaviors. 13681 * @private 13682 * @param {string}
13682 nodeKey Key of the row that was unselected. 13683 */ 13684 fireUnselectNodeEvent: function(nodeKey) { 13685 if(this.hasBehavior('unselect')) { 13686 var ext = { 13687 params: [ 13688 {name: this.id + '_instantUnselection', value: nodeKey} 13689 ] 13690 }; 13691 13692 this.callBehavior('unselect', ext); 13693 } 13694 }, 13695 13696 /** 13697 * Initializes scrolling and sets up the appropriate event handlers. 13698 * @private 13699 */ 13700 setupScrolling: function() { 13701 this.scrollHeader = this.jq.children('div.ui-treetable-scrollable-header'); 13702 this.scrollBody = this.jq.children('div.ui-treetable-scrollable-body'); 13703 this.scrollFooter = this.jq.children('div.ui-treetable-scrollable-footer'); 13704 this.scrollStateHolder = $(this.jqId + '_scrollState'); 13705 this.scrollHeaderBox = this.scrollHeader.children('div.ui-treetable-scrollable-header-box'); 13706 this.scrollFooterBox = this.scrollFooter.children('div.ui-treetable-scrollable-footer-box'); 13707 this.headerTable = this.scrollHeaderBox.children('table'); 13708 this.bodyTable = this.scrollBody.children('table'); 13709 this.footerTable = this.scrollFooterBox.children('table'); 13710 this.headerCols = this.headerTable.find('> thead > tr > th'); 13711 this.footerCols = this.footerTable.find('> tfoot > tr > td'); 13712 this.percentageScrollHeight = this.cfg.scrollHeight && (this.cfg.scrollHeight.indexOf('%') !== -1); 13713 this.percentageScrollWidth = this.cfg.scrollWidth && (this.cfg.scrollWidth.indexOf('%') !== -1); 13714 var $this = this; 13715 13716 if(this.cfg.scrollHeight) { 13717 if(this.cfg.scrollHeight.indexOf('%') !== -1) { 13718 this.adjustScrollHeight(); 13719 } 13720 13721 if(this.cfg.scrollHeight.indexOf('vh') !== -1) { 13722 this.applyViewPortScrollHeight(); 13723 } 13724 13725 this.marginRight = this.getScrollbarWidth() + 'px'; 13726 this.scrollHeaderBox.css('margin-right', this.marginRight); 13727 this.scrollFooterBox.css('margin-right', this.marginRight); 13728 this.alignScrollBody(); 13729 } 13730 13731 this.fixColumnWidths(); 13732 13733 if(this.cfg.scrollWidth) { 13734 if(this.cfg.scrollWidth.indexOf('%') !== -1) { 13735 this.adjustScrollWidth(); 13736 } 13737 else { 13738 this.setScrollWidth(parseInt(this.cfg.scrollWidth)); 13739 } 13740 } 13741 13742 this.cloneHead(); 13743 13744 this.restoreScrollState(); 13745 13746 this.updateVerticalScroll(); 13747 13748 this.scrollBody.on('scroll.treeTable', function() { 13749 var scrollLeft = $this.scrollBody.scrollLeft(); 13750 $this.scrollHeaderBox.css('margin-left', -scrollLeft + 'px'); 13751 $this.scrollFooterBox.css('margin-left', -scrollLeft + 'px'); 13752 13753 $this.saveScrollState(); 13754 }); 13755 13756 this.scrollHeader.on('scroll.treeTable', function() { 13757 $this.scrollHeader.scrollLeft(0); 13758 }); 13759 13760 this.scrollFooter.on('scroll.treeTable', function() { 13761 $this.scrollFooter.scrollLeft(0); 13762 }); 13763 13764 PrimeFaces.utils.registerResizeHandler(this, 'resize.' + this.id + '_align', $this.jq, function() { 13765 if ($this.percentageScrollHeight) { 13766 $this.adjustScrollHeight(); 13767 } 13768 if ($this.percentageScrollWidth) { 13769 $this.adjustScrollWidth(); 13770 } 13771 }); 13772 }, 13773 13774 /** 13775 * Clones a table header and removes duplicate IDs. 13776 * @private 13777 * @param {JQuery} thead The head (`THEAD`) of the table to clone. 13778 * @param {JQuery} table The table to which the head belongs. 13779 * @return {JQuery} The cloned table head. 13780 */ 13781 cloneTableHeader: function(thead, table) { 13782 var clone = thead.clone(); 13783 clone.find('th').each(function() { 13784 var header = $(this); 13785 header.attr('id', header.attr('id') + '_clone'); 13786 header.children().not('.ui-column-title').remove(); 13787 header.children('.ui-column-title').children().remove(); 13788 }); 13789 clone.removeAttr('id').addClass('ui-treetable-scrollable-theadclone').height(0).prependTo(table); 13790 13791 return clone; 13792 }, 13793 13794 /** 13795 * Creates and stores a cloned copy of the table head(er), and sets up some event handlers. 13796 * @private 13797 */ 13798 cloneHead: function() { 13799 if (this.theadClone) { 13800 this.theadClone.remove(); 13801 } 13802 this.theadClone = this.cloneTableHeader(this.headerTable.children('thead'), this.bodyTable); 13803 }, 13804 13805 /** 13806 * Applies the desired width to all columns. 13807 * @private 13808 */ 13809 fixColumnWidths: function() { 13810 var $this = this; 13811 13812 if(!this.columnWidthsFixed) { 13813 if(this.cfg.scrollable) { 13814 this.headerCols.each(function() { 13815 var headerCol = $(this), 13816 colIndex = headerCol.index(), 13817 width = headerCol.width(); 13818 13819 if ($this.resizableState) { 13820 width = $this.findColWidthInResizableState(headerCol.attr('id')) || width; 13821 } 13822 13823 headerCol.width(width); 13824 13825 if($this.footerCols.length > 0) { 13826 var footerCol = $this.footerCols.eq(colIndex); 13827 footerCol.width(width); 13828 } 13829 }); 13830 } 13831 else { 13832 var columns = this.jq.find('> table > thead > tr > th'), 13833 visibleColumns = columns.filter(':visible'), 13834 hiddenColumns = columns.filter(':hidden'); 13835 13836 this.setColumnsWidth(visibleColumns); 13837 /* IE fixes */ 13838 this.setColumnsWidth(hiddenColumns); 13839 } 13840 13841 this.columnWidthsFixed = true; 13842 } 13843 }, 13844 13845 /** 13846 * Applies the appropriated width to all given column elements. 13847 * @param {JQuery} columns A list of column elements. 13848 * @private 13849 */ 13850 setColumnsWidth: function(columns) { 13851 if(columns.length) { 13852 var $this = this; 13853 13854 columns.each(function() { 13855 var col = $(this), 13856 colStyle = col[0].style, 13857 width = colStyle.width||col.width(); 13858 13859 if ($this.resizableState) { 13860 width = $this.findColWidthInResizableState(col.attr('id')) || width; 13861 } 13862 13863 col.width(width); 13864 }); 13865 } 13866 }, 13867 13868 /** 13869 * Computes and saves the resizable state of this data table, ie. which columns have got which width. May be used 13870 * later to restore the current column width after an AJAX update. 13871 * @private 13872 * @param {JQuery} columnHeader Element of a column header of this data table. 13873 * @param {JQuery} nextColumnHeader Element of the column header next to the given column header. 13874 * @param {JQuery} table The element for this data table. 13875 * @param {number} newWidth New width to be applied. 13876 * @param {number | null} nextColumnWidth Width of the column next to the given column header. 13877 */ 13878 updateResizableState: function(columnHeader, nextColumnHeader, table, newWidth, nextColumnWidth) { 13879 var expandMode = (this.cfg.resizeMode === 'expand'), 13880 currentColumnId = columnHeader.attr('id'), 13881 nextColumnId = nextColumnHeader.attr('id'), 13882 tableId = this.id + "_tableWidthState", 13883 currentColumnState = currentColumnId + '_' + newWidth, 13884 nextColumnState = nextColumnId + '_' + nextColumnWidth, 13885 tableState = tableId + '_' + parseInt(table.css('width')), 13886 currentColumnMatch = false, 13887 nextColumnMatch = false, 13888 tableMatch = false;
13889 13890 for(var i = 0; i < this.resizableState.length; i++) { 13891 var state = this.resizableState[i]; 13892 if(state.indexOf(currentColumnId) === 0) { 13893 this.resizableState[i] = currentColumnState; 13894 currentColumnMatch = true; 13895 } 13896 else if(!expandMode && state.indexOf(nextColumnId) === 0) { 13897 this.resizableState[i] = nextColumnState; 13898 nextColumnMatch = true; 13899 } 13900 else if(expandMode && state.indexOf(tableId) === 0) { 13901 this.resizableState[i] = tableState; 13902 tableMatch = true; 13903 } 13904 } 13905 13906 if(!currentColumnMatch) { 13907 this.resizableState.push(currentColumnState); 13908 } 13909 13910 if(!expandMode && !nextColumnMatch) { 13911 this.resizableState.push(nextColumnState); 13912 } 13913 13914 if(expandMode && !tableMatch) { 13915 this.resizableState.push(tableState); 13916 } 13917 13918 this.resizableStateHolder.val(this.resizableState.join(',')); 13919 }, 13920 13921 /** 13922 * Finds the saved width of the given column. The width of resizable columns may be saved to restore it after an 13923 * AJAX update. 13924 * @private 13925 * @param {string} id ID of a column 13926 * @return {string | null} The saved width of the given column in pixels. `null` when the given column does not 13927 * exist. 13928 */ 13929 findColWidthInResizableState: function(id) { 13930 for (var i = 0; i < this.resizableState.length; i++) { 13931 var state = this.resizableState[i]; 13932 if (state.indexOf(id) === 0) { 13933 return state.substring(state.lastIndexOf('_') + 1, state.length); 13934 } 13935 } 13936 13937 return null; 13938 }, 13939 13940 /** 13941 * Adjust the view and scrolling position for the current height of the table. 13942 * @private 13943 */ 13944 adjustScrollHeight: function() { 13945 var relativeHeight = this.jq.parent().innerHeight() * (parseInt(this.cfg.scrollHeight) / 100), 13946 tableHeaderHeight = this.jq.children('.ui-treetable-header').outerHeight(true), 13947 tableFooterHeight = this.jq.children('.ui-treetable-footer').outerHeight(true), 13948 scrollersHeight = (this.scrollHeader.outerHeight(true) + this.scrollFooter.outerHeight(true)), 13949 height = (relativeHeight - (scrollersHeight + tableHeaderHeight + tableFooterHeight)); 13950 13951 this.scrollBody.height(height); 13952 }, 13953 13954 /** 13955 * Sets the height of the scroll body to the value of this widget's configuration. 13956 * @private 13957 */ 13958 applyViewPortScrollHeight: function() { 13959 this.scrollBody.height(this.cfg.scrollHeight); 13960 }, 13961 13962 /** 13963 * Adjust the view and scrolling position for the current width of the table. 13964 * @private 13965 */ 13966 adjustScrollWidth: function() { 13967 var width = parseInt((this.jq.parent().innerWidth() * (parseInt(this.cfg.scrollWidth) / 100))); 13968 this.setScrollWidth(width); 13969 }, 13970 13971 /** 13972 * Applies the given outer width to an element. 13973 * @private 13974 * @param {JQuery} element An element to modify. 13975 * @param {number} width The new (outer) width for the element. 13976 */ 13977 setOuterWidth: function(element, width) { 13978 var diff = element.outerWidth() - element.width(); 13979 element.width(width - diff); 13980 }, 13981 13982 /** 13983 * Checks if there is any vertical overflow present currently. 13984 * @private 13985 * @return {boolean} `true` if there is overflow in the vertical y direction, or `false` otherwise. 13986 */ 13987 hasVerticalOverflow: function() { 13988 return (this.cfg.scrollHeight && this.bodyTable.outerHeight() > this.scrollBody.outerHeight()); 13989 }, 13990 13991 /** 13992 * Adjust the view for the given scrollbar width. 13993 * @private 13994 * @param {number} width The width of the scrollbar. 13995 */ 13996 setScrollWidth: function(width) { 13997 var $this = this; 13998 this.jq.children('.ui-widget-header').each(function() { 13999 $this.setOuterWidth($(this), width); 14000 }); 14001 this.scrollHeader.width(width); 14002 this.scrollBody.css('padding-right', '0px').width(width); 14003 this.scrollFooter.width(width); 14004 }, 14005 14006 /** 14007 * Aligns the scroll body element, taking into account the width of the scrollbar. 14008 * @private 14009 */ 14010 alignScrollBody: function() { 14011 if(!this.cfg.scrollWidth) { 14012 if(this.hasVerticalOverflow()) 14013 this.scrollBody.css('padding-right', '0px'); 14014 else
14015 this.scrollBody.css('padding-right', this.getScrollbarWidth() + 'px'); 14016 } 14017 }, 14018 14019 /** 14020 * Attempts to find a width for the scrollbar of the browser. 14021 * @private 14022 * @return {number} An estimate in pixels for the width of the native scrollbar. 14023 */ 14024 getScrollbarWidth: function() { 14025 return $.browser.webkit ? '15' : PrimeFaces.calculateScrollbarWidth(); 14026 }, 14027 14028 /** 14029 * Reads the scroll position from the hidden input element and applies it. 14030 * @private 14031 */ 14032 restoreScrollState: function() { 14033 var scrollState = this.scrollStateVal||this.scrollStateHolder.val(), 14034 scrollValues = scrollState.split(','); 14035 14036 this.scrollBody.scrollLeft(scrollValues[0]); 14037 this.scrollBody.scrollTop(scrollValues[1]); 14038 this.scrollStateVal = null; 14039 }, 14040 14041 /** 14042 * Stores the current scroll position in a hidden input element. 14043 * @private 14044 */ 14045 saveScrollState: function() { 14046 var scrollState = this.scrollBody.scrollLeft() + ',' + this.scrollBody.scrollTop(); 14047 14048 this.scrollStateHolder.val(scrollState); 14049 }, 14050 14051 /** 14052 * Sets up the JQuery UI draggable with the appropriate event listeners for resizing columns. 14053 * @private 14054 */ 14055 setupResizableColumns: function() { 14056 this.fixColumnWidths(); 14057 14058 if(!this.cfg.liveResize) { 14059 this.resizerHelper = $('<div class="ui-column-resizer-helper ui-state-highlight"></div>').appendTo(this.jq); 14060 } 14061 14062 this.thead.find('> tr > th.ui-resizable-column:not(:last-child)').prepend('<span class="ui-column-resizer"> </span>'); 14063 var resizers = this.thead.find('> tr > th > span.ui-column-resizer'), 14064 $this = this; 14065 14066 resizers.draggable({ 14067 axis: 'x', 14068 start: function() { 14069 if($this.cfg.liveResize) { 14070 $this.jq.css('cursor', 'col-resize'); 14071 } 14072 else { 14073 var header = $this.cfg.stickyHeader ? $this.clone : $this.thead, 14074 height = $this.cfg.scrollable ? $this.scrollBody.height() : header.parent().height() - header.height() - 1; 14075 14076 if($this.cfg.stickyHeader) { 14077 height = height - $this.relativeHeight; 14078 } 14079 14080 $this.resizerHelper.height(height); 14081 $this.resizerHelper.show(); 14082 } 14083 }, 14084 drag: function(event, ui) { 14085 if($this.cfg.liveResize) { 14086 $this.resize(event, ui); 14087 } 14088 else { 14089 $this.resizerHelper.offset({ 14090 left: ui.helper.offset().left + ui.helper.width() / 2, 14091 top: $this.thead.offset().top + $this.thead.height() 14092 }); 14093 } 14094 }, 14095 stop: function(event, ui) { 14096 var columnHeader = ui.helper.parent(); 14097 ui.helper.css('left',''); 14098 14099 if($this.cfg.liveResize) { 14100 $this.jq.css('cursor', 'default'); 14101 } else { 14102 $this.resize(event, ui); 14103 $this.resizerHelper.hide(); 14104 } 14105 14106 var options = { 14107 source: $this.id, 14108 process: $this.id, 14109 params: [ 14110 {name: $this.id + '_colResize', value: true}, 14111 {name: $this.id + '_columnId', value: columnHeader.attr('id')}, 14112 {name: $this.id + '_width', value: parseInt(columnHeader.width())}, 14113 {name: $this.id + '_height', value: parseInt(columnHeader.height())} 14114 ] 14115 }; 14116 14117 if($this.hasBehavior('colResize')) { 14118 $this.callBehavior('colResize', options); 14119 } 14120 14121 if($this.cfg.stickyHeader) { 14122 $this.reclone(); 14123 } 14124 }, 14125 containment: this.jq 14126 }); 14127 }, 14128 14129 /** 14130 * Callback for when a row was resized. Adjust the column widths. 14131 * @private 14132 * @param {JQuery.TriggeredEvent} event Event that triggered the resize. 14133 * @param {JQueryUI.DraggableEventUIParams} ui Details about the resize. 14134 */ 14135 resize: function(event, ui) { 14136 var columnHeader = ui.helper.parent(), 14137 nextColumnHeader = columnHeader.next(), 14138 table = this.thead.parent(), 14139 change = null, 14140 newWidth = null, 14141 nextColumnWidth = null; 14142 14143 if(this.cfg.liveResize) { 14144 change = columnHeader.outerWidth() - (event.pageX - columnHeader.offset().left), 14145 newWidth = (columnHeader.width() - change), 14146 nextColumnWidth = (nextColumnHeader.width() + change); 14147 } 14148 else { 14149 change = (ui.position.left - ui.originalPosition.left), 14150 newWidth = (columnHeader.width() + change), 14151 nextColumnWidth = (nextColumnHeader.width() - change); 14152 } 14153 14154 if(newWidth > 15 && nextColumnWidth > 15) { 14155 columnHeader.width(newWidth); 14156 nextColumnHeader.width(nextColumnWidth); 14157 this.updateResizableState(columnHeader, nextColumnHeader, table, newWidth, nextColumnWidth); 14158 14159 var colIndex = columnHeader.index(); 14160 14161 if(this.cfg.scrollable) { 14162 this.theadClone.find(PrimeFaces.escapeClientId(columnHeader.attr('id') + '_clone')).width(newWidth); 14163 this.theadClone.find(PrimeFaces.escapeClientId(nextColumnHeader.attr('id') + '_clone')).width(nextColumnWidth); 14164 14165 if(this.footerCols.length > 0) { 14166 var footerCol = this.footerCols.eq(colIndex), 14167 nextFooterCol = footerCol.next(); 14168 14169 footerCol.width(newWidth); 14170 nextFooterCol.width(nextColumnWidth); 14171 } 14172 } 14173 } 14174 }, 14175 14176 /** 14177 * Removes the cloned table header and create a new clone. 14178 * @private 14179 */ 14180 reclone: function() { 14181 this.clone.remove(); 14182 this.clone = this.thead.clone(false); 14183 this.jq.children('table').append(this.clone); 14184 }, 14185 14186 /** 14187 * Switches a row to edit mode and displays the editors for that row. 14188 * @param {JQuery} row A row for which to activate the editors. Must be a TR element. 14189 */ 14190 switchToRowEdit: function(row) { 14191 this.showRowEditors(row); 14192 14193 if(this.hasBehavior('rowEditInit')) { 14194 var rowKey = row.data('rk'); 14195 14196 var ext = { 14197 params: [{name: this.id + '_rowEditIndex', value: rowKey}] 14198 }; 14199 14200 this.callBehavior('rowEditInit', ext); 14201 } 14202 }, 14203 14204 /** 14205 * Hides the row and display the row editors. 14206 * @private 14207 * @param {JQuery} row A row for which to show the editors. 14208 */ 14209 showRowEditors: function(row) { 14210 row.addClass('ui-state-highlight ui-row-editing').children('td.ui-editable-column').each(function() { 14211 var column = $(this); 14212 14213 column.find('.ui-cell-editor-output').hide(); 14214 column.find('.ui-cell-editor-input').show(); 14215 }); 14216 }, 14217 14218 /** 14219 * When a row is currently being edited: Saves the edited row and hides the editors. 14220 * @param {JQuery} rowEditor A row to save, must be a TR element. 14221 */ 14222 saveRowEdit: function(rowEditor) { 14223 this.doRowEditRequest(rowEditor, 'save'); 14224 }, 14225 14226 /** 14227 * When a row is currently being edited: cancels row editing and discards the entered data. 14228 * @param {JQuery} rowEditor A row for which to cancel editing, must be a TR element. 14229 */ 14230 cancelRowEdit: function(rowEditor) { 14231 this.doRowEditRequest(rowEditor, 'cancel'); 14232 }, 14233 14234 /** 14235 * Sends an AJAX request to the server to handle a row save or cancel event. 14236 * @private 14237 * @param {JQuery} rowEditor The inline editor with data that needs to be saved or discarded. 14238 * @param {string} action The action to perform, either `save` or `cancel`. 14239 */ 14240 doRowEditRequest: function(rowEditor, action) { 14241 var row = rowEditor.closest('tr'), 14242 rowKey = row.data('rk'), 14243 expanded = row.hasClass('ui-expanded-row'), 14244 $this = this, 14245 options = { 14246 source: this.id, 14247 process: this.id, 14248 update: this.id, 14249 formId: this.getParentFormId(), 14250 params: [{name: this.id + '_rowEditIndex', value: rowKey}, 14251 {name: this.id + '_rowEditAction', value: action}], 14252 onsuccess: function(responseXML, status, xhr) { 14253 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 14254 widget: $this, 14255 handle: function(content) { 14256 if(expanded) { 14257 this.collapseRow(row); 14258 } 14259 14260 this.updateRows(row, content); 14261 } 14262 }); 14263 14264 return true; 14265 }, 14266 oncomplete: function(xhr, status, args, data) { 14267 if(args && args.validationFailed) { 14268 $this.invalidateRow(rowKey); 14269 } 14270 } 14271 }; 14272 14273 if(action === 'save') { 14274 this.getRowEditors(row).each(function() { 14275 options.params.push({name: this.id, value: this.id}); 14276 }); 14277 } 14278 14279 if(action === 'save' && this.hasBehavior('rowEdit')) { 14280 this.callBehavior('rowEdit', options); 14281 } 14282 else if(action === 'cancel' && this.hasBehavior('rowEditCancel')) { 14283 this.callBehavior('rowEditCancel', options); 14284 } 14285 else { 14286 PrimeFaces.ajax.Request.handle(options); 14287 } 14288 }, 14289 14290 /** 14291 * Updates a row with the given HTML content. 14292 * @private 14293 * @param {JQuery} row A row to update. 14294 * @param {string | HTMLElement | HTMLElement[] | JQuery} content The new HTML content of the row. 14295 */ 14296 updateRows: function(row, content) { 14297 this.tbody.children('tr').filter('[data-prk^="'+ row.data('rk') +'"]').remove(); 14298 row.replaceWith(content); 14299 }, 14300 14301 /** 14302 * Callback for when validation did not succeed. Switches all editors of the given row to the error state. 14303 * @private 14304 * @param {string} rowKey the rowKey. 14305 */ 14306 invalidateRow: function(rowKey) { 14307 this.tbody.children('tr').filter('[data-rk="'+ rowKey +'"]').addClass('ui-widget-content ui-row-editing ui-state-error'); 14308 }, 14309 14310 /** 14311 * Finds all editors of a row. 14312 * @private 14313 * @param {JQuery} row A row for which to find all cell editors. 14314 * @return {JQuery} All cell editors of the given row. 14315 */ 14316 getRowEditors: function(row) { 14317 return row.find('div.ui-cell-editor'); 14318 }, 14319 14320 /** 14321 * Collapses the given row of this tree table after saving the contents of an inline editor. 14322 * @private 14323 * @param {JQuery} row A row to collapse. 14324 */ 14325 collapseRow: function(row) { 14326 row.removeClass('ui-expanded-row').next('.ui-expanded-row-content').remove(); 14327 }, 14328 14329 /** 14330 * Activates the inline editor for the given cell. 14331 * @param {JQuery} c The cell TD element for which to activate the inline editor. 14332 */ 14333 showCellEditor: function(c) { 14334 var cell = null; 14335 14336 if(c) { 14337 cell = c; 14338 14339 //remove contextmenu selection highlight 14340 if(this.contextMenuCell) { 14341 this.contextMenuCell.parent().removeClass('ui-state-highlight'); 14342 } 14343 } 14344 else { 14345 cell = this.contextMenuCell; 14346 } 14347 14348 var editorInput = cell.find('> .ui-cell-editor > .ui-cell-editor-input'); 14349 if(editorInput.length !== 0 && editorInput.children().length === 0 && this.cfg.editMode === 'cell') { 14350 // for lazy cellEditMode 14351 this.cellEditInit(cell); 14352 } 14353 else { 14354 this.showCurrentCell(cell); 14355 14356 if(this.hasBehavior('cellEditInit')) { 14357 var cellInfo = this.getCellMeta(cell); 14358 var ext = { 14359 params: [{name: this.id + '_cellInfo', value: cellInfo}] 14360 }; 14361 this.callBehavior('cellEditInit', ext); 14362 } 14363 } 14364 }, 14365 14366 /** 14367 * Makes the inline cell visible and sets up the appropriate event listeners. 14368 * @private 14369 * @param {JQuery} cell The cell TD element for which to activate inline editing mode. 14370 */ 14371 showCurrentCell: function(cell) { 14372 var $this = this; 14373 14374 if(this.currentCell) { 14375 if(this.cfg.saveOnCellBlur) 14376 this.saveCell(this.currentCell); 14377 else if(!this.currentCell.is(cell)) 14378 this.doCellEditCancelRequest(this.currentCell); 14379 } 14380 14381 this.currentCell = cell; 14382 14383 var cellEditor = cell.children('div.ui-cell-editor'), 14384 displayContainer = cellEditor.children('div.ui-cell-editor-output'), 14385 inputContainer = cellEditor.children('div.ui-cell-editor-input'), 14386 inputs = inputContainer.find(':input:enabled'),
14387 multi = inputs.length > 1; 14388 14389 cell.addClass('ui-state-highlight ui-cell-editing'); 14390 displayContainer.hide(); 14391 inputContainer.show(); 14392 inputs.eq(0).trigger('focus').trigger('select'); 14393 14394 //metadata 14395 if(multi) { 14396 var oldValues = []; 14397 for(var i = 0; i < inputs.length; i++) { 14398 oldValues.push(inputs.eq(i).val()); 14399 } 14400 14401 cell.data('multi-edit', true); 14402 cell.data('old-value', oldValues); 14403 } 14404 else { 14405 cell.data('multi-edit', false); 14406 cell.data('old-value', inputs.eq(0).val()); 14407 } 14408 14409 //bind events on demand 14410 if(!cell.data('edit-events-bound')) { 14411 cell.data('edit-events-bound', true); 14412 14413 inputs.on('keydown.treetable-cell', function(e) { 14414 var keyCode = $.ui.keyCode, 14415 shiftKey = e.shiftKey, 14416 key = e.which, 14417 input = $(this); 14418 14419 if(key === keyCode.ENTER) { 14420 $this.saveCell(cell); 14421 14422 e.preventDefault(); 14423 } 14424 else if(key === keyCode.TAB) { 14425 if(multi) { 14426 var focusIndex = shiftKey ? input.index() - 1 : input.index() + 1; 14427 14428 if(focusIndex < 0 || (focusIndex === inputs.length)) { 14429 $this.tabCell(cell, !shiftKey); 14430 } else { 14431 inputs.eq(focusIndex).trigger('focus'); 14432 } 14433 } 14434 else { 14435 $this.tabCell(cell, !shiftKey); 14436 } 14437 14438 e.preventDefault(); 14439 } 14440 else if(key === keyCode.ESCAPE) { 14441 $this.doCellEditCancelRequest(cell); 14442 e.preventDefault(); 14443 } 14444 }) 14445 .on('focus.treetable-cell click.treetable-cell', function(e) { 14446 $this.currentCell = cell; 14447 }); 14448 } 14449 }, 14450 14451 /** 14452 * Callback for when the tab key is pressed, switches (focuses) to the next or previous cell editor. 14453 * @private 14454 * @param {JQuery} cell The currently focused cell. 14455 * @param {boolean} forward `true` to move to the next cell, or `false` to move to the previous cell. 14456 */ 14457 tabCell: function(cell, forward) { 14458 var targetCell = forward ? cell.nextAll('td.ui-editable-column:first') : cell.prevAll('td.ui-editable-column:first'); 14459 if(targetCell.length == 0) { 14460 var tabRow = forward ? cell.parent().next() : cell.parent().prev(); 14461 targetCell = forward ? tabRow.children('td.ui-editable-column:first') : tabRow.children('td.ui-editable-column:last'); 14462 } 14463 14464 this.showCellEditor(targetCell); 14465 }, 14466 14467 /** 14468 * Saves the current data entered into a cell's inline editor. Checks whether the data has changed and if so, sends 14469 * it to the server. 14470 * @param {JQuery} cell A cell with an inline editor to save. 14471 */ 14472 saveCell: function(cell) { 14473 var inputs = cell.find('div.ui-cell-editor-input :input:enabled'), 14474 changed = false, 14475 $this = this; 14476 14477 if(cell.data('multi-edit')) { 14478 var oldValues = cell.data('old-value'); 14479 for(var i = 0; i < inputs.length; i++) { 14480 if(inputs.eq(i).val() != oldValues[i]) { 14481 changed = true; 14482 break; 14483 } 14484 } 14485 } 14486 else { 14487 changed = (inputs.eq(0).val() != cell.data('old-value')); 14488 } 14489 14490 if(changed) 14491 $this.doCellEditRequest(cell); 14492 else 14493 $this.viewMode(cell); 14494 14495 if(this.cfg.saveOnCellBlur) { 14496 this.currentCell = null; 14497 } 14498 }, 14499 14500 /** 14501 * Switch from edit mode to view mode, Hides the inline editor and displays the data. 14502 * @private 14503 * @param {JQuery} cell The cell with an activate inline editor to hide. 14504 */ 14505 viewMode: function(cell) { 14506 var cellEditor = cell.children('div.ui-cell-editor'), 14507 editableContainer = cellEditor.children('div.ui-cell-editor-input'), 14508 displayContainer = cellEditor.children('div.ui-cell-editor-output'); 14509 14510 cell.removeClass('ui-cell-editing ui-state-error ui-state-highlight'); 14511 displayContainer.show(); 14512 editableContainer.hide(); 14513 cell.removeData('old-value').removeData('multi-edit'); 14514 14515 if(this.cfg.cellEditMode === "lazy") { 14516 editableContainer.children().remove(); 14517 } 14518 }, 14519 14520 /** 14521 * When the inline editor a cell is active and the user wants to save the changes: send the newly entered data to 14522 * the server and hide the editor. 14523 * @private 14524 * @param {JQuery} cell The cell with an inline editor to be saved. 14525 */ 14526 doCellEditRequest: function(cell) { 14527 var cellEditor = cell.children('.ui-cell-editor'), 14528 cellEditorId = cellEditor.attr('id'), 14529 cellInfo = this.getCellMeta(cell), 14530 $this = this; 14531 14532 var options = { 14533 source: this.id, 14534 process: this.id, 14535 update: this.id, 14536 params: [{name: this.id + '_cellInfo', value: cellInfo}, 14537 {name: cellEditorId, value: cellEditorId}], 14538 onsuccess: function(responseXML, status, xhr) { 14539 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 14540 widget: $this, 14541 handle: function(content) { 14542 cellEditor.children('.ui-cell-editor-output').html(content); 14543 } 14544 }); 14545 14546 return true; 14547 }, 14548 oncomplete: function(xhr, status, args, data) { 14549 if(args.validationFailed) 14550 cell.addClass('ui-state-error'); 14551 else 14552 $this.viewMode(cell); 14553 } 14554 }; 14555 14556 if(this.hasBehavior('cellEdit')) { 14557 this.callBehavior('cellEdit', options); 14558 } 14559 else { 14560 PrimeFaces.ajax.Request.handle(options); 14561 } 14562 }, 14563 14564 /** 14565 * When the inline editor a cell is active and the user requests a cancel: discards the data and loads the 14566 * original content of the cell. 14567 * @private 14568 * @param {JQuery} cell The cell for which editing should be canceled. 14569 */ 14570 doCellEditCancelRequest: function(cell) { 14571 var cellEditor = cell.children('.ui-cell-editor'), 14572 cellIndex = cell.index(), 14573 cellInfo = cell.closest('tr').data('rk') + ',' + cellIndex, 14574 $this = this; 14575 14576 this.currentCell = null; 14577 14578 var options = { 14579 source: this.id, 14580 process: this.id, 14581 update: this.id, 14582 params: [{name: this.id + '_cellEditCancel', value: true}, 14583 {name: this.id + '_cellInfo', value: cellInfo}], 14584 onsuccess: function(responseXML, status, xhr) { 14585 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 14586 widget: $this, 14587 handle: function(content) { 14588 cellEditor.children('.ui-cell-editor-input').html(content); 14589 } 14590 }); 14591 14592 return true; 14593 }, 14594 oncomplete: function(xhr, status, args, data) { 14595 $this.viewMode(cell);
14596 cell.data('edit-events-bound', false); 14597 } 14598 }; 14599 14600 if(this.hasBehavior('cellEditCancel')) { 14601 this.callBehavior('cellEditCancel', options); 14602 } 14603 else { 14604 PrimeFaces.ajax.Request.handle(options); 14605 } 14606 }, 14607 14608 /** 14609 * When activating the inline editor of a cell, starts an AJAX request to fetch the editor's HTML. Also invokes 14610 * the appropriate behaviors. 14611 * @private 14612 * @param {JQuery} cell The cell for which inline editing should be activated. 14613 */ 14614 cellEditInit: function(cell) { 14615 var cellEditor = cell.children('.ui-cell-editor'), 14616 cellInfo = this.getCellMeta(cell), 14617 $this = this; 14618 14619 var options = { 14620 source: this.id, 14621 process: this.id, 14622 update: this.id, 14623 global: false, 14624 params: [{name: this.id + '_cellEditInit', value: true}, 14625 {name: this.id + '_cellInfo', value: cellInfo}], 14626 onsuccess: function(responseXML, status, xhr) { 14627 PrimeFaces.ajax.Response.handle(responseXML, status, xhr, { 14628 widget: $this, 14629 handle: function(content) { 14630 cellEditor.children('.ui-cell-editor-input').html(content); 14631 } 14632 }); 14633 14634 return true; 14635 }, 14636 oncomplete: function(xhr, status, args, data) { 14637 cell.data('edit-events-bound', false); 14638 $this.showCurrentCell(cell); 14639 } 14640 }; 14641 14642 if(this.hasBehavior('cellEditInit')) { 14643 this.callBehavior('cellEditInit', options); 14644 } 14645 else { 14646 PrimeFaces.ajax.Request.handle(options); 14647 } 14648 }, 14649 14650 /** 14651 * Retrieves the meta data of the given cell. 14652 * @private 14653 * @param {JQuery} cell A cell to inspect. 14654 * @return {string} The meta data for the given cell. 14655 */ 14656 getCellMeta: function(cell) { 14657 var cellIndex = cell.index(), 14658 cellInfo = cell.closest('tr').data('rk') + ',' + cellIndex; 14659 return cellInfo; 14660 }, 14661 14662 /** 14663 * Updates the vertical scroll position and adjusts the margin. 14664 * @private 14665 */ 14666 updateVerticalScroll: function() { 14667 if(this.cfg.scrollable && this.cfg.scrollHeight) { 14668 if(this.bodyTable.outerHeight() < this.scrollBody.outerHeight()) { 14669 this.scrollHeaderBox.css('margin-right', '0px'); 14670 this.scrollFooterBox.css('margin-right', '0px'); 14671 } 14672 else { 14673 this.scrollHeaderBox.css('margin-right', this.marginRight); 14674 this.scrollFooterBox.css('margin-right', this.marginRight); 14675 } 14676 } 14677 }, 14678 14679 /** 14680 * Checks whether the tree table should be sorted. 14681 * @private 14682 * @param {JQuery.TriggeredEvent} event Event that occurred. 14683 * @param {JQuery} column Column that was clicked. 14684 * @return {boolean} Whether the tree table should be sorted. 14685 */ 14686 shouldSort: function(event, column) { 14687 if(this.isEmpty()) { 14688 return false; 14689 } 14690 14691 var target = $(event.target); 14692 if(target.closest('.ui-column-customfilter', column).length) { 14693 return false; 14694 } 14695 14696 return target.is('th,span'); 14697 }, 14698 14699 /** 14700 * Checks whether any data is currently displayed. 14701 * @return {boolean} Whether there is any data displayed currently. 14702 */ 14703 isEmpty: function() { 14704 return this.tbody.children('tr.ui-treetable-empty-message').length === 1; 14705 }, 14706 14707 /** 14708 * Adds the given sorting to the list of sortings. Each sorting describes a column by which to sort. This data table 14709 * may be sorted by multiple columns. 14710 * @param {PrimeFaces.widget.DataTable.SortMeta} meta Sorting to add. 14711 * @private 14712 */ 14713 addSortMeta: function(meta) { 14714 this.sortMeta = $.grep(this.sortMeta, function(value) { 14715 return value.col !== meta.col; 14716 }); 14717 14718 this.sortMeta.push(meta); 14719 }, 14720 14721 /** 14722 * Serializes the option from the sort meta items. 14723 * @private 14724 * @param {keyof PrimeFaces.widget.DataTable.SortMeta} option Property of the sort meta to use. 14725 * @return {string} All values from the current sort meta list for the given option. 14726 */ 14727 joinSortMetaOption: function(option) { 14728 var value = ''; 14729 14730 for(var i = 0; i < this.sortMeta.length; i++) { 14731 value += this.sortMeta[i][option]; 14732 14733 if(i !== (this.sortMeta.length - 1)) { 14734 value += ','; 14735 } 14736 } 14737 14738 return value; 14739 }, 14740 14741 /** 14742 * Creates the sort order message shown to indicate what the current sort order is. 14743 * @private 14744 * @param {string | undefined} ariaLabel Optional label text from an aria attribute. 14745 * @param {string} sortOrderMessage Sort order message. 14746 * @return {string} The sort order message to use. 14747 */ 14748 getSortMessage: function(sortOrderMessage) { 14749 if(sortOrderMessage) { 14750 return sortOrderMessage; 14751 } 14752 else{ 14753 return 'Unsortiert'; 14754 } 14755 }, 14756 14757 /** 14758 * In multi-sort mode this will add number indicators to let the user know the current 14759 * sort order. If only one column is sorted then no indicator is displayed and will 14760 * only be displayed once more than one column is sorted. 14761 * @private 14762 */ 14763 updateSortPriorityIndicators: function() { 14764 var $this = this; 14765 14766 // remove all indicator numbers first 14767 $this.sortableColumns.find('.ui-sortable-column-badge').text('').addClass('ui-helper-hidden'); 14768 14769 // add 1,2,3 etc to columns if more than 1 column is sorted 14770 var sortMeta = $this.sortMeta; 14771 if (sortMeta && sortMeta.length > 1) { 14772 $this.sortableColumns.each(function() { 14773 var id = $(this).attr("id"); 14774 for (var i = 0; i < sortMeta.length; i++) { 14775 if (sortMeta[i].col == id) { 14776 $(this).find('.ui-sortable-column-badge').text(i + 1).removeClass('ui-helper-hidden'); 14777 } 14778 } 14779 }); 14780 } 14781 }, 14782 14783 closeDroplistMenu: function(){ 14784 var droplists = jQuery('ul.droplist-menu'); 14785 for(let i = 0; i < droplists.length; i++){ 14786 droplists[i].classList.add('noDisplay'); 14787 } 14788 } 14789}); 14790 } 14791 14792 /** 14793 * First Remove all current 'visibleTreeNode'-Markings 14794 * Then mark all child nodes of the current activeNode as 'visibleTreeNode' 14795 */ 14796 function markVisibleTreeNodes(treeElement) { 14797 var theTreeContainer = jQuery(treeElement); 14798 var breadcrumbContainer = theTreeContainer.find('.breadcrumb-container'); 14799 var activeNodeKey = breadcrumbContainer.attr('data-activeNodeKey'); 14800 14801 // Aktuell markierte Knoten finden und Markierung entfernen 14802 theTreeContainer.find('.ui-widget-content.visibleTreeNode').removeClass('visibleTreeNode'); 14803 14804 // Alle Knoten, die den aktiven Knoten als Parent haben auf sichtbar setzen 14805 var targetNodes = theTreeContainer.find('.ui-widget-content[data-prk="' + activeNodeKey + '"]'); 14806 targetNodes.addClass('visibleTreeNode'); 14807
14808 theTreeContainer.attr('data-markedVisibleTreeNodes', 'true'); 14809 } 14810 14811 14812 function hideWaiting() { 14813 jQuery(jQuery(".short-waiting-behavior[data-startswaiting='true'")[0]).removeData('waitingBehaviorSet'); 14814 jQuery(".short-waiting-behavior[data-startswaiting='true'").removeAttr('data-startswaiting'); 14815 jQuery('.treeTableSmallAnimation')[0].classList.add('noDisplay'); 14816 de.his.modules.Waiting.refresh(); 14817 } 14818 14819 window.isMobile = function() { 14820 return /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 14821 } 14822 14823 function toggleStickyButton() { 14824 jQuery(window).on('scroll resize', function () { 14825 const stickyButtons = document.querySelectorAll('[id$="stickyBackButton"]'); 14826 let oneDisplayed = false; 14827 14828 stickyButtons.forEach(stickyButton => { 14829 const breadcrumbContainer = stickyButton.previousElementSibling; 14830 const originalBackButton = breadcrumbContainer?.querySelector('.breadcrumbBack'); 14831 14832 stickyButton.classList.remove('display'); 14833 14834 if (!breadcrumbContainer || !originalBackButton) return; 14835 if (window.innerWidth > 768) return; 14836 14837 const rect = breadcrumbContainer.getBoundingClientRect(); 14838 const breadcrumbIstVollständigUnsichtbar = rect.bottom <= 0 || rect.top >= window.innerHeight; 14839 const containerVisible = !breadcrumbContainer.classList.contains('noDisplay'); 14840 14841 if (!oneDisplayed && containerVisible && breadcrumbIstVollständigUnsichtbar) { 14842 stickyButton.classList.add('display'); 14843 oneDisplayed = true; 14844 } 14845 }); 14846 }); 14847 14848 // Trigger once on page load too 14849 jQuery(window).trigger('scroll'); 14850 } 14851 14852 // Automatisches Prüfen bei Laden, Resize für den stickyBackButton 14853 window.addEventListener("load", toggleStickyButton); 14854 window.addEventListener("resize", toggleStickyButton); 14855};'use strict'; 14856 14857use_package("de.his.component"); 14858 14859de.his.component.PrimePaginator = new function() { 14860 de.his.modules.ModuleRegistry 14861 .registerModule(this) 14862 .registerAjaxRefreshModule(this); 14863 this.moduleName = "de.his.component.PrimePaginator"; 14864 14865 this.init = function() { 14866 if (window.PrimeFaces) { 14867 PrimeFaces.widget.Paginator(); 14868 } 14869 } 14870 14871 this.refresh = function() { 14872 this.init(); 14873 }; 14874 14875 if (window.PrimeFaces) { 14876 /// START PrimeFaces-Komponente /// 14877 PrimeFaces.widget.Paginator = PrimeFaces.widget.DeferredWidget.extend({ 14878 14879 /** 14880 * @override 14881 * @inheritdoc 14882 * @param {PrimeFaces.PartialWidgetCfg<PaginatorCfg>} cfg 14883 */ 14884 init: function (a) { 14885 this._super(a); 14886 this.pagesContainer = this.jq; 14887 this.pageLinks = this.pagesContainer.find(".ui-paginator-page"); 14888 this.rppSelect = this.jq.children(".ui-paginator-rpp-options"); 14889 this.jtpSelect = this.jq.children(".ui-paginator-jtp-select"); 14890 this.jtpInput = this.jq.children(".ui-paginator-jtp-input"); 14891 this.firstLink = this.jq.find("a.iconfont-resultset_first"); 14892 this.prevLink = this.jq.find("a.iconfont-resultset_previous"); 14893 this.nextLink = this.jq.find("a.iconfont-resultset_next"); 14894 this.endLink = this.jq.find("a.iconfont-resultset_last"); 14895 this.currentReport = this.jq.children(".ui-paginator-current"); 14896 this.cfg.rows = this.cfg.rows == 0 ? this.cfg.rowCount : this.cfg.rows; 14897 this.cfg.prevRows = this.cfg.rows; 14898 this.cfg.pageCount = Math.ceil(this.cfg.rowCount / this.cfg.rows) || 1; 14899 console.log('pepep: ', this.cfg.rowCount, this.cfg.rows, this.cfg.pageCount); 14900 this.cfg.pageLinks = this.cfg.pageLinks || 10; 14901 this.cfg.currentPageTemplate = this.cfg.currentPageTemplate || "({currentPage} of {totalPages})"; 14902 //this.cfg.ariaPageLabel = PrimeFaces.getAriaLabel("paginator.PAGE"); 14903 this.bindEvents() 14904 }, 14905 bindEvents: function () { 14906 var a = this; 14907 this.jq.find("a").on("keydown.paginator", function (d) { 14908 var b = d.which, 14909 c = $.ui.keyCode; 14910 if ((b === c.ENTER)) { 14911 $(this).trigger("click"); 14912 d.preventDefault() 14913 } 14914 }); 14915 this.bindPageLinkEvents(); 14916 this.firstLink.on("click", function (b) { 14917 PrimeFaces.clearSelection(); 14918 if (!$(this).hasClass("disabled")) { 14919 a.setPage(0) 14920 } 14921 b.preventDefault() 14922 }); 14923 this.prevLink.on("click", function (b) { 14924 PrimeFaces.clearSelection(); 14925 if (!$(this).hasClass("disabled")) { 14926 a.setPage(a.cfg.page - 1) 14927 } 14928 b.preventDefault() 14929 }); 14930 this.nextLink.on("click", function (b) { 14931 PrimeFaces.clearSelection(); 14932 if (!$(this).hasClass("disabled")) { 14933 a.setPage(a.cfg.page + 1) 14934 } 14935 b.preventDefault() 14936 }); 14937 this.endLink.on("click", function (b) { 14938 PrimeFaces.clearSelection(); 14939 if (!$(this).hasClass("disabled")) { 14940 a.setPage(a.cfg.pageCount - 1) 14941 } 14942 b.preventDefault() 14943 }) 14944 }, 14945 bindPageLinkEvents: function () { 14946 var a = this; 14947 14948 // Seitenzahlen 14949 var b = this.pagesContainer.find(".ui-paginator-page"); 14950 b.off("click.paginator").on("click.paginator", function (f) { 14951 var d = $(this), 14952 c = parseInt(d.text()); 14953 a.setPage(c - 1); 14954 f.preventDefault(); 14955 }).off("keydown.paginator").on("keydown.paginator", function (f) { 14956 var c = f.which, 14957 d = $.ui.keyCode; 14958 if ((c === d.ENTER)) { 14959 $(this).trigger("click"); 14960 f.preventDefault(); 14961 } 14962 }); 14963 14964 // <<< NEU: Klicks für Pfeile >>>
14965 this.pagesContainer.find(".iconfont-resultset_first").off("click").on("click", function (e) { 14966 if (!$(this).closest("li").hasClass("disabled")) a.setPage(0); 14967 e.preventDefault(); 14968 }); 14969 this.pagesContainer.find(".iconfont-resultset_previous").off("click").on("click", function (e) { 14970 if (!$(this).closest("li").hasClass("disabled")) a.prev(); 14971 e.preventDefault(); 14972 }); 14973 this.pagesContainer.find(".iconfont-resultset_next").off("click").on("click", function (e) { 14974 if (!$(this).closest("li").hasClass("disabled")) a.next(); 14975 e.preventDefault(); 14976 }); 14977 this.pagesContainer.find(".iconfont-resultset_last").off("click").on("click", function (e) { 14978 if (!$(this).closest("li").hasClass("disabled")) a.setPage(a.cfg.pageCount - 1); 14979 e.preventDefault(); 14980 }); 14981 }, 14982 bindSwipeEvents: function (a, b) { 14983 if (!PrimeFaces.env.isTouchable(b)) { 14984 return 14985 } 14986 var c = this; 14987 a.swipe({ 14988 swipeLeft: function (d) { 14989 c.prev() 14990 }, 14991 swipeRight: function (d) { 14992 c.next() 14993 }, 14994 excludedElements: PrimeFaces.utils.excludedSwipeElements() 14995 }) 14996 }, 14997 unbindEvents: function () { 14998 var a = this.jq.children("a.ui-state-default"); 14999 if (a.length > 0) { 15000 a.off() 15001 } 15002 var b = this.pagesContainer.find(".ui-paginator-page"); 15003 if (b.length > 0) { 15004 b.off() 15005 } 15006 }, 15007 updateUI: function() { 15008 var pagesUl = this.pagesContainer; 15009 var currentPage = this.cfg.page; 15010 var pageCount = this.cfg.pageCount; 15011 console.log('epoeoeo: ', pageCount); 15012 15013 pagesUl.empty(); 15014 15015 pagesUl.append(buildArrowLi("iconfont-resultset_first", "Zur ersten Seite springen.", "Zur ersten Seite springen.", currentPage === 0)); 15016 pagesUl.append(buildArrowLi("iconfont-resultset_previous", "Zur vorherigen Seite springen.", "Zur vorherigen Seite springen.", currentPage === 0)); 15017 15018 var maxPagesToShow = this.cfg.pageLinks || 10; 15019 var startPage = Math.max(0, currentPage - Math.floor(maxPagesToShow / 2)); 15020 var endPage = Math.min(pageCount - 1, startPage + maxPagesToShow - 1); 15021 if (endPage - startPage + 1 < maxPagesToShow) { 15022 startPage = Math.max(0, endPage - maxPagesToShow + 1); 15023 } 15024 15025 for (var i = startPage; i <= endPage; i++) { 15026 var li = $('<li></li>'); 15027 var a = $('<a href="#" class="ui-paginator-page ui-state-default"></a>').text(i + 1); 15028 if (i === currentPage) { 15029 li.addClass('activePage'); 15030 var language = de.his.common.LanguageHelper.currentLanguage(); 15031 var titleText = (language === "de") ? "Aktive Seite: " + (i + 1) : "Active Page: " + (i + 1); 15032 a.attr({title: titleText, 'aria-label': titleText}); 15033 } 15034 li.append(a); 15035 pagesUl.append(li); 15036 } 15037 15038 pagesUl.append(buildArrowLi("iconfont-resultset_next", "Zur nächsten Seite springen.", "Zur nächsten Seite springen.", currentPage === pageCount - 1)); 15039 pagesUl.append(buildArrowLi("iconfont-resultset_last", "Zur letzten Seite springen.", "Zur letzten Seite springen.", currentPage === pageCount - 1)); 15040 15041 this.pageLinks = pagesUl.find('ul.ui-paginator').toArray(); 15042 15043 this.bindPageLinkEvents(); 15044 15045 // Seitenanzeige-Text aktualisieren (Start, End, Total) 15046 var startRecord = (this.cfg.rowCount === 0) ? 0 : (currentPage * this.cfg.rows) + 1; 15047 var endRecord = (currentPage * this.cfg.rows) + this.cfg.rows; 15048 if (endRecord > this.cfg.rowCount) endRecord = this.cfg.rowCount; 15049 15050 var pageInfo = this.cfg.currentPageTemplate 15051 .replace("{currentPage}", currentPage + 1) 15052 .replace("{totalPages}", pageCount) 15053 .replace("{totalRecords}", this.cfg.rowCount) 15054 .replace("{startRecord}", startRecord) 15055 .replace("{endRecord}", endRecord); 15056 15057 this.currentReport.text(pageInfo); 15058 15059 // Jump-to-page Dropdown aktualisieren (wenn vorhanden) 15060 if (this.jtpSelect.length > 0) { 15061 if (this.jtpSelect[0].options.length !== pageCount) { 15062 var optionsHtml = ""; 15063 for (var j = 0; j < pageCount; j++) { 15064 optionsHtml += '<option value="' + j + '">' + (j + 1) + '</option>'; 15065 } 15066 this.jtpSelect[0].innerHTML = optionsHtml; 15067 } 15068 this.jtpSelect.children("option[value=" + currentPage + "]").prop("selected", true); 15069 } 15070 if (this.jtpInput.length > 0) { 15071 this.jtpInput.val(currentPage + 1); 15072 } 15073 this.updatePageLinks(this.cfg.page); 15074 }, 15075 buildArrowLi: function(className, title, ariaLabel, disabled) { 15076 var li = $('<li></li>'); 15077 var a = $('<a href="#"></a>') 15078 .addClass(className + " ui-state-default ui-corner-all") 15079 .attr('title', title) 15080 .attr('aria-label', ariaLabel) 15081 .attr('tabindex', disabled ? -1 : 0); 15082 15083 if (disabled) { 15084 a.addClass('disabled'); 15085 a.attr('disabled', true); 15086 } 15087 15088 li.append(a); 15089 return li; 15090 }, 15091 updatePageLinks: function (page) { 15092 var activePage = page + 1; 15093 var language = de.his.common.LanguageHelper.currentLanguage(); 15094 for(let i = 0; i < this.pageLinks.length; i++){ 15095 if(this.pageLinks[i].innerText == activePage){ 15096 this.pageLinks[i].closest("li").classList.add("activePage"); 15097 if (language == "de") { 15098 this.pageLinks[i].setAttribute("title", "Aktive Seite: " + activePage); 15099 this.pageLinks[i].setAttribute("aria-label", "Aktive Seite: " + activePage); 15100 } 15101 else{ 15102 this.pageLinks[i].setAttribute("title", "Active Page: " + activePage); 15103 this.pageLinks[i].setAttribute("aria-label", "Active Page: " + activePage); 15104 } 15105 } 15106 else{ 15107 this.pageLinks[i].closest("li").classList.remove("activePage"); 15108 this.pageLinks[i].removeAttribute("title"); 15109 this.pageLinks[i].removeAttribute("aria-label"); 15110 } 15111 } 15112 this.bindPageLinkEvents() 15113 }, 15114 setPage: function (c) { 15115 if (c >= 0 && c <= this.cfg.pageCount && this.cfg.page != c) { 15116 var b = { 15117 first: this.cfg.rows * c, 15118 rows: this.cfg.rows, 15119 page: c 15120 }; 15121 this.cfg.paginate.call(this, b) 15122 } else { 15123 de.his.modules.Waiting.refresh(); 15124 } 15125 }, 15126 setRowsPerPage: function (b) { 15127 if (b === "*") { 15128 this.cfg.rows = this.cfg.rowCount; 15129 this.cfg.pageCount = 1; 15130 this.cfg.page = 0; 15131 var c = { 15132 first: 0, 15133 rows: b, 15134 page: this.cfg.page 15135 }; 15136 this.cfg.paginate.call(this, c) 15137 } else { 15138 var d = this.cfg.rows * this.cfg.page; 15139 this.cfg.rows = parseInt(b); 15140 var a = parseInt(d / this.cfg.rows);
15141 this.cfg.pageCount = Math.ceil(this.cfg.rowCount / this.cfg.rows); 15142 this.cfg.page = -1; 15143 this.setPage(a) 15144 } 15145 }, 15146 setTotalRecords: function (a) { 15147 this.cfg.rowCount = a; 15148 this.cfg.pageCount = Math.ceil(a / this.cfg.rows) || 1; 15149 this.cfg.page = 0; 15150 this.updateUI() 15151 }, 15152 updateTotalRecords: function (a) { 15153 this.cfg.rowCount = a; 15154 this.cfg.pageCount = Math.ceil(a / this.cfg.rows) || 1; 15155 this.updateUI() 15156 }, 15157 getCurrentPage: function () { 15158 return this.cfg.page 15159 }, 15160 getFirst: function () { 15161 return (this.cfg.rows * this.cfg.page) 15162 }, 15163 getRows: function () { 15164 return this.cfg.rows 15165 }, 15166 getContainerHeight: function (c) { 15167 var a = 0; 15168 for (var b = 0; b < this.jq.length; b++) { 15169 a += this.jq.eq(b).outerHeight(c) 15170 } 15171 return a 15172 }, 15173 disableElement: function (a) { 15174 a.removeClass("ui-state-hover ui-state-focus ui-state-active").attr("tabindex", -1).addClass("disabled").attr('disabled', true); 15175 a.removeClass("ui-state-hover ui-state-focus ui-state-active").attr("tabindex", -1).addClass("disabled").attr('disabled', true) 15176 }, 15177 enableElement: function (a) { 15178 a.removeClass("disabled").attr("tabindex", 0).removeAttr("disabled", true) 15179 }, 15180 next: function () { 15181 this.setPage(this.cfg.page + 1) 15182 }, 15183 prev: function () { 15184 this.setPage(this.cfg.page - 1) 15185 } 15186 }); 15187 15188 function buildArrowLi(className, title, ariaLabel, disabled) { 15189 var li = $('<li></li>'); 15190 var a = $('<a href="#"></a>') 15191 .addClass(className + " ui-state-default ui-corner-all") 15192 .attr('title', title) 15193 .attr('aria-label', ariaLabel) 15194 .attr('tabindex', disabled ? -1 : 0); 15195 15196 if (disabled) { 15197 a.addClass('disabled'); 15198 a.attr('disabled', true); 15199 } 15200 15201 li.append(a); 15202 return li; 15203 } 15204 15205}}/** 15206* @author [email protected], [email protected] 15207* @usage 15208* <{containerElement} 15209* class="quickmenu-container" //must be declared 15210* data-menu-taketext //value optional, boolean, defaults to false, if true will insert text into the quickmenu items (if buttons) taken from the data-title or alt attribute 15211* data-quickmenu-items //optional, defaults to 2, specify if you wish to see more/less actions by default 15212* data-quickmenu-selector //optional, defaults to "> *", value must be a valid css selector, use this to specify exactly which items within this container are quickmenu-items 15213* data-quickmenu-alwaysMenu //optional, defaults to "false", specify if the menu will always be created, even if there would be only 1 element in the menu 15214* > 15215* <button /> 15216* <li></li> 15217* <a></a> 15218* </{containerElement}> 15219**/ 15220 15221use_package( "de.his.component" ); 15222 15223//IIF: $ === jQuery 15224( function( $ ) { 15225 de.his.component.Quickmenu = new function() { 15226 de.his.modules.ModuleRegistry 15227 .registerModule(this) 15228 .registerAjaxRefreshModule(this); 15229 this.moduleName = "de.his.component.Quickmenu"; 15230 15231 var quickmenu = { 15232 15233 /** 15234 * change with attribute "data-quickmenu-items" 15235 * @private 15236 * @property _defaultItemNumer 15237 * @type {Integer} 15238 * @default 2 15239 */ 15240 _defaultItemNumer: 2, 15241 /** 15242 * change with attribute "data-quickmenu-selector" 15243 * @private 15244 * @property _defaultItemSelector 15245 * @type {String} 15246 * @default "> *" 15247 */ 15248 _defaultItemSelector: "> *", 15249 /** 15250 * change with attribute "data-quickmenu-alwaysMenu" 15251 * @private 15252 * @property _defaultAlwaysMenu 15253 * @type {boolean} 15254 * @default "false" 15255 */ 15256 _defaultAlwaysMenu: false, 15257 /** 15258 * @private 15259 * @method _dropdownButton 15260 * @return {jQuery Template Element} 15261 */ 15262 _dropdownButton: function(menu) { 15263 //get local 15264 //title wählen 15265 var language = de.his.common.LanguageHelper.currentLanguage(); 15266 if (language == "de") { 15267 title = "Menü aufklappen"; 15268 } else { 15269 title = "Open menu"; 15270 } 15271 // Shortcut für das Aufklappen des Quickmenus soll auch im Title angezeigt werden. 15272 var hotkey = jQuery( "html" ).data( "hotkey" ); 15273 if (hotkey && !menu.closest('table').length) { 15274 title = title + "[" + hotkey.toUpperCase() + "+W]"; 15275 } 15276 15277 return $( "<div aria-haspopup='true' tabindex='0' role='button' title='" + title + "' aria-label='" + title + "' class='quickmenu-action quickmenu-action-show iconfont-arrow_thin_down' data-shortcut='w' aria-expanded='false'>" ); 15278 }, 15279 /** 15280 * @private 15281 * @method _text 15282 * @return {jQuery Template Element} 15283 */ 15284 _text: function( $item ) { 15285 var text = $item.data( "title" ) || $item.attr( "title" ) || ""; 15286 return $( "<span class='quickmenu-item-text' aria-hidden='true'>" ).text( text ); 15287 }, 15288 15289 /** 15290 * @method init 15291 */ 15292 init: function() { 15293 var me = this, $menus = $( ".quickmenu-container" ) 15294 if ( $menus.length ) { 15295 me.initMenus( $menus ); 15296 } 15297 }, 15298 15299 /** 15300 * @method initMenus 15301 * @param $menus {jQuery Object} 15302 **/ 15303 initMenus: function( $menus ) { 15304 var me = this, $menu; 15305 for ( var i = 0, l = $menus.length; i < l; i++ ) { 15306 $menu = $( $menus[ i ] ); 15307 $menuAlreadyExist = $menu.find(".quickmenu-identifier");// Search for this css class to check if the quickmenu was already created 15308 if(!$menuAlreadyExist.length){
15309 // Die Pipe '.spacerHyphenTable' vor dem Delete Icon sorgt dafür, dass die Zählung der Menü Items durcheinander geht 15310 // und muss gesondert behandelt werden. S. Ticket 326840 15311 if ($menu.children().length > 3 && $menu.find('.spacerHyphenTable').length) { 15312 $menu.find('.spacerHyphenTable').remove(); 15313 } 15314 me.initQuickMenu( $menu ); 15315 } 15316 } 15317 $menus.removeClass("noDisplay"); 15318 }, 15319 15320 /** 15321 * @initShowBtnAction 15322 * @param $menu {jQuery Object} container of $showBtn where ".quickmenu-container" is defined 15323 */ 15324 initShowBtnAction: function( $menu ) { 15325 var me = this; 15326 15327// $menu.append( $showBtn ); 15328 $menu.find("span").first().css("cursor", "pointer"); 15329 $quickItems = $( ".quickmenu-identifier", $menu ); 15330 var buttons = $quickItems.children("button, a, input, span"); 15331 if (buttons.length) { 15332 /* Wenn das letzte Elemente im Quickmenu via Tab erreicht wird und erneut Tab gedrückt wird, 15333 * so wird ein blur Event ausgelöst. Dadurch wird das Quickmenu geschlossen und automatisch das nächste 15334 * fokussierbare Element erhält den Fokus. 15335 * Problematisch ist hierbei, dass wenn bei fokussiertem letzten Element ein anderes Element im Quickmenu via 15336 * Maus angeklickt wird, das Menü geschlossen wird und die Aktion auf das Element nicht registriert wird. (sehr selten) 15337 */ 15338// buttons.last().on("blur", function (event) { 15339// me.closeMenu($quickItems); 15340// }); 15341 15342 /* 15343 * Blur Variante dekativiert: wenn letztes Element im Menü ein overlay Button war. 15344 * Wurde das Overlay geladen aber nicht angezeigt, weil dieses sich im Menü befindet 15345 * und dieses durch das blur geschlossen wurde. 15346 */ 15347 buttons.last().on("keydown", function (event) { 15348 if (event.keyCode == 9) { 15349 if (!event.shiftKey) { 15350 me.closeMenu($quickItems); 15351 } 15352 } 15353 }); 15354 15355 // Beim ersten Element soll nach Shift-Tab das Menü auch geschlossen werden. 15356 buttons.first().on("keydown", function (event) { 15357 if (event.keyCode == 9 && event.shiftKey) { 15358 me.closeMenu($quickItems); 15359 } 15360 }); 15361 } 15362 15363 //ESC key will close menu. 15364 $quickItems.on("keydown", function(event) { 15365 if (event.keyCode == 27) { 15366 me.closeMenu($quickItems); 15367 } 15368 }); 15369 15370 buttons.on("keydown", function(event) { 15371 //Arrow DOWN 15372 if (event.keyCode == 40) { 15373 event.preventDefault(); 15374 if( $(this).next().hasClass('tabable-link') ) { 15375 $(this).next().children().focus(); 15376 } 15377 else { 15378 $(this).next().focus(); 15379 } 15380 if( !$(this).next().length ) { 15381 me.closeMenu($quickItems); 15382 } 15383 } 15384 //Arrow UP 15385 if (event.keyCode == 38) { 15386 event.preventDefault(); 15387 if( $(this).prev().hasClass('tabable-link') ) { 15388 $(this).prev().children().focus(); 15389 } 15390 else { 15391 $(this).prev().focus(); 15392 } 15393 if( !$(this).prev().length ) { 15394 me.closeMenu($quickItems); 15395 } 15396 } 15397 }); 15398 $menu.find('.quickmenu-action, .quickmenuSpanUnderlined').on( "click keydown", function( event ) { 15399 if (event.type == "keydown" || event.type == "click") { 15400 //open menu with click, enter or space 15401 if (event.type == "click" || event.keyCode == 13 || event.keyCode == 32) { 15402 $quickItems = $( ".quickmenu-identifier", $menu ), $showBtn = $menu.find(".quickmenu-action"); 15403 offset = $showBtn.position(); 15404 $menu.closest("tr").addClass("rowHighlightedRose"); 15405 15406 if ( $quickItems.length && $quickItems.hasClass("noDisplay")) { 15407 event.preventDefault(); 15408 event.stopPropagation(); 15409 me.closeAnyOpenMenus(); 15410 var language = de.his.common.LanguageHelper.currentLanguage(); 15411 if (language == "de") { 15412 $menu.find(".quickmenu-action").attr("title", "Menü schlieÃen"); 15413 } else { 15414 $menu.find(".quickmenu-action").attr("title", "Close menu"); 15415 } 15416 $menu.find(".quickmenu-action").removeClass("iconfont-arrow_thin_down"); 15417 $menu.find(".quickmenu-action").addClass("iconfont-arrow_thin_up"); 15418 $menu.find(".quickmenu-action").attr("aria-expanded", "true"); 15419 $quickItems.removeClass("noDisplay"); 15420 $quickItems.addClass("quickmenu-show quickmenu-container-items"); 15421 15422 // Prüfe ob das Quickmenu am rechten Bildschirm Rand ist
15423 var minWidth = parseInt(jQuery('.quickmenu-container-items.quickmenu-show').css("min-width")); 15424 var quickmenuLeftPos; 15425 // Wenn es am Rand ist, positioniere es weiter links 15426 if ($showBtn.offset().left + minWidth > window.innerWidth) { 15427 quickmenuLeftPos = $showBtn.offset().left - minWidth; 15428 } else { 15429 quickmenuLeftPos = $showBtn.offset().left; 15430 } 15431 15432 $menu.find(".quickmenu-identifier").css( { 15433 left: quickmenuLeftPos 15434 } ); 15435 15436 // Focus first Element in Quickmenu 15437 var Elements = $quickItems.children(); 15438 if(Elements.length){ 15439 Elements[0].focus(); 15440 } 15441 15442 15443 // Add blurrEvent to quickItems 15444 me.addBlurEvent( $quickItems ); 15445 15446 } else { 15447 me.closeMenu($quickItems); 15448 } 15449 } 15450 } 15451 } ); 15452 setTimeout(function(){ 15453 $menu.find('.quickmenu-action').trigger('click'); 15454 }); 15455 }, 15456 15457 /** 15458 * @method closeAnyOpenMenus 15459 */ 15460 closeAnyOpenMenus: function() { 15461 var me = this, $menu = $( ".quickmenu-show" ); 15462 if ( $menu.length ) { 15463 me.closeMenu( $menu ); 15464 } 15465 }, 15466 15467 /** 15468 * @method addBlurEvent 15469 * @param $menu {jQuery Object} 15470 **/ 15471 addBlurEvent: function( $menu ) { 15472 var me = this, 15473 f = function( event ) { 15474 var $target = $( event.target ); 15475 if ( !$menu.has( $target ).length ) { 15476 me.closeMenu( $menu ); 15477 $( document ).off( "click touchstart" ); 15478 } 15479 }; 15480 $( document ).off( "click touchstart" ); 15481 $( document ).on( "click touchstart", f ); 15482 $menu.data( "quickmenu-global-click-function", f ); 15483 }, 15484 15485 /** 15486 * @method closeMenu 15487 * @param $menu{jQuery Object} 15488 **/ 15489 closeMenu: function( $menu ) { 15490 var me = this; 15491 var language = de.his.common.LanguageHelper.currentLanguage(); 15492 if (language == "de") { 15493 $menu.prev(".quickmenu-action").attr("title", "Menü aufklappen"); 15494 } else { 15495 $menu.prev(".quickmenu-action").attr("title", "Open menu"); 15496 } 15497 $menu.prev(".quickmenu-action").removeClass("iconfont-arrow_thin_up"); 15498 $menu.prev(".quickmenu-action").addClass("iconfont-arrow_thin_down"); 15499 $menu.prev(".quickmenu-action").attr("aria-expanded", "false"); 15500 $menu.removeClass( "quickmenu-show quickmenu-container-items" ); 15501 $menu.addClass("noDisplay"); 15502 $menu.closest("tr").removeClass("rowHighlightedRose"); 15503 }, 15504 15505 /** 15506 * @method initQuickMenu 15507 * @param $menu {jQuery Object} 15508 */ 15509 initQuickMenu: function( $menu ) { 15510 var me = this; 15511 15512 //Quickmenu erst bei klick Initialisieren 15513 items = $menu.attr( "data-quickmenu-items" ) ? $menu.data( "quickmenu-items" ) : me._defaultItemNumer; 15514 if( $menu.children().not('.ui-tooltip').not('.spacerHyphenTable').length > items && !$menu.find('.quickmenu-action').length > 0 ) { 15515 $showBtn = me._dropdownButton($menu); 15516 $showBtn.appendTo( $menu ); 15517 15518 $firstElement = $menu.children(":first"); 15519 if($firstElement.is("span:not(.tabable-link)")) { 15520 $firstElement.addClass("quickmenuSpanUnderlined"); 15521 } 15522 $menu.find('.quickmenu-action, .quickmenuSpanUnderlined').on('click keydown', function(event){ 15523 if (event.type == "click" || event.keyCode == 13 || event.keyCode == 32) { 15524 if (event.keyCode == 32) { event.preventDefault();} 15525 if( !$menu.find('.quickmenu-identifier').length > 0 ) { 15526 if(me.initItems( $menu ) ){ 15527 jQuery(this).off('click keydown'); 15528 jQuery(this).parent().find('.quickmenuSpanUnderlined').off('click keydown'); 15529 me.initShowBtnAction( $menu ); 15530 } 15531 } 15532 } 15533 }); 15534 $menu.css("display", ""); 15535 } 15536 15537 }, 15538 15539 /** 15540 * @method initItems 15541 * @param $menu {jQuery Object} 15542 * @return {boolean} true if items exist, false if not 15543 **/ 15544 initItems: function( $menu ) { 15545 var me = this, 15546 takeText = ( function( $m ) { 15547 var d = $m.data( "menu-taketext" ); 15548 return d === true || d === ""; 15549 } )( $menu ), 15550 $quickItems = $menu.attr( "data-quickmenu-selector" ) ? $( $menu.data( "quickmenu-selector" ), $menu ) : $( me._defaultItemSelector, $menu ), 15551 items = $menu.attr( "data-quickmenu-items" ) ? $menu.data( "quickmenu-items" ) : me._defaultItemNumer, $item, $box = $( "<div role='application' class='noDisplay quickmenu-identifier'>" ); 15552 for ( var i = 0, l = $quickItems.length; i < l; i++ ) { 15553 $item = $( $quickItems[ i ] ); 15554 /* 15555 * excludeFromQuickmenu - ermöglicht es Elemente bei der Erstellung des Me
15555nus zu ignorieren. 15556 */ 15557 if($item.hasClass( "spacerImageTable" ) || $item.hasClass( "spacerHyphenTable" ) || $item.hasClass( "excludeFromQuickmenu" )){ 15558 $item.remove(); 15559 continue; 15560 } 15561 /* 15562 * Abfrage für overlayShowButton, damit die generierten divs zu einem Overlay-Button nicht 15563 * im Quickmenu angezeigt werden 15564 */ 15565 /* Lösung per CSS eingebunden #258647 15566 if($item.attr("id")){ 15567 if($item.attr("id").search("overlayShowButton") != -1){ 15568 // hole element des showOverlayButtons und suche das nächstgelegene Div. 15569 var nextDivItem = document.getElementById($item.attr("id")).next('div'); 15570 nextDivItem.addClassName("quickmenuOverlayDiv"); 15571 } 15572 } 15573 */ 15574 } 15575 $quickItems = $menu.attr( "data-quickmenu-selector" ) ? $( $menu.data( "quickmenu-selector" ), $menu ) : $( me._defaultItemSelector, $menu ); 15576 itemSize = $quickItems.length; 15577 for(var i = 0; i < itemSize; i++){ 15578 $item = $( $quickItems[ i ] ); 15579 if($item.attr('type') == "hidden" || $item.hasClass("noDisplay") || $item.hasClass("refreshButtonNoDisplay")){ 15580 $quickItems.splice(i,1); 15581 i--; 15582 } 15583 } 15584 var showAlwaysMenuString = $menu.attr( "data-quickmenu-alwaysMenu" ) ? $menu.attr( "data-quickmenu-alwaysMenu" ) : me._defaultAlwaysMenu; 15585 var showAlwaysMenu = (showAlwaysMenuString == 'true'); 15586 // Check if more than 1 quickitem exist for bewerbung sichten to show status ( first element of quickItems ) but not the quickmenu 15587 if($quickItems.length > 1) 15588 { 15589 if($quickItems.length > (items+1) || showAlwaysMenu ){ 15590 for ( var i = items, l = $quickItems.length; i < l; i++ ) { 15591 $item = $( $quickItems[ i ] ); 15592 if ( takeText ) { 15593 if ( $item.is( "button" ) ) { 15594 $item.append( me._text( $item ) ); 15595 } else if ($item.is( "a" ) ) { 15596 $item.append( me._text( $item.find('img'))); 15597 } else if ($item.is("input") && $item.attr("type") == "checkbox") { 15598 if(!$item.hasClass("noDisplay") && !$item.attr('type') !== "hidden"){ 15599 $item.css("display", "inline-block") 15600 } 15601 } else if ($item.is("label")) { 15602 $item.css("display", "inline-block") 15603 }else if($item.find("button").length > 0 ){ 15604 // Sofern das item weder link noch button ist ( bspw span ) und taketext aktiviert ist, wird einfach der title des nächst sichtbaren Buttons oder Links genommen 15605 var $foundButton = $item.find("button"); 15606 if(!$foundButton.hasClass("noDisplay") && !$foundButton.attr('type') !== "hidden"){ 15607 $foundButton.append( me._text( $foundButton ) ); 15608 }else if($item.find("a").length > 0){ 15609 var $foundLink = $item.find("a"); 15610 if(!$foundLink.hasClass("noDisplay") && !$foundLink.attr('type') !== "hidden") 15611 $foundLink.append( "<span>" + $foundLink.attr( "title" ) + "</span>" ); 15612 } 15613 }else if($item.find("a").length > 0){ 15614 var $foundLink = $item.find("a"); 15615 if(!$foundLink.hasClass("noDisplay") && !$foundLink.attr('type') !== "hidden"){ 15616 var text = $foundLink.data( "title" ) || $foundLink.attr( "title" ) || ""; 15617 $foundLink.append( me._text( text ) ); 15618 } 15619 } 15620 } 15621 if ( !$item.hasClass( "quickmenu-action" ) ) { 15622 $item.appendTo( $box ); 15623 } 15624 /* Entfernt, siehe https://hiszilla.his.de/hiszilla/show_bug.cgi?id=283784 15625 if ($item.is( "button") && $item.hasClass("submit") && !$item.hasClass("submit_linkLook")) { 15626 $item.addClass("submit_linkLook"); 15627 }*/ 15628 } 15629 if ( items < $quickItems.length || showAlwaysMenu) { 15630 /*//add the button here, so it has logical order in the parent div (better tab behaviour) 15631 $showBtn = me._dropdownButton($menu); 15632 $showBtn.appendTo( $menu );*/ 15633 $box.appendTo( $menu ); 15634 /*$firstElement = $menu.children(":first"); 15635 if($firstElement.is("span")) 15636 { 15637 $firstElement.addClass("quickmenuSpanUnderlined"); 15638 }*/ 15639 $menu.css("display", ""); 15640 return true; 15641 } 15642 } 15643 } 15644 15645 // wenn nur das "mehr..." enthalten ist, soll es nicht angezeigt werden 15646 if ($quickItems.length == 1 && $menu.find('.quickMenuMoreElement').length > 0) { 15647 return false;
vendor: 6,438 bytes, lines 15648-15722
15648 } 15649 15650 //$menu.css("display", ""); 15651 return false; 15652 } 15653 15654 }; 15655 15656 this.init = function() { 15657 //start 15658 quickmenu.init(); 15659 } 15660 15661 this.refresh = function() { 15662 quickmenu.init(); 15663 15664 } 15665 }; 15666 15667} )( jQuery ); 15668use_package("de.his.component"); 15669 15670de.his.component.SystemClipboard = new function() { 15671 de.his.modules.ModuleRegistry 15672 .registerModule(this) 15673 .registerAjaxRefreshModule(this); 15674 this.moduleName = "de.his.component.SystemClipboard"; 15675 15676 this.init = function() { 15677 jQuery('.copyToSystemClipboard').click(function () { 15678 var clipboardContent = jQuery('#clipboardContent'); 15679 var appendix=jQuery('<input>'); 15680 jQuery('body').append(appendix); 15681 appendix.val(clipboardContent.text()); 15682 appendix.select(); 15683 document.execCommand('copy'); 15684 appendix.remove(); 15685 }); 15686 return false; 15687 }; 15688 15689 this.refresh = function() { 15690 this.init(); 15691 }; 15692};/* mousetrap v1.5.3 craig.is/killing/mice */ 15693(function(C,r,g){function t(a,b,h){a.addEventListener?a.addEventListener(b,h,!1):a.attachEvent("on"+b,h)}function x(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return l[a.which]?l[a.which]:p[a.which]?p[a.which]:String.fromCharCode(a.which).toLowerCase()}function D(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function u(a){return"shift"==a||"ctrl"==a||"alt"==a|| 15694"meta"==a}function y(a,b){var h,c,e,g=[];h=a;"+"===h?h=["+"]:(h=h.replace(/\+{2}/g,"+plus"),h=h.split("+"));for(e=0;e<h.length;++e)c=h[e],z[c]&&(c=z[c]),b&&"keypress"!=b&&A[c]&&(c=A[c],g.push("shift")),u(c)&&g.push(c);h=c;e=b;if(!e){if(!k){k={};for(var m in l)95<m&&112>m||l.hasOwnProperty(m)&&(k[l[m]]=m)}e=k[h]?"keydown":"keypress"}"keypress"==e&&g.length&&(e="keydown");return{key:c,modifiers:g,action:e}}function B(a,b){return null===a||a===r?!1:a===b?!0:B(a.parentNode,b)}function c(a){function b(a){a= 15695a||{};var b=!1,n;for(n in q)a[n]?b=!0:q[n]=0;b||(v=!1)}function h(a,b,n,f,c,h){var g,e,l=[],m=n.type;if(!d._callbacks[a])return[];"keyup"==m&&u(a)&&(b=[a]);for(g=0;g<d._callbacks[a].length;++g)if(e=d._callbacks[a][g],(f||!e.seq||q[e.seq]==e.level)&&m==e.action){var k;(k="keypress"==m&&!n.metaKey&&!n.ctrlKey)||(k=e.modifiers,k=b.sort().join(",")===k.sort().join(","));k&&(k=f&&e.seq==f&&e.level==h,(!f&&e.combo==c||k)&&d._callbacks[a].splice(g,1),l.push(e))}return l}function g(a,b,n,f){d.stopCallback(b, 15696b.target||b.srcElement,n,f)||!1!==a(b,n)||(b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation?b.stopPropagation():b.cancelBubble=!0)}function e(a){"number"!==typeof a.which&&(a.which=a.keyCode);var b=x(a);b&&("keyup"==a.type&&w===b?w=!1:d.handleKey(b,D(a),a))}function l(a,c,n,f){function e(c){return function(){v=c;++q[a];clearTimeout(k);k=setTimeout(b,1E3)}}function h(c){g(n,c,a);"keyup"!==f&&(w=x(c));setTimeout(b,10)}for(var d=q[a]=0;d<c.length;++d){var p=d+1===c.length?h:e(f|| 15697y(c[d+1]).action);m(c[d],p,f,a,d)}}function m(a,b,c,f,e){d._directMap[a+":"+c]=b;a=a.replace(/\s+/g," ");var g=a.split(" ");1<g.length?l(a,g,b,c):(c=y(a,c),d._callbacks[c.key]=d._callbacks[c.key]||[],h(c.key,c.modifiers,{type:c.action},f,a,e),d._callbacks[c.key][f?"unshift":"push"]({callback:b,modifiers:c.modifiers,action:c.action,seq:f,level:e,combo:a}))}var d=this;a=a||r;if(!(d instanceof c))return new c(a);d.target=a;d._callbacks={};d._directMap={};var q={},k,w=!1,p=!1,v=!1;d._handleKey=function(a, 15698c,e){var f=h(a,c,e),d;c={};var k=0,l=!1;for(d=0;d<f.length;++d)f[d].seq&&(k=Math.max(k,f[d].level));for(d=0;d<f.length;++d)f[d].seq?f[d].level==k&&(l=!0,c[f[d].seq]=1,g(f[d].callback,e,f[d].combo,f[d].seq)):l||g(f[d].callback,e,f[d].combo);f="keypress"==e.type&&p;e.type!=v||u(a)||f||b(c);p=l&&"keydown"==e.type};d._bindMultiple=function(a,b,c){for(var d=0;d<a.length;++d)m(a[d],b,c)};t(a,"keypress",e);t(a,"keydown",e);t(a,"keyup",e)}var l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt", 1569920:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},p={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},A={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},z={option:"alt",command:"meta","return":"enter", 15700escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},k;for(g=1;20>g;++g)l[111+g]="f"+g;for(g=0;9>=g;++g)l[g+96]=g;c.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};c.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};c.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};c.prototype.reset=function(){this._callbacks={};this._directMap= 15701{};return this};c.prototype.stopCallback=function(a,b){return-1<(" "+b.className+" ").indexOf(" mousetrap ")||B(b,this.target)?!1:"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};c.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};c.init=function(){var a=c(r),b;for(b in a)"_"!==b.charAt(0)&&(c[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};c.init();C.Mousetrap=c;"undefined"!==typeof module&&module.exports&&(module.exports= 15702c);"function"===typeof define&&define.amd&&define(function(){return c})})(window,document); 15703/** 15704 * @author [email protected] used with mousetrap: https://craig.is/killing/mice 15705 */ 15706use_package("de.his.component"); 15707 15708de.his.component.HisMousetrap = new function() { 15709 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 15710 this.moduleName = "de.his.component.HisMousetrap"; 15711 15712 this.init = function() { 15713 initIntern(this, "[data-shortcut]") 15714 }; 15715 15716 this.refresh = function() { 15717 initIntern(this, ".bookmarkPopupMenuLink[data-shortcut]"); // Lesezeichen können per Ajax umdefiniert werden 15718 }; 15719 15720 var initIntern = function(self, shortcutSelector) { 15721 "use strict"; 15722 if (!window.Mousetrap) {
15723 throw Error("Mousetrap js library not found"); 15724 } 15725 15726 var hotkeys = jQuery("html").data("hotkey"); 15727 var shortcuts = jQuery(shortcutSelector); 15728 var bindTrap; 15729 15730 if (shortcuts.length) { 15731 15732 bindTrap = function($el) { 15733 var sc = $el.data("shortcut"); 15734 var element = $el[0]; 15735 var hk = hotkeys ? hotkeys + "+" : ""; // if hotkeys are present add a "+" 15736 console.log("Mousetrap hotkeys: "+hotkeys); 15737 15738 Mousetrap.bind(hk + sc, function(event) { 15739 event.preventDefault(); 15740 15741 var type = element.tagName; 15742 15743 if (type.toUpperCase() !== 'INPUT') { 15744 // wenn Angular eingebunden Anker aus URL zusammenbauen, das Routing von Angular kommt sonst nicht mit Ankern aus JSF zurecht 15745 if( jQuery('app-root' ).length ) { 15746 var anchor = jQuery(element).attr('href'); 15747 if( anchor.startsWith('#') ) { 15748 jQuery(element).attr('href',window.location.pathname+window.location.search+anchor); 15749 } 15750 } 15751 element.click(); 15752 } else { 15753 element.focus(); 15754 } 15755 return false; 15756 }); 15757 }; 15758 15759 for (var i = 0; i < shortcuts.length; i++) { 15760 var e = jQuery(shortcuts[i]); 15761 if(e.data("shortcut") != ""){ 15762 bindTrap(e); 15763 console.log("Bind Shortcut '"+hotkeys+"+"+e.data("shortcut")+"' to '"+e[0].type+"' with id '"+e[0].id+"'"); 15764 } 15765 } 15766 } 15767 }; 15768};/*! 15769 * Flex Level Drop Down Menu v1.1 15770 * Created: Jan 5th, 2010 by DynamicDrive.com. This notice must stay intact for usage 15771 * Author: Dynamic Drive at http://www.dynamicdrive.com/ 15772 * Visit http://www.dynamicdrive.com/ for full source code 15773 */ 15774 15775 15776// Achtung: Diese Version ist eine angepasste Version! 15777// Nicht einfach durch eine Neue ersetzen! 15778use_package( "de.his.portal" ); 15779 15780de.his.portal.Flexdropdown = new function() { 15781 15782 de.his.modules.ModuleRegistry.registerModule( this ).registerAjaxRefreshModule( this ); 15783 this.moduleName = "de.his.portal.Flexdropdown"; 15784 15785 this.init = function() { 15786 var reinit = false; 15787 flexdropdownmenuInit(reinit); 15788 }; 15789 15790 this.refresh = function() { 15791 var reinit = true; 15792 flexdropdownmenuInit(reinit); 15793 }; 15794 15795var flexdropdownmenuInit = function(reinit) { 15796var flexdropdownmenu={ 15797// arrowpath: 'arrow.gif', //full URL or path to arrow image 15798 animspeed: 0, //reveal animation speed (in milliseconds) 15799 showhidedelay: [400, 2000], //delay before menu appears and disappears when mouse rolls out of it, in milliseconds 15800 defaultOffsetX: -11, 15801 defaultOffsetY: 1, //jQuery.browser.mozilla? 1 : (jQuery.browser.msie && parseInt(j
15801Query.browser.version)==8)? 3 : 5, 15802 minSpaceToRightEdge: 20, 15803 minSpaceToBottomEdge: 20, 15804 15805 //***** NO NEED TO EDIT BEYOND HERE 15806 startzindex:1000, 15807 builtflexmenuids: [], //ids of flex menus already built (to prevent repeated building of same flex menu) 15808 menuitemsToHide: [], 15809 debug: false, 15810 15811 positionMenu:function($, $menu, e, $anchor){ 15812 var istoplevel=$menu.hasClass('jqflexmenu') //Bool indicating whether $menu is top level flex menu DIV 15813 var docrightedge=$(document).scrollLeft()+$(window).width()-this.minSpaceToRightEdge 15814 var docbottomedge=$(document).scrollTop()+$(window).height()-this.minSpaceToBottomEdge 15815 if (istoplevel){ //if main flex menu DIV 15816 var offsets=$anchor.offset() 15817 var anchorsetting=$anchor.data('setting') 15818 var x=offsets.left+this.defaultOffsetX+anchorsetting.useroffsets[0]+(anchorsetting.dir=="h"? $anchor.outerWidth() : 0) //x pos of main flex menu UL 15819 var y=offsets.top+this.defaultOffsetY+anchorsetting.useroffsets[1]+(anchorsetting.dir=="h"? 0 : $anchor.outerHeight()) 15820 var menuWidth = $anchor.outerWidth() 15821 var subMenuWidth = $menu.data('dimensions').w 15822 x=(x+subMenuWidth > docrightedge)? x-(anchorsetting.useroffsets[0]*2) - subMenuWidth + menuWidth + (anchorsetting.dir=="h"? -(menuWidth*2) : 0) : x //if not enough horizontal room to the ridge of the cursor 15823// y=(y+$menu.data('dimensions').h > docbottomedge)? y-(anchorsetting.useroffsets[1]*2)-$menu.data('dimensions').h-$anchor.outerHeight()+(anchorsetting.dir=="h"? ($anchor.outerHeight()*2) : 0) : y 15824 15825 // Wenn Menuliste zu hoch für viewport den Header nicht fixieren 15826 if ($menu.parents('.navband').length) { 15827 var winHeight = $(window).outerHeight(); 15828 var menuHeight = $menu.outerHeight(); 15829 var $header = $('#hisinoneHeader'); 15830 if( winHeight <= menuHeight ) { 15831 var headerTop = $header.offset().top; 15832 $header.addClass('js-absolute').css({top:headerTop}); 15833 } 15834 } 15835 15836 } 15837 else{ //if sub level flex menu UL 15838 var $parentli=$menu.data('$parentliref') 15839 var parentlioffset=$parentli.offset() 15840 var x=$menu.data('dimensions').parentliw //x pos of sub UL 15841 var y=0 15842 x=(parentlioffset.left+x+$menu.data('dimensions').w > docrightedge)? x-$menu.data('dimensions').parentliw-$menu.data('dimensions').w : x //if not enough horizontal room to the ridge parent LI 15843// y=(parentlioffset.top+$menu.data('dimensions').h > docbottomedge)? y-$menu.data('dimensions').h+$menu.data('dimensions').parentlih : y 15844 } 15845 $menu.css({left:x, top:y}) 15846 }, 15847 15848 showMenu:function($, $menu, ev){ 15849 if ($menu.data('timers').hidetimer) { 15850 clearTimeout($menu.data('timers').hidetimer) 15851 $menu.data('timers').hidetimer = null 15852 this.removeFromMenuitemsToHide($menu) 15853 } 15854 this.hideOldMenuImmediate() 15855 $menu.data('timers').showtimer=setTimeout(function(){$menu.show(flexdropdownmenu.animspeed)}, this.showhidedelay[0]) 15856 }, 15857 15858 hideMenu:function($, $menu){ 15859 if ($menu.data('timers').showtimer) clearTimeout($menu.data('timers').showtimer) 15860 $menu.data('timers').hidetimer=setTimeout(function(){ 15861 $menu.hide(flexdropdownmenu.animspeed) 15862 $('#hisinoneHeader').removeClass('js-absolute').css({top:''}); // Header wieder fixieren 15863 }, this.showhidedelay[1]) //hide flex menu plus all of its sub ULs 15864 this.menuitemsToHide.push($menu) 15865 }, 15866 15867 hideOldMenuImmediate:function() { 15868 if (this.menuitemsToHide.length > 0){ 15869 for (var i = 0; i < this.menuitemsToHide.length; i++) { 15870 if (this.menuitemsToHide[i].data('timers').hidetimer) { 15871 clearTimeout(this.menuitemsToHide[i].data('timers').hidetimer) 15872 this.menuitemsToHide[i].data('timers').hidetimer = null 15873 this.menuitemsToHide[i].hide() 15874 if (this.debug) 15875 flexdropdownmenu.writeLog('Hide Submenu of: '+this.menuitemsToHide[i].parent().find('a:eq(0)').get(0).innerHTML) 15876 } 15877 } 15878 this.menuitemsToHide = new Array() 15879 } 15880 }, 15881 15882 removeFromMenuitemsToHide:function($menuToShow) { 15883 var length_ = $menuToShow.get().length 15884 if (length_ == 0) { 15885 return 15886 } 15887 if (length_ > 1) { 15888 if (this.debug) this.writeLog('Fehler: Mehr als ein UL als Parameter übergeben!') 15889 return 15890 } 15891 if (!$menuToShow.get(0).id) { 15892 if (this.debug) this.writeLog('Fehler: UL hat keine id') 15893 return 15894 } 15895 for (var i = 0; i < this.menuitemsToHide.length; i++) { 15896 if (this.menuitemsToHide[i].get(0).id == $menuToShow.get(0).id) { 15897 this.menuitemsToHide.splice(i,1) // Element löschen 15898 break 15899 } 15900 } 15901 }, 15902 15903 writeLog:function(text) { 15904 var xx = jQuery('#debug').get(0)
15905 xx.innerHTML = text + '<br>' + xx.innerHTML 15906 }, 15907 15908 buildflexmenu:function($, $menu, $anchor){ // $anchor ist Button oder Link, $menu ist ein ul (auf gleicher Ebene wie der Button/Link) 15909 if( $menu.hasClass('jqflexmenu') ) { 15910 return; 15911 } 15912 $menu.css({display:'block', visibility:'hidden', zIndex:++this.startzindex}).addClass('jqflexmenu')//.appendTo(document.body) 15913 if(typeof $menu.attr("data-flexmenuBuildMenu") === "undefined"){ 15914 $menu.on('mouseenter', function(){ 15915 clearTimeout($menu.data('timers').hidetimer) 15916 $menu.data('timers').hidetimer = null 15917 flexdropdownmenu.removeFromMenuitemsToHide($menu) 15918 }).on('mouseleave', function(){ //hide menu when mouse moves out of it 15919 flexdropdownmenu.hideMenu($, $menu) 15920 }) 15921 $menu.attr("data-flexmenuBuildMenu", "true"); 15922 } 15923 $menu.data('dimensions', {w:$menu.outerWidth(), h:$menu.outerHeight()}) //remember main menu's dimensions 15924 $menu.data('timers', {}) 15925 var $lis=$menu.find("ul").parent() //find all LIs within menu with a sub UL 15926 $lis.each(function(i){ 15927 var $li=$(this) 15928 var $subul=$li.find('ul:eq(0)').css({display:'block'}) //set sub UL to "block" so we can get dimensions 15929 $subul.data('dimensions', {w:$subul.outerWidth(), h:$subul.outerHeight(), parentliw:this.offsetWidth, parentlih:this.offsetHeight}) 15930 $subul.data('$parentliref', $li) //cache parent LI of each sub UL 15931 $subul.data('timers', {}) 15932 $li.data('$subulref', $subul) //cache sub UL of each parent LI 15933// $li.children("input").addClass('link_next') //add arrow image 15934// $li.children("a:eq(0)").append( //add arrow images 15935// '<img src="'+flexdropdownmenu.arrowpath+'" class="rightarrowclass" style="border:0;" />' 15936// ) 15937 $subul.css({zIndex: ++flexdropdownmenu.startzindex}) 15938 if(typeof $li.attr("data-flexmenuBuild") == "undefined"){ 15939 $li.on('mouseenter', function(ev){ //show sub UL when mouse moves over parent LI 15940 var $li_ = $(this) 15941 var $targetul=$li_.addClass("selected").data('$subulref') 15942 if ($targetul.queue().length<=1) { //if 1 or less queued animations 15943 if (flexdropdownmenu.debug) 15944 flexdropdownmenu.writeLog('Mouseover: ' + $li_.find('a:eq(0)').get(0).innerHTML) 15945 if ($targetul.data('timers').hidetimer) { 15946 clearTimeout($targetul.data('timers').hidetimer) 15947 $targetul.data('timers').hidetimer = null 15948 flexdropdownmenu.removeFromMenuitemsToHide($targetul) 15949 } 15950 flexdropdownmenu.removeFromMenuitemsToHide($li_.parent('ul')) // parent ul 15951 flexdropdownmenu.removeFromMenuitemsToHide($li_.parent('ul').parent('li').parent('ul')) // grand parent ul 15952 flexdropdownmenu.hideOldMenuImmediate() 15953 $targetul.data('timers').showtimer=setTimeout(function(){ 15954 flexdropdownmenu.positionMenu($, $targetul, ev) 15955 $targetul.show(flexdropdownmenu.animspeed) 15956 }, flexdropdownmenu.showhidedelay[0]) 15957 } 15958 }).on('mouseleave', function(ev){ 15959 //hide sub UL when mouse moves out of parent LI 15960 var $targetul=$(this).data('$subulref') 15961 clearTimeout($targetul.data('timers').showtimer) 15962 $targetul.data('timers').hidetimer=setTimeout(function(){$targetul.hide(flexdropdownmenu.animspeed).data('$parentliref').removeClass('selected')}, flexdropdownmenu.showhidedelay[1]) 15963 flexdropdownmenu.menuitemsToHide.push($targetul) 15964 if (flexdropdownmenu.debug) 15965 flexdropdownmenu.writeLog('Mouseout: ' + $targetul.parent().find('a:eq(0)').get(0).innerHTML) 15966 }) 15967 $li.attr("data-flexmenuBuild","true"); 15968 } 15969 }) 15970 $menu.find('ul').addBack().css({display:'none', visibility:'visible'}) //collapse all ULs again 15971 this.builtflexmenuids.push($menu.get(0).id) //remember id of flex menu that was just built 15972 }, 15973 15974 15975 init:function($, $anchor, $menu){ // $anchor ist Button oder Link, $menu ist ein ul, das sich in der gleichen xml-Ebene wie $anchor befindet 15976 15977 // Nicht in Burgernavigation ausführen 15978 if ($menu.parents('.topMenuContainer').length) { 15979 return; 15980 } 15981 if (this.builtflexmenuids.length==0 && reinit == false){ //only bind click event to document once 15982 $(document).on("click", function(ev){ 15983 if (ev.button==0){ //hide all flex menus (and their sub ULs) when left mouse button is clicked 15984 $('.jqflexmenu').find('ul').addBack().hide() 15985 } 15986 }) 15987 } 15988 if (jQuery.inArray($menu.get(0).id, this.builtflexmenuids)==-1) //if this flex menu hasn't been built yet 15989 this.buildflexmenu($, $menu, $anchor) 15990 if ($anchor.parents().filter('ul.jqflexmenu').length>0) //if $anchor matches an element within the flex menu markup, don't bind onflexmenu to that element 15991 return 15992 var useroffsets=$anchor.attr('data-offsets')? $anchor.attr('data-offsets').split(',') : [0,0] //get additional user offsets of menu 15993 useroffsets=[parseInt(useroffsets[0]), parseInt(useroffsets[1])] 15994 $anchor.data('setting', {dir: $anchor.attr('data-dir'), useroffsets: useroffsets}) //store direction (drop right or down) of menu plus user offsets 15995 if(typeof $anchor.attr("data-flexmenuAnchorInit") === "undefined"){ 15996 $anchor.on("mouseenter", function(ev){ 15997 $menu.css('zIndex', ++flexdropdownmenu.startzindex) 15998 flexdropdownmenu.positionMenu($, $menu, ev, $anchor) 15999 flexdropdownmenu.showMenu($, $menu, ev) 16000 }).on("mouseleave", function(ev){ 16001 flexdropdownmenu.hideMenu($, $menu) 16002 }) 16003 $anchor.attr("data-flexmenuAnchorInit", "true"); 16004 } 16005 } 16006} 16007 16008jQuery.fn.addflexmenu=function(options){ 16009 var $=jQuery 16010 return this.each(function(){ //return jQuery obj 16011 var $anchor=$(this) 16012 if (typeof options=="object"){ //if options parameter defined 16013 if (options.dir) 16014 $anchor.attr('data-dir', options.dir) //set/overwrite data-dir attr with defined value 16015 if (options.offsets) 16016 $anchor.attr('data-offsets', options.offsets) //set/overwrite data-offsets attr with defined value 16017 } 16018 var $subul = $anchor.parent().find('ul:eq(0)') 16019 16020 if ($subul.length==1) //check flex menu is defined 16021 flexdropdownmenu.init($, $anchor, $subul) 16022 }) 16023}; 16024 16025 16026 var $anchors=$('.subMenuBtn.flexdropdownmenu, .topMenuLink.flexdropdownmenu ') 16027 $anchors.each(function(){ 16028 $(this).addflexmenu() 16029 }) 16030 if (flexdropdownmenu.debug) { 16031 jQuery('body').append('<div id="debug" style="position:absolute; z-index:10000; width:100%; height:300px; left:0; bottom:0; background-color:white; overflow:auto;" />') 16032 } 16033} 16034} 16035/** 16036* Extend the flexdropdown menu functionality to include arrow key navigation 16037* author: [email protected] 16038*/ 16039 16040window.his_flexdropdown = window.his_flexdropdown || new function(){ 16041 16042 var topLevelElement = null, openElement, originalTimers, currentFocus; 16043 16044 16045 var setTopLevelElement = function(fe){ 16046 topLevelElement = fe; 16047 } 16048 16049 var getTopLevelElement = function(){ 16050 var item = jQuery(".topMenuList a:focus"); 16051 if(item.length > 0){ 16052 if(!item.hasClass(".topMenuLink") && !item.hasClass(".topMenuLinkHighlighted")){ 16053 item = item.closest(".topMenuList"); 16054 item = item.find("> a"); 16055 } 16056 return item; 16057 } 16058 }; 16059 16060 var setOpenElement = function(oe){ 16061 openElement = oe; 16062 } 16063 16064 var getOpenElement = function(){ 16065 return openElement; 16066 }; 16067 16068 var setFlexTimers = function(a,b){ 16069 originalTimers = flexdropdownmenu.showhidedelay; 16070 flexdropdownmenu.showhidedelay = [a, b]; //overwrite it. so the menu shows immediately 16071 } 16072 16073 var resetFlexTimers = function(){ 16074 flexdropdownmenu.showhidedelay = originalTimers; 16075 } 16076 16077 var focusItem = function(element, silent){ 16078 currentFocus = element; 16079 //without timeout it won't always focus because of keyup event 16080 if(currentFocus && !silent){ 16081 currentFocus.focus(); 16082 } 16083 } 16084 16085 var getFocusedItem = function(){ 16086 return currentFocus; 16087 } 16088 16089 var closeOpen = function(element){ 16090 var oe = element || getOpenElement(); 16091 //if any open menus - then close 16092 if(oe){ 16093 setFlexTimers(0, 0); //make it immediate 16094 flexdropdownmenu.hideMenu(jQuery, oe); 16095 if(!element){ 16096 setOpenElement(null); //clear openElement 16097 } 16098 resetFlexTimers(); 16099 } 16100 }; 16101 16102 var private_showMenu = function(menu, event){ 16103 //position and show menu - this was take from flexdropdownmenu.init() -> bind("mouseenter") 16104 flexdropdownmenu.positionMenu(jQuery, menu, event, menu.parent().find("> a")); 16105 //override the showMenu function so that the focus() doesn't need to be called delayed 16106 var oldShow = flexdropdownmenu.showMenu; 16107 flexdropdownmenu.showMenu = function($, $menu, ev){ 16108 if ($menu.data('timers').hidetimer) { 16109 $menu.data('timers').hidetimer = null 16110 this.removeFromMenuitemsToHide($menu) 16111 } 16112 this.hideOldMenuImmediate(); 16113 $menu.show(flexdropdownmenu.animspeed); 16114 }; 16115 flexdropdownmenu.showMenu(jQuery, menu, event); 16116 //reset it 16117 flexdropdownmenu.showMenu = oldShow; 16118 ///////// 16119 setOpenElement(menu); 16120 }; 16121 16122 var openChildMenu = function(menu, event){ 16123 private_showMenu(menu, event); 16124 16125 //end - boolean start from back for array 16126 var findLink = function(lis, end){ 16127 if(lis.length > 0){ 16128 if(end){ 16129 lis = lis.toArray().reverse(); 16130 } 16131 16132 var link, a; 16133 for(var i = 0, l = lis.length; i<l; i++){ 16134 link = jQuery(lis[i]); 16135 a = link.find("> a"); 16136 if(a.length > 0){ 16137 return a; 16138 } 16139 } 16140 16141 } 16142 }; 16143 16144 16145 var lis = menu.find("> li"); 16146 if(lis.length > 0){ 16147 var firstItem = findLink(lis); 16148 focusItem(firstItem); //focus the first item in the new menu shown 16149 16150 //if tab shift is called on the first item of the menu - close the menu as the user is leaving the menu 16151 var tab = function(e){ 16152 var keyCode = e.which || e.keyCode; 16153 if (keyCode == 9 && e.shiftKey) { 16154 closeOpen(menu); 16155 firstItem.keydown(tab); 16156 } 16157 } 16158 firstItem.keydown(tab); 16159 16160 //if the menu has more than 1 LI (entry) also close the menu when the user presses the tab item on the last menu item as the user is also leaving the menu 16161 if(lis.length > 1){ 16162 var lastItem = findLink(lis, true); 16163 if(lastItem){ 16164 var tabDown = function(e){ 16165 var keyCode = e.which || e.keyCode; 16166 if (keyCode == 9 && !e.shiftKey) { 16167 closeOpen(menu);
16168 lastItem.unbind("keydown"); 16169 } 16170 } 16171 lastItem.keydown(tabDown); 16172 } 16173 } 16174 } 16175 16176 }; 16177 16178 //dir == next or prev (jQuery function) 16179 var topLevelMove = function(dir){ 16180 focusItem(getTopLevelElement().parent()[dir]().find("> a")); 16181 }; 16182 16183 var keyActions = { 16184 left: function(event){ 16185 event.preventDefault(); 16186 //find the drop down 16187 var child = getTopLevelElement().parent().find("> ul.jqflexmenu"); 16188 16189 //check if exists and 16190 if(child.length > 0){ 16191 //check visibility 16192 if(!child.is(":visible")){ 16193 //top menu - move across one 16194 topLevelMove("prev"); 16195 }else{ 16196 //sub menu 16197 var current = getFocusedItem(); 16198 if(current){ 16199 //find its own menu - i.e. the UL where the current LI is present 16200 var menu = current.closest("ul.subMenu"); 16201 //find the parent of that menu - i.e. the LI where the sub UL is in 16202 var parent = menu.parent("li").find("> a"); 16203 if(menu.length > 0 && parent.length > 0){ 16204 //close subMenu and focus on parent Link 16205 closeOpen(menu); 16206 focusItem(parent); 16207 } 16208 } 16209 } 16210 }else{ 16211 topLevelMove("prev"); //has no children 16212 } 16213 }, 16214 right: function(event){ 16215 event.preventDefault(); 16216 //find the drop down 16217 var child = getTopLevelElement().parent().find("> ul.jqflexmenu"); 16218 16219 //check if exists and 16220 if(child.length > 0){ 16221 //check visibility 16222 if(!child.is(":visible")){ 16223 //top menu - move across one 16224 topLevelMove("next"); 16225 }else{ 16226 var current = getFocusedItem(); 16227 if(current){ 16228 var subMenu = current.next("ul.subMenu"); 16229 if(subMenu.length > 0){ 16230 //open the next level (subMenu) of a menu point 16231 openChildMenu(subMenu, event); 16232 } 16233 } 16234 } 16235 }else{ 16236 topLevelMove("next");//has no children 16237 } 16238 }, 16239 up: function(event){ 16240 event.preventDefault(); 16241 //find the drop down 16242 var child = getTopLevelElement().parent().find("> ul.jqflexmenu"); 16243 //check if exists and 16244 if(child && child.length > 0){ 16245 //check visibility 16246 var current = getFocusedItem(); 16247 var li = current.closest("li"); 16248 var prev = li.prev().find("> a"); 16249 16250 if(child.is(":visible")){ 16251 if(prev.length > 0){ 16252 //focus on previous entry 16253 focusItem(prev); 16254 }else{ 16255 //only if current focus item is not inside a submenu 16256 var subMenu = current.closest("ul.subMenu"); 16257 if(subMenu.length <= 0){ 16258 //no top item - hide menu and move a level up 16259 closeOpen(child); 16260 focusItem(getTopLevelElement()); 16261 } 16262 } 16263 } 16264 } 16265 }, 16266 down: function(event){ 16267 event.preventDefault(); 16268 //find the drop down 16269 var child = getTopLevelElement().parent().find("> ul.jqflexmenu"); 16270 //check if exists and 16271 if(child.length > 0){ 16272 //check visibility 16273 var current = getFocusedItem(); 16274 if(!child.is(":visible")){ 16275 openChildMenu(child, event); 16276 }else{ 16277 //is visible 16278 var next = current.closest("li").next().find("> a"); 16279 //focus on next entry 16280 if(next.length > 0){ 16281 focusItem(current.closest("li").next().find("> a")); 16282 } 16283 } 16284 } 16285 }, 16286 tab_up: function(event){ 16287 var newFocus = jQuery("ul.nav a:focus"); 16288 if(newFocus.length > 0){ 16289 focusItem(newFocus, true); 16290 } 16291 } 16292 }; 16293 16294 var keyMapper = { 16295 onKeyDown: function(e){ 16296 if(getTopLevelElement()){ 16297 var keyCode = e.keyCode || e.which, 16298 arrow = {left: 37, up: 38, right: 39, down: 40 }, tab = 9; 16299 switch (keyCode) { 16300 case arrow.left: 16301 keyActions.left(e); 16302 break; 16303 case arrow.up: 16304 keyActions.up(e); 16305 break; 16306 case arrow.right: 16307 keyActions.right(e); 16308 break; 16309 case arrow.down: 16310 keyActions.down(e); 16311 break; 16312 } 16313 } 16314 }, 16315 onKeyUp: function(e){ 16316 if(getTopLevelElement()){ 16317 var keyCode = e.keyCode || e.which, 16318 tab = 9; 16319 switch (keyCode) { 16320 case tab: 16321 keyActions.tab_up(e); 16322 break; 16323 } 16324 } 16325 } 16326 }; 16327 16328 var registerEvents = function(){ 16329 //register events on topmenu item
16330 jQuery(".topMenuLink, .topMenuLinkHighlighted").focus(function(){ 16331 closeOpen(); 16332 }); 16333// jQuery(document).on("focus mouseenter", ".topMenuLink, .topMenuLinkHighlighted", function(event){ 16334// closeOpen(); 16335// }); 16336 16337 //register keydown actions 16338 jQuery(document).keydown(keyMapper.onKeyDown).keyup(keyMapper.onKeyUp); 16339 }; 16340 16341 this.init = function(){ 16342 registerEvents(); 16343 }; 16344 16345}; 16346 16347 16348jQuery(document).ready(function(){ 16349 16350 his_flexdropdown.init(); 16351 16352});/** 16353 * Actions to support angular. 16354 * Currently the only function is deleting HTML5 SessionStorage keys 16355 * when clicking certain buttons and links in the JSF frame, 16356 * like startpage, bookmarks, menu search, menu items. 16357 */ 16358use_package("de.his.modules"); 16359de.his.modules.angularHelper = new function() { 16360 16361 this.moduleName = "de.his.modules.angularHelper"; 16362 16363 /** 16364 * Delete all Angular keys from HTML5 SessionStorage. 16365 */ 16366 this.deleteAngularSessionStorageKeys = function() { 16367 console.log( 'Delete angular keys from HTML5 SessionStorage...' ); 16368 sessionStorage.removeItem( 'his_cs_sys_last_menu_item' ); 16369 sessionStorage.removeItem( 'his_cs_sys_last_search_url' ); 16370 sessionStorage.removeItem( 'his_cs_sys_last_searchresult_url' ); 16371 sessionStorage.removeItem( 'his_cs_sys_last_back_url' ); 16372 } 16373}; 16374use_package("de.his.component"); 16375 16376de.his.component.TreetableFocus = new function() { 16377 de.his.modules.ModuleRegistry.registerModule(this) 16378 .registerAjaxRefreshModule(this); 16379 this.moduleName = "de.his.component.TreetableFocus"; 16380 16381 this.init = function() { 16382 overlayListener(); 16383 this.refresh(); 16384 }; 16385 16386 this.refresh = function() { 16387 // Wurde ein Button geklickt, der ein Overlay geöffnet hat? Dann soll die Ãberschrift des Overlays fokussiert werden.... 16388 var overlay = jQuery('div.overlay.modal'); 16389 if (overlay && overlay.length) { 16390 // wird vom overlay.js selber erledigt. 16391 return false; 16392 } 16393 }; 16394 16395 var overlayListener = function(){ 16396 de.his.modules.eventRegistry.addListener("overlayClose", function(){ 16397 overlayClosed = true; 16398 sessionStorage.removeItem('lastClickedNodeId'); 16399 }, this, false); 16400 } 16401 16402 $(document).on('click', '.ui-treetable button, .ui-treetable span.tabable-link', function() { 16403 var nodeId = $(this).attr('id'); 16404 sessionStorage.setItem('lastClickedNodeId', nodeId); 16405 if (nodeId && (nodeId.endsWith('anmelden') || nodeId.endsWith('abmelden'))) { 16406 sessionStorage.setItem('lastClickedNodeIdChangeElement', nodeId); 16407 } 16408 }); 16409 16410 $(window).on('beforeunload', function (event) { 16411 const searchParams = new URLSearchParams(window.location.search); 16412 const flowId = searchParams.get('_flowId'); 16413 window.localStorage.setItem('lastFlow', flowId); 16414 }); 16415 16416 16417 this.lastClickedButtonHandler = function () { 16418 const searchParams = new URLSearchParams(window.location.search); 16419 const flowId = searchParams.get('_flowId'); 16420 const lastFlow = window.localStorage.getItem('lastFlow'); 16421 16422 if (flowId !== lastFlow || !flowId) return; 16423 16424 const lastClickedNodeId = sessionStorage.getItem('lastClickedNodeId'); 16425 const lastClickedNodeIdChangeElement = sessionStorage.getItem('lastClickedNodeIdChangeElement'); 16426 16427 if (lastClickedNodeId) { 16428 const $node = $('#' + de.his.common.Util.toJQueryId(lastClickedNodeId)); 16429 if ($node.length > 0) { 16430 const treeTable = $node.closest('.ui-treetable.ui-widget'); 16431 if (treeTable && 'true' === treeTable.attr('data-markedVisibleTreeNodes')) { 16432 focusAndScrollTo($node); 16433 sessionStorage.removeItem('lastClickedNodeId'); 16434 } 16435 } 16436 } 16437 if (lastClickedNodeIdChangeElement && typeof lastClickedNodeIdChangeElement === 'string') { 16438 let baseId = lastClickedNodeIdChangeElement; 16439 let newSuffix = ''; 16440 16441 if (baseId.endsWith('anmelden')) { 16442 baseId = baseId.slice(0, -'anmelden'.length); 16443 newSuffix = 'abmelden'; 16444 } else if (baseId.endsWith('abmelden')) { 16445 baseId = baseId.slice(0, -'abmelden'.length); 16446 newSuffix = 'anmelden'; 16447 } 16448 16449 if (baseId && newSuffix) { 16450 const newId = baseId + newSuffix; 16451 const $newNode = $('#' + de.his.common.Util.toJQueryId(newId)); 16452 if ($newNode.length > 0) { 16453 focusAndScrollTo($newNode); 16454 sessionStorage.removeItem('lastClickedNodeIdChangeElement'); 16455 } 16456 } 16457 } 16458 } 16459 16460 function focusAndScrollTo($el) { 16461 if (!$el.is(':focusable')) { 16462 if (!$el.is('button') && !$el.is('a')) { 16463 $el.attr('tabindex', '-1'); 16464 } 16465 $el = $el.find(':focusable').first(); 16466 } 16467 16468 // Verwende requestAnimationFrame, um sicherzustellen, dass der Fokus gesetzt wird, nachdem alle visuellen Ãnderungen abgeschlossen sind 16469 requestAnimationFrame(function() { 16470 $el.focus(); 16471 $el[0].scrollIntoView({ behavior: 'smooth', block: 'center' }); 16472 }); 16473 } 16474 16475};use_package("de.his.component"); 16476 16477de.his.component.tabsAsDropdown = new function() { 16478 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 16479 this.moduleName = "de.his.component.tabsAsDropdown"; 16480 this.refresh = function() { 16481 this.init(); 16482 }; 16483 16484 this.init = function() { 16485 jQuery('.tabsAsDropdown').each(function(){ 16486 var $this = jQuery(this); 16487 if( !$this.find('.mikronavi_submit-trigger').length ) { 16488 var activeText = $this.find('button.active').html(); 16489 jQuery('<button class="mikronavi_submit-trigger">'+activeText+'</button>').insertBefore($this.children('ul')); 16490 } 16491 }); 16492 16493 jQuery('.tabsAsDropdown').off('click').on('click', '.mikronavi_submit-trigger', function(e){ 16494 e.preventDefault(); 16495 var $this = jQuery(this); 16496 $this.toggleClass('open'); 16497 $this.next('ul').slideToggle(100); 16498 }); 16499 16500 }; 16501};use_package("de.his.portal"); 16502 16503/** 16504 * Portal Grid 16505 */ 16506de.his.portal.grid = new function() { 16507 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 16508 16509 this.moduleName = "de.his.portal.grid"; 16510 16511 this.init = function(){ 16512 if( jQuery('body').hasClass('editNavigationframe') ) { 16513 drag(); 16514 createGrid(); 16515 configureGrid(); 16516 initial = true; 16517 if( !jQuery('.gridWrapConfiguration').hasClass('visible') ) { 16518 jQuery('.gridDDZoneWrap').removeClass('gridDDZone-hide'); 16519 } 16520 setTimeout(function(){ 16521 jQuery('#hisinoneHeader').addClass('js-fixed').parent().css({paddingTop:jQuery('#hisinoneHeader').outerHeight()}) 16522 }, 500); 16523 } 16524 } 16525 16526 createGrid = function(){ 16527 grid = []; 16528 16529 jQuery('.gridElement').each(function() { 16530 $this = jQuery(this); 16531 16532 var widgetPosition = $this.attr('id'); 16533 widgetPosition = widgetPosition.split('_')[1]; 16534 16535 $this.find('.draggableEl').each(function(i){ 16536 $this = jQuery(this); 16537 var widgetType = $this.attr('id'); 16538 widgetType = widgetType.split('_')[0]; 16539 widgetId = $this.data('id'); 16540 item = {} 16541 item["widgetPosition"] = Number(widgetPosition); 16542 item["widgetType"] = widgetType; 16543 item["widgetId"] = Number(widgetId); 16544 16545 item["widgetSortorder"] = i; 16546 //item["widgetSortInPos"] = {widgetPosition: Number(widgetPosition) , widgetSortorder: i}; 16547 16548 grid.push(item); 16549 }); 16550 }); 16551 // Elemente aus DropZone holen 16552 ddzoneIndx = 0; 16553 jQuery('#gridDDZone').children().each(function(){ 16554 ddzoneIndx++; 16555 $this = jQuery(this); 16556 var widgetType = $this.attr('id'); 16557 widgetType = widgetType.split('_')[0]; 16558 widgetId = $this.data('id'); 16559 item = {} 16560 item["widgetPosition"] = 0; 16561 item["widgetType"] = widgetType; 16562 //item["widgetSortorder"] = 999+ddzoneIndx; 16563 item["widgetId"] = Number(widgetId); 16564 16565 item["widgetSortorder"] = ddzoneIndx; 16566 //item["widgetSortInPos"] = {widgetPosition: 0 , widgetSortorder: ddzoneIndx}; 16567 16568 grid.push(item); 16569 }); 16570 16571 // Reihenfolge in Array schreiben 16572 /*for (i = 0; i < grid.length; i++){ 16573 if( !grid[i].widgetSortorder ) { 16574 grid[i].widgetSortorder = i+1; 16575 } 16576 }*/ 16577 16578 gridString = JSON.stringify(grid); 16579 document.getElementById('gridForm:gridData').value = gridString; 16580 16581 //console.log(gridString); 16582 16583 } 16584 initial = true; 16585 var allGridAreasSelected; 16586 configureGrid = function(){ 16587 16588 var gridAreasString = jQuery('.gridSizeHeader').val(); 16589 gridAreasString = gridAreasString.replace(/'/g, ''); 16590 var gridAreas = gridAreasString.split(" "); 16591 16592 var gridAreasStringFooter = jQuery('.gridSizeFooter').val(); 16593 gridAreasStringFooter = gridAreasStringFooter.replace(/'/g, ''); 16594 var gridAreasFooter = gridAreasStringFooter.split(" "); 16595 16596 16597 if( initial == true ) { 16598 createConfigurationGrid(gridAreas, gridAreasFooter); 16599 } 16600 // Vorhandenes Grid anzeigen 16601 function createConfigurationGrid(gridAreas, gridAreasFooter){ 16602 16603 if( jQuery('.gridWrapConfiguration').find('.gridElementSelected').length == 0 ) { 16604 16605 //Header 16606 var gridWithCount = 1; 16607 for (i = 0; i < gridAreas.length; i++){ 16608 var pos = i+1; 16609 var gridElementWidth = jQuery('.gridHeader').find('.gridWrapConfiguration').find('.gridElement').width(); 16610 if( gridAreas[i] != gridAreas[i-1] ) { 16611 //console.log(gridAreas[i], pos); 16612 if( !jQuery('.gridHeader').find('.gridWrapConfiguration').find('.gridElement:nth-child('+pos+')').attr('data-index', gridAreas[i]).find('.gridElementSelected').length ) { 16613 jQuery('.gridHeader').find('.gridWrapConfiguration').find('.gridElement:nth-child('+pos+')').attr('data-index', gridAreas[i]) 16614 .append('<div class="gridElementSelected"><a class="gridElementSelectedClose iconfont-delete" title="Rasterelement löschen" href="#" ></a><div class="gridElementDragbar"></div></div>'); 16615 gridWithCount = 1; 16616 } 16617 16618 } else { 16619 gridWithCount++; 16620 gridElementWidth = gridElementWidth*gridWithCount; 16621 jQuery('.gridHeader').find('.gridWrapConfiguration').find('.gridElement[data-index='+gridAreas[i]+']').children('.gridElementSelected').css({width:gridWithCount*100+'%'}); 16622 } 16623 } 16624 16625 //Footer 16626 var gridWithCountFooter = 1; 16627 for (i = 0; i < gridAreasFooter.length; i++){ 16628 var pos = i+1; 16629 var gridElementWidth = jQuery('.gridFooter').find('.gridWrapConfiguration').find('.gridElement').width(); 16630 if( gridAreasFooter[i] != gridAreasFooter[i-1] ) { 16631 // console.log(gridAreas[i], pos); 16632 if( !jQuery('.gridFooter').find('.gridWrapConfiguration').find('.gridElement:nth-child('+pos+')').attr('data-index', gridAreasFooter[i]).find('.gridElementSelected').length ) { 16633 jQuery('.gridFooter').find('.gridWrapConfiguration').find('.gridElement:nth-child('+pos+')').attr('data-index', gridAreasFooter[i]) 16634 .append('<div class="gridElementSelected"><a class="gridElementSelectedClose iconfont-delete" title="Rasterelement löschen" href="#" ></a><div class="gridElementDragbar"></div></div>'); 16635 gridWithCountFooter = 1; 16636 } 16637 16638 } else { 16639 gridWithCountFooter++; 16640 gridElementWidth = gridElementWidth*gridWithCountFooter; 16641 jQuery('.gridFooter').find('.gridWrapConfiguration').find('.gridElement[data-index='+gridAreasFooter[i]+']').children('.gridElementSelected').css({width:gridWithCountFooter*100+'%'}); 16642 16643 } 16644 } 16645 } 16646 16647 } 16648 16649 16650 // Grid Konfiguration 16651 var selectedElements = []; 16652 var selectedElements2 = []; 16653 var savedElements = []; 16654 var savedElements2 = []; 16655 16656 // Grid Konfiguration ein und ausblenden 16657 jQuery('.toggleGridConfig').off('click').on('click', function(){ 16658 if( jQuery('.gridWrapConfiguration').hasClass('visible') ) { 16659 saveGridConfig(); 16660 // Wenn nicht jedes Gridfeld gefüllt nicht weiter machen 16661 if( allGridAreasSelected == false ) { 16662 return false;
16663 } 16664 jQuery('#gridForm\\:submitGrid').attr('disabled', false); 16665 } else { 16666 jQuery('#gridForm\\:submitGrid').attr('disabled', true); 16667 } 16668 jQuery('.gridWrapConfiguration').toggleClass('visible'); 16669 jQuery('.gridDDZoneWrap').toggleClass('gridDDZone-hide'); 16670 16671 }); 16672 // Grid anwenden bei klick auf speichern 16673 jQuery('.saveGridConfig').off('click').on('click', function(){ 16674 saveGridConfig(); 16675 }); 16676 16677 jQuery('.toggleLoggedinView').off('click').on('click', function(){ 16678 if( !jQuery('.gridWrapConfiguration').hasClass('visible') ) { 16679 jQuery('body').toggleClass('editNavigationframe_loggedinView'); 16680 } 16681 }); 16682 16683 // letzten geladene Konfiguratin zurückholen 16684 /*jQuery('.restoreGridConfig').on('click', function(){ 16685 restoreGridConfig(); 16686 });*/ 16687 16688 16689 // Grid Konfigurieren per Drag 16690 function resizableGrid() { 16691 jQuery('.gridElementDragbar').parent().resizable({ 16692 handles: 'e', 16693 // TODO: 16694 //Links und rechts dragbar 16695 //handles: 'e, w', 16696 containment: "document", 16697 /*grid: 207,*/ 16698 start: function(event, ui){ 16699 // Lücke für maximale Breite berechnen 16700 var $this = jQuery(this); 16701 var $gridElement = $this.closest('.gridElement'); 16702 var gridElementWidth = $gridElement.outerWidth(); 16703 16704 var nextElement = $gridElement.nextAll().find('.gridElementSelected')[0]; 16705 var prevElement = $gridElement.prevAll().find('.gridElementSelected')[0]; 16706 $this.resizable( "option", "maxWidth", 0 ); 16707 $this.resizable( "option", "minWidth", gridElementWidth ); 16708 16709 var thisTop = $this.offset().top; 16710 var thisLeft = $this.offset().left; 16711 if( nextElement ) { 16712 var nextLeft = jQuery(nextElement).offset().left; 16713 var nextTop = jQuery(nextElement).offset().top; 16714 var maxWidth = nextLeft-thisLeft; 16715 if( nextTop == thisTop ) { 16716 $this.resizable( "option", "maxWidth", maxWidth ); 16717 } 16718 } 16719 /*if( prevElement && !event.toElement.classList.contains('ui-resizable-e') ) { 16720 var prevLeft = jQuery(prevElement).offset().left; 16721 var prevWidth = jQuery(prevElement).outerWidth(); 16722 var prevTop = jQuery(prevElement).offset().top; 16723 var maxWidth = prevLeft+prevWidth-thisLeft; 16724 if( prevTop == prevTop ) { 16725 $this.resizable( "option", "maxWidth", maxWidth ); 16726 } 16727 console.log('prevElement', prevElement) 16728 }*/ 16729 16730 }, 16731 stop: function(){ 16732 // neue GröÃe berechnen 16733 var $this = jQuery(this); 16734 var $gridElement = $this.closest('.gridElement'); 16735 var gridElementWidth = $gridElement.outerWidth(); 16736 var thisWidth = $this.outerWidth(); 16737 var newWidth = (thisWidth/gridElementWidth); 16738 newWidth = Math.round(newWidth); 16739 $this.css({width: 100*newWidth+'%'}); 16740 }, 16741 resize: function(){ 16742 }, 16743 16744 }); 16745 } resizableGrid(); 16746 // Grid Konfigurieren per Click 16747 jQuery('.gridWrapConfiguration').find('.gridElement').off('click').on('click', function(e){ 16748 var $this = jQuery(this); 16749 if(e.target.classList.contains('gridElement')) { 16750 // wenn nicht vorhanden element anlegen 16751 if( !$this.find('.gridElementSelected').length ) { 16752 $this.append('<div class="gridElementSelected"><a class="gridElementSelectedClose iconfont-delete" title="Rasterelement löschen" href="#" ></a><div class="gridElementDragbar"></div></div>') 16753 // wenn vorhanden auswahl erweitern 16754 } 16755 resizableGrid(); 16756 /*if( !jQuery('.gridElementSelectedActive').length ) { 16757 $this.append('<div class="gridElementSelected gridElementSelectedActive"><a class="gridElementSelectedSave iconfont-save_mono" href="#" ></a><a class="gridElementSelectedClose iconfont-delete" href="#" ></a><div class="gridElementDragbar"></div></div>') 16758 // wenn vorhanden auswahl erweitern 16759 } else { 16760 var selectedLeft = jQuery('.gridElementSelectedActive').offset().left; 16761 var thisLeft = $this.offset().left; 16762 16763 // nur positive Clicks zulassen 16764 if( selectedLeft <= thisLeft ) { 16765 var thisWidth = $this.width(); 16766 var newWidth = thisLeft-selectedLeft + thisWidth; 16767 jQuery('.gridElementSelectedActive').css({width:newWidth}); 16768 } 16769 } */ 16770 } 16771 }); 16772 16773 // Element bearbeiten 16774 jQuery('.gridWrapConfiguration').find('.gridElement').on('click', '.gridElementSelectedEdit', function(){ 16775 jQuery(this).closest('.gridElementSelected').addClass('gridElementSelectedActive'); 16776 }); 16777 16778 // Element entfernen und array leeren 16779 jQuery('.gridWrapConfiguration').find('.gridElement').on('click', '.gridElementSelectedClose', function(){ 16780 jQuery(this).closest('.gridElementSelected').remove(); 16781 // selectedElements = []; 16782 }); 16783 16784 function collectAllItems() { 16785 /*Header*/ 16786 var selectedCounter = 0; 16787 var selectedCounterArr = []; 16788 jQuery('.gridHeader').find('.gridWrapConfiguration').find('.gridElementSelected').each(function(){ 16789 var $thisSelected = jQuery(this); 16790 var selectedLeft = $thisSelected.offset().left; 16791 var selectedWidth = $thisSelected.outerWidth(); 16792 var selectedTop = $thisSelected.offset().top; 16793 var activeRange = selectedLeft+selectedWidth; 16794 // alle gridelemente finden die überlagert werden von der Auswahl und in Array legen 16795 $thisSelected.closest('.gridWrapConfiguration').find('.gridElement').each(function(){ 16796 $this = jQuery(this); 16797 var gridElementLeft = $this.offset().left; 16798 var gridElementWidth = $this.outerWidth(); 16799 var gridElementRange = gridElementLeft+gridElementWidth; 16800 var gridElementTop = $this.offset().top; 16801 if(Math.round(gridElementLeft) >= Math.round(selectedLeft) && Math.round(activeRange) >= Math.round(gridElementRange) && selectedTop == gridElementTop ) { 16802 var id = $this.attr('id').split('_')[1]; 16803 selectedElements.push(id); 16804 16805 // Gridfelder sammeln um zu prüfen ob alle gefüllt sind 16806 selectedCounter++; 16807 selectedCounterArr.push(selectedCounter); 16808 } 16809 }); 16810 var selectedId = $thisSelected.parent().attr('id').split('_')[1]; 16811 savedElements.push({selectedElements, selectedId}); 16812 selectedElements = []; 16813 16814 // Elemente in nicht definierten Areas finden 16815 jQuery('.gridHeader.gridWrap:not(.gridWrapConfiguration)').children('#gridElement_'+selectedId).addClass('inuse'); 16816 }); 16817 16818 /*Footer*/ 16819 jQuery('.gridFooter').find('.gridWrapConfiguration').find('.gridElementSelected').each(function(){ 16820 var $thisSelected = jQuery(this); 16821 var selectedLeft = $thisSelected.offset().left; 16822 var selectedWidth = $thisSelected.outerWidth(); 16823 var selectedTop = $thisSelected.offset().top; 16824 var activeRange = selectedLeft+selectedWidth; 16825 // alle gridelemente finden die überlagert werden von der Auswahl und in Array legen 16826 $thisSelected.closest('.gridWrapConfiguration').find('.gridElement').each(function(){ 16827 $this = jQuery(this); 16828 var gridElementLeft = $this.offset().left; 16829 var gridElementWidth = $this.outerWidth(); 16830 var gridElementRange = gridElementLeft+gridElementWidth; 16831 var gridElementTop = $this.offset().top; 16832 if(Math.round(gridElementLeft) >= Math.round(selectedLeft) && Math.round(activeRange) >= Math.round(gridElementRange) && selectedTop == gridElementTop ) { 16833 var id = $this.attr('id').split('_')[1]; 16834 selectedElements2.push(id); 16835 16836 // Gridfelder sammeln um zu prüfen ob alle gefüllt sind 16837 selectedCounter++; 16838 selectedCounterArr.push(selectedCounter); 16839 } 16840 }); 16841 var selectedId = $thisSelected.parent().attr('id').split('_')[1]; 16842 savedElements2.push({selectedElements2, selectedId}); 16843 selectedElements2 = []; 16844 16845 // Elemente in nicht definierten Areas finden 16846 jQuery('.gridFooter.gridWrap:not(.gridWrapConfiguration)').children('#gridElement_'+selectedId).addClass('inuse'); 16847 }); 16848 16849 // Püfen ob alle Gridfelder gefüllt sind 16850 if( selectedCounterArr.length != 20 ) { 16851 allGridAreasSelected = false;
16852 } else { 16853 allGridAreasSelected = true; 16854 } 16855 16856 // Wenn nicht jedes Gridfeld gefüllt nicht weiter machen 16857 if( allGridAreasSelected == false ) { 16858 return false; 16859 } 16860 // wenn LoginForm wegkonfigurtiert 16861 if( jQuery('.gridWrap:not(.gridWrapConfiguration)').find('.gridElement:not(.inuse)').find('#loginForm_DragID.draggableEl').length ) { 16862 document.getElementById('gridForm:isLoginFormVisible').value = false; 16863 jQuery('#gridForm\\:isLoginFormVisible').trigger('change'); 16864 } 16865 // nicht in Raster positionierte Widgets in Dropzone legen 16866 // Productlogo darf nicht entfernt werden und wird wieder in den Footer gelegt 16867 jQuery('.gridWrap:not(.gridWrapConfiguration)').find('.gridElement:not(.inuse)').find('.draggableEl:not(.productLogo)').prependTo('#gridDDZone'); 16868 jQuery('.gridWrap:not(.gridWrapConfiguration)').find('.gridElement:not(.inuse)').find('.draggableEl.productLogo').appendTo('#gridElement_11'); 16869 jQuery('.gridWrap').find('.gridElement.inuse').removeClass('inuse'); 16870 16871 } 16872 16873 this.saveGridConfig = function() { 16874 // Neue Auswahl in vorhandenem Array ändern 16875 collectAllItems(); 16876 // Wenn nicht jedes Gridfeld gefüllt nicht weiter machen 16877 if( allGridAreasSelected == false ) { 16878 jQuery('.triggerAllGridAreasSelectedMessage').trigger('click'); 16879 return false; 16880 } else { 16881 if( jQuery('.error_infobox').length ) { 16882 jQuery('.infobox_close').trigger('click'); 16883 } 16884 } 16885 16886 //Header 16887 for (i = 0; i < savedElements.length; i++){ 16888 gridElement = savedElements[i].selectedId; 16889 elements = savedElements[i].selectedElements; 16890 for (i2 = 0; i2 < elements.length; i2++){ 16891 gridAreas[elements[i2]-1] = 'grid'+ gridElement; 16892 } 16893 } 16894 // Ausgabe für css Aufbereiten 16895 var gridAreasCss1 = []; 16896 var gridAreasCss2 = []; 16897 for (i = 0; i < gridAreas.length; i++){ 16898 if(i < 5) { 16899 gridAreasCss1.push(gridAreas[i]); 16900 } else { 16901 gridAreasCss2.push(gridAreas[i]); 16902 } 16903 } 16904 var gridAreasCss = "'" + gridAreasCss1.join(' ') + "' '"+ gridAreasCss2.join(' ') + "'"; 16905 //console.log('gridAreasCss', gridAreasCss); 16906 jQuery('.gridSizeHeader').val(gridAreasCss); 16907 jQuery('.gridHeader').css({gridTemplateAreas: gridAreasCss}); 16908 savedElements = []; 16909 16910 //Footer 16911 for (i = 0; i < savedElements2.length; i++){ 16912 gridElement = savedElements2[i].selectedId; 16913 elements = savedElements2[i].selectedElements2; 16914 for (i2 = 0; i2 < elements.length; i2++){ 16915 gridAreasFooter[elements[i2]-11] = 'grid'+ gridElement; 16916 } 16917 } 16918 var gridAreasCss1_2 = []; 16919 var gridAreasCss2_2 = []; 16920 for (i = 0; i < gridAreasFooter.length; i++){ 16921 if(i < 5) { 16922 gridAreasCss1_2.push(gridAreasFooter[i]); 16923 } else { 16924 gridAreasCss2_2.push(gridAreasFooter[i]); 16925 } 16926 } 16927 var gridAreasCss_2 = "'" + gridAreasCss1_2.join(' ') + "' '"+ gridAreasCss2_2.join(' ') + "'"; 16928 jQuery('.gridSizeFooter').val(gridAreasCss_2); 16929 jQuery('.gridFooter').css({gridTemplateAreas: gridAreasCss_2}); 16930 savedElements2 = []; 16931 }; 16932 16933 } 16934 16935 this.submitGrid = function() { 16936 jQuery('.saveGridConfig').trigger('click'); 16937 createGrid(); 16938 setTimeout(function(){ 16939 configureGrid(); 16940 },800); 16941 16942 initial = false; 16943 // Wenn nicht jedes Gridfeld gefüllt nicht weiter machen 16944 if( allGridAreasSelected == false ) { 16945 de.his.modules.Waiting.resetWaitingBehaviour(); 16946 return false; 16947 } 16948 } 16949 16950 16951 var drag = function(){ 16952 16953 /*jQuery('<button type="button" class="saveGrid">ShowArray</button>').insertAfter('#hisinoneHeader'); 16954 jQuery('.saveGrid').off('click').on('click',function(){ 16955 createGrid(); 16956 });*/ 16957 16958 var $dropZone = jQuery('.gridElement, #gridDDZone'); 16959 var $dragElement = jQuery(".draggableEl"); 16960 $dragElement.attr('draggable', 'true'); 16961 16962 16963 var originalPosX; 16964 var originalPosY; 16965 var currPosX; 16966 var currPosY; 16967 16968 jQuery('body').on('dragover', function(e){ 16969 currPosX = e.clientX; 16970 currPosY = e.clientY; 16971 jQuery('.js-dragClone').css({left: currPosX, top: currPosY}); 16972 }); 16973 16974 $dragElement.on('dragstart', function(e){ 16975 16976 originalPosX = jQuery(this).offset().left; 16977 originalPosY = jQuery(this).offset().top; 16978 16979 $dropZone.addClass('dragactive'); 16980 jQuery(this).addClass('onthedrag'); 16981 if( !jQuery('.js-dragClone').length ) { 16982 jQuery(this).clone().addClass('js-dragClone').css({left: originalPosX, top: originalPosY}).appendTo('body'); 16983 } 16984 16985 var thisId = jQuery(e.target).closest("[draggable=true]").attr('id'); 16986 localStorage.setItem('dataTransferObject', thisId); 16987 16988 if( jQuery(this).hasClass('productLogo') ) { 16989 jQuery('.gridDDZoneWrap').addClass('gridDDZone-hide'); 16990 } 16991 16992 }).on('dragend', function(e){ 16993 if( e.originalEvent.dataTransfer.dropEffect == 'none' ) { 16994 jQuery('.js-dragClone').animate({'top':originalPosY, 'left':originalPosX},400); 16995 } 16996 16997 $dragElement.removeClass('onthedrag'); 16998 if( jQuery('.js-dragClone').length ) { 16999 setTimeout(function(){ 17000 jQuery('.js-dragClone').remove(); 17001 jQuery('.gridDDZoneWrap').removeClass('gridDDZone-hide'); 17002 },400); 17003 } 17004 }); 17005 17006 $dropZone.off('drop').on('drop', function(e){ 17007 e.preventDefault(); 17008 var ev = e; 17009 var data = localStorage.getItem('dataTransferObject'); 17010 setTimeout(function(){ 17011 $dropZone.removeClass('dragactive dragover'); 17012 if( ev.target.classList.contains('gridElement') || ev.target.id.contains('gridDDZone') ) { 17013 ev.target.appendChild(document.getElementById(data)); 17014 } 17015 else { 17016 var $closestDragZone = jQuery(ev.target).closest("[draggable=true]"); 17017 $closestDragZone[0].before(document.getElementById(data)); 17018 } 17019 17020 // wenn LoginForm wegkonfigurtiert 17021 if( data.contains('loginForm') ) { 17022 if( ev.currentTarget.id.contains('gridDDZone') ) { 17023 document.getElementById('gridForm:isLoginFormVisible').value = false;
17024 jQuery('#gridForm\\:isLoginFormVisible').trigger('change'); 17025 } else { 17026 document.getElementById('gridForm:isLoginFormVisible').value = true; 17027 jQuery('#gridForm\\:isLoginFormVisible').trigger('change'); 17028 } 17029 } 17030 17031 localStorage.removeItem('dataTransferObject'); 17032 jQuery('#hisinoneHeader').addClass('js-fixed').parent().css({paddingTop:jQuery('#hisinoneHeader').outerHeight()}); 17033 },400); 17034 jQuery('.js-dragClone').addClass('bye'); 17035 }); 17036 17037 17038 /*$dropZone.on('dragenter', function(e){ 17039 e.preventDefault(); 17040 jQuery(this).addClass('dragover'); 17041 });*/ 17042 17043 $dropZone.on('dragleave', function(e){ 17044 e.preventDefault(); 17045 jQuery(this).removeClass('dragover'); 17046 }); 17047 17048 $dropZone.on('dragover', function(e){ 17049 jQuery(this).addClass('dragover'); 17050 e.preventDefault(); 17051 }); 17052 } 17053 17054 17055 17056 this.refresh = function() { 17057 this.init(); 17058 }; 17059}; 17060/** 17061 * Creates custom tooltips in Firefox, Safari and Chrome Browsers 17062 * does not work in Edge 17063 */ 17064use_package("de.his.component"); 17065 17066de.his.component.customtooltip = new function() { 17067 de.his.modules.ModuleRegistry 17068 .registerModule(this) 17069 .registerAjaxRefreshModule(this); 17070 17071 this.moduleName = "de.his.component.customtooltip "; 17072 17073 this.init = function() { 17074 initCustomTooltips(); 17075 if(window.device.desktop()){ 17076 focustooltip(); 17077 if( navigator.webdriver != true ) { 17078 hovertooltip(); 17079 } 17080 } 17081 }; 17082 17083 this.refresh = function() { 17084 de.his.component.customtooltip.init(); 17085 }; 17086 17087 this.initHovertooltip = function() { 17088 hovertooltip(); 17089 } 17090 17091 this.setTooltip = function(element) { 17092 if(window.device.desktop()){ 17093 setTooltip(element); 17094 } 17095 } 17096 17097 this.removeTooltip = function(element) { 17098 removeTooltip(element); 17099 } 17100 17101 var initCustomTooltips = function() { 17102 // setCustomValidity on required input fields 17103 $focusableElements = jQuery('input[required]:not([data-required])'); 17104 $focusableElements.each(function(index, element) { 17105 var $this = jQuery(element); 17106 17107 if(typeof $this.attr('required') !== 'undefined'){ 17108 17109 //$this.removeAttr('required'); // rausgenommen, da es Probleme bereitet siehe #314515 17110 // add data-required attribut to prevent this script from running more than once per field 17111 $this.attr('data-required', 'required'); 17112 //console.log("data-required", $this); 17113 //console.log($this.closest('form')); 17114 if(typeof $this.closest('form').attr('data-required-listener-set') === 'undefined'){ 17115 17116 $this.closest('form').find('button[type="submit"]').on('click', function(e){ 17117 // onclick 17118 // wird z.B. im Login Formular verwendet 17119 $this.closest('form').find('input[data-required]').each(function(index, element){ 17120 //jQuery(element).attr('required','required'); 17121 if (element.value == '') { 17122 element.setCustomValidity('Fülle dieses Feld aus.'); 17123 } else { 17124 element.setCustomValidity(''); 17125 } 17126 }); 17127 }); 17128 }; 17129 }; 17130 }); 17131 }; 17132 17133 var setTooltip = function(element, removeTitle = false) { 17134 var $this = jQuery(element); 17135 var title = $this.attr('title'); 17136 $this.attr('data-title', title); 17137 var id = $this.attr('id'); 17138 17139 jQuery('.focusTooltip').remove(); 17140 17141 if (title !== undefined && title.trim() !== '' ) { 17142 jQuery('body').append('<span class="focusTooltip"></span>'); 17143 jQuery('.focusTooltip').attr('data-id', id); 17144 jQuery('.focusTooltip').text(title); 17145 // fix for selenium tests #312308 17146 if( removeTitle && navigator.webdriver != true ) { 17147 $this.removeAttr('title'); 17148 } 17149 var rect = element.getBoundingClientRect(); 17150 var thisHeight = $this.outerHeight(); 17151 var highlightFocusOutlineWidth = 0; 17152 // check for outlines on button. If so, we need to add them to the height to possition the tooltip properly 17153 if(parseFloat($this.css('outline-width'))>0 && getComputedStyle(element).getPropertyValue('--highlightFocusOutline')) { 17154 // value of $this.css('outline-width') won't be correct on click and first focus. Probably because of transitions etc., so we are getting the correct outline value directly from the css variable 17155 // get outline with form css variable, works as long as highlightFocusOutline width is not set to double digit value 17156 highlightFocusOutlineWidth = parseFloat(getComputedStyle(element).getPropertyValue('--highlightFocusOutline').slice(0,1)); 17157 // to reduce variations because of decimal number in outer height we round up
17158 thisHeight = Math.ceil(parseFloat(thisHeight)) + highlightFocusOutlineWidth; 17159 } 17160 17161 jQuery('.focusTooltip').css({ 17162 left: rect.left + 'px', 17163 top: rect.top + thisHeight + 'px' 17164 }); 17165 17166 if(rect.bottom + thisHeight > (window.innerHeight || document.documentElement.clientHeight)) { 17167 jQuery('.focusTooltip').css({ 17168 top: rect.top - jQuery('.focusTooltip').outerHeight() - highlightFocusOutlineWidth + 'px' 17169 }); 17170 } 17171 17172 var ftWidth = jQuery('.focusTooltip').outerWidth(); 17173 var rightPosition = ftWidth + rect.left; 17174 var winWidth = jQuery(window).width(); 17175 var newLeftPosition = rect.left - (rightPosition - winWidth); 17176 17177 if (rightPosition >= winWidth) { 17178 jQuery('.focusTooltip').css({ 17179 left: newLeftPosition + 'px' 17180 }); 17181 } 17182 } 17183 } 17184 17185 var removeTooltip = function(element) { 17186 var $this = jQuery(element); 17187 var title = $this.attr('title'); 17188 if (title === undefined) { 17189 $this.attr('title', $this.attr('data-title')); 17190 } 17191 $this.removeAttr('data-title'); 17192 jQuery('.focusTooltip').remove(); 17193 } 17194 17195 17196 17197 var hovertooltip = function() { 17198 var $focusableElements = jQuery('a[title], button[title], li[title], div[title], input[title], img[title], span[title]'); 17199 // :not([type="checkbox"]) 17200 17201 $focusableElements.each(function(index, element) { 17202 //var nestedFocusableElements = element.find('a[title], button[title], li[title], div[title], input[title], img[title], span[title]'); 17203 17204 if(element.getAttribute("data-customTooltipInitialized") == null){ 17205 var $this = jQuery(element); 17206 $this.on('mouseenter', function(e) { 17207 // "save" mouse is on element to be able to separate mouse click event from enter/space key while screen reader usage (does not work if mouse is on same element which is used enter or space on) 17208 $this.attr('data-hover', true); 17209 setTooltip(element, true); 17210 }).on('mouseleave', function(e) { 17211 $this.removeAttr('data-hover'); 17212 removeTooltip(element); 17213 //console.log("remove hovertooltip on mouseleave"); 17214 }).on('updateTooltip', function(e) { 17215 // check if is Edge and mouse is on same element. updateTooltip is triggered as well if screen reader is used and enter or space key is hit 17216 if (/Edg/.test(navigator.userAgent) && !$this.attr('data-hover')) { 17217 console.log("no focus tooltip for edge"); 17218 return; 17219 } 17220 // check if mouse is on same element and set removeTitle param in dependence on that. Needed because of issues with screen reader using 'click'-event on enter and space 17221 setTooltip(element, !!$this.attr('data-hover')); 17222 }); 17223 element.setAttribute("data-customTooltipInitialized","true"); 17224 } 17225 17226 }); 17227 } 17228 17229 var focustooltip = function() { 17230 // not for Edge #307939 17231 if (/Edg/.test(navigator.userAgent)) { 17232 console.log("no focus tooltip for edge"); 17233 return; 17234 } 17235 var $focusableElements = jQuery('a[title], button[title], li[title], div[title], input[title], img[title], span[title]'); 17236 17237 $focusableElements.each(function(index, element) { 17238 if(element.getAttribute("data-customFocusTooltipInitialized") == null){ 17239 var $this = jQuery(element); 17240 var isInputElement = element.nodeName.toLowerCase() === 'input'; 17241 $this.on('keyup', function(e) { 17242 var code = e.keyCode || e.which; 17243 // menuSearch is also navigatable with up(40) and down(38) cursor keys. 17244 if (code == '9' || code == '38' || code == '40') { 17245 setTooltip(element); 17246 } else if (code == 27) { 17247 jQuery('.focusTooltip').remove(); 17248 } else if (isInputElement) { 17249 // remove tooltip on typing in input fields like search f
17249ield for example 17250 jQuery('.focusTooltip').remove(); 17251 } 17252 }).on('focusout', function(e) { 17253 removeTooltip(element); 17254 }); 17255 17256 element.setAttribute("data-customFocusTooltipInitialized","true"); 17257 } 17258 }); 17259 17260 jQuery(window).on('scroll', function() { 17261 jQuery('.focusTooltip').remove(); 17262 }); 17263 } 17264}/** 17265 * @Author: jgrimm 17266 */ 17267use_package("de.his.modules"); 17268de.his.modules.HISinOneGallery = new function() { 17269 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 17270 17271 this.moduleName = "de.his.modules.HISinOneGallery"; 17272 var intervalId; 17273 17274 this.init = function() { 17275 jQuery(".hisinone-gallery").each(function() { 17276 var currentGallery = jQuery(this); 17277 de.his.modules.HISinOneGallery.initGallery(currentGallery); 17278 }); 17279 } 17280 17281 this.refresh = function() { 17282 de.his.modules.HISinOneGallery.init(); 17283 } 17284 17285 this.initGallery = function(gallery) { 17286 // init/compute image metadata 17287 gallery.data("imageCount", 0); 17288 gallery.children("img").each(function(index) { 17289 var galleryImage = jQuery(this); 17290 17291 galleryImage.data("index", index); 17292 17293 // set title to filename if not available 17294 var title = galleryImage.attr("title"); 17295 if (!title) { 17296 var src = galleryImage.attr("src"); 17297 var srcParts = src.split('/'); 17298 var filename = srcParts[srcParts.length - 1]; 17299 galleryImage.attr("title", filename); 17300 } 17301 17302 // set alt to title if not available 17303 var alt = galleryImage.attr("alt"); 17304 if (!alt) { 17305 galleryImage.attr("alt", galleryImage.attr("title")); 17306 } 17307 17308 gallery.data("imageCount", gallery.data("imageCount") + 1); 17309 }); 17310 17311 if(!gallery.data("initialized")){ 17312 // init gallery nav and captions 17313 gallery.append("<div class='hisinone-gallery-nav-caption'>" + de.his.modules.HISinOneGallery.galleryContentMarkup(null, '', null)+ "</div>"); 17314 gallery.append("<div class='hisinone-gallery-nav'><a href='#' class='hisinone-gallery-nav-button hisinone-gallery-nav-last' title='Zurück' alt='Zurück'><span class='unsichtbar'>Zurück</span></a> <a href='#' class='hisinone-gallery-nav-button hisinone-gallery-nav-next' title='Weiter' alt='Weiter'><span class='unsichtbar'>Weiter</span></a></div>"); 17315 17316 // register click handlers for navigation 17317 gallery.find(".hisinone-gallery-nav-last").click(de.his.modules.HISinOneGallery.last); 17318 gallery.find(".hisinone-gallery-nav-next").click(de.his.modules.HISinOneGallery.next); 17319 17320 // start with image 0 17321 gallery.data("currentImageIndex", 0); 17322 de.his.modules.HISinOneGallery.setGalleryImage(gallery, -1, 0); 17323 17324 // start image interval 17325 var interval = gallery.data("interval"); 17326 if (interval) { 17327 intervalId = setInterval(function() { 17328 de.his.modules.HISinOneGallery.changeImage(gallery, 1); 17329 }, interval); 17330 } 17331 } 17332 gallery.data("initialized", true); 17333 } 17334 17335 /** 17336 * show last image 17337 */ 17338 this.last = function() { 17339 var gallery = jQuery(this).closest(".hisinone-gallery"); 17340 de.his.modules.HISinOneGallery.changeImage(gallery, -1); 17341 clearInterval(intervalId); 17342 return false; 17343 } 17344 17345 /** 17346 * show next image 17347 */ 17348 this.next = function() { 17349 var gallery = jQuery(this).closest(".hisinone-gallery"); 17350 de.his.modules.HISinOneGallery.changeImage(gallery, 1); 17351 clearInterval(intervalId); 17352 return false; 17353 } 17354 17355 /** 17356 * change image by 'currentIndex + amount' where amount can be positive or negative 17357 */ 17358 this.changeImage = function(gallery, amount) { 17359 if (!amount || amount == 0) { 17360 return; 17361 } 17362 17363 var galleryImageCount = gallery.data("imageCount"); 17364 var currentImageIndex = gallery.data("currentImageIndex"); 17365 var nextImageIndex = de.his.modules.HISinOneGallery.getNextImageIndex(galleryImageCount, currentImageIndex, amount); 17366 17367 de.his.modules.HISinOneGallery.setGalleryImage(gallery, currentImageIndex, nextImageIndex); 17368 } 17369 17370 /** 17371 * compute next image index 17372 * @param images number of images 17373 * @param current index of current image 17374 * @param change amount to change the current index 17375 */ 17376 this.getNextImageIndex = function(images, current, change) { 17377 var next = current + change; 17378 while (next < 0) { 17379 next += images; 17380 } 17381 17382 return next % images; 17383 } 17384 17385 /** 17386 * changes the image 17387 */ 17388 this.setGalleryImage = function(gallery, lastImageIndex, nextImageIndex) { 17389 // hide previous image 17390 if (lastImageIndex >= 0) { 17391 var lastImage = jQuery(gallery.children("img")[lastImageIndex]); 17392 lastImage.fadeOut(); 17393 } 17394 17395 // show next image 17396 var nextImage = jQuery(gallery.children("img")[nextImageIndex]); 17397 nextImage.fadeIn(); 17398 gallery.data("currentImageIndex", nextImageIndex); 17399 17400 // copy link from image to gallery 17401 var href = nextImage.data("href"); 17402 var title = nextImage.attr("title"); 17403 var alt = nextImage.attr("alt"); 17404 var content = gallery.find(".hisinone-gallery-nav-content"); 17405 content.replaceWith(de.his.modules.HISinOneGallery.galleryContentMarkup(href, title, alt)); 17406 17407 // copy image caption 17408 var caption = nextImage.data("caption"); 17409 var text = gallery.find(".hisinone-gallery-nav-text"); 17410 if (caption) { 17411 text.fadeIn(); 17412 text.text(caption); 17413 } else { 17414 text.fadeOut(); 17415 text.text(""); 17416 } 17417 } 17418 17419 this.galleryContentMarkup = function(href, title, alt) { 17420 if (!href) { 17421 return "<div title='" + title + "' class='hisinone-gallery-nav-content'><span class='hisinone-gallery-nav-text'></span></div>"; 17422 } 17423 17424 return "<a href='" + href + "' title='" + title + "' alt='" + alt + "' class='hisinone-gallery-nav-content' target='_blank'><span class='hisinone-gallery-nav-text'></span></a>"; 17425 } 17426 17427};use_package("de.his.component.sidebar"); 17428 17429de.his.component.sidebar = new function(){ 17430 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 17431 this.moduleName = "de.his.component.sidebar"; 17432 var self = this; 17433 17434 this.lastClickedOpenSidebarElementId = ""; 17435 17436 var closeButtonClicked = false;
17437 var isHidingSidebar = false; 17438 17439 this.init = function(){ 17440 handleOpenClick(); 17441 handleCloseClick(); 17442 } 17443 17444 this.refresh = function(){ 17445 self.init(); 17446 } 17447 17448 var handleOpenClick = function(){ 17449 jQuery("[id$='showSidebar']").click( function(event){ 17450 if( jQuery(this).attr('id').length ) { 17451 self.lastClickedOpenSidebarElementId = de.his.common.Util.toJQueryId( jQuery(this).attr('id') ); 17452 } else { 17453 self.lastClickedOpenSidebarElementId = de.his.common.Util.toJQueryId(de.his.common.ContextInformation.get("active-page-element-id")); 17454 } 17455 localStorage.setItem("lastClickedOpenSidebarElementId", self.lastClickedOpenSidebarElementId); 17456 focusSidebar(); 17457 }); 17458 17459 } 17460 17461 var handleCloseClick = function(){ 17462 jQuery("[id*='hideSidebar']").click(function(event){ 17463 if (isHidingSidebar) return; 17464 isHidingSidebar = true; 17465 17466 event.preventDefault(); 17467 focusLastClickedOpenedElementOnHideSidebar(); 17468 setTimeout(function() { 17469 isHidingSidebar = false; 17470 }, 100); 17471 }); 17472 } 17473 17474 // Funktion wird zu oft aufgerufen, verhindern, dass nur einmal pro Klick 17475 var focusSidebar = function(){ 17476 var sidebarContainers = jQuery(".ui-sidebar"); 17477 // Wenn es mehrere Sidebars innerhalb einer Seite gibt 17478 if(sidebarContainers.length > 1){ 17479 for(let i = 0; i < sidebarContainers.length; i++){ 17480 var openingButton = localStorage.getItem("lastClickedOpenSidebarElementId"); 17481 if(openingButton.toLocaleLowerCase().includes(sidebarContainers[i].getAttribute("name").toLowerCase())){ 17482 $(sidebarContainers[i]).find('h2').focus(); 17483 break; 17484 } 17485 } 17486 } 17487 else{ 17488 sidebarContainers.find('h2').focus(); 17489 } 17490 } 17491 17492 var focusLastClickedOpenedElementOnHideSidebar = function(){ 17493 var lastClickedElementId = localStorage.getItem("lastClickedOpenSidebarElementId"); 17494 if(lastClickedElementId != null && lastClickedElementId != ""){ 17495 setTimeout(function() { 17496 jQuery('#' + de.his.common.Util.toJQueryId(lastClickedElementId.replaceAll('\\', ''))).focus(); 17497 self.lastClickedOpenSidebarElementId = ""; 17498 localStorage.setItem("lastClickedOpenSidebarElementId", self.lastClickedOpenSidebarElementId); 17499 }, 100); 17500 } 17501 } 17502 17503 this.handleSidebarHide = function(event){ 17504 if (!closeButtonClicked) { 17505 this.hideStudyPlannerSidebar(event); 17506 document.getElementById('studyPlannerSidebar:filterSidebarBottom_hideSidebar').click(); 17507 } 17508 closeButtonClicked = false; 17509 } 17510 17511 this.isButtonClick = function(event){ 17512 closeButtonClicked = true; 17513 this.hideStudyPlannerSidebar(event); 17514 } 17515 17516 this.hideStudyPlannerSidebar = function(event) { 17517 var isMobileWidth = false; 17518 if(768 >= window.innerWidth){ 17519 isMobileWidth = true; 17520 } 17521 document.getElementById('studyPlannerSidebar:hiddenWindowWidthChecker').value = isMobileWidth; 17522 PF(event).hide(); 17523 } 17524}; 17525/***************************************************************************** 17526* Include in diesen Datei ändern: layoutHISinOne*.xhtml 17527* 17528* portalHelper: Funktionen die von unterschiedlichen Stellen aufgerufen werden 17529*****************************************************************************/ 17530 17531 17532/** 17533 * Funktion um Text zu kürzen 17534 * TODO hier evtl noch ein wenig optimieren 17535 */ 17536function resizeText(maxLength, str ) { 17537 if (str == null || maxLength == null || str == "" || maxLength == "" || str.length < 1) { 17538 return str; 17539 } 17540 17541 var dummy = document.createElement("div"); 17542 17543 dummy.innerHTML = str; 17544 dummy.style.whiteSpace = "nowrap"; 17545 dummy.style.position = "absolute"; 17546 dummy.style.top = "-100px"; 17547 document.body.appendChild(dummy); 17548 var breite = dummy.scrollWidth; 17549 if (breite == null || breite == "" || breite < 0) { 17550 return str; 17551 } 17552 document.body.removeChild(dummy); 17553 maxLength -= 110; 17554 if (breite > maxLength) { 17555 var newbreite = breite; 17556 var sicherung = 0; 17557 while(newbreite > maxLength) { 17558 str = str.substr(0,str.length - 1) 17559 var dummy = document.createElement("div"); 17560 dummy.innerHTML = str; 17561 dummy.style.whiteSpace = "nowrap"; 17562 dummy.style.position = "absolute"; 17563 dummy.style.top = "-100px"; 17564 document.body.appendChild(dummy); 17565 newbreite = dummy.scrollWidth; 17566 document.body.removeChild(dummy); 17567 // Sicherheitsabfrage Schleife beenden 17568 if (sicherung > 50) { 17569 break; 17570 } 17571 sicherung++; 17572 } 17573 return (str + "..."); 17574 } else { 17575 return str; 17576 } 17577}; 17578 17579/** 17580 * Entfernt ein Html-Element mit der übergeben ID aus dem DOM-Baum 17581 * @param clientId 17582 */ 17583function removeHtmlElement(clientId) { 17584 if (clientId == null) { 17585 return; 17586 } 17587 if (document.getElementById(clientId) == null) { 17588 return; 17589 } 17590 document.getElementById(clientId).style.display = 'none'; 17591} 17592 17593/** 17594 * Entfernt ein HTML-Element oder fügt wieder eines hinzu mit einer "coolen" Animation 17595 * @param clientId 17596 */ 17597function toggleHtmlElementWithEffect(clientId) { 17598 if (clientId == null ||clientId == "") { 17599 return; 17600 } 17601 if (document.getElementById(clientId) == null) { 17602 return; 17603 } 17604 if (clientId.indexOf(':')>=0) { 17605 clientId = de.his.common.Util.toJQueryId(clientId); 17606 } 17607 jQuery("#"+clientId).fadeToggle("fast", "linear"); 17608} 17609 17610/** 17611 * Fügt ein Html-Element mit der übergeben ID wieder als Block-Element hinzu 17612 * @param clientId 17613 */ 17614function restoreHtmlElement(clientId) { 17615 if (clientId == null) { 17616 return; 17617 } 17618 if (document.getElementById(clientId) == null) { 17619 return; 17620 } 17621 document.getElementById(clientId).style.display = 'block'; 17622} 17623 17624/** 17625 * Fügt ein Html-Element mit der übergeben ID wieder als Inline-Element hinzu 17626 * @param clientId 17627 */ 17628function restoreHtmlElementInline (clientId) { 17629 if (clientId == null) { 17630 return; 17631 } 17632 if (document.getElementById(clientId) == null) { 17633 return; 17634 } 17635 document.getElementById(clientId).style.display = 'inline'; 17636} 17637 17638/** 17639 * SchlieÃt die Sidebar/Infobox 17640 * 17641 * @param contextPath 17642 * @param clientId 17643 * @param sidebarContentId 17644 */ 17645function closeSidebar(contextPath, clientId, sidebarContentId) { 17646 toggleHtmlElementWithEffect(sidebarContentId); 17647// if (renderFixed != "true") { 17648// document.getElementById('portalContent').style.width = '99%'; 17649// } 17650// restoreHtmlElement(sidebarContentId); 17651 17652 // Ajax ausführen 17653 var ajaxToken = getAjaxToken(); 17654 jQuery.ajax( { 17655 type: 'POST', 17656 url : contextPath+'/pages/cs/sys/portal/sidebarAjaxReqest.faces', 17657 data: ({ 17658 ajaxToken :ajaxToken, 17659 clientId:clientId 17660 }), 17661 error : function() { 17662 de.his.ajax.Refresher.onError('Fehler beim SchlieÃen der Sidebar'); 17663 } 17664 }); 17665} 17666 17667/** 17668 * Ãffnet die Sidebar/Infobox 17669 * @param contextPath 17670 * @param clientId 17671 * @param sidebarContentId 17672 */ 17673function openSidebar(contextPath, clientId, sidebarContentId) { 17674// removeHtmlElement('clipboardWhitoutContent'); 17675// if (renderFixed != "true") { 17676// document.getElementById('portalContent').style.width = '73%'; 17677// } 17678 toggleHtmlElementWithEffect(sidebarContentId); 17679 17680 // Ajax ausführen 17681 var ajaxToken = getAjaxToken(); 17682 jQuery.ajax( { 17683 type: 'POST', 17684 url : contextPath+'/pages/cs/sys/portal/sidebarAjaxReqest.faces', 17685 data: ({ 17686 ajaxToken :ajaxToken, 17687 clientId:clientId 17688 }), 17689 error : function() { 17690 de.his.ajax.Refresher.onError('Fehler beim Ãffnen der Sidebar'); 17691 } 17692 }); 17693} 17694 17695function resizeIt( $iframe ){ 17696 /** 17697 * TODO: refactor to iFramePortletResize. 17698 */ 17699 console.log("RESIZE IT "+ $iframe.attr( "id" )); 17700 var winHeight = jQuery( window ).height(), 17701 $body, 17702 $footer, 17703 top, 17704 $mainContent, 17705 height = 0, 17706 $header, 17707 $parent = $iframe.parent(); 17708 17709 /** 17710 * Fälle: 17711 * 17712 * Jeweils für ganzseitige iFrames und iFrame Portlets. (duh!) 17713 * 17714 * 1. Seite auf gleicher Domain, fixierte Header und Footer deaktiviert 17715 * 2. Seite auf gleicher Domain, fixierte H&F aktiv 17716 * 3. X-Domain, fixed H&F deaktiviert 17717 * 4. X-Domain, fixed H&F aktiv 17718 */ 17719 var resizeFunction = function ($iframe){ 17720 function hasHeightInData($el){ 17721 var ds = (jQuery($el).attr('data-style') || '').toLowerCase(); // raw str 17722 return /height\s*:\s*[\d.]+(px|%|em|rem|vh|vw)/.test(ds); // valid? 17723 } 17724 $parent = $iframe.parent(); 17725 if(hasHeightInData($parent)){ 17726 // NUtzer hat manuelle GröÃe gesetzt, nicht resizen 17727 return; 17728 } 17729 17730 let manualHeight = ''; 17731 // reset style to determine real height of iframe 17732 if($parent[0].style.height !== ''){ 17733 manualHeight = $parent[0].style.height; 17734 $parent[0].style.height = ''; 17735 //return; 17736 } 17737 17738 // Bei iFrames die Seiten mit der gleichen Domain einbinden, 17739 // die volle Höhe des iFrames ermitteln und als Höhe des parents setzen. 17740 // margins und paddings der Kindelemente nicht mit einbeziehen.
17741 var $content = jQuery( $iframe[ 0 ].contentWindow.document.body ); 17742 console.log("read iframe body for resize", $content); 17743 if ( $content.length ) { 17744 /** 17745 * same-origin iframe 17746 */ 17747 var contentHeight = $iframe[ 0 ].contentWindow.document.documentElement.scrollHeight 17748 || $iframe[ 0 ].contentWindow.document.body.scrollHeight; 17749 17750 if(contentHeight !== $parent.innerHeight()){ 17751 console.log("content Height of IFrame: "+ contentHeight + " parent:" + $parent.innerHeight()); 17752 // +2 removes 1px microscrollbars in infobox on mobile 17753 $parent.height( 2 + contentHeight );// + childPadding); 17754 }else{ 17755 console.log("(no resize) content Height of IFrame: "+ contentHeight + " parent:"+ $parent.innerHeight()); 17756 } 17757 } else { 17758 //needed for safari - doesn't throw an error with cors 17759 throw new Error(); 17760 } 17761 } 17762 try { 17763 var url = $iframe.attr("src"); 17764 if( ! url.includes('/a/')){ 17765 // JSF Portlets sind fertig gerendert wenn loaded und müssen einmal resized werden. 17766 resizeFunction($iframe); 17767 } else { 17768 // MutationObserver für Angular Portlets, weil Angular beim document.ready noch nicht fertig gerendert ist. 17769 // siehe auch: https://hiszilla.his.de/hiszilla/show_bug.cgi?id=309092 17770 // 17771 // Auch zur dynamischen Anpassung der GröÃe für JSF Portlets statt postMessage nach ajax-refresh möglich, aber unnötig. 17772 let lastMutationTimeout; 17773 17774 // timeout Hack um bis zur letzten Mutation keinen resize durch zu führen. 17775 function handleMutations() { 17776 clearTimeout(lastMutationTimeout); 17777 17778 lastMutationTimeout = setTimeout(() => { 17779 resizeFunction($iframe); 17780 }, 50); 17781 } 17782 17783 const observer = new MutationObserver(() => { 17784 console.log("Mutation detected"); 17785 handleMutations(); 17786 }); 17787 17788 observer.observe($iframe[0].contentWindow.document.getElementById('contentFrame'), { attributes: true, childList: true, subtree:true }); 17789 } 17790 17791 } catch( e ) { 17792 console.warn('portlet resize error. This is expected only on Safari Browsers.', e); 17793 /** 17794 * wenn fehler fliegt: x-origin iframe 17795 */ 17796 $footer = jQuery( "#hisinoneFooter" ); 17797 $mainContent = jQuery( "#contentFrame" ); 17798 $header = jQuery( "#hisinoneHeader" ); 17799 $body = jQuery( "body" ); 17800 $title = jQuery( "#hisinoneTitle" ); 17801 $permissionQuery = jQuery( "#askForNotificationPermission" ); 17802 17803 // childrens have paddings and margins that can change when the CSS is changed. 17804 // Take them into account. 17805 childrenPadding = getChildrenPaddingAndMargin($mainContent); 17806 childrenPadding = childrenPadding + getElementPaddingMarginAndBorder(jQuery( ".his_main_content" )); 17807 childrenPadding = childrenPadding + getElementPaddingMarginAndBorder(jQuery( "#clearer" )); 17808 17809 if($permissionQuery.length && !$permissionQuery.hasClass("unsichtbar")){ 17810 // wenn Anfrage für push da ist und ganzseitig, höhe dazu nehmen. 17811 childrenPadding = childrenPadding + $permissionQuery.outerHeight(true)+3; 17812 } 17813 17814 childrenPadding = childrenPadding + $title.outerHeight(true); // 17815 17816 bodyHeight = $body.outerHeight(); 17817 17818 headerHeight = $header.outerHeight(true); 17819 17820 footerHeight = $footer.outerHeight(true); 17821 17822 contentPaddingMargin = childrenPadding; 17823 17824 height = bodyHeight - footerHeight - headerHeight - childrenPadding; 17825 17826 console.log("bodyHeight: "+ bodyHeight); 17827 console.log("headerHeight: "+ headerHeight); 17828 console.log("footerHeight: "+ footerHeight); 17829 console.log("contentPaddingMargin: "+ contentPaddingMargin); 17830 console.log("height: "+ height); 17831 17832 if(height !== $parent.innerHeight()){ 17833 $parent.height( height ); 17834 } 17835 17836 }
17837 makeAppleScroll($iframe[ 0 ]); 17838} 17839 17840//function resizeIframeOnXDomain(){ 17841// if( jQuery( "body.fixedLayout" ).length ){ 17842// 17843// }else{ 17844// 17845// } 17846//} 17847// 17848//function resizeIframeOnSameDomain(){ 17849// if( jQuery( "body.fixedLayout" ).length ){ 17850// 17851// }else{ 17852// 17853// } 17854//} 17855 17856function getChildrenPaddingAndMargin(jQueryElement){ 17857 mainContentChildren = jQueryElement.find("*"); 17858 17859 // padding und margin vom content div mit einbeziehen. 17860 childrenPadding = getElementPaddingMarginAndBorder(jQueryElement); 17861 mainContentChildren.each(function(){ 17862 if(jQuery(this).is(":hidden") || jQuery(this).hasClass('unsichtbar') || jQuery(this).parents().hasClass('unsichtbar')){ 17863 //do nothing 17864 }else{ 17865 childrenPadding += getElementPaddingMarginAndBorder(jQuery(this)); 17866 } 17867 }); 17868 console.log("childrenPadding: "+ childrenPadding); 17869 return childrenPadding; 17870} 17871 17872function getElementPaddingMarginAndBorder(jQueryElement){ 17873 var bordT = jQueryElement.outerHeight() - jQueryElement.innerHeight(); 17874 var paddT = jQueryElement.innerHeight() - jQueryElement.height(); 17875 var margT = jQueryElement.outerHeight(true) - jQueryElement.outerHeight(); 17876 var paddMargBord = paddT+margT+bordT; 17877 17878 //console.log("child id: #"+ jQueryElement.attr('id')); 17879// console.log("child class: ."+ jQueryElement.attr('class')); 17880// console.log("padd+marg+bord: "+ paddMargBord); 17881 17882 return paddMargBord; 17883} 17884 17885function makeAppleScroll(element){ 17886 // Configure for scrolling peculiarities of iPad and iPhone 17887 17888 if (navigator.userAgent.indexOf('iPhone') != -1 || navigator.userAgent.indexOf('iPad') != -1){ 17889 var iFrame = jQuery(element); 17890 var iframeWrapper = iFrame.parent(); 17891 var iframeWidth = iFrame.width(); 17892 var bodyWidth = jQuery("body").width(); 17893 console.log("makeAppleScroll"); 17894 console.log("iframeWrapper "+iframeWrapper); 17895 console.log("iframeWidth "+iframeWidth); 17896 17897 var iframeHeight = iFrame.height(); 17898 var bodyHeight = jQuery("body").height(); 17899 console.log("iframeHeight "+iframeHeight); 17900 17901 var lang = de.his.common.LanguageHelper.currentLanguage(); 17902 17903 if(jQuery("#appleLinkToIframeSrc").length === 0){ 17904 if(lang==='en'){ 17905 var linkText = "Open embedded site in new window."; 17906 } 17907 if(lang==='de'){ 17908 var linkText = "Eingebettete Seite in einem neuen Fenster öffnen."; 17909 } 17910 jQuery('#hisinoneIframePage').prepend('<a id="appleLinkToIframeSrc" href="'+iFrame.attr('src')+'" target="_blank">'+linkText+'</a>'); 17911 } 17912 17913 /** 17914 * There are no margins and padding on wrapper or iframe that could be taken into account. 17915 */ 17916// var paddWrapper = iframeWrapper.innerWidth() - iframeWrapper.width(); 17917// var margWrapper = iframeWrapper.outerWidth(true) - iframeWrapper.outerWidth(); 17918// 17919// iframeWrapper.prepend("<div>Wrapper Padding: "+paddWrapper+"px ; Wrapper Margin: "+margWrapper+"px </div>") 17920// 17921// var paddiFrame = iFrame.innerWidth() - iFrame.width(); 17922// var margiFrame = iFrame.outerWidth(true) - iFrame.outerWidth(); 17923// 17924// iframeWrapper.prepend("<div>Frame Padding: "+paddiFrame+"px ; Frame Margin: "+margiFrame+"px </div>") 17925 17926 // workaround for fixed Header and Footer 17927 if( jQuery( "body.fixedLayout" ).length ){ 17928 jQuery(".fixedElements").css('height','auto'); 17929 jQuery(".fixedLayout").css('overflow','auto'); 17930 iframeWrapper.css('overflow','auto'); 17931 } 17932 // NO change of width... renders iframe portlets ugly... 17933 // create a responsive CSS for the child site INSTEAD. 17934// if (iframeWidth > bodyWidth){ 17935// // not quite sure, why these addings (+90 and +120) are needed in some cases, but them do no harm in other scenarios 17936// iframeWrapper.css('width',90+iframeWidth + 'px'); 17937// jQuery("body").css('width',120+iframeWidth + 'px'); 17938// } 17939 17940 if (iframeHeight > bodyHeight){ 17941 iframeWrapper.css('height',iframeHeight + 'px'); 17942 } 17943 } 17944}; 17945 17946/** 17947 * Berechnet die Höhe eines Elements 17948 * @param elem 17949 * @returns Höhe 17950 */ 17951function getOffsetHeight(elem) { 17952 if (jQuery(elem) != null && jQuery(elem)[0] != null) { 17953 return jQuery(elem)[0].offsetHeight; 17954 } 17955 return 0; 17956} 17957 17958/** 17959 * Bei fixem Header und Footer den Header berechnen, damit das Navigationsmenü vollständig hinein passt 17960 */ 17961function resizeHeader() { 17962// if(jQuery('#hisinoneHeader').hasClass("header_fixed")){ 17963// if(jQuery("html.tablet.ios").length){ 17964// jQuery('.content_portal_hisinone_fixed').css('margin-top', jQuery('#hisinoneHeader').height() + 5 + "px"); 17965// }else{ 17966// jQuery('.content_portal_hisinone_fixed').css('top', jQuery('#hisinoneHeader').height() + "px"); 17967// } 17968// } 17969} 17970 17971/** 17972 * Hole Ajax Token 17973 * @returns token 17974 */ 17975function getAjaxToken() { 17976 var ajaxToken = document.getElementById("ajaxToken").value; 17977 return ajaxToken; 17978} 17979 17980/** 17981 * Ein Icon toggeln, also abwechselend das eine und mal das andere anzeigen 17982 * @param clientId 17983 * @param img0 17984 * @param img1 17985 */ 17986function toggleIcon(clientId, img0, img1) { 17987 var img = document.getElementById(clientId).src; 17988 if (img == null) { 17989 return; 17990 } 17991 if (img.endsWith(img0)) { 17992 document.getElementById(clientId).src = img1; 17993 } else { 17994 document.getElementById(clientId).src = img0; 17995 } 17996} 17997 17998/** 17999 * Icon toggeln, wenn es das Kind-Element eines Links ist 18000 * @param a 18001 * @param img0 18002 * @param img1 18003 */
18004function toggleIconAsChild(a, img0, img1) { 18005 if (a == null) { 18006 return; 18007 } 18008 var clientId = jQuery(a).children('img').attr('id'); 18009 toggleIcon(clientId, img0, img1); 18010} 18011 18012/** 18013 * ?? 18014 * @param elem 18015 */ 18016function toggleCCDiff(elem) { 18017 if (elem == null) { 18018 return; 18019 } 18020 jQuery(elem).parent().find(".ccDiff").fadeToggle("fast", "linear"); 18021} 18022 18023/** 18024 * Das Navigationsmenü, Breadcrumb, usw. deaktiveren oder aktiveren 18025 * EXP, wird nicht verwendet 18026 */ 18027function lockOrUnlockNavigation () { 18028 //Linkes Menü deaktivieren 18029 var isLock = false; 18030 //Topmenü 18031 var menu = jQuery('.topMenuContainer .flexdropdownmenu'); 18032 if (menu != null) { 18033 isLock = jQuery('.topMenuContainer').attr('title') != null; 18034 } else { 18035 return; 18036 } 18037 lockMenu(menu, isLock); 18038 18039 //linkes Menü 18040 menu = jQuery('#leftTopMenu .auflistung'); 18041 lockMenu(menu, isLock); 18042 18043 //Krümelpfad 18044 menu = jQuery('.divBreadcrumb a'); 18045 lockMenu(menu, isLock); 18046 18047 if (isLock) { 18048 //Entsperren 18049 unFadeMenu('.topMenuContainer'); 18050 unFadeMenu('#leftTopMenu'); 18051 unFadeMenu('.divBreadcrumb'); 18052 } else { 18053 //Sperren 18054 fadeMenu('#leftTopMenu'); 18055 fadeMenu('.topMenuContainer'); 18056 fadeMenu('.divBreadcrumb'); 18057 } 18058 //Topmenü deaktiveren 18059 18060 //Krümelpfad deaktivieren 18061} 18062 18063/** 18064 * Menü sperren oder entsperren (EXP) 18065 */ 18066function lockMenu(menu, isLock) { 18067 if (menu == null) { 18068 return; 18069 } 18070 jQuery.each(menu, function() { 18071 if (isLock) { 18072 //Entsperren 18073 jQuery(this).attr('onclick', ''); 18074 } else { 18075 //Sperren 18076 jQuery(this).attr('onclick', 'return false;'); 18077 } 18078 }); 18079} 18080 18081/** 18082 * ??? 18083 * @param clientId 18084 */ 18085function unFadeMenu(clientId) { 18086 jQuery(clientId).fadeTo(200,1); 18087 jQuery(clientId).attr('title',null); 18088} 18089 18090/** 18091 * ??? 18092 * @param clientId 18093 */ 18094function fadeMenu(clientId) { 18095 jQuery(clientId).fadeTo(400,0.4); 18096 jQuery(clientId).attr('title','Dieses Menü wurde gesperrt. Zum entsperren klicken Sie bitte auf den Entsperren-Button oben rechts im Kopfbereich der Seite.'); 18097} 18098 18099/** 18100 * Spezielle Bildergalerie in der Infobox-Verwaltung 18101 */ 18102function showImageOnmouseover() { 18103// jQuery(this).css('cssText' , 'padding:5px;'); 18104 jQuery(".picture").hover(function() { 18105 jQuery(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 18106 jQuery(this).addClass("hoverImg").stop() /* Add class of "hover", then stop animation queue buildup*/ 18107 .animate({ 18108 marginTop: '-30px', /* The next 4 lines will vertically align this image */ 18109 marginLeft: '-30px', 18110// top: '100%', 18111// left: '100%', 18112 width: '60px', /* Set new width */ 18113 height: '60px' /* Set new height */ 18114 }, 0); /* this value of "200" is the speed of how fast/slow this hover animates */ 18115 18116 } , function() { 18117 jQuery(this).css({'z-index' : '0'}); /* Set z-index back to 0 */ 18118 jQuery(this).removeClass("hoverImg").stop() /* Remove the "hover" class , then stop animation queue buildup*/ 18119 .animate({ 18120 marginTop: '0', /* Set alignment back to default */ 18121 marginLeft: '0', 18122// top: '0', 18123// left: '0', 18124 width: '23px', /* Set new width */ 18125 height: '23px', /* Set new height */ 18126 padding: '2px' 18127 }, 0); 18128 jQuery(this).removeAttr('style'); 18129 }); 18130} 18131 18132/** 18133 * ??? 18134 * @param frameId 18135 */ 18136function xonload2(frameId) 18137{ 18138 document.getElementById('frameWrapper_' + frameId).className = 'frameWrapper2'; 18139 document.getElementById(frameId).style.visibility = 'visible'; 18140} 18141 18142/** 18143 * Alle Buttons quasi deaktieren in dem ihr onclick Event überschrieben wird 18144 */ 18145function disableAllButtons() { 18146 jQuery(':submit').attr('onClick', 'return false;'); 18147} 18148use_package("de.his.component.overlay"); 18149 18150/** 18151 * @Author: wahrendorff Date: 16.01.2013 18152 * Zweck: Changes some CSS behaviour of modal Dialogs 18153 * - disables/reenables Scolling of body 18154 * - corrects height of Dialog on window resize. 18155 * - corrects height of content when help is shown 18156 * - catches Tab for modal function 18157 * - sets inert on other interative element parents 18158 * - moves overlay on drag and drop 18159 */ 18160 18161de.his.component.overlay = new function() { 18162 18163 de.his.modules.ModuleRegistry 18164 .registerModule(this) 18165 .registerAjaxRefreshModule(this); 18166 18167 this.moduleName = "de.his.component.overlay"; 18168 18169 this.lastOverlayIds = []; 18170 this.lastClickedOpenOverlayElementIds = []; 18171 18172 var origMarginRight = "0px"; 18173 18174 var origMinButtonTitle = null; 18175 18176 var isAnimating = false;
18177 18178 var self = this; 18179 18180 this.init = function() { 18181 // init wird beim laden der Seite aufgerufen, 18182 // synonym für $(document).ready 18183 console.log("init overlay"); 18184 18185 handleOverlayUse(); 18186 handleResize(); 18187 handleTabKey(); 18188 handleMinButton(); 18189 /*handleTransparency();*/ 18190 }; 18191 18192 this.refresh = function() { 18193 // refresh wird nach ajaxRefresh Events aufgerufen 18194 console.log("init overlay after refresh"); 18195 18196 unsetInert(); 18197 handleOverlayUse(); 18198 handleResize(); 18199 handleTabKey(); 18200 handleMinButton(); 18201 /*handleTransparency();*/ 18202 }; 18203 /*this.indicateAjaxRequestStart = function(){ 18204 unsetInert(); 18205 }*/ 18206 18207 /*var handleTransparency = function(){ 18208 document.querySelectorAll(".overlayMinButton").forEach(function(elem){ 18209 var overlay = elem.closest('.overlay'); 18210 elem.addEventListener('mouseenter', function(){ 18211 overlay.style.opacity = '0'; 18212 }, false); 18213 elem.addEventListener('mouseleave', function(){ 18214 overlay.style.opacity = '1'; 18215 }, false); 18216 18217 }); 18218 18219 }*/ 18220 const toggleMinFunc = function(event) { 18221 event.preventDefault(); 18222 18223 // Verhindere mehrfache Klicks während der Animation 18224 if (isAnimating) { 18225 return false; 18226 } 18227 18228 //disable Tab key until overlay is minimized 18229 disableTabKey(); 18230 18231 let button = event.target; 18232 console.log('button.tagName:', button.tagName); 18233 if (button.tagName.toUpperCase() === 'SPAN') { 18234 button = button.closest('button'); 18235 } 18236 18237 if (origMinButtonTitle === null) { 18238 origMinButtonTitle = button.dataset.title; 18239 } 18240 18241 let parentOverlay = button.closest('.overlay'); 18242 //button.classList.toggle('image'); 18243 var toggleReturn = parentOverlay.classList.toggle('minimizedOverlay'); 18244 18245 console.log('MinButton toggleReturn:', toggleReturn); 18246 console.log('MinButton button:', button); 18247 console.log('MinButton parentOverlay:', parentOverlay); 18248 18249 // Animation startet - weitere Klicks sperren 18250 isAnimating = true; 18251 18252 if (toggleReturn) { 18253 //wurde hinzugefügt 18254 18255 parentOverlay.classList.remove('maximizedOverlay'); 18256 button.title = button.dataset.maxTitle; 18257 console.log('button.firstChild', button.firstElementChild); 18258 button.firstElementChild.classList.toggle('iconfont-empty'); 18259 button.firstElementChild.classList.toggle('iconfont-panel_open'); 18260 18261 // hide elements in overlay after animation is done. 18262 setTimeout(function() { 18263 parentOverlay.querySelectorAll('.overlayContent,.overlaySubTitle,.submit_information,.overlayFooter').forEach(function(elem) { 18264 elem.classList.add('noDisplay'); 18265 setModalFields(jQuery(parentOverlay)); 18266 handleTabKey(); 18267 }); 18268 // Animation beendet - Klicks wieder erlauben 18269 isAnimating = false; 18270 }, 500) 18271 enableScolling(); 18272 } else { 18273 // wurde entfernt 18274 parentOverlay.classList.add('maximizedOverlay'); 18275 button.dataset.title = origMinButtonTitle; 18276 button.firstElementChild.classList.toggle('iconfont-empty'); 18277 button.firstElementChild.classList.toggle('iconfont-panel_open'); 18278 parentOverlay.querySelectorAll('.overlayContent,.overlaySubTitle,.submit_information,.overlayFooter').forEach(function(elem) { 18279 elem.classList.remove('noDisplay'); 18280 setModalFields(jQuery(parentOverlay)); 18281 handleTabKey(); 18282 }) 18283 // Animation für Maximieren ist kürzer - Klicks nach kurzer Zeit wieder erlauben 18284 setTimeout(function() { 18285 isAnimating = false; 18286 }, 300); 18287 disableScolling(); 18288 } 18289 18290 18291 return false; 18292 } 18293 18294 const handleMinButton = function() { 18295 18296 document.querySelectorAll('.overlayMinButton').forEach(function(minButton) { 18297 minButton.removeEventListener('click', toggleMinFunc); 18298 minButton.addEventListener('click', toggleMinFunc); 18299 }); 18300 } 18301 18302 var handleDrag = function(overlayElement) { 18303 if (typeof overlayElement == 'undefined' || !overlayElement.draggable) { 18304 // might be undefined when data-infobox-type="Query" is shown upon an overlay 18305 return; 18306 } 18307 var overlayContent = overlayElement.getElementsByClassName('overlayContent')[0]; 18308 var dragStart = function(e) { 18309 //console.log("target", e.target); 18310 18311 if (!document.getElementById("dragAndDrop_contentCurtain" + overlayElement.id)) { 18312 // create a curtain for the content, because it might not be droppable (iframe, see #331409) 18313 let div = document.createElement("div"); 18314 div.id = "dragAndDrop_contentCurtain" + overlayElement.id; 18315 div.style = "position:absolute;height:100%;width:100%;z-index:1100;";
18316 overlayContent.prepend(div); 18317 } 18318 18319 18320 if (typeof e.target.classList === 'undefined' || !e.target.classList.contains('overlay')) { 18321 // if text selected and accidentally dragged, do not throw error. 18322 return; 18323 } 18324 var style = window.getComputedStyle(e.target, null); 18325 e.dataTransfer.setData("text/plain", 18326 (parseInt(style.getPropertyValue("left"), 10) - e.clientX) + ',' + (parseInt(style.getPropertyValue("top"), 10) - e.clientY)); 18327 } 18328 var drag = function(e) { 18329 e.preventDefault(); 18330 return false; 18331 } 18332 var dragEnd = function(e) { 18333 //overlayContent.classList.remove('noDisplay'); 18334 var offset = e.dataTransfer.getData("text/plain").split(','); 18335 //console.log("dragEnd offset:",offset,e); 18336 overlayElement.style.left = (e.clientX + parseInt(offset[0], 10)) + 'px'; 18337 overlayElement.style.top = (e.clientY + parseInt(offset[1], 10)) + 'px'; 18338 e.preventDefault(); 18339 return false; 18340 } 18341 18342 var dragFinal = function(e) { 18343 //console.log("dragFInal!"); 18344 18345 // remove curtain when drag ends, even outsite of window 18346 if (document.getElementById("dragAndDrop_contentCurtain" + overlayElement.id)) { 18347 document.getElementById("dragAndDrop_contentCurtain" + overlayElement.id).remove(); 18348 } 18349 } 18350 18351 overlayElement.addEventListener('dragstart', dragStart, false); 18352 document.body.addEventListener('dragover', drag, false); 18353 document.body.addEventListener('drop', dragEnd, false); 18354 overlayElement.addEventListener('dragend', dragFinal, false); 18355 18356 // enable text selection in content 18357 overlayContent.addEventListener('mousedown', function(e) { 18358 console.log('mousedown text selection') 18359 // can't use getElementsByClassName with forEach, because its not an array. 18360 // 18361 let overlays = document.getElementsByClassName('overlay'); 18362 for (var i = 0; i < overlays.length; i++) { 18363 overlays[i].setAttribute("draggable", "false"); 18364 } 18365 //overlayElement.setAttribute("draggable", "false"); 18366 }); 18367 18368 // let the item be draggable again after the text selection is done. 18369 overlayContent.addEventListener('mouseleave', function(e) { 18370 console.log('mouseleave text selection') 18371 let overlays = document.getElementsByClassName('overlay'); 18372 for (var i = 0; i < overlays.length; i++) { 18373 overlays[i].setAttribute("draggable", "true"); 18374 } 18375 //overlayElement.setAttribute("draggable", "true"); 18376 }); 18377 }; 18378 18379 /** 18380 * Handles Overlays that open via "openOnLoad" set by a flowScope variable or similar. 18381 * 18382 * DONE: Should be able to handle all overlays now. 18383 * * Evaluate to remove direct calls to de.his.component.overlay.disableBodyScroll 18384 * and de.his.component.overlay.enableBodyScroll in overlay.xhtml 18385 */ 18386 var handleOverlayUse = function() { 18387 // Button to open overlays shall regain focus after closing the overlay 18388 jQuery(".overlayShowButton").on('click', function() { 18389 //console.log("push lastClickedOpenOverlayElementIds",jQuery(this).attr('id')); 18390 self.lastClickedOpenOverlayElementIds.push(de.his.common.Util.toJQueryId(jQuery(this).attr('id'))); 18391 }); 18392 if (jQuery('.overlayContainer').length > 0 || jQuery('div[data-infobox-type="Query"]:visible').length > 0) { 18393 // overlay was not closed for any reason (failed validation, browser-refresh etc.) 18394 // or overlay was opened by some other button via openOnLoad 18395 // hide scrollbar or it possibly doubles 18396 var onReady = function($overlay) { 18397 $overlay.ready(function() { 18398 18399 /** Workaround for #290267 18400 FileUpload does not refresh JS*/ 18401 de.his.modules.eventRegistry.addListener("fileUploaded", function() { 18402 de.his.component.overlay.refresh(); 18403 }, document, true); 18404 18405 /** 18406 * - schauen ob Kindkomponente iFrame, 18407 * - wenn ja, warten bis fertig geladen 18408 * - wenn nein, einfach Höhe korrigieren 18409 */ 18410 disableScolling(); 18411 18412 if ($overlay.find("iframe").length > 0) { 18413 //iFrame vorhanden 18414 var iFrame = $overlay.find("iframe"); 18415 jQuery("iframe").on("load", function() { 18416 self.startModalFunction(); 18417 correctHeight(); 18418 correctBackgroundHeight(); 18419 correctPosition(); 18420 handleDrag($overlay[0]); 18421 }); 18422 } else { 18423 self.startModalFunction(); 18424 correctHeight();
18425 correctBackgroundHeight(); 18426 correctPosition(); 18427 handleDrag($overlay[0]); 18428 } 18429 }); 18430 }; 18431 onReady(jQuery(".overlay.modal:visible").last()); 18432 } else { 18433 enableScolling(); 18434 de.his.component.overlay.endModalFunction(); 18435 } 18436 18437 }; 18438 18439 var disableScolling = function() { 18440 if (isScrollBarActive()) { 18441 origMarginRight = jQuery("body").css("margin-right"); 18442 console.log("margin-right: " + origMarginRight); 18443 18444 jQuery("body").css("margin-right", getScrollbarWidth() + "px"); 18445 jQuery(".overlayContainer").css("padding-right", getScrollbarWidth() + "px"); 18446 } 18447 18448 jQuery("body").css("overflow", "hidden"); 18449 }; 18450 18451 var enableScolling = function() { 18452 // special case, with fixed header and footer overflow on body is always hidden 18453 if (!jQuery('body').hasClass('fixedLayout')) { 18454 jQuery("body").css("overflow", "auto"); 18455 jQuery("body").css("margin-right", origMarginRight); 18456 jQuery(".overlayContainer").css("padding-right", "0px"); 18457 } 18458 }; 18459 18460 var isScrollBarActive = function() { 18461 return (jQuery("body").get(0).scrollHeight > jQuery("body").height()); 18462 }; 18463 18464 var getScrollbarWidth = function() { 18465 18466 var div, width = getScrollbarWidth.width; 18467 if (width === undefined) { 18468 div = document.createElement('div'); 18469 div.innerHTML = '<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>'; 18470 div = div.firstChild; 18471 document.body.appendChild(div); 18472 width = getScrollbarWidth.width = div.offsetWidth - div.clientWidth; 18473 document.body.removeChild(div); 18474 } 18475 return width; 18476 }; 18477 18478 var handleResize = function() { 18479 /** 18480 * on resize event 18481 */ 18482 jQuery(window).resize(function() { 18483 correctHeight(); 18484 correctBackgroundHeight(); 18485 }); 18486 }; 18487 18488 /** 18489 * disables the Tab key 18490 */ 18491 var disableTabKey = function() { 18492 jQuery('.overlay').last().unbind('keydown').bind('keydown', function(e) { 18493 e.preventDefault(); 18494 }); 18495 }; 18496 /** 18497 * handles tab key trap for overlays and UserQuerys 18498 */ 18499 var handleTabKey = function() { 18500 jQuery('.overlay').last().unbind('keydown').bind('keydown', function(e) { 18501 if (e.keyCode == 9) { 18502 // 9 is tab key 18503 if (e.shiftKey) { 18504 // tab and Shift pressed... do anything here... 18505 if (jQuery(document.activeElement).attr("firstmodalfield") == "true") { 18506 e.preventDefault(); 18507 jQuery(this).find("[lastmodalfield=true]").focus(); 18508 } 18509 return; 18510 } 18511 // tab without shift is pressed 18512 if (jQuery(document.activeElement).attr("lastmodalfield") == "true") { 18513 e.preventDefault(); 18514 jQuery(this).find("[firstmodalfield=true]").focus(); 18515 } 18516 } 18517 }); 18518 jQuery('div[data-infobox-type="Query"]:visible').last().bind('keydown', function(e) { 18519 //console.log("bind userQuery Tab key."); 18520 if (e.keyCode == 9) { 18521 // 9 is tab key 18522 if (e.shiftKey) { 18523 // tab and Shift pressed... do anything here... 18524 if (jQuery(document.activeElement).attr("firstmodalfield") == "true") { 18525 e.preventDefault(); 18526 jQuery(this).find("[lastmodalfield=true]").focus(); 18527 } 18528 return; 18529 } 18530 // tab without shift is pressed 18531 if (jQuery(document.activeElement).attr("lastmodalfield") == "true") { 18532 e.preventDefault(); 18533 jQuery(this).find("[firstmodalfield=true]").first().focus(); 18534 } 18535 } 18536 }); 18537 }; 18538 18539 /** 18540 * TODO: Remove from overlay.xhtml and EXA Descendants. Afterwards remove here. 18541 * Need to be public, is called in overlay.xhtml 18542 */ 18543 this.disableBodyScroll = function(data) { 18544 // Legacy 18545 }; 18546 18547 this.enableBodyScroll = function(data) { 18548 // Legacy 18549 }; 18550 18551 /** 18552 * Setting inert on parents makes containing elements non-interactable. 18553 */ 18554 var setInert = this.setInert = function() { 18555 18556 /** set inert für barrierefreie Focus Trap #299063 */ 18557 18558 /** Wir müssen das Suchkonfigurationsoverlay für den Cust modus prioritär behandeln #355805 */ 18559 var overlay; 18560 var priorityOverlay = jQuery("#downloadSearchConfigurationForm\\:downloadSearchConfigurationFileHeader\\:overlay.overlay.modal:visible"); 18561 18562 if (priorityOverlay.length > 0) { 18563 overlay = priorityOverlay; 18564 } else { 18565 overlay = jQuery(".overlay.modal:visible").last(); 18566 } 18567 //OverlayKeyMover.setActive(overlay); 18568 // visible messages infoboxes, exclude possible shown debug and log info boxes and callBackContainer (fix #352866) 18569 var messagesInfobox = jQuery(".messages-infobox:visible").not(".sys_warning").not(".confirm_infobox"); 18570 if (messagesInfobox.length > 1) { 18571 console.log("Overlay: messsages-infobox found"); 18572 // multiple messages infoboxes are open, save parent container of the infoboxes to check against it later 18573 messagesInfobox = messagesInfobox[0].closest(".messages-infobox-container"); 18574 } 18575 18576 console.log("Overlay: messsages-infobox", messagesInfobox); 18577 var loginDiv = jQuery("#sessionTimeoutLoginDiv"); 18578
18579 var clipboard = jQuery("#clipboardForm\\:ajax_clipboard"); 18580 18581 // Legacy workaround for old callbacks 18582 // focus old callback, when in overlay 18583 var callBackContainer = jQuery('div[data-infobox-type="Query"]:visible'); 18584 if (callBackContainer.length > 0) { 18585 overlay = callBackContainer; 18586 console.log("set inert for callBackContainer", overlay); 18587 } 18588 18589 var alert = jQuery("#alert"); 18590 18591 if(alert.length >0){ 18592 console.log("set inert for alert Message", overlay); 18593 } 18594 18595 if (loginDiv.is(":visible")) { 18596 overlay = loginDiv; 18597 console.log("set inert for loginDiv", overlay); 18598 } 18599 18600 console.log("set inert", overlay[0].id); 18601 18602 /** divs auf oberster ebene die wir erstmal abklemmen können*/ 18603 document.getElementById('hisinoneHeader')?.setAttribute('inert', 'inert'); 18604 document.getElementById('hisinoneFooter')?.setAttribute('inert', 'inert'); 18605 document.getElementById('sessionTimeoutLoginDiv')?.setAttribute('inert', 'inert'); 18606 18607 /** legacy userQuerys (und möglicherweise auch manche custom overlays im header) werden in vorher inert gesetzte Bereiche gerendert */ 18608 let overlayInertParent = overlay[0].closest('[inert]'); 18609 if (overlayInertParent !== null) { 18610 console.log("Overlay in inert Parent!", overlayInertParent, overlay); 18611 overlayInertParent.removeAttribute('inert'); 18612 } 18613 18614 /** suche tabbare Elemente im contentFrame div und setze an deren parents inert */ 18615 // .getElementById('contentFrame') 18616 document.querySelectorAll("[tabindex], input:not([type=hidden]), button, a, textarea, label, select, details").forEach(function(element, key, parent) { 18617 /** erkenne ob element parent vom sichtbaren Overlay oder anders herum und spare aus. */ 18618 /** erkenne ob messages-infobox vorhanden und wenn ja, spare diese aus. */ 18619 /** erkenne ob ein parent schon inert hat und spare aus. */ 18620 if (!element.parentElement.contains(overlay[0]) && !overlay[0].contains(element) 18621 && (typeof messagesInfobox[0] === 'undefined' || (!element.parentElement.contains(messagesInfobox[0]) && !messagesInfobox[0].contains(element))) 18622 && (typeof clipboard[0] === 'undefined' || (!element.parentElement.contains(clipboard[0]) && !clipboard[0].contains(element))) 18623 // inert wurde nicht bereits gesetzt 18624 && element.closest("[inert]") === null 18625 // ist kein typeahead element das immer am Seitenende gerendert wird 18626 && !element.classList.contains('ui-menu-item-wrapper') 18627 && !element.classList.contains('ui-selectonemenu-item') 18628 && !element.classList.contains('ui-selectonemenu-filter') 18629 && !element.parentElement.parentElement.contains(alert[0])) { 18630 18631 // wenn wir als ancestor eine form, ein fieldset, eine table, oder liste finden und diese nicht das overlay beinhaltet, 18632 // können wir uns ein paar inerts sparen, weil es voraussichtlich interaktive Geschwister gibt. 18633 18634 // array der parent selektoren 18635 const selectors = ['form', 'fieldset', 'table', 'ul', 'ol']; 18636 18637 // finde ersten passenden ancestor 18638 let ancestorElement = null; 18639 for (const selector of selectors) { 18640 const foundElement = element.closest(selector); 18641 if (foundElement 18642 && !foundElement.contains(overlay[0]) 18643 && !foundElement.contains(messagesInfobox[0]) 18644 && !foundElement.contains(alert[0])) { 18645 ancestorElement = foundElement; 18646 break; 18647 } 18648 } 18649 18650 // setze inert auf ancestor oder fallback zum parent 18651 const inertElement = ancestorElement || element.parentElement; 18652 inertElement.setAttribute('inert', 'inert'); 18653 18654 //console.log('set inert',elementToMakeInert); 18655 18656 } 18657 }); 18658 18659 }; 18660 /** 18661 * unset inert Attribute 18662 */ 18663 var unsetInert = function() { 18664 /** remove inert #299063 */ 18665 var overlay = jQuery(".overlay.modal:visible").last(); 18666 18667 /** 18668 * Wenn noch n Overlays vorhanden sind, nur im letzten Overlay inert entfernen 18669 */ 18670 if (overlay.length > 0) { 18671 overlay[0].querySelectorAll("*[inert]").forEach(function(element, key, parent) { 18672 element.removeAttribute('inert'); 18673 //OverlayKeyMover.setActive(overlay); 18674 }); 18675 } else { 18676 document.querySelectorAll("*[inert]").forEach(function(element, key, parent) { 18677 //console.log('remove inert '+key, element); 18678 element.removeAttribute('inert'); 18679 //OverlayKeyMover.setInactive(); 18680 }); 18681 } 18682 }; 18683 18684 /** 18685 * control focus in conjunction with de.his.modules.input-refresh.js 18686 */ 18687 this.startModalFunction = function() {
18688 var overlay = jQuery(".overlay.modal:visible").last(), 18689 inputs, 18690 last, 18691 first; 18692 18693 console.log("START Overlay Modal Function", overlay); 18694 overlay.css("position","relative"); 18695 // Legacy workaround for old callbacks 18696 // focus old callback, when in overlay 18697 var callBackContainer = jQuery('div[data-infobox-type="Query"]:visible'); 18698 if (callBackContainer.length > 0) { 18699 console.log("Overlay: Callback exists, focus callback"); 18700 overlay = callBackContainer; 18701 } 18702 18703 //does modal pop exist 18704 if (overlay && overlay.length > 0) { 18705 console.log("OVERLAY EXISTS."); 18706 de.his.modules.eventRegistry.fireEvent("overlayOpen"); 18707 var focusafterclose = overlay.data('focusafterclose'); 18708 18709 // mark first and last interactable element for tab focus trap 18710 setModalFields(overlay); 18711 // set Page Markers for Focus Management 18712 setPageMarkers(); 18713 18714 // check status of overlay and do magic. 18715 if (self.lastOverlayIds.length > 0 && overlay.attr('id') === self.lastOverlayIds[self.lastOverlayIds.length - 1]) { 18716 // immernoch das gleiche Overlay nach ajaxRefresh, lasse input-refresh focus setzen. 18717 console.log("Overlay: Noch offen! Lasse input-refresh den Fokus setzen! id: ", overlay.attr('id'), self.lastOverlayIds); 18718 18719 // es gibt Fälle in EXA (die eigentlich nicht auftreten sollten) 18720 // in denen ein Overlay durch drücken der Enter Taste mehrfach per ajax geöffnet werden kann. die nacheinander fiolgenden refreshes 18721 // bringen diese Logik zum straucheln. 18722 // in diesen Fällen ist der overlay button das aktive Element welches wieder den Fokus bekommt. 18723 // Lösung: setze den Fokus auf das erste Element im overlay, falls der fokus ausserhalb des sichtbaren overlays liegt & fix für #349844 nicht zutrifft 18724 18725 if (jQuery(document.activeElement).closest(".overlayContainer").length == 0) { 18726 if (overlay && overlay.length > 0) { 18727 // fix für #349844: refreshBtnClick in input-refresh setzt his_lastRefresherElementId, auf dieses Element wird dann hier nach dem refresh der Fokus wieder gesetzt 18728 var lastRefresherElementId = sessionStorage.getItem("his_lastRefresherElementId"); 18729 var $elementToFocus = null; 18730 if(lastRefresherElementId) { 18731 var $lastRefresherElementId = de.his.common.Util.toJQueryId(lastRefresherElementId); 18732 $elementToFocus = overlay.find("#"+$lastRefresherElementId); 18733 } 18734 // check if elementToFocus is input, set focus and remove lastRefresherElement 18735 if($elementToFocus != null && $elementToFocus.length > 0 && $elementToFocus.first().is(':input') ){ 18736 $elementToFocus.focus(); 18737 sessionStorage.removeItem("his_lastRefresherElementId"); 18738 return; 18739 } 18740 // kein elementToFocus gefunden, setze den Fokus auf das erste Element im overlay 18741 overlay.find("[firstmodalfield='true']").focus(); 18742 } 18743 } 18744 18745 } else { 18746 /** 18747 * Wenn ein overlay neu geöffnet wurde oder wenn ein ntes overlay geschlossen wird. 18748 */ 18749 //console.log("New overlay or nth overlay closed. overlayIDArray:",self.lastOverlayIds); 18750 // fix Logik muss auch für callBackContainer gelten #346536, #350828, #351296 18751 if (jQuery('.overlayContainer').length > 0 || callBackContainer.length > 0) { 18752 //neues overlay 18753 var overlayId = overlay.closest('[id]').attr('id'); 18754 18755 if (self.lastOverlayIds.indexOf(overlayId) === -1) { 18756 // neu geöffnetes Overlay 18757 console.log("Neues Overlay: Fokus setzen!", overlayId); 18758 18759 // schau nach autofocus objekten, wenn keinne, dann header fokussieren 18760 de.his.modules.Autofocus.setFocusAutomatically('#' + de.his.common.Util.toJQueryId(overlayId)); 18761 var activePageElementId = de.his.common.Util.toJQueryId(de.his.common.ContextInformation.get("active-page-element-id")); 18762 18763 // initialer fokus auf headlines in overlays wurde aufgrund des Barrierefreiheitprüfberichts entfernt #312274 18764 // fix für Tastaturfokus sollte sich nach dem SchlieÃen von Overlays auf dem Element befinden, mit dem es geöffnet wurde #312274 18765 // fix für Tastaturfokus nach dem SchlieÃen, auch wenn im overlayHeading keine Buttons vorhanden sind die initial fokussiert werden oder wenn es ein Hilfe toggle button ist #334724 18766 var activePageElement = overlay.find("#" + activePageElementId); 18767 var activePageElementIsButtonOrLink = activePageElement ? activePageElement.is("button") || activePageElement.is("a") : false;
18768 if (activePageElementIsButtonOrLink && !activePageElementId.toLowerCase().includes('minbutton') && !activePageElementId.toLowerCase().includes('closebutton') && !activePageElementId.toLowerCase().includes('overlayhelp')) { 18769 console.log("push lastClickedOpenOverlayElementIds", activePageElementId); 18770 self.lastClickedOpenOverlayElementIds.push(activePageElementId); 18771 } else if(!activePageElementId.toLowerCase().includes('minbutton') && !activePageElementId.toLowerCase().includes('closebutton') && !activePageElementId.toLowerCase().includes('overlayhelp')) { 18772 // set focus in callBackContainer #346536, #350828, #351296 18773 first = overlay.find("input:visible,button:visible").first(); 18774 if (first) { 18775 first.attr("firstmodalfield", true); 18776 first.focus(); 18777 } 18778 } 18779 self.lastOverlayIds.push(overlayId); 18780 18781 //console.log("lastClickedOpenOverlayElementIds: ",self.lastClickedOpenOverlayElementIds); 18782 //console.log("overlayIDArray: ",self.lastOverlayIds); 18783 } else { 18784 // altes, noch geöffnetes Overlay 18785 console.log("Overlay: Wiedererkannt, setze focus auf letzten aktiven Button in diesem Overlay..") 18786 //console.log("lastClickedOpenOverlayElementIds: ",self.lastClickedOpenOverlayElementIds); 18787 18788 //console.log("ID: #"+self.lastClickedOpenOverlayElementIds[self.lastClickedOpenOverlayElementIds.length-1]); 18789 var lastElement = overlay.find("#" + self.lastClickedOpenOverlayElementIds[self.lastClickedOpenOverlayElementIds.length - 1]); 18790 18791 if (lastElement) { 18792 console.log("Overlay: Fokus auf letztes betätigtes Element.", lastElement); 18793 lastElement.focus(); 18794 self.lastClickedOpenOverlayElementIds.pop(); 18795 self.lastOverlayIds.pop(); 18796 } 18797 } 18798 18799 } 18800 } 18801 setInert(); 18802 } 18803 }; 18804 18805 this.endModalFunction = function() { 18806 unsetInert(); 18807 // das letzte (bzw. erste von n) overlay wurde gerade geschlossen 18808 if (self.lastOverlayIds.length > 0) { 18809 18810 if (self.lastClickedOpenOverlayElementIds.length > 0) { 18811 // setzt den Fokus auf den letzen öffnen Button beim schlieÃen von verschachtelten Overlays 18812 console.log("End Overlay Modal Function", self.lastClickedOpenOverlayElementIds); 18813 // versuche Fokus von vor dem öffnen des ersten Overlays wieder her zu stellen. 18814 //console.log("lastClickedOpenOverlayElementIds: ",self.lastClickedOpenOverlayElementIds); 18815 var index = self.lastClickedOpenOverlayElementIds.length - 1; 18816 console.log("End Overlay index", index); 18817 var lastElementId = self.lastClickedOpenOverlayElementIds[index]; 18818 console.log("End Overlay lastElemntId: #", lastElementId); 18819 18820 if (lastElementId !== "") { 18821 18822 var lastElement = jQuery("#" + self.lastClickedOpenOverlayElementIds[self.lastClickedOpenOverlayElementIds.length - 1]); 18823 18824 if (lastElement) { 18825 if (de.his.common.Util.isCollection(lastElement)) { 18826 lastElement[0].focus(); 18827 } 18828 else { 18829 //console.log("Overlay closed: Fokus auf letztes betätigtes Element.",lastClickedOpenOverlayElementIds); 18830 lastElement[0] ? lastElement[0].focus() : lastElement.focus(); 18831 } 18832 self.lastClickedOpenOverlayElementIds.pop(); 18833 } 18834 } 18835 } 18836 18837 // Hilfsvariablen leeren. 18838 self.lastOverlayIds = []; 18839 self.lastClickedOpenOverlayElementIds = []; 18840 18841 console.log("Overlay: finished focus handling.", self.lastClickedOpenOverlayElementIds); 18842 18843 //console.log("overlayIDArray: "+self.lastOverlayIds); 18844 de.his.modules.eventRegistry.fireEvent("overlayClose"); 18845 } 18846 }; 18847 18848 this.toggleHelp = function(data) { 18849 //jQuery(".overlayContent").css('top','0px'); 18850 if (data.status != "success") { 18851 return; 18852 } 18853 if (jQuery(".overlayHelp").length == 0) { 18854 // help is hidden 18855 jQuery(".overlayContent").css('top', '20px'); 18856 } else { 18857 // help is shown 18858 jQuery(".overlayContent").css('top', '10px'); 18859 } 18860 correctHeight(); 18861 correctBackgroundHeight(); 18862 }; 18863 18864 /** 18865 * Marks the first and last selectable element in the docuemtn for trapping the focus as long as an overlay is opened 18866 */ 18867 var setPageMarkers = function() { 18868 jQuery(document).find(':focusable').first().attr("firstfocusableelement", true); 18869 jQuery(document).find(':focusable').last().attr("lastfocusableelement", true); 18870 }; 18871 /** 18872 * Marks the first and last interactable element in overlay 18873 */ 18874 const setModalFields = function(overlay) { 18875 // determine first and last element in modal dialog 18876 inputs = overlay.find("input:visible,button:visible,a:visible"); //give all fields the attribute "modal" 18877 //remove first, needs to be set again when overlay is minimized 18878 inputs.each(function(index, elem) { 18879 elem.removeAttribute("firstmodalfield"); 18880 elem.removeAttribute("lastmodalfield"); 18881 }); 18882 last = inputs.last(); 18883 if (last) { 18884 last.attr("lastmodalfield", true); 18885 } 18886 first = inputs.first(); 18887 if (first) { 18888 first.attr("firstmodalfield", true); 18889 } 18890 } 18891
18892 /** 18893 * @param el = jQuery select elem = jQuery(".myselector") 18894 */ 18895 var getTrueHeight = function(el) { 18896 var h = 0; 18897 18898 if (el) { 18899 h = el.outerHeight(); //includes padding - not margins 18900 h += el.css("margin-top") ? parseInt(el.css("margin-top").replace("px", "")) : 0; 18901 h += el.css("margin-bottom") ? parseInt(el.css("margin-top").replace("px", "")) : 0; 18902 } 18903 18904 return h; 18905 }; 18906 18907 var correctBackgroundHeight = function(data) { 18908 if (jQuery('.overlayContainer').length > 0) { 18909 console.log("correctBackgroundHeight"); 18910 18911 jQuery(".overlayBackground").css("height", jQuery(".overlay").outerHeight() + 30 + "px"); 18912 } 18913 }; 18914 18915 var correctHeight = function(data) { 18916 18917 var overlay = jQuery(".overlay").last(); 18918 //console.log("correctHeight"); 18919 //console.log(overlay); 18920 if (overlay && overlay.length > 0) { 18921 //console.log("correctHeight2"); 18922 var maxHeight = overlay.css("max-height"); 18923 //console.log("maxHeight: " + maxHeight); 18924 if (maxHeight) { 18925 if (maxHeight.indexOf("px") >= 0) { 18926 maxHeight = parseInt(maxHeight.replace("px", "")); 18927 } else if (maxHeight.indexOf("%") >= 0) { 18928 //Chrome returns the actual css rather than the calculated value 18929 var perc = parseInt(maxHeight.replace("%", "")); //example: 85% -> 85 18930 var decimal = perc / 100; //85 -> 0.85 18931 maxHeight = Math.floor(window.innerHeight * decimal); 18932 } 18933 } else { 18934 maxHeight = 300; //default 18935 } 18936 //console.log("maxHeight2: " + maxHeight); 18937 var headingHeight = getTrueHeight(jQuery(".overlayHeading")); 18938 var footerHeight = getTrueHeight(jQuery(".overlayFooter")); 18939 var padding = overlay.css("padding") ? parseInt(overlay.css("padding").replace("px", "")) : 0; 18940 18941 var maxContentHeight = maxHeight - padding - headingHeight - footerHeight; 18942 18943 if (jQuery(".overlayContent > .box_content").height() < maxContentHeight) { 18944 //console.log("height: 100%"); 18945 jQuery(".overlayContent").css("height", "100%"); 18946 } else { 18947 //console.log("maxContentHeight: " + maxContentHeight); 18948 jQuery(".overlayContent").css("height", maxContentHeight); 18949 } 18950 } 18951 }; 18952 18953 // When the overlay extends to much in both ways, it will be cut on top due to the transform css attribute. 18954 // In case this happens this method removes the transform 18955 var correctPosition = function() { 18956 if (jQuery(".modal").length > 0) { 18957 overlayDiv = jQuery(".modal"); 18958 if (overlayDiv.offset().top < 0) { 18959 overlayDiv.css("transform", ""); 18960 overlayDiv.css("top", ""); 18961 } 18962 } 18963 }; 18964 18965 this.debug = function() { 18966 var windowHeight = jQuery(window).height(); 18967 var containerHeight = jQuery(".overlay").outerHeight(); 18968 18969 var headingHeight = jQuery(".overlayHeading").outerHeight(); 18970 var footerHeight = jQuery(".overlayFooter").outerHeight(); 18971 var helpHeight = jQuery(".overlayHelp").outerHeight(); 18972 18973 var contentHeight = jQuery(".overlayContent").outerHeight(true); 18974 var contentScrollHeight = jQuery(".overlayContent") 18975 .prop("scrollHeight"); 18976 18977 var paddings = containerHeight - contentHeight; 18978 18979 var maxNewContentHeight = windowHeight - helpHeight - paddings; 18980 var minNewContentHeight = contentScrollHeight + paddings; 18981 18982 var newContentHeight = windowHeight - helpHeight - paddings; 18983 //jQuery(".overlayContent").append 18984 if (jQuery(".debug").length > 0) { 18985 jQuery(".debug").html( 18986 "<span class='debug'>" + "windowHeight:" + windowHeight + "; " 18987 + "help:" + helpHeight + "; " + "footer:" 18988 + footerHeight + "; " + "heading:" + headingHeight 18989 + ";<br/> " + "paddings:" + paddings + "; " 18990 + "container:" + containerHeight + "; " 18991 + "content:" + contentHeight + "; <br/>" 18992 + "maxNewContentHeight:" + maxNewContentHeight + "; " 18993 + "minNewContetnHeight:" + minNewContentHeight + "; " 18994 + "newContentHeight:" + newContentHeight + "; " 18995 + "contentScroll:" + contentScrollHeight + "; " 18996 + "</span>"); 18997 } else { 18998 jQuery(".overlayContent").find(".box_content").prepend( 18999 "<span class='debug'>" + "windowHeight:" + windowHeight + "; " 19000 + "help:" + helpHeight + "; " + "footer:" 19001 + footerHeight + "; " + "heading:" + headingHeight 19002 + ";<br/> " + "paddings:" + paddings + "; " 19003 + "container:" + containerHeight + "; " 19004 + "content:" + contentHeight + "; <br/>" 19005 + "maxNewContentHeight:" + maxNewContentHeight + "; " 19006 + "minNewContetnHeight:" + minNewContentHeight + "; " 19007 + "newContentHeight:" + newContentHeight + "; " 19008 + "contentScroll:" + contentScrollHeight + "; " 19009 + "</span>"); 19010 } 19011 19012 }; 19013 var OverlayKeyMover = (function(){ 19014 var active = null; 19015 var step = 5; 19016 var dir = {x:0,y:0}; 19017 var tick = null; 19018 19019 function move(){ 19020 if(!active || (dir.x===0 && dir.y===0)) return; 19021 var $p = jQuery(active); 19022 var l = (parseInt($p.css('left'),10)||0)+dir.x*step; 19023 var t = (parseInt($p.css('top'),10)||0)+dir.y*step; 19024 $p.css({left:l,top:t}); 19025 } 19026 19027 jQuery(window) 19028 .on('keydown.overlayMove',function(e){ 19029 if(!active) return; 19030 switch(e.which){ 19031 case 37: dir.x=-1; break; 19032 case 39: dir.x= 1; break; 19033 case 38: dir.y=-1; break; 19034 case 40: dir.y= 1; break; 19035 default: return; 19036 } 19037 e.preventDefault(); 19038 if(!tick) tick = setInterval(move,15); 19039 }) 19040 .on('keyup.overlayMove',function(e){ 19041 switch(e.which){ 19042 case 37: if(dir.x==-1) dir.x=0; break; 19043 case 39: if(dir.x== 1) dir.x=0; break; 19044 case 38: if(dir.y==-1) dir.y=0; break; 19045 case 40: if(dir.y== 1) dir.y=0; break; 19046 default: return; 19047 } 19048 if(dir.x===0 && dir.y===0 && tick){ 19049 clearInterval(tick); 19050 tick = null; 19051 } 19052 }); 19053 19054 return { 19055 setActive: function(container){ active = container; }, 19056 setInactive: function(){active = null; } 19057 }; 19058 })(); 19059}; 19060 19061use_package("de.his.component.popup"); 19062 19063/** 19064 * Author: wahrendorff Date: 12.03.2013 Zweck: move popup 19065 *
19066 * Popup: 19067 * - öffnen: via mouseover oder via click 19068 * - schlieÃen: via mouseout oder via click auf schlieÃen button. 19069 * - positionieren: beim öffnen, beim verschieben, bei resize des Fensters 19070 * 19071 * - fokussieren: nach dem SchlieÃen den öffnenden Button fokussieren 19072 */ 19073 19074de.his.component.popup = new function(){ 19075 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this); 19076 this.moduleName = "de.his.component.popup"; 19077 var mouseOverClass = "showOnMouseOver"; 19078 var stayOpenProp = "stayOpen"; 19079 19080 var self = this; 19081 19082 this.lastClickedOpenPopupElementId = ""; 19083 19084 19085 this.init = function(){ 19086 handleOpenClick(); 19087 handleCloseClick(); 19088 handleMouseOver(); 19089 } 19090 19091 this.refresh = function(){ 19092 self.init(); 19093 } 19094 19095 var handleMouseOver = function(){ 19096 var popupButtons = jQuery("." + mouseOverClass + ":not([data-popup-event-registered=true])").find("> button, > a"); 19097 19098 popupButtons.each(function(){ 19099 handleMouseEvents( jQuery( this ) ); 19100 }); 19101 } 19102 19103 var handleOpenClick = function(){ 19104 jQuery("[id$='showPopup']").click( function(event){ 19105 // ID des geklickten Buttons holen und zwischenspeichern 19106 if( jQuery(this).attr('id').length ) { 19107 self.lastClickedOpenPopupElementId = de.his.common.Util.toJQueryId( jQuery(this).attr('id') ); 19108 } else { 19109 self.lastClickedOpenPopupElementId = de.his.common.Util.toJQueryId(de.his.common.ContextInformation.get("active-page-element-id")); 19110 } 19111 localStorage.setItem("lastClickedOpenPopupElementId", self.lastClickedOpenPopupElementId); 19112 19113 event.preventDefault(); 19114 /* 19115 var popup = jQuery(this).parent().parent(); 19116 var popupContainer = popup.find(".popoverContainer"); //Wenn mehrere Popups im Container sind, dann werden alle gefunden 19117 */ 19118 var popupContainer = jQuery(this).siblings(".popoverContainer"); 19119 19120 // Popup wieder schlieÃen bei Klick auf das Icon 19121 if( jQuery('#bookmarkForm').find('.popoverContainer').css('display') != 'none' && jQuery(this).parents('#bookmarkForm').length > 0 ) { 19122 hidePopup(popupContainer); 19123 return false; 19124 } 19125 19126 if( popupContainer.parents().hasClass('jobConfigurationSelector' ) ) { 19127 correctSize(popupContainer); 19128 } 19129 showPopup(popupContainer); 19130 handleDrag(popupContainer); 19131 PopupKeyMover.setActive(popupContainer); 19132 correctPosition(popupContainer, event); 19133 handleCloseClickBookmark(); 19134 bindFocus(popupContainer); 19135 return false; 19136 }); 19137 19138 } 19139 19140 var handleCloseClick = function(){ 19141 //console.log("handleCloseClick"); 19142 jQuery("[id$='hidePopup'], [id$='backgroundClose']").click(function(event){ 19143 event.preventDefault(); 19144 var popupContainer = jQuery(this).parents(".popoverContainer"); 19145 //console.log(popupContainer); 19146 19147 hidePopup(popupContainer); 19148 PopupKeyMover.setInactive(); 19149 return false; 19150 }); 19151 } 19152 19153 var handleCloseClickBookmark = function(){ 19154 jQuery('body').on('click', function(e){ 19155 if( jQuery('#bookmarkForm').find('.popoverContainer').css('display') != 'none' && jQuery(e.target).parents('#bookmarkForm .popoverContainer').length == 0 ) { 19156 var popupBookmark = jQuery('#bookmarkForm').find('.popoverContainer'); 19157 hidePopup(popupBookmark); 19158 } 19159 }); 19160 } 19161 19162 var handleDrag = function(popupContainer){ 19163 jQuery("[id$='movePopup']", popupContainer).mousedown(function() { 19164 jQuery('body').addClass('noMouseSelection'); 19165 de.his.component.popup.Mover.startMove( jQuery(this) ); 19166 }); 19167 jQuery("[id$='movePopup']", popupContainer).mouseup(function(){ 19168 de.his.component.popup.Mover.stopMove(); 19169 }); 19170 } 19171 19172 /** 19173 * set focus on the first interactable element in popup 19174 */ 19175 var setFocusOnFirst = function(popoverContainer){ 19176 // find popupContainer inside popover 19177 var tmpPopupContainer = popoverContainer.find('.popupContainer'); 19178 // check if popupContainer exists inside popover and determine first element in popup 19179 inputs = tmpPopupContainer ? tmpPopupContainer.find("input:visible,button:visible,a[href]:visible") : popoverContainer.find("input:visible,button:visible,a[href]:visible"); 19180 first = inputs.first(); 19181 if (first) { 19182 first.focus(); 19183 } 19184 } 19185 19186 /** 19187 * set focus on the last interactable element in popup 19188 */ 19189 var setFocusOnLast = function(popoverContainer){ 19190 // find popupContainer inside popover 19191 var tmpPopupContainer = popoverContainer.find('.popupContainer'); 19192 // check if popupContainer exists inside popover and determine first element in popup 19193 inputs = tmpPopupContainer ? tmpPopupContainer.find("input:visible,button:visible,a[href]:visible") : popoverContainer.find("input:visible,button:visible,a[href]:visible"); 19194 last = inputs.last(); 19195 if (last) { 19196 last.focus(); 19197 } 19198 } 19199 19200 var PopupKeyMover = (function(){ 19201 var active = null; 19202 var step = 5; 19203 var dir = {x:0,y:0}; 19204 var tick = null; 19205 19206 function move(){ 19207 if(!active || (dir.x===0 && dir.y===0)) return; 19208 var $p = jQuery(active); 19209 var l = (parseInt($p.css('left'),10)||0)+dir.x*step; 19210 var t = (parseInt($p.css('top'),10)||0)+dir.y*step; 19211 $p.css({left:l,top:t}); 19212 } 19213 19214 jQuery(window) 19215 .on('keydown.popupMove',function(e){ 19216 if(!active) return; 19217 switch(e.which){ 19218 case 37: dir.x=-1; break; 19219 case 39: dir.x= 1; break; 19220 case 38: dir.y=-1; break; 19221 case 40: dir.y= 1; break; 19222 default: return; 19223 } 19224 e.preventDefault(); 19225 if(!tick) tick = setInterval(move,15); 19226 }) 19227 .on('keyup.popupMove',function(e){ 19228 switch(e.which){ 19229 case 37: if(dir.x==-1) dir.x=0; break; 19230 case 39: if(dir.x== 1) dir.x=0; break; 19231 case 38: if(dir.y==-1) dir.y=0; break; 19232 case 40: if(dir.y== 1) dir.y=0; break; 19233 default: return; 19234 } 19235 if(dir.x===0 && dir.y===0 && tick){ 19236 clearInterval(tick); 19237 tick = null; 19238 } 19239 }); 19240 19241 return {
19242 setActive: function(container){ active = container; }, 19243 setInactive: function(){active = null; } 19244 }; 19245 })(); 19246 19247 var showPopup = function(popupContainer){ 19248 //fix for #344058 because of the focus change from headline to button, get scroll position before open popup and set focus 19249 var scrollpos = jQuery(window).scrollTop(); 19250 19251 popupContainer.show();//removeClass("unsichtbar"); 19252 //Fokus auf das erste interaktive Element setzen. Fix für Barrierefreiheitsprüfberichte #334724 19253 setFocusOnFirst(popupContainer); 19254 //reset scrollTop to position before setting focus. Fix for #344058 because of the focus change from headline to button 19255 jQuery(window).scrollTop(scrollpos); 19256 } 19257 19258 var bindFocus = function(popupContainer){ 19259 jQuery("[class='focusTrapEnd']", popupContainer).on("focus", function(){ 19260 //Fokus auf das erste interaktive Element setzen. Fix für Barrierefreiheitsprüfberichte #334724 19261 setFocusOnFirst(popupContainer); 19262 }); 19263 19264 jQuery("[class='focusTrapFirst']", popupContainer).on("focus", function(){ 19265 if(popupContainer.find("[id$='hidePopup']")) { 19266 popupContainer.find("[id$='hidePopup']").focus(); 19267 } else { 19268 setFocusOnLast(popupContainer); 19269 } 19270 }); 19271 } 19272 19273 var hidePopup = function(popupContainer){ 19274 popupContainer.hide();//addClass("unsichtbar"); 19275 popupContainer.removeProp( stayOpenProp ); 19276 popupContainer.css( {top: ''}); 19277 focusLastClickedOpenedElementOnHidePopup(); 19278 } 19279 19280 // Fokussiert den öffnenden Button des Popups nach dem SchlieÃen dieses 19281 var focusLastClickedOpenedElementOnHidePopup = function(){ 19282 var lastClickedElementId = localStorage.getItem("lastClickedOpenPopupElementId"); 19283 if(lastClickedElementId != null && lastClickedElementId != ""){ 19284 jQuery('#' + de.his.common.Util.toJQueryId(lastClickedElementId.replaceAll('\\', ''))).focus(); 19285 19286 self.lastClickedOpenPopupElementId = ""; 19287 localStorage.setItem("lastClickedOpenPopupElementId", self.lastClickedOpenPopupElementId); 19288 } 19289 } 19290 19291 var handleMouseEvents = function( $it ){ 19292 //console.log("handleMouseEvents start"); 19293 var $cont = $it.parent().find(".popoverContainer"); 19294 //console.log($cont); 19295 if($cont && $cont.length){ 19296 $it.attr("data-popup-event-registered", true); //for any ajax requests with call init() again 19297 $it.on("mouseover", function(event){ 19298 //console.log("mouseover start ", $cont); 19299 var clickFunc; 19300 if( $cont.is(":hidden") ){ 19301 //console.log("$cont is hidden"); 19302 clickFunc = function(){ 19303 $cont.prop( stayOpenProp, true); 19304 }; 19305 var $popCont = $cont.find(".popupContainer"); 19306 showPopup($cont); 19307 correctPosition($cont,event); 19308 if( $cont.parent().hasClass("popupDismissable") ){ 19309 handleDismissableEvents( $cont ); 19310 } 19311 $popCont.on("click", clickFunc); 19312 $popCont.on("mouseleave", function(e){ 19313 //stayOpen property is set if the user clicks anywhere inside the popup 19314 if(!$cont.prop( stayOpenProp )){ 19315 hidePopup( $cont ); 19316 $popCont.off("click"); 19317 $popCont.off("mouseleave"); 19318 } 19319 }); 19320 } 19321 }); 19322 } 19323 }; 19324 19325 var handleDismissableEvents = function( $popup ){ 19326 //console.log("Dismissable popup id:"+$popup.attr('id')); 19327 var func = function(event){ 19328 var $target = jQuery( event.target ); 19329 //console.log("click target: ",$target); 19330 if( !$target.closest(".popoverContainer").length && (typeof $target.attr('id') == 'undefined' || !$target.attr('id').endsWith("poll")) ){ 19331 hidePopup( $popup ); 19332 jQuery( document ).off("click", func); 19333 } 19334 }; 19335 jQuery( document ).on("click", func); 19336 }; 19337 19338 var correctPosition = function( popupContainer, event ){ 19339 var left, top; 19340 if(event.type === "mouseover"){ 19341 left = event.pageX - 30; 19342 top = event.pageY - 30; 19343 } 19344 19345 de.his.component.popup.Mover.positionHorizontal( popupContainer, left ); 19346 de.his.component.popup.Mover.positionVertical( popupContainer, top ); 19347 }; 19348 19349 var correctSize = function( popupContainer ){ 19350 var newWidth, 19351 windowWidth = jQuery(window).width(), 19352 windowHeight = jQuery(window).height(), 19353 scrollPosition = window.pageYOffset; 19354 19355 setTimeout(function(){ 19356 var maxWidth = 0, 19357 popupLeftpos = popupContainer.position().left; 19358 19359 jobConfigurationListItem = popupContainer.find('.jobConfigurationListItem');
19360 jobConfigurationListItem.each(function() { 19361 if(jQuery(this).width() > maxWidth) { 19362 maxWidth = jQuery(this).width(); 19363 } 19364 }); 19365 newWidth = maxWidth+30; 19366 19367 if( newWidth+popupLeftpos <= windowWidth) { 19368 popupContainer.children('.popupContainer').css({'min-width':newWidth}); 19369 } else { 19370 popupContainer.find('.jobConfigurationListItem').children('.quickStartJob').addClass('whiteSpaceNormal'); 19371 } 19372 19373 var popupHeight = popupContainer.find('.popupContainer').outerHeight(), 19374 popupTopOffset = popupContainer.offset().top; 19375 popupToppos = popupTopOffset-scrollPosition; 19376 19377 var popupPosHeight = popupHeight+popupToppos; 19378 19379 if( popupPosHeight > windowHeight) { 19380 var newPosition = scrollPosition -( (popupPosHeight - windowHeight) - popupToppos); 19381 popupContainer.css( {top: newPosition}); 19382 } 19383 if(popupHeight > windowHeight) { 19384 popupContainer.css( {top: scrollPosition}); 19385 } 19386 19387 },1); 19388 19389 19390 19391 }; 19392 19393}; 19394 19395de.his.component.popup.Mover = new function() { 19396 de.his.modules.ModuleRegistry.registerModule(this) 19397 .registerAjaxRefreshModule(this); 19398 this.moduleName = "de.his.component.popup.Mover"; 19399 // Globale Variablen: 19400 // Firebug debug 19401 var logConsole = false; 19402 // Mauskoordinaten 19403 var mouseX; 19404 var mouseY; 19405 // Distanz von Maus zum nullpunkt des Popup`s 19406 var distX; 19407 var distY; 19408 // Zu verschiebendes Popup 19409 var movePopup = null; 19410 19411 // Bei jeder Mausbewegung werden die Koordinaten in die Globalen Variablen 19412 // geschrieben und die move() Funktion ausgeführt, wenn das Popup gehalten 19413 // wird. 19414 19415 this.init = function(){ 19416 19417 // Falls kein Popup gehalten wird, muss auch nichts verschoben werden. 19418 jQuery(document).mouseup(function(e) { 19419 // reenable selection 19420 jQuery('body').removeClass('noMouseSelection'); 19421 movePopup = null; 19422 }); 19423 19424 jQuery(document).mousemove(function(e) { 19425 mouseX = e.pageX; 19426 mouseY = e.pageY; 19427 // if(logConsole) console.log("mouseX: " + mouseX + " mouseY: " + 19428 // mouseY); 19429 if (movePopup != null){ 19430 //console.log("movePopup",movePopup) 19431 de.his.component.popup.Mover.move(); 19432 } 19433 19434 }); 19435 } 19436 19437 this.refresh = function(){ 19438 de.his.component.popup.Mover.init(); 19439 } 19440 19441 this.stopMove = function(){ 19442 jQuery('body').removeClass('noMouseSelection'); 19443 movePopup = null; 19444 } 19445 19446 // brechnet die Distanz von mauszeiger zu popup 19447 this.startMove = function(element) { 19448 //console.log("startMOve"); 19449 if (logConsole){ 19450 console.log("MoveId: " + element.attr("id")); 19451 } 19452 movePopup = element.parents(".popupContainer"); 19453 if (logConsole){ 19454 console.log("PopupId: " + movePopup.attr("id")); 19455 } 19456 var popupPos = movePopup.position(); 19457 distX = mouseX - popupPos.left; 19458 distY = mouseY - popupPos.top; 19459 19460 }; 19461 19462 // verschiebt das Popup 19463 this.move = function() { 19464 jQuery(movePopup).css("position", "absolute"); 19465 jQuery(movePopup).css("top", mouseY - distY + "px"); 19466 jQuery(movePopup).css("left", mouseX - distX + "px"); 19467 }; 19468 19469 /** 19470 * @param left {Integer} optional 19471 */ 19472 this.positionHorizontal = function(popupPlaceholder, left) { 19473 /** 19474 * DONE: Horizontale Positionierung - get width of viewPort - get width 19475 * of popup - get x position of popup - if (x + popupWidth > 19476 * viewPortWidth) x = viewPortWidth - popupWidth 19477 * 19478 */ 19479 var windowWidth = jQuery(window).width(), 19480 element = popupPlaceholder.find(".popupContainer"), 19481 popupWidth = element.outerWidth() + 5, 19482 position = popupPlaceholder.position(), 19483 posX = position.left; 19484 19485 if(left){ 19486 posX = left; 19487 }else{ 19488 left = posX; 19489 } 19490 19491 console.log("eLEMENTiD=" + popupPlaceholder + " widths: WIN " + windowWidth + " : popW " + popupWidth + " :pos " + posX); 19492 if (posX + popupWidth > windowWidth) { 19493 //alert("yes!"); 19494 element.parent().css("left", windowWidth - popupWidth + "px"); 19495 } else{ 19496 element.parent().css("left", left + "px"); 19497 } 19498 }; 19499 19500 /** 19501 * @param top {Integer} optional 19502 */ 19503 this.positionVertical = function(popupPlaceholder, top) { 19504 /** 19505 * DONE: Vertikale Positionierung - get height of viewPort - get height 19506 * of popup - get y position of popup - if (y + popupHeight > 19507 * viewPortHeight) y = viewPortHeight - popupHeight 19508 * 19509 */ 19510 var windowHeight = jQuery(window).height(), 19511 scrollTop = jQuery(window).scrollTop(), 19512 documentHeight = jQuery(document).height(), 19513 element = popupPlaceholder.find(".popupContainer"), 19514 popupHeight = element.outerHeight() + 5, // 5px more corrects // some margin/border// problems 19515 position = popupPlaceholder.position(), 19516 posY = position.top; 19517 console.log("eLEMENTiD=" + popupPlaceholder + " height: WIN " 19518 + windowHeight + " : DOC " + documentHeight
19519 + " : scrollTop " + scrollTop + " : popH " + popupHeight 19520 + " :posY " + posY 19521 + "top: "+top); 19522 19523 //element.parent().css("top", windowHeight - popupHeight + scrollTop + "px"); 19524 19525 // Wenn fixer Header/Footer aktiviert ist die Positionierung anhand des scrollenden Containers berechnen. 19526 if ( element.parents().hasClass('content_portal_hisinone_fixed' ) ) { 19527 element.parent().css({ top: '' }); 19528 eltop = element.offset().top; 19529 containerTop = jQuery('.content_portal_hisinone_fixed').scrollTop(); 19530 top = eltop-containerTop; 19531 } 19532 19533 if(top){ 19534 console.log("top is set"); 19535 //element.parent().css("top", top + "px"); 19536 if (top + popupHeight > windowHeight + scrollTop) { 19537 console.log("outer bla"); 19538 element.parent().css("top", windowHeight - popupHeight + scrollTop + "px"); 19539 } else{ 19540 element.parent().css("top", top + "px"); 19541 } 19542 }else{ 19543 console.log("posY is set"); 19544 if (posY + popupHeight > windowHeight + scrollTop) { 19545 //alert("yes!"); 19546 if( !element.parents().hasClass('jobConfigurationSelector' ) ) { 19547 element.parent().css("top", windowHeight - popupHeight + scrollTop + "px"); 19548 } 19549 } 19550 } 19551 }; 19552}; 19553(function($){ 19554 19555 var capsLockActive = false; 19556 var fdsa = document.getElementById("fdsa"); 19557 var text = document.getElementById("capsLockWarning"); 19558 19559 if(fdsa == null){ 19560 // return if no login field exists #311009 19561 return; 19562 } 19563 19564 var checkCapsLock = function(event) { 19565 let key = event.key; 19566 //console.log("key:", key); 19567 if(key=="Enter"){ 19568 return; 19569 } 19570 if(capsLockActive && key == "CapsLock"){ 19571 // remove warning instantly if capsLock was active and capsLock is pressed 19572 capsLockActive = false; 19573 } else if ( typeof event.getModifierState !== 'undefined' && event.getModifierState("CapsLock")) { 19574 // #311778 getModifierState is undefined when password is filled by (webkit) autofill. 19575 capsLockActive = true; 19576 } else { 19577 capsLockActive = false; 19578 } 19579 19580 if (capsLockActive) { 19581 var warningContainer = jQuery("#capsLockWarning"); 19582 var popup = warningContainer.find('button'); 19583 if (popup.length) { 19584 19585 warningContainer.show(); 19586 // setze Fokus zurück auf Passworteingabe wenn popup per click geschlossen wird 19587 // one (im gegensatz zu on()), löscht den Clickhandler wenn er einmal ausgelöst wurde 19588 popup.one('click',function(){ 19589 jQuery("#fdsa").focus(); 19590 }); 19591 popup[0].click(); 19592 } 19593 }else { 19594 $("#capsLockWarning").hide(); 19595 } 19596 }; 19597 19598 // keyup to recognize modifier State instantly when tabbing into the passwort field 19599 fdsa.addEventListener("keyup", checkCapsLock); 19600 // click to recognize modifier State instantly when mouse clicking into the passwort field 19601 fdsa.addEventListener("click", checkCapsLock); 19602 19603})(jQuery);use_package("de.his.component"); 19604 19605/** 19606 * Wird durch die messages-infobox-Komponente eingebunden. 19607 * 19608 * Setzt die Nachrichten fix mit der Seite verbunden. 19609 * Sie werden mitgescrollt solange sie im sichtbaren Bereich sind, 19610 * ansonsten sind sie oben (links, durch austauschen der css-Anweisung 19611 * unten auch rechts möglich)fest angeordnet. 19612 * 19613 * 19614 */ 19615de.his.component.MessagesInfobox = new function() { 19616 de.his.modules.ModuleRegistry 19617 .registerModule(this) 19618 .registerAjaxRefreshModule(this); 19619 this.moduleName = "de.his.component.MessagesInfobox"; 19620 var isInitialized = false, 19621 isFixedHeaderLayout = false, 19622 normalTop = 20, 19623 scrolledTop = 20, 19624 restoreTop = 20, 19625 19626 right = 20, 19627 zIndex = 1300, 19628 19629 scrollingBase = window; 19630 19631 var body = jQuery('body'); 19632 var mobileBody = jQuery('body.currentDevice_mobile'); 19633 19634 this.init = function() { 19635 initIntern(); 19636 focusMessageInfobox(); 19637 }; 19638 19639 this.refresh = function() { 19640 initIntern(); 19641 focusMessageInfobox(); 19642 }; 19643 19644 //de.his.component.MessagesInfobox.showMessagesInfoboxWithTitle(messageList, severity, title) 19645 this.showMessagesInfoboxWithTitle = function(messageList, severity, title){ 19646 /** 19647 * TODO: replace titles with js context information translated. 19648 */ 19649 var iconClass = "iconfont-tick"; // checkmark 19650 var messageBoxStyleClass = "success"; 19651 var additionalStyleClass = "auto-closing-box-behavior"; // auto-closing-box-behavior 19652 19653 if(severity == 'info'){ 19654 iconClass = "iconfont-error_mono"; 19655 messageBoxStyleClass = "info"; 19656 additionalStyleClass=""; 19657 } 19658 19659 if(severity == 'warn' || severity == 'warning'){ 19660 severity = 'warn'; 19661 iconClass = "iconfont-warning_mono"; 19662 messageBoxStyleClass = "warning"; 19663 additionalStyleClass=""; 19664 } 19665 19666 if(severity == 'error'){ 19667 iconClass = "iconfont-error_mono"; 19668 additionalStyleClass = ""; 19669 messageBoxStyleClass = "error"; 19670 additionalStyleClass=""; 19671 } 19672 19673 var titleEnding = title.endsWith(')') || title.endsWith(':') ? '' : ':'; 19674 var htmlPart1 = '<div id="messages-infobox:'+severity+'" class="infobox '+messageBoxStyleClass+'_infobox messages-infobox '+additionalStyleClass+'" style=" ">' 19675 + ' <div class="messages-infobox-scroll-container">' 19676 + ' <span class="messages_infobox_header">' 19677 + ' <span title=" " class="'+iconClass+'"></span> '+title + titleEnding 19678 + ' </span>' 19679 + ' <button id="messages-infobox:'+severity+':button" name="messages-infobox:'+severity+':button" type="submit" onclick="jQuery(\'messages-infobox:'+severity+'\').attr(\'style\', \'transform: scale(0, 0); transition: all 2s ease 0s;\');" title="SchlieÃen (Mit der Escape-Taste können Sie alle Meldungen zusammen schlieÃen.)" style="" class="simple-close-button-behavior submit_image infobox_close">' 19680 + ' <span class="iconfont-panel_close"></span>' 19681 + ' </button>' 19682 + ' <ul class="listMessages">'; 19683 19684 var htmlListOfMessages = ''; 19685 for(message of messageList){ 19686 htmlListOfMessages += " <li>" + de.his.common.Util.escapeHtml(message) + "</li>"; 19687 } 19688 19689 var htmlPart3 = ' </ul>' 19690 + ' </div>' 19691 + ' <div class="clearerSpaceAboveHalfEm"></div>' 19692 + ' <button id="messages-infobox:'+severity+':buttonESC" name="messages-infobox:'+severity+':button" type="submit" onclick="jQuery(\'messages-infobox:'+severity+'\').attr(\'style\', \'transform: scale(0, 0); transition: all 2s ease 0s;\');" title="SchlieÃen (Mit der Escape-Taste können Sie alle Meldungen zusammen schlieÃen.)" style="" class="simple-close-button-behavior closeButtonMessagesESC">' 19693 + ' <span>SchlieÃen [ESC]</span>' 19694 + ' </button>' 19695 + ' </div>' 19696 + ' </div>'; 19697 19698 var html = htmlPart1 + htmlListOfMessages + htmlPart3; 19699 var contentFrame = jQuery('div[id$="contentFrame"]'); 19700 if(contentFrame.find('.messages-infobox-container').length){ 19701 contentFrame.find('.messages-infobox-container').append("<div class='messages-infobox-behavior' data-maximum-severity='"+severity+"'>"+html+"</div>"); 19702 19703 } else{ 19704 contentFrame.append("<div class='messages-infobox-container'><div class='messages-infobox-behavior' data-maximum-severity='"+severity+"'>"+html+"</div></div>"); 19705 } 19706 initIntern(); 19707 } 19708 19709 this.showMessagesInfobox = function(message, severity){ 19710 var titleTranslation = new Map([["success", "Bestätigung"], ["info", "Hinweis"], ["warn", "Warnung"], ["error","Fehler"]]); 19711 de.his.component.MessagesInfobox.showMessagesInfoboxWithTitle([message], severity, titleTranslation.get(severity)
19711); 19712 } 19713 19714 var initDefaultValues = function() { 19715 if (isInitialized) { 19716 return; 19717 } 19718 isInitialized = true; 19719 19720 }; 19721 19722 var initIntern = function() { 19723 /** 19724 * TODO: Needs redesign maybe - Priority low. 19725 * 19726 * Was designed to handle only one message-infobox per page. 19727 * Now global functions that create messages from javascript (see this.showMessagesInfobox) 19728 * 19729 * Each is a hack that makes it work with more than one message-infobox on one page, 19730 * but it can lead to strange behaviour when used excessively without reloading the page. 19731 * (Boxes overlap, instead of aligning beneath. 19732 * 19733 */ 19734 19735 jQuery('.messages-infobox-behavior').each(function(){ 19736 19737 19738 var messagesInfobox = jQuery(this); 19739 if (jQuery(messagesInfobox).hasClass('rendered-behavior')) { 19740 jQuery(messagesInfobox).removeClass('rendered-behavior'); 19741 return; 19742 } 19743 19744 // only initialize if element has not been initialized before 19745 // if(messagesInfobox.data('initialized') == 'true'){ 19746 // //console.log('messagesInfobox already initialized...'); 19747 // return; 19748 // } 19749 // // set element as initialized 19750 // messagesInfobox.data('initialized', 'true'); 19751 19752 // Sachen, welche immer initialisiert werden müssen 19753 initAndResetClickedButtonMark(); 19754 19755 if (messagesInfobox.children().length <= 0) { 19756 return; 19757 } 19758 19759 // Sachen, welche nur benötigt sind, wenn Messages existieren 19760 markClickedButton(messagesInfobox); 19761 19762 //Meldungen in IFrames sollen per iFrameCommunication an das parent Fenster gegen werden und dort angezeigt werden. #251815 19763 /*// wenn Message in iFrame dann soll sie mitscrollen anhand der Scrollbar des Hauptfensters #264425 19764 if(jQuery('body').hasClass('embedded')) { 19765 var messageTop = messagesInfobox.offset().top; 19766 var messageHeight = messagesInfobox.outerHeight(); 19767 messageTop = messageTop+messageHeight; 19768 19769 var frameId = window.frameElement.id; 19770 var iFrame = parent.window.document.getElementById(frameId).parentNode; 19771 var iFrameTop = iFrame.offsetTop; 19772 19773 var scrollFromTop = jQuery(parent.window).scrollTop(); 19774 var messagePos = Math.round(messageTop+iFrameTop); 19775 var newPos = scrollFromTop-messagePos+messageHeight+parent.window.document.getElementById('hisinoneHeader').clientHeight; 19776 19777 if( messageTop+iFrameTop <= scrollFromTop ) { 19778 messagesInfobox.css({top:newPos}); 19779 jQuery('.message-infobox-button-wrapper').css({top:newPos}); 19780 } 19781 jQuery(parent.window).on('scroll', function(){ 19782 scrollFromTop = jQuery(parent.window).scrollTop(); 19783 newPos = scrollFromTop-messagePos+messageHeight+parent.window.document.getElementById('hisinoneHeader').clientHeight; 19784 19785 if( messagePos-messageHeight <= scrollFromTop ) { 19786 messagesInfobox.css({top:newPos}); 19787 jQuery('.message-infobox-button-wrapper').css({top:newPos}); 19788 } else { 19789 messagesInfobox.css({top:''}); 19790 jQuery('.message-infobox-button-wrapper').css({top:''}); 19791 } 19792 }); 19793 } */ 19794 19795 // um die Messages auch rechts anzuordnen hier statt left right setzen: 19796 messagesInfobox.css({ 19797 position: "fixed", 19798 top: jQuery('#hisinoneHeader').height(), 19799 right: "50px", 19800 "z-index": zIndex, 19801 }); 19802 19803 jQuery('.messages-infobox-behavior > .messages-infobox .simple-close-button-behavior') 19804 .click(function() { 19805 mobileBody.removeClass("bgBlock"); 19806 jQuery(this) 19807 .closest('.messages-infobox') 19808 .css({ 19809 'marginRight': '-300px', 19810 'opacity' : '0', 19811 'transition': 'all 0.5s ease-in' 19812 }) 19813 .addClass('hideWhenClosed'); 19814 19815 setTimeout(enableRestoreHiddenMessages, 800); 19816 return false; 19817 }).show(); 19818 19819 jQuery('.messages-infobox-restore-button-behavior').each(function(){ 19820 var restoreMessages = jQuery(this); 19821 restoreMessages.parent() 19822 .click(function() { 19823 focusMessageInfobox(); 19824 jQuery('.messages-infobox-behavior > .messages-infobox').css({'display': 'block'}); 19825 jQuery('.hideWhenClosed').removeClass('hideWhenClosed'); 19826 setTimeout(function() { 19827 jQuery('.messages-infobox-behavior > .messages-infobox') 19828 .stop() 19829 .unAutoClosing() 19830 .css({ 19831 'marginRight': 0, 19832 'opacity' : '1', 19833 'transition': 'all 0.5s ease-out' 19834 }); 19835 }, 0); 19836 restoreMessages.hide(); 19837 return false;
19838 }); 19839 }); 19840// var restoreMessages = jQuery('.messages-infobox-restore-button-behavior').first().parent() 19841// .click(function() { 19842// jQuery('.messages-infobox-behavior > .messages-infobox').css({'display': 'block'}); 19843// jQuery('.hideWhenClosed').removeClass('hideWhenClosed'); 19844// setTimeout(function() { 19845// jQuery('.messages-infobox-behavior > .messages-infobox:not(.info_infobox)') 19846// .stop() 19847// .unAutoClosing() 19848// .css({ 19849// 'marginRight': 0, 19850// 'opacity' : '1', 19851// 'transition': 'all 1s ease-out' 19852// }); 19853// }, 0); 19854// restoreMessages.hide(); 19855// return false; 19856// }); 19857 19858 /* 19859 * Wenn sich die Seite in einem Iframe befindet und via AJAX (auf mobilem Gerät) Fehler generiert werden, 19860 * sollen diese so formatiert werden, dass sie auch bei sehr kleinen Iframes noch lesbar sind. Behebt #160686 19861 */ 19862 var isInIframe = (window.location != window.parent.location) ? true : false; 19863 if (isInIframe && window.device.mobile()) { 19864 jQuery('.messages-infobox-behavior').addClass("messages-infobox-behavior-iframe"); 19865 jQuery('.messages-infobox').addClass("messages-infobox-iframe"); 19866 } 19867 19868 messagesInfobox.fadeIn(1000); 19869 19870 if(jQuery('.auto-closing-box-behavior').length > 0){ 19871 jQuery('.auto-closing-box-behavior').autoClosing({callbackOnHidden : enableRestoreHiddenMessages}); 19872 } 19873 19874 // Wenn es schon eine Meldung gibt, die Folgende darunter positionieren um Ãberlappung zu vermeiden. 19875 if( messagesInfobox.prev('.messages-infobox-behavior').length || messagesInfobox.prev('.messages-infobox-behavior-scroll').length) { 19876 if( !jQuery('.messages-infobox-behavior-scroll').length ) { 19877 messagesInfobox.prev('.messages-infobox-behavior').wrap('<div class="messages-infobox-behavior-scroll"></div>'); 19878 } 19879 messagesInfobox.prependTo('.messages-infobox-behavior-scroll'); 19880 } 19881 // Mouseenter von Autoclosing unbinden, es gibt sonst Darstellungsprobleme, wenn mehrere Meldungen sichtbar. 19882 if(messagesInfobox.parent('.messages-infobox-behavior-scroll').length != 0){ 19883 jQuery('.messages-infobox-behavior > .messages-infobox').off('mouseenter'); 19884 } 19885 19886 }); 19887 }; 19888 19889 var enableRestoreHiddenMessages = function() { 19890 jQuery('.messages-infobox-behavior > .messages-infobox.hideWhenClosed').css("display", "none"); 19891 jQuery('.messages-infobox-restore-button-behavior').parent().show(); 19892 //Der Button selbst erhält ein element style mit display: none, wenn Meldungen via "Bullet" vom Nutzer eingeblendet werden. Dieser muss entfernt werden. 19893 jQuery('.messages-infobox-restore-button-behavior').css("display", "block"); 19894 19895 // Wenn mehrere Meldungen vorhanden, einen Counter einbinden. 19896 if(jQuery('.messages-infobox-behavior').parent('.messages-infobox-behavior-scroll').length != 0){ 19897 var messagesInfoboxLength = jQuery('.messages-infobox-behavior-scroll').find('.messages-infobox.hideWhenClosed').length; 19898 if( !jQuery('.messages-infobox-counter').length ) { 19899 jQuery('<div class="messages-infobox-counter"><span>'+parseInt(messagesInfoboxLength)+'</span></div>').appendTo('.message-infobox-button-wrapper'); 19900 } else { 19901 jQuery('.messages-infobox-counter').addClass('animated').text(parseInt(messagesInfoboxLength)); 19902 } 19903 setTimeout(function(){ 19904 jQuery('.messages-infobox-counter').removeClass('animated'); 19905 },500); 19906 } 19907 19908 focusElementOnCloseMessagesInfobox(); 19909 }; 19910 19911 var initAndResetClickedButtonMark = function() { 19912 jQuery('input[type="submit"],input[type="image"]').not('.messages-infobox-restore-button-behavior').not('.simple-close-button-behavior').click(function() { 19913 de.his.common.Cookie.create('_clickedButtonId', jQuery(this).attr('id')); 19914 }); 19915 19916 if ((mobileBody).find(".messages-infobox[data-infobox-type='Error']").length > 0) { 19917 mobileBody.addClass("bgBlock"); 19918 19919 var headerHeight = jQuery('#hisinoneHeader').height(); 19920 var viewHeight = jQuery(window).height(); 19921 var msgHeight = viewHeight-headerHeight-15; 19922 jQuery(mobileBody).find(".messages-infobox[data-infobox-type='Error']").css({'maxHeight':msgHeight}); 19923 } 19924 19925 else { 19926 body.removeClass("bgBlock"); 19927 } 19928 19929 if (!body.data("clickButtonMarkRemover")) { 19930 body 19931 .data("clickButtonMarkRemover", true) 19932 .click(function() { 19933 removeClickedButtonMark(); 19934 // TODO: Auch die Messages bei click und oder keydown entfernen?: 19935 //jQuery('.messages-infobox-behavior > .messages-infobox .simple-close-button-behavior').click(); 19936 }) 19937 .keydown(function() { 19938 removeClickedButtonMark(); 19939 }); 19940 } 19941 19942 removeClickedButtonMark(); 19943 }; 19944 19945 var removeClickedButtonMark = function() { 19946 jQuery('input.highlighted-behavior').each(function() { 19947 var button = jQuery(this), 19948 severityStyleClass = button.data('severity-style-class'); 19949 19950 button 19951 .removeClass('highlighted-behavior') 19952 .removeClass(severityStyleClass) 19953 .removeData('severity-style-class'); 19954 }); 19955 }; 19956 19957 var markClickedButton = function(messagesInfobox) { 19958 var maximumSeverity = messagesInfobox.data('maximum-severity'), 19959 buttonStyleClass = severityToStyleClass(maximumSeverity), 19960 clickedButtonId = de.his.common.Cookie.read('_clickedButtonId'); 19961 19962 if (clickedButtonId) { 19963 var button = jQuery('#' + de.his.common.Util.toJQueryId(clickedButtonId)), 19964 oldCss = button.css('border'); 19965 19966 button 19967 .addClass('highlighted-behavior') 19968 .addClass(buttonStyleClass) 19969 .data('severity-style-class', buttonStyleClass); 19970 19971 de.his.common.Cookie.erase('_clickedButtonId'); 19972 } 19973 }; 19974 19975 var severityToStyleClass = function(severity) { 19976 switch(severity) { 19977 case 'error': 19978 /* PRODUCTION_REMOVE_BEGIN */ 19979// if (Audio) { 19980// var snd = new Audio("http://dl.dropbox.com/u/25363220/his-test/Shadow_demon_laugh_05.ogg"); 19981// snd.load(); 19982// snd.play(); 19983// }
19984 /* PRODUCTION_REMOVE_END */ 19985 return 'highlight-error-button'; 19986 case 'warn': 19987 /* PRODUCTION_REMOVE_BEGIN */ 19988// if (Audio) { 19989// var snd = new Audio("http://dl.dropbox.com/u/25363220/his-test/Female%20Scream-SoundBible.com-237334261.ogg"); 19990// snd.load(); 19991// snd.play(); 19992// } 19993 /* PRODUCTION_REMOVE_END */ 19994 return 'highlight-warn-button'; 19995 case 'info': 19996 return 'highlight-info-button'; 19997 case 'success': 19998 return 'highlight-success-button'; 19999 default: 20000 throw new Error("Undefined severity: " + severity); 20001 } 20002 }; 20003 20004 var focusMessageInfobox = function(){ 20005 if(jQuery(".messages_infobox_header").length > 0){ 20006 setTimeout(function() { 20007 var lastInfoboxClose = (document.querySelectorAll(".messages-infobox-container button.infobox_close"))[document.querySelectorAll(".messages-infobox-container button.infobox_close").length - 1]; 20008 var lastInfoboxCloseDisplay = window.getComputedStyle(lastInfoboxClose)?.display; 20009 if((document.querySelectorAll(".messages-infobox-container button.infobox_close")[document.querySelectorAll(".messages-infobox-container button.infobox_close").length - 1]) && lastInfoboxCloseDisplay != "none"){ 20010 (document.querySelectorAll(".messages-infobox-container button.infobox_close")[document.querySelectorAll(".messages-infobox-container button.infobox_close").length - 1]).focus(); 20011 } 20012 else if((document.querySelectorAll(".messages-infobox-container button.closeButtonMessagesESC")[document.querySelectorAll(".messages-infobox-container button.closeButtonMessagesESC").length - 1])){ 20013 (document.querySelectorAll(".messages-infobox-container button.closeButtonMessagesESC")[document.querySelectorAll(".messages-infobox-container button.closeButtonMessagesESC").length - 1]).focus(); 20014 } 20015 bindFocus(); 20016 openingInfoboxElement = localStorage.getItem("openingInfoboxElement"); 20017 if(!document.getElementById(openingInfoboxElement)){ 20018 localStorage.setItem("openingInfoboxElement", ""); 20019 } 20020 }, 50); 20021 } 20022 } 20023 20024 var bindFocus = function(){ 20025 jQuery("[class='focusTrapEnd']", jQuery(".messages-infobox")[jQuery(".messages_infobox_header").length - 1]).on("focus", function(){ 20026 jQuery(".messages-infobox .infobox_close")[jQuery(".messages-infobox .infobox_close").length - 1].focus(); 20027 }); 20028 20029 jQuery("[class='focusTrapFirst']", jQuery(".messages-infobox")[jQuery(".messages_infobox_header").length - 1]).on("focus", function(){ 20030 jQuery(".messages-infobox .closeButtonMessagesESC")[jQuery(".messages-infobox .closeButtonMessagesESC").length - 1].focus(); 20031 }); 20032 } 20033 20034 var focusElementOnCloseMessagesInfobox = function(){ 20035 // Wenn Fehler auf der Seite vorhanden sind, zuerst diese fokussieren 20036 var firstErrorField = jQuery(".error"); // .error ist nicht an jedem Eingabefeld vorhanden 20037 var firstErrortextField = jQuery(".errortext"); 20038 var isErrorHigher = false; 20039 if(firstErrorField?.position()?.top <= firstErrortextField?.position()?.top){ 20040 isErrorHigher = true; 20041 } 20042 if(isErrorHigher && firstErrorField.find(":tabbable").length > 0){ 20043 firstErrorField.find(":tabbable")[0].focus(); 20044 return; 20045 } else if(firstErrortextField.length > 0) { 20046 // Fix für #339738 20047 // Wenn es sonstige Fehlermeldungen (nicht firstErrorField) gibt, prüfen ob der erste Fehler antabbar ist. 20048 // Wenn nicht antabbar, suche ein antabbares Element in firstErrortextField[0] und setze den Fokus (z.B. bei Dropdownfeldern die als div im firstErrortextField landen) 20049 if(jQuery(firstErrortextField[0]).is(":tabbable")){ 20050 firstErrortextField[0].focus(); 20051 return; 20052 } else { 20053 if(jQuery(firstErrortextField[0]).find(":tabbable").length > 0){ 20054 jQuery(firstErrortextField[0]).find(":tabbable")[0].focus(); 20055 return; 20056 } 20057 } 20058 } 20059 20060 // fix für #334724 PLZ-Feld soll nach Hinweis wieder fokussiert werden 20061 var firstInfoTextField = jQuery(".infofocus "); 20062 if(firstInfoTextField.length > 0) { 20063 if(jQuery(firstInfoTextField[0]).is(":tabbable")){ 20064 firstInfoTextField[0].focus(); 20065 return; 20066 } else if(jQuery(firstInfoTextField[0]).find(":tabbable").length > 0){ 20067 jQuery(firstInfoTextField[0]).find(":tabbable")[0].focus(); 20068 return; 20069 } 20070 } 20071 20072 // Wenn weitere Meldungen auf Seite angezeigt werden, setze den Fokus auf den nächsten infobox SchlieÃen Button 20073 var visibleInfoboxElements = jQuery('.messages-infobox-behavior .
20073infobox').filter(function() { 20074 return $(this).css('display') !== 'none'; 20075 }); 20076 if (visibleInfoboxElements.length > 0 && visibleInfoboxElements.find('.infobox_close').length > 0){ 20077 visibleInfoboxElements.find('.infobox_close')[0].focus(); 20078 return; 20079 } 20080 20081 // Ist ein Overlay oder eine ConfirmBox/userQuery geöffnet, das Overlay selbst den Fokus setzen lassen 20082 var callBackContainer = jQuery('div[data-infobox-type="Query"]:visible'); 20083 if ((jQuery(".overlay.modal").length > 0 && jQuery(".overlay.modal") != undefined) || callBackContainer.length > 0) { 20084 let isAlreadyFocusedOverlay = jQuery(".overlay.modal").find(document.activeElement); 20085 let isAlreadyFocusedCallBack = callBackContainer.find(document.activeElement); 20086 if ((typeof isAlreadyFocusedOverlay == 'undefined' || isAlreadyFocusedOverlay.length == 0) && (typeof isAlreadyFocusedCallBack == 'undefined' || isAlreadyFocusedCallBack.length == 0)) { 20087 de.his.component.overlay.startModalFunction(); 20088 } 20089 return; 20090 } 20091 20092 // Ist ein messages-infobox-restore-button sichtbar, Fokus auf den Button setzen 20093 if(jQuery(".messages-infobox-restore-button").length > 0 && visibleInfoboxElements.length <= 0) { 20094 jQuery(".messages-infobox-restore-button").focus(); 20095 return; 20096 } 20097 20098 // Fokus auf das zuletzt fokussierte Element auf der Seite setzen 20099 if(localStorage.getItem("openingInfoboxElement") && localStorage.getItem("openingInfoboxElement").length > 0){ 20100 document.getElementById(localStorage.getItem("openingInfoboxElement"))?.focus(); 20101 return; 20102 } 20103 de.his.modules.Autofocus.init(); 20104 } 20105 20106 jQuery(".messages-infobox button").click( function(event){ 20107 focusElementOnCloseMessagesInfobox(); 20108 }); 20109 20110 jQuery(".messages-infobox-restore-button").click( function(event){ 20111 focusMessageInfobox(); 20112 }); 20113 20114 jQuery("button:not(.infobox_close):not(.closeButtonMessagesESC):not([id$='toggleSearchShowAllCriteria'])").click( function(event){ 20115 var openingInfoboxElement = event.currentTarget.id; 20116 localStorage.setItem("openingInfoboxElement", openingInfoboxElement); 20117 }); 20118}; 20119use_package("de.his.component"); 20120/** 20121 * Scrollt zum Anfang der Seite 20122 */ 20123de.his.component.ScrollToLink = new function() { 20124 de.his.modules.ModuleRegistry.registerModule(this).registerAjaxRefreshModule(this);; 20125 this.moduleName = "de.his.components.ScrollToLink"; 20126 this.init = function() { 20127 20128 jQuery('a.scrollToLink').on('click', function(event){ 20129 //console.log("targetid", jQuery(this).data('targetid')); 20130 scrollTo(jQuery(this).data('targetid')); 20131 }); 20132 jQuery('a.scrollToLink').on('keydown', function(event){ 20133 // console.log("targetid", jQuery(this).data('targetid')); 20134 // Enter and Space 20135 if(event.which === 13){ 20136 var targetId = jQuery(this).data('targetid'); 20137 scrollTo(targetId); 20138 } 20139 }); 20140 }; 20141 this.refresh = function(){ 20142 this.init(); 20143 }; 20144 20145 var scrollTo = function(targetId){ 20146 console.log("targetid", targetId); 20147 20148 20149 20150 if(jQuery('.header_fixed').length){ 20151 document.getElementsByClassName("his_main_content")[0].scroll(0,findPos(document.getElementById(targetId))); 20152 } else { 20153 document.getElementById(targetId).scrollIntoView(); 20154 } 20155 // focus Element, set tabindex, since they dont know how browser native Anchors work and 20156 // they want to scrollTo and focus any element, not just anchors, they also scrollTo spans and divs via id. 20157 document.getElementById(targetId).setAttribute('tabindex','-1'); 20158 document.getElementById(targetId).focus(); 20159 20160 } 20161 20162 var findPos = function (obj) { 20163 var curtop = 0; 20164 if (obj.offsetParent) { 20165 do { 20166 curtop += obj.offsetTop; 20167 } while (obj = obj.offsetParent); 20168 return [curtop]; 20169 }; 20170 }; 20171};use_package("de.his.common"); 20172 20173/** 20174 * JS-Funktionen zur Ajax-Funktion: Header einklappen 20175 */ 20176de.his.common.EndlessWaiting = new function() { 20177 20178 de.his.modules.ModuleRegistry.registerModule(this) 20179 .registerAjaxRefreshModule(this); 20180 20181 this.moduleName = "de.his.common.EndlessWaiting"; 20182 20183 this.init = function() { 20184 jQuery('#contentFrame iframe').each(function() { 20185 var _this = jQuery(this); 20186 // only initialize if element has not been initialized before 20187 if (_this.data('initialized') == 'true') { 20188 //console.log('Helptext already initialized...'); 20189 return; 20190 } 20191 // set element as initialized 20192 _this.data('initialized', 'true'); 20193 20194 if (typeof _this.attr("src") !== 'undefined' && _this.attr("src").indexOf("/HISinOne/images/") > -1) { 20195 _this.parent().next().fadeIn("slow", function() { 20196 // Animation complete 20197 }); 20198 } 20199 }); 20200 }; 20201 20202 this.refresh = function() { 20203 this.init(); 20204 }; 20205};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.