123456 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: hal
- // (C) Copyright IBM Corp. 2003, 2017.
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- function C_Chooser(_hL31, _h7O1, _hAX, _hLN1){this._hM31=_hL31;this._hM31.style.position="relative";this._hM31.style.overflow="hidden";this._h8O1=_h7O1;this._h8O1.setAttribute( "view", "icon" );if(!this._h8O1.getAttribute("classPrefix")){this._h8O1.setAttribute( "classPrefix", "clsListItem_chooser" );}this._h8O1.setAttribute( "allowCtrlDeselect", "false" );this._hXN1=_hLN1?_hLN1:null;this._h9O1=this._hM31.parentNode.insertBefore(document.createElement("DIV"), this._hM31);this._h9O1.style.position="absolute";this._h9O1.style.width=Math.F_NonNeg(this._hM31.offsetWidth-8)+"px";this._h9O1.style.height=this._hM31.offsetHeight+"px";this._h9O1.style.backgroundColor="#777777";this._h9O1.style.marginLeft="4px";this._h9O1.style.marginTop="3px";this._h9O1.style.opacity="0.2";this._hR91=this._hM31.appendChild(document.createElement("DIV"));this._hR91.className="clsListView";this._hR91.style.width=this._hM31.offsetWidth+"px";this._hR91.style.height=this._hM31.offsetHeight+"px";this._hR91.style.padding="8px 0px 0px 8px";this._hR91.style.backgroundColor="white";this.F_SetValueFilter(_hAX);this.F_Draw();};C_Chooser.prototype.F_Detach=function(){if(this._hAO1){this._hAO1.F_Detach();}if(this._h9O1){this._h9O1.parentNode.removeChild(this._h9O1);}if(this._hR91){this._hR91.parentNode.removeChild(this._hR91);}};C_Chooser.prototype.F_GetId=function(){return this._hM31.id;};C_Chooser.prototype.F_GetContainer=function(){return this._hM31;};C_Chooser.prototype.F_GetListItems=function(){return this._hAO1.F_GetListItems();};C_Chooser.prototype.F_GetSelectedListItem=function(){return this._hAO1.F_GetSelectedListItem();};C_Chooser.prototype.F_GetSelectedListItems=function(){return this._hAO1.F_GetSelectedListItems();};C_Chooser.prototype.F_SetValueFilter=function(_hAX){this._hBX=_hAX||null;};C_Chooser.prototype._hRI=function(_h7O1,_hAX){if(_hAX){U_XML.F_RemoveNodes( _h7O1, "listItems/listItem" + U_XML.F_ConstructInFilter( "@value", _hAX, false, true ) );}};C_Chooser.prototype.F_Draw=function(){if(this._hXN1&&this._hXN1.F_Chooser_OnTransitionStart){this._hXN1.F_Chooser_OnTransitionStart(this);}var _h7O1=this._h8O1.cloneNode(true);var _hS91=[];var _hN31;var _hJR;var _hSM;if(this._hAO1){this._hAO1.F_ClearSelections(true);var _hCX=U_XML.F_AppendValuesToObject(null, this._hAO1.F_GetListViewNode().selectNodes("listItems/listItem/@value"));this._hRI(_h7O1, this._hBX);var _hO31=U_XML.F_AppendValuesToObject(null, _h7O1.selectNodes("listItems/listItem/@value"));_hN31=U_Object.F_Subtract(_hO31, _hCX);_hJR=U_Object.F_Subtract(_hCX, _hO31);_hSM={};var nl=this._hAO1.F_GetListItems();var _hBZ1=nl.length;for(var i=0;i<_hBZ1;i++){var _hBO1=nl.item(i);var _h552=_hBO1.getAttribute("value");var el=this._hAO1.F_GetCustomHtmlElement(_hBO1);if(_hJR[_h552]){this._hV6(el, _hS91);}else{var _hPZ1=this._hM31.appendChild(el.cloneNode(true));_hSM[_h552]=_hPZ1;var _hIC2=U_DOM.F_GetRelativeOffset(el, this._hM31);_hPZ1.style.position="absolute";_hPZ1.style.top=(_hIC2.top+1)+ "px";_hPZ1.style.left=(_hIC2.left+1)+ "px";_hPZ1.style.borderStyle="none";}}}else{this._hRI(_h7O1, this._hBX);_hN31=U_XML.F_AppendValues(null, _h7O1.selectNodes("listItems/listItem/@value")).F_CreateDictionary();}var fn=this._hVG1.bind(this, _h7O1, _hN31, _hJR, _hSM);var _hSA=new C_ParallelAnimations(_hS91, fn);_hSA.F_Play();};C_Chooser.prototype._hV6=function(_hP31,_hS91){var a=this._h0G(_hP31);for(var i=0;i<a.length;i++){_hS91.push(new C_FadeOut(a[i], null, 500, U_Easing.Linear.F_EaseInOut));}};C_Chooser.prototype._hQ8=function(_hP31,_hSA){var a=this._h0G(_hP31);for(var i=0;i<a.length;i++){_hSA.F_Push(new C_FadeIn(a[i], null, 500, U_Easing.Linear.F_EaseInOut));}};C_Chooser.prototype._h0G=function(_hP31){return [_hP31.firstChild, _hP31.lastChild];};C_Chooser.prototype._hWG1=function(_hBO1){var _hBG1=_hBO1.getAttribute("idsTooltip");if(_hBG1){G_HAL.F_VerifyDependencies("G_ResManager");return G_ResManager.F_GetString(_hBG1);}return _hBO1.getAttribute( "tooltip" )||"";};C_Chooser.prototype._hVG1=function(_h7O1,_hN31,_hJR,_hSM){if(this._hAO1){this._hAO1.F_Detach();}var _hXG1=_h7O1.getAttribute("iconWidth");var _hT91=_h7O1.getAttribute("iconHeight");var nl=_h7O1.selectNodes("listItems/listItem");var _hBZ1=nl.length;for(var i=0;i<_hBZ1;i++){var _hBO1=nl.item(i);var _h052=_hBO1.getAttribute("label");var _h3U1=this._hWG1(_hBO1);var _hA92 ='<div style="visibility:hidden; padding:4px 2px 2px 2px;"' + ( _h3U1?' title="' + _h3U1.F_HTMLEncode() + '"':'' ) + '>' +'<div style="height:1.5em; width:' + _hXG1 + '; text-align:left; font-size:8pt; overflow:hidden; text-overflow:ellipsis;' + ( _h052?"":"display:none;" ) + '">' + _h052 + '</div>' +'<img src="images/' + _hBO1.getAttribute( "icon" ) + '" style="width:' + _hXG1 + '; height:' + _hT91 + ';"/>' +'</div>';_hBO1.setAttribute("html", _hA92);}this._hAO1=new C_ListView(this._hR91, _h7O1, this);var _hSA=new C_ParallelAnimations();for(var _h552 in _hSM){var _hIU1=_hSM[_h552];var _hU91=this._hAO1.F_FindListItem("value", _h552);var _hIC2=U_DOM.F_GetRelativeOffset(this._hAO1.F_GetCustomHtmlElement(_hU91), this._hM31);_hSA.F_Push(new C_Move(_hIU1, this._hM31, _hIC2.top+1, _hIC2.left+1, null, 600, U_Easing.Cubic.F_EaseInOut));}_hSA.F_SetOnComplete(this._hKR.bind(this, _hSM, _hN31));_hSA.F_Play();};C_Chooser.prototype._hKR=function(_hSM,_hN31){var _hSA=new C_ParallelAnimations(null, this._hSI.bind(this));var nl=this._hAO1.F_GetListItems();var _hBZ1=nl.length;for(var i=0;i<_hBZ1;i++){var _hBO1=nl.item(i);var el=this._hAO1.F_GetCustomHtmlElement(_hBO1);el.style.visibility="visible";if(_hN31&&_hN31[_hBO1.getAttribute("value")]){this._hQ8(el, _hSA);}}_hSA.F_Play();for(var _h552 in _hSM){var el=_hSM[_h552];el.parentNode.removeChild(el);}};C_Chooser.prototype._hSI=function(){if(this._hXN1&&this._hXN1.F_Chooser_OnTransitionComplete){this._hXN1.F_Chooser_OnTransitionComplete(this);}};C_Chooser.prototype.F_ListView_OnItemClick=function(_hCO1,_hBO1,_hQ31){if(this._hXN1&&this._hXN1.F_Chooser_OnItemClick){this._hXN1.F_Chooser_OnItemClick(this, _hBO1, _hQ31);}};C_Chooser.prototype.F_ListView_OnItemDblClick=function(_hCO1,_hBO1){if(this._hXN1&&this._hXN1.F_Chooser_OnItemDblClick){setTimeout(this._hXN1.F_Chooser_OnItemDblClick.bind(this._hXN1, this, _hBO1), 0);}};
|