(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","jquery-ui","jquery-ui/ui/core","jquery-ui/ui/data","jquery-ui/ui/focusable","jquery-ui/ui/keycode","jquery-ui/ui/tabbable","jquery-ui/ui/version","jquery-ui/ui/widget","jquery-ui/ui/widgets/mouse","jquery-ui/ui/widgets/datepicker","jquery-ui/ui/widgets/draggable","jquery-ui/ui/widgets/droppable","jquery-ui/ui/widgets/mouse","jquery-ui/ui/widgets/resizable","./infragistics.core"],factory)}else{factory(jQuery)}})(function($){/*!@license * Infragistics.Web.ClientUI Combo 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.templating.js * infragistics.util.js * infragistics.util.jquery.js * infragistics.dataSource.js * infragistics.ui.widget.js * * Example to use: * * */ (function($){$.widget("ui.igCombo",$.ui.igWidget,{options:{width:null,height:null,dropDownWidth:null,dataSource:null,dataSourceType:null,dataSourceUrl:null,responseTotalRecCountKey:null,responseDataKey:null,responseDataType:null,responseContentType:null,requestType:"GET",valueKey:null,textKey:null,itemTemplate:null,headerTemplate:null,footerTemplate:null,inputName:null,animationShowDuration:100,animationHideDuration:100,dropDownAttachedToBody:true,filteringType:"local",filterExprUrlKey:null,filteringCondition:"contains",filteringLogic:"OR",noMatchFoundText:undefined,dropDownButtonTitle:undefined,clearButtonTitle:undefined,placeHolder:undefined,locale:{noMatchFoundText:undefined,dropDownButtonTitle:undefined,clearButtonTitle:undefined,placeHolder:undefined},loadOnDemandSettings:{enabled:false,pageSize:16},visibleItemsCount:15,mode:"editable",virtualization:false,multiSelection:{enabled:false,addWithKeyModifier:false,showCheckboxes:false,itemSeparator:", "},grouping:{key:null,dir:"asc"},validatorOptions:null,highlightMatchesMode:"multi",caseSensitive:false,autoSelectFirstMatch:true,autoComplete:false,allowCustomValue:false,closeDropDownOnBlur:true,delayInputChangeProcessing:250,tabIndex:null,dropDownOnFocus:false,closeDropDownOnSelect:true,selectItemBySpaceKey:false,initialSelectedItems:[{index:-1,value:null}],preventSubmitOnEnter:true,format:"auto",suppressKeyboard:false,enableClearButton:true,dropDownOrientation:"auto"},events:{rendered:"rendered",dataBinding:"dataBinding",dataBound:"dataBound",filtering:"filtering",filtered:"filtered",itemsRendering:"itemsRendering",itemsRendered:"itemsRendered",dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",selectionChanging:"selectionChanging",selectionChanged:"selectionChanged"},css:{comboWrapper:"ui-igcombo-wrapper",combo:"ui-igcombo ui-widget ui-state-default ui-corner-all ui-unselectable",dropDownMode:"ui-igcombo-mode-dropdown",readOnlyMode:"ui-igcombo-mode-readonly",readOnlyListMode:"ui-igcombo-mode-readonlylist",textBox:"ui-igcombo-textbox ui-state-default ui-corner-all",field:"ui-igcombo-field ui-corner-all",fieldHolder:"ui-igcombo-fieldholder",fieldHolderLTR:"ui-igcombo-fieldholder-ltr ui-corner-left",fieldHolderRTL:"ui-igcombo-fieldholder-rtl ui-corner-right",dropDownListRTL:"ig-rtl",button:"ui-igcombo-button ui-state-default ui-unselectable",buttonIcon:"ui-igcombo-buttonicon ui-icon-triangle-1-s ui-icon",buttonLTR:"ui-igcombo-button-ltr ui-corner-right",buttonRTL:"ui-igcombo-button-rtl ui-corner-left",clear:"ui-igcombo-clear ui-unselectable",clearRTL:"ui-igcombo-clear-rtl ui-unselectable",clearHover:"ui-igcombo-clear-hover ui-state-hover",clearIcon:"ui-igcombo-clearicon ui-icon-circle-close ui-icon",dropDown:"ui-igcombo-dropdown ui-widget ui-widget-content ui-corner-all",list:"ui-igcombo-list",listOverflow:"ui-igcombo-list-overflow",listItemHolder:"ui-igcombo-listitemholder",listItem:"ui-igcombo-listitem ui-state-default ui-unselectable",header:"ui-igcombo-header",footer:"ui-igcombo-footer",group:"ui-igcombo-group",groupHeader:"ui-igcombo-group-header ui-state-default ui-unselectable",itemInFocus:"ui-igcombo-item-in-focus",listItemHighlighted:"ui-igcombo-highlight",noMatchFound:"ui-igcombo-nomatchfound",listItemTextWithCheckbox:"ui-igcombo-listitemtextwithcheckbox",checkbox:"ui-igcombo-checkbox ui-state-default ui-corner-all ui-igcheckbox-small",checkboxOff:"ui-icon ui-igcombo-checkbox-off ui-igcheckbox-small-off",checkboxOn:"ui-icon ui-icon-check ui-igcombo-checkbox-on ui-igcheckbox-small-on",hiddenField:"ui-igcombo-hidden-field",hover:"ui-state-hover",active:"ui-state-active",unselectable:"ui-unselectable",noBorder:"ui-igcombo-no-border",scrollHolder:"ui-igcombo-scrollholder ui-unselectable",scroll:"ui-igcombo-scroll ui-unselectable",recordsView:"ui-igcombo-records-view",recordsData:"ui-igcombo-records-data",recordsServer:"ui-igcombo-records-server",recordsServerTotal:"ui-igcombo-records-server-total",loading:"ui-igcombo-loading",hidden:"ui-helper-hidden",disabled:"ui-state-disabled",orientationTop:"ui-igcombo-orientation-top",orientationBottom:"ui-igcombo-orientation-bottom"},RECORDS_VIEW:"{0}",RECORDS_DATA:"{1}",RECORDS_SERVER:"{2}",RECORDS_SERVER_TOTAL:"{3}",_createWidget:function(options){var mode;this._options={$window:$(window),$comboWrapper:null,$combo:null,$input:null,$hiddenInput:null,$fieldCont:null,$clearCont:null,$clearIcon:null,$dropDownBtnCont:null,$dropDownBtnIcon:null,$dropDownCont:null,$dropDownListCont:null,$dropDownList:null,$header:undefined,$footer:undefined,$dropDownScrollCont:null,$dropDownScroll:null,$loading:null,$noMatchFound:null,$itemsToSelectOnShiftUpDown:$(),$itemsToSelectOnShiftClick:$(),selectedData:[],keyNavItemData:null,autoSelectedItemData:null,autoCompleteItemData:null,inputVal:"",highlightElement:"span",ltr:true,dropDownOpened:false,deltaItemsForLoadOnDemand:5,dataBinding:false,shiftKeyCode:16,validator:null,shiftDown:false,nameAttribute:"",internalSelChangeSubs:[],initialDataBinding:true,remoteFilteringTriggerEvt:null,preventInputBlur:false,mouseDownStartedFromListItem:false,cachedData:[],strDataSource:null,updateInputValuesOnRemoteFilter:false,hasFooterVariables:false,hadInputSelectionOnKeydown:false,expression:null,preventItemSeparatorOnFocus:false,preventDropDownOnFocus:false,keyUpTimeout:null,repositionInterval:null,disableScroll:false,cachedGroupLength:null,dropDownModeSearchBy:"",dropDownModeSearchByResetTimeout:null,dropDownModeSearchByResetDelay:1e3,originalOptions:options,checkboxItemTemplate:""+""+"
{innerMarkup}
",scrollCallback:null,closingDropDownOnBlur:false,composition:null};if(options){mode=options.mode;if(options.multiSelection&&options.multiSelection.enabled&&options.closeDropDownOnSelect===undefined){options.closeDropDownOnSelect=false}if(mode==="readonly"||mode==="readonlylist"||mode==="dropdown"&&!(options.multiSelection&&options.multiSelection.enabled)&&options.enableClearButton===undefined){options.enableClearButton=false}}this._superApply(arguments)},_create:function(){this._handlers={windowResize:$.proxy(this._windowResize,this),documentMouseUp:$.proxy(this._documentMouseUp,this),inputFocus:$.proxy(this._inputFocus,this),inputBlur:$.proxy(this._inputBlur,this),inputClick:$.proxy(this._inputClick,this),inputKeyDown:$.proxy(this._inputKeyDown,this),inputPaste:$.proxy(this._inputPaste,this),inputKeyUp:$.proxy(this._inputKeyUp,this),inputKeyPress:$.proxy(this._inputKeyPress,this),inputMouseDown:$.proxy(this._inputMouseDown,this),inputCompositionUpdate:$.proxy(this._inputCompositionUpdate,this),inputCompositionEnd:$.proxy(this._inputCompositionEnd,this),inputInput:$.proxy(this._inputInputHandler,this)};this._analyzeOptions();this._analyzeInitialElem();this._render();this.validator();this._attachEvents();this.dataBind();this._initCompositionObject()},_analyzeOptions:function(){var key,firstDataItem,options=this.options,$combo=$(this.element),lod=options.loadOnDemandSettings;if(this.options.dataSource){if($.isArray(this.options.dataSource)){firstDataItem=this.options.dataSource[0]}else if(this.options.dataSource&&typeof this.options.dataSource._xmlToArray==="function"&&typeof this.options.dataSource._encodePkParams==="function"){firstDataItem=this.options.dataSource.data()[0]}}if(options.mode!=="editable"&&options.mode!=="dropdown"&&options.mode!=="readonly"&&options.mode!=="readonlylist"){options.mode="editable"}if(lod&&lod.enabled&&lod.pageSize&&options.loadOnDemandSettings.pageSize<5){lod.pageSize=5}else if(lod&&lod.enabled&&!lod.pageSize){lod.pageSize=this.options.visibleItemsCount+1}if(!options.textKey){if(options.valueKey){options.textKey=options.valueKey}else if(firstDataItem&&$.type(firstDataItem)==="object"){for(key in firstDataItem){if(firstDataItem.hasOwnProperty(key)){options.textKey=key;break}}}}if(!options.valueKey){options.valueKey=options.textKey}if(!options.textKey&&!options.valueKey){options.textKey="text";options.valueKey="value"}if(options.filteringType!=="local"&&options.filteringType!=="remote"&&options.filteringType!=="none"){options.filteringType="none"}if($combo.attr("name")&&this._options.originalOptions.inputName===undefined){options.inputName=$combo.attr("name")}if($combo.attr("multiple")==="multiple"&&(this._options.originalOptions.multiSelection===undefined||this._options.originalOptions.multiSelection.enabled===undefined)){this.options.multiSelection.enabled=true}if($combo.attr("dir")==="rtl"){this._options.ltr=false}if(this.options.grouping.key&&firstDataItem&&firstDataItem[this.options.grouping.key]===undefined){throw new Error(this._getLocaleValue("errorIncorrectGroupingKey"))}},_analyzeInitialElem:function(){var element=this.element,_options=this._options;if(element.is("div")||element.is("span")){_options.$comboWrapper=element}else if(element.is("input")){_options.$input=element;_options.nameAttribute=element.attr("name");element.removeAttr("name")}else if(element.is("select")){element.hide();_options.nameAttribute=element.attr("name");element.removeAttr("name")}},_setupInput:function(){var _options=this._options;_options.$input.attr({placeholder:this._getLocaleValue("placeHolder"),"data-localeid":"placeHolder","data-localeattr":"placeholder"});if(this.options.mode!=="editable"){_options.$input.attr({readonly:true,unselectable:"on"}).addClass(this.css.unselectable)}},_renderHeaderTemplate:function(css,options,parent){var $header,headerClass,$existingHeader;headerClass="."+css.header;$existingHeader=parent.find(headerClass);if($existingHeader.length){if(typeof options.headerTemplate==="string"){$existingHeader.remove()}}$header=$("
").addClass(css.header).html(options.headerTemplate);$header.prependTo(parent);this._options.$header=$header},_renderFooterTemplate:function(css,options,parent,combo){var $footer,footerMarkup,footerClass,$existingFooter;footerClass="."+css.footer;$existingFooter=parent.find(footerClass);if($existingFooter.length){if(typeof options.footerTemplate==="string"){$existingFooter.remove()}}footerMarkup=options.footerTemplate.replace(combo.RECORDS_VIEW,"").replace(combo.RECORDS_DATA,"").replace(combo.RECORDS_SERVER,"").replace(combo.RECORDS_SERVER_TOTAL,"");combo._options.hasFooterVariables=footerMarkup!==options.footerTemplate;if(combo._options.hasFooterVariables){$footer=$("
").addClass(css.footer).html(footerMarkup);$footer.appendTo(parent);combo._options.$footer=$footer;return}$footer=$("
").addClass(css.footer).html(footerMarkup);$footer.appendTo(parent);this._options.$footer=$footer},_render:function(){var css=this.css,options=this.options,_options=this._options,$comboWrapper=(_options.$comboWrapper||$("
")).addClass(css.comboWrapper),$combo=$("
").addClass(css.combo).attr("unselectable","on"),$input=(_options.$input||$("")).addClass(css.field).attr({tabIndex:options.tabIndex,autocomplete:"off"}),$hiddenInput=$("").addClass(css.hiddenField),$fieldCont=$("
").addClass(css.fieldHolder),$clearCont=$("
").addClass(css.clear).attr({unselectable:"on",title:this._getLocaleValue("clearButtonTitle"),"data-localeid":"clearButtonTitle","data-localeattr":"title"}),$clearIcon=$("
").addClass(css.clearIcon),$dropDownBtnCont=$("
").addClass(css.button).attr({unselectable:"on",title:this._getLocaleValue("dropDownButtonTitle"),"data-localeid":"dropDownButtonTitle","data-localeattr":"title"}),$dropDownBtnIcon=$("
").addClass(css.buttonIcon),$dropDownCont=$("
").addClass(css.dropDown).width(options.dropDownWidth),$dropDownListCont=$("
").addClass(css.list),$dropDownList=$(""}else{args.message=args.messages[0]||null}if(evt){this._trigger(this.events.validated,evt,args);this._trigger(this.events.error,evt,args)}if(this._skipMessages||!this._errorOnSubmitAllowed()){return}this._hideSuccess(options,evt);args={owner:this,message:args.message,target:options._$messageTarget?options._$messageTarget:options.notifyTarget,fieldOptions:args.fieldOptions};if(evt&&!this._trigger(this.events.errorShowing,evt,args)){return}this._ensureNotifier(options);if(options._$messageTarget){options._$messageTarget.removeClass("field-validation-valid").addClass("field-validation-error").html(args.message).show();options.notifyTarget.data("igNotifier")._setOption("state","error");options.notifyTarget.data("igNotifier")._setTargetState()}else{options.notifyTarget.igNotifier("notify","error",args.message)}if(evt){this._trigger(this.events.errorShown,evt,args)}this._addErrorOnSubmit()},_hideError:function(options,evt){var notifier=options._$messageTarget||options.notifyTarget.data("igNotifier"),args={owner:this,target:options._$messageTarget||options.notifyTarget,message:notifier._currentText||options._$messageTarget&&options._$messageTarget.text(),fieldOptions:options===this.options?null:options};if(this._hasVisibleError(options)){if(evt&&!this._trigger(this.events.errorHiding,evt,args)){return}notifier.hide();options.notifyTarget.data("igNotifier")._setTargetState(true);if(evt){this._trigger(this.events.errorHidden,evt,args)}}},_showSuccess:function(options,args,evt){if(this._skipMessages){return}this._hideError(options,evt);if(args.message){args={owner:this,message:args.message,target:options._$messageTarget?options._$messageTarget:options.notifyTarget,fieldOptions:args.fieldOptions};if(evt&&!this._trigger(this.events.successShowing,evt,args)){return}this._ensureNotifier(options);if(options._$messageTarget){options._$messageTarget.removeClass("field-validation-error").addClass("field-validation-valid").html(args.message).show();options.notifyTarget.data("igNotifier")._setOption("state","success");options.notifyTarget.data("igNotifier")._setTargetState()}else{options.notifyTarget.igNotifier("notify","success",args.message)}if(evt){this._trigger(this.events.successShown,evt,args)}}},_hideSuccess:function(options,evt){var notifier=options._$messageTarget||options.notifyTarget.data("igNotifier"),args={owner:this,target:options._$messageTarget||options.notifyTarget,message:notifier._currentText||options._$messageTarget&&options._$messageTarget.text(),fieldOptions:options===this.options?null:options};if(this._hasVisibleSuccess(options)){if(evt&&!this._trigger(this.events.successHiding,evt,args)){return}notifier.hide();if(evt){this._trigger(this.events.successHidden,evt,args)}}},_handleNotifierEvent:function(evt,ui,type,args){var state=ui.owner.options.state;args.message=ui.owner._currentText;if(state==="error"){return args.owner._trigger(this.events["error"+type],evt,args)}else if(state==="success"){return args.owner._trigger(this.events["success"+type],evt,args)}return true},_getTargetValue:function(options){if(options._control){if(options._control.options.checked!==undefined){return options._control.options.checked}else if(options._control.refreshValue&&options._control.options.allowCustomValue){options._control.refreshValue()}return options._control.value()}var $target=this._targetFromOptions(options);if(!$target.length){return null}switch(options._type){case"textarea":return $target.val().replace(/\r?\n/g,"\r\n");case"checkbox":return $target[0].checked;case"radio":case"checkboxrange":return options._group.filter(":checked").map(function(){return this.value}).get();case"input":case"select":case"selectrange":return $target.val()}return $target.val&&$target.val()},_getLocalizedMessage:function(key,postfix){key+=postfix||"Message";var message=this._getLocaleValue(key);if(!message&&$.ig&&$.ig.Validator&&$.ig.Validator.locale){message=this._getLocaleValue(key)}return message||""},_targetFromOptions:function(options,outer){if(outer&&options._control){if(options._control.editorContainer){return options._control.editorContainer()}else if(options._control.comboWrapper){return options._control.comboWrapper().children().first()}}if(options.selector){return options.selector instanceof $?options.selector:$(options.selector)}else{return this.element}},_getEditor:function(elem){var widgets=elem.data(),controls=["Editor","Combo","Rating","DatePicker","TimePicker"],regEx=new RegExp("ig.*?("+controls.join("|")+")");for(var i in widgets){if(widgets[i].widgetName&®Ex.test(widgets[i].widgetName)){return widgets[i]}}return null},_cleanupField:function(options){var element=this._targetFromOptions(options||this.options);element.unbind(".validator");if(options.notifyTarget&&options.notifyTarget.data("igNotifier")){options.notifyTarget.igNotifier("destroy").unbind(".validator")}this._clearMessageTarget(options);if(element.data("igValidatorField")){element.removeData("igValidatorField")}this._removeFieldIndications(options);if(options._control){if(options._control._options){options._control._options.validator=null}else{options._control._validator=null}}element.removeClass(this.css.target)},_addGlobalSettings:function(options){if(options===this.options){return options}var properties=["required","threshold","number","date","lengthRange","valueRange","email","creditCard","custom","onblur","onchange","onsubmit","successMessage","errorMessage","requiredIndication","optionalIndication","executeAllRules"],extendedOptions=$.extend({},options);for(var i=0;i=this.options.fields.length){return-1}return index},validate:function(field){var valid;this._forceValidation=true;valid=this._validate(field);this._forceValidation=false;return valid},isValid:function(field){this._skipMessages=true;var valid=this.validate(field);this._skipMessages=false;return valid},hide:function(field){var i;if(this.options.fields){if(field!==undefined){if((i=this._fieldIndexOf(field))>-1){this._hideError(this.options.fields[i]);this._hideSuccess(this.options.fields[i])}return}for(i=0;i-1&&this.options.fields[i].isValid!==undefined&&!this.options.fields[i].isValid){Array.prototype.push.apply(result,this.options.fields[i]._currentMessages)}return result}for(i=0;i-1){result=!result?this._fieldMessageVisible(this.options.fields[i]):result}return result}for(i=0;i-1){notifier=this.options.fields[i].notifyTarget&&this.options.fields[i].notifyTarget.data("igNotifier")}else{notifier=this.options.notifyTarget&&this.options.notifyTarget.data("igNotifier")}return notifier||null},addField:function(field){if(!this.options.fields){return}this.options.fields.push(field);this._initializeField($(field.selector),field);var options=this._addGlobalSettings(field);if(options.onsubmit){if(!this._formHandleCounter){this._attachToForm(true)}this._formHandleCounter++}},removeField:function(field){if(!this.options.fields){return}var index=this._fieldIndexOf(field);if(index>-1){var removed=this.options.fields.splice(index,1)[0],options=this._addGlobalSettings(removed);this._cleanupField(removed);if(options.onsubmit&&!--this._formHandleCounter){this._detachFromForm()}}},updateField:function(field,fieldOptions){if(!this.options.fields){return}var index=this._fieldIndexOf(field);if(index>-1){if(!fieldOptions){this._cleanupField(this.options.fields[index]);this._initializeField($(this.options.fields[index].selector),this.options.fields[index]);return}fieldOptions=$.extend({},this.options.fields[index],fieldOptions);var current=this._addGlobalSettings(this.options.fields[index]),options=this._addGlobalSettings(fieldOptions);this._cleanupField(current);this._initializeField($(fieldOptions.selector),fieldOptions);if(current.onsubmit&&!--this._formHandleCounter){this._detachFromForm()}if(options.onsubmit){if(!this._formHandleCounter){this._attachToForm(true)}this._formHandleCounter++}this.options.fields.splice(index,1,fieldOptions)}},destroy:function(){if(!this.options.fields){this._cleanupField(this.options)}else{for(var i=0;i-1){return this.groupMessageName}else{return this.name}},shouldRun:function(options){return options[this.name]},isValid:function(options,value){var internalValue=!isNaN(parseFloat(value))?value.toString():value;if(!internalValue||value.length===0){return false}return true}});$.ig.igValidatorControlRule=$.ig.igValidatorControlRule||$.ig.igValidatorBaseRule.extend({name:"control",getMessageType:function(){return"default"},getRuleMessage:function(options){return options.errorMessage||options._control._currentMessage||""},shouldRun:function(options,value){return options._control&&typeof options._control.isValid==="function"&&value},isValid:function(options){return options._control.isValid()}});$.ig.igValidatorNumberRule=$.ig.igValidatorNumberRule||$.ig.igValidatorBaseRule.extend({name:"number",_isNumber:function(options,value){if(typeof value==="number"){return true}else if(typeof value==="string"){return this._parseNumber(value,options)!==null}return false},_parseNumber:function(value,options){if(typeof value==="number"){return value}var decimalSeparator=options.number&&options.number.decimalSeparator,thousandsSeparator=options.number&&options.number.thousandsSeparator,thousandsRegEx,result;decimalSeparator=decimalSeparator||$.ui.igValidator.defaults.decimalSeparator;thousandsSeparator=thousandsSeparator||$.ui.igValidator.defaults.thousandsSeparator;thousandsRegEx=new RegExp("\\"+thousandsSeparator,"g");value=value.split(decimalSeparator);value[0]=value[0].replace(thousandsRegEx,"");result=value.join(".");if(result.length&&!isNaN(result)){return parseFloat(result)}return null},isValid:function(options,value){var internalValue=""+value;if(internalValue){return this._isNumber(options,value)}return true}});$.ig.igValidatorDateRule=$.ig.igValidatorDateRule||$.ig.igValidatorBaseRule.extend({name:"date",isValid:function(options,value){return value instanceof Date||!isNaN(new Date(value).getSeconds())}});$.ig.igValidatorLengthRule=$.ig.igValidatorLengthRule||$.ig.igValidatorBaseRule.extend({name:"lengthRange",_lastMessageType:"rangeLength",getMessageType:function(){return this._lastMessageType},isValid:function(options,value){if(value&&value.length){var min,max,messageSuffix=value.push?"Select":"Length",minLength=options.lengthRange.push?options.lengthRange[0]:options.lengthRange.min,maxLength=options.lengthRange.push?options.lengthRange[1]:options.lengthRange.max;min=minLength&&value.lengthmaxLength;if(minLength&&maxLength&&(min||max)){this._lastMessageType="range"+messageSuffix;this.formatItems=[minLength,maxLength]}else if(min){this._lastMessageType="min"+messageSuffix;this.formatItems=[minLength]}else if(max){this._lastMessageType="max"+messageSuffix;this.formatItems=[maxLength]}if(min||max){return false}}return true}});$.ig.igValidatorValueRule=$.ig.igValidatorValueRule||$.ig.igValidatorNumberRule.extend({name:"valueRange",_lastMessageType:"rangeValue",getMessageType:function(){return this._lastMessageType},isValid:function(options,value){var min=false,max=false,minValue,maxValue,hasMin,hasMax,isNumber=this._isNumber(options,value),isDateParsable=!isNaN(new Date(value).getSeconds());if(!isDateParsable&&!isNumber){return true}minValue=options.valueRange.push?options.valueRange[0]:options.valueRange.min;maxValue=options.valueRange.push?options.valueRange[1]:options.valueRange.max;hasMin=typeof minValue==="number"||minValue;hasMax=typeof maxValue==="number"||maxValue;if(!hasMin&&!hasMax){return true}if(isNumber&&!options.date){value=this._parseNumber(value,options);if(hasMin){min=valuemaxValue}}else if(isDateParsable&&!options.number){value=new Date(value);if(hasMin){minValue=new Date(minValue);min=valuemaxValue;maxValue=maxValue.toLocaleString()}}if(hasMin&&hasMax&&(min||max)){this._lastMessageType="rangeValue";this.formatItems=[minValue,maxValue]}else if(min){this._lastMessageType="minValue";this.formatItems=[minValue]}else if(max){this._lastMessageType="maxValue";this.formatItems=[maxValue]}return!(min||max)}});$.ig.igValidatorEqualToRule=$.ig.igValidatorEqualToRule||$.ig.igValidatorBaseRule.extend({name:"equalTo",isValid:function(options,value){var selector=options.equalTo.selector||options.equalTo,targetValue=this.validator._getTargetValue({_control:this.validator._getEditor($(selector)),selector:selector});if($.ig.util.compare(value,targetValue)){return false}return true}});$.ig.igValidatorEmailRule=$.ig.igValidatorEmailRule||$.ig.igValidatorBaseRule.extend({name:"email",isValid:function(options,value){return $.ui.igValidator.defaults.emailRegEx.test(value)}});$.ig.igValidatorPatternRule=$.ig.igValidatorPatternRule||$.ig.igValidatorBaseRule.extend({name:"pattern",isValid:function(options,value){var regEx=options.pattern.expresion||options.pattern.expression||options.pattern;regEx=regEx.test?regEx:new RegExp(regEx.toString());return regEx.test(value)}});$.ig.igValidatorCustomRule=$.ig.igValidatorCustomRule||$.ig.igValidatorBaseRule.extend({name:"custom",getMessageType:function(){return"default"},shouldRun:function(options){return options[this.name]},isValid:function(options,value){var fieldOptions=options===this.validator.options?null:options,func=options.custom.method||options.custom;if(typeof func==="string"&&typeof window[func]==="function"){func=window[func]}if(typeof func==="function"&&!func.apply(this.validator,[value,fieldOptions])){return false}return true}});$.ig.igValidatorCreditCardRule=$.ig.igValidatorCreditCardRule||$.ig.igValidatorBaseRule.extend({name:"creditCard",isValid:function(options,value){var val=value&&""+value,evenDigit=false,checksum=0;if(val){val=val.replace(/-/g,"");val=val.replace(/ /g,"");val=val.reverse();for(var i=0;i0){checksum+=digitValue%10;digitValue=Math.floor(digitValue/10)}}return checksum%10===0}return true}})})($);/*!@license * Infragistics.Web.ClientUI HtmlEditor 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.util.js * infragistics.util.jquery.js * infragistics.ui.widget.js * infragistics.ui.toolbarbutton.js * infragistics.ui.toolbar.js * infragistics.ui.popover.js * infragistics.ui.splitbutton.js * infragistics.ui.colorpicker.js * infragistics.ui.colorpickersplitbutton.js * infragistics.ui.combo.js * infragistics.ui.htmleditor-en.js * infragistics.ui.toolbar-en.js */ (function($){$.widget("ui.igHtmlEditor",$.ui.igWidget,{options:{showFormattingToolbar:true,showTextToolbar:true,showInsertObjectToolbar:true,showCopyPasteToolbar:true,width:725,height:350,toolbarSettings:[],customToolbars:[],inputName:"source",value:""},events:{rendered:"rendered",rendering:"rendering",actionExecuting:"actionExecuting",actionExecuted:"actionExecuted",toolbarCollapsing:"toolbarCollapsing",toolbarCollapsed:"toolbarCollapsed",toolbarExpanding:"toolbarExpanding",toolbarExpanded:"toolbarExpanded",cut:"cut",copy:"copy",paste:"paste",undo:"undo",redo:"redo",workspaceResized:"workspaceResized"},css:{htmlEditor:"ui-widget ui-widget-content ui-corner-all ui-ightmleditor ui-helper-clearfix",htmlEditorContent:"ui-ightmleditor-content",toolbarsContainer:"ui-igtoolbars-holder",pathFinder:"ui-igPathFinder",workspaceIframe:"ui-widget-content"},NODE:new $.ig.XmlNodeType,_toolbarsActiveState:{},_isDirty:false,_initDefaultToolbars:function(){this.defaultToolbars=[{name:"textToolbar",displayName:this._getLocaleValue("textToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"Bold",type:"button",scope:null,localeProperties:{"data-localeid":"boldButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:true},isBold:{value:false,action:"_isSelectedAction"},boldButtonTooltip:{value:this._getLocaleValue("boldButtonTitle"),action:"_tooltipAction"},boldButtonIcon:{value:"ui-igbutton-bold",action:"_buttonIconAction"}}},{name:"Italic",type:"button",language:this.options.language,localeProperties:{"data-localeid":"italicButtonTitle","data-localeattr":"title"},props:{isItalic:{value:false,action:"_isSelectedAction"},italicButtonTooltip:{value:this._getLocaleValue("italicButtonTitle"),action:"_tooltipAction"},italicButtonIcon:{value:"ui-igbutton-italic",action:"_buttonIconAction"}}},{name:"Underline",type:"button",language:this.options.language,localeProperties:{"data-localeid":"underlineButtonTitle","data-localeattr":"title"},props:{isUnderline:{value:false,action:"_isSelectedAction"},underlineButtonTooltip:{value:this._getLocaleValue("underlineButtonTitle"),action:"_tooltipAction"},underlineButtonIcon:{value:"ui-igbutton-underline",action:"_buttonIconAction"}}},{name:"Strikethrough",type:"button",language:this.options.language,localeProperties:{"data-localeid":"strikethroughButtonTitle","data-localeattr":"title"},props:{isStrikethrough:{value:false,action:"_isSelectedAction"},strikethroughButtonTooltip:{value:this._getLocaleValue("strikethroughButtonTitle"),action:"_tooltipAction"},strikethroughButtonIcon:{value:"ui-igbutton-strikethrough",action:"_buttonIconAction"}}},{name:"fontFamily",type:"combo",language:this.options.language,scope:null,handler:"_fontNamePlg",props:{fontFamilyComboWidth:{value:180,action:"_comboWidthAction"},fontFamilyComboHeight:{value:"",action:"_comboHeightAction"},fontFamilies:{value:this._getFontFamilies(),action:"_comboDataSourceAction"},selectedFontFamily:{value:"Times New Roman",action:"_comboSelectedItem"}}},{type:"combo",name:"fontSize",language:this.options.language,scope:null,handler:"_fontSizePlg",props:{fontSizeComboWidth:{value:75,action:"_comboWidthAction"},fontSizeComboHeight:{value:"",action:"_comboHeightAction"},fontSizes:{value:this._getLocaleValue("fontSizes"),action:"_comboDataSourceAction"},selectedFontSize:{value:"3",action:"_comboSelectedItem"},fontSizeItemsListWidth:{value:100,action:"_comboDropDownListWidth"}}},{type:"combo",name:"formatsList",language:this.options.language,scope:null,handler:"_formatsListPlg",props:{formatsListComboWidth:{value:170,action:"_comboWidthAction"},formatsListComboHeight:{value:"",action:"_comboHeightAction"},formatsList:{value:this._getLocaleValue("formatsList"),action:"_comboDataSourceAction"},selectedFormat:{value:"p",action:"_comboSelectedItem"}}}]},{name:"formattingToolbar",displayName:this._getLocaleValue("formattingToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"justifyleft",type:"button",localeProperties:{"data-localeid":"alignTextLeftButtonTitle","data-localeattr":"title"},props:{isJustifyLeft:{value:true,action:"_isSelectedAction"},justifyLeftButtonTooltip:{value:this._getLocaleValue("alignTextLeftButtonTitle"),action:"_tooltipAction"},justifyLeftButtonIcon:{value:"ui-igbutton-justifyleft",action:"_buttonIconAction"}}},{name:"justifycenter",type:"button",localeProperties:{"data-localeid":"alignTextCenterButtonTitle","data-localeattr":"title"},props:{isJustifyCenter:{value:false,action:"_isSelectedAction"},justifyCenterButtonTooltip:{value:this._getLocaleValue("alignTextCenterButtonTitle"),action:"_tooltipAction"},justifyCenterButtonIcon:{value:"ui-igbutton-justifycenter",action:"_buttonIconAction"}}},{name:"justifyright",type:"button",localeProperties:{"data-localeid":"alignTextRightButtonTitle","data-localeattr":"title"},props:{isJustifyRight:{value:false,action:"_isSelectedAction"},justifyRightButtonTooltip:{value:this._getLocaleValue("alignTextRightButtonTitle"),action:"_tooltipAction"},justifyRightButtonIcon:{value:"ui-igbutton-justifyright",action:"_buttonIconAction"}}},{name:"justifyfull",type:"button",localeProperties:{"data-localeid":"justifyButtonTitle","data-localeattr":"title"},props:{isJustifyFull:{value:false,action:"_isSelectedAction"},justifyFullButtonTooltip:{value:this._getLocaleValue("justifyButtonTitle"),action:"_tooltipAction"},justifyFullButtonIcon:{value:"ui-igbutton-justifyfull",action:"_buttonIconAction"}}},{name:"InsertUnorderedList",type:"button",localeProperties:{"data-localeid":"bulletsButtonTitle","data-localeattr":"title"},props:{isUnorderedList:{value:false,action:"_isSelectedAction"},insertUnorderedListTooltip:{value:this._getLocaleValue("bulletsButtonTitle"),action:"_tooltipAction"},insertUnorderedListButtonIcon:{value:"ui-igbutton-unorderedlist",action:"_buttonIconAction"}}},{name:"InsertOrderedList",type:"button",localeProperties:{"data-localeid":"numberingButtonTitle","data-localeattr":"title"},props:{isOrderedList:{value:false,action:"_isSelectedAction"},insertOrderedListTooltip:{value:this._getLocaleValue("numberingButtonTitle"),action:"_tooltipAction"},insertOrderedListButtonIcon:{value:"ui-igbutton-orderedlist",action:"_buttonIconAction"}}},{name:"outdent",type:"button",localeProperties:{"data-localeid":"decreaseIndentButtonTitle","data-localeattr":"title"},props:{outdentButtonTooltip:{value:this._getLocaleValue("decreaseIndentButtonTitle"),action:"_tooltipAction"},outdentButtonIcon:{value:"ui-igbutton-removeindent",action:"_buttonIconAction"}}},{name:"indent",type:"button",localeProperties:{"data-localeid":"increaseIndentButtonTitle","data-localeattr":"title"},props:{indentTooltip:{value:this._getLocaleValue("increaseIndentButtonTitle"),action:"_tooltipAction"},indentButtonIcon:{value:"ui-igbutton-indent",action:"_buttonIconAction"}}},{name:"textColor",type:"splitButtonColor",handler:"_fontColorPlg",localeProperties:{"data-localeid":"fontColorButtonTitle","data-localeattr":"title",title:this._getLocaleValue("fontColorButtonTitle")},props:{items:{value:[{name:"textColor",iconClass:"ui-igbutton-forecolor"}]},defaultItemName:{value:"textColor"},selectedTextColor:{value:"red",action:"_spltButtonColorAction"}}},{name:"backgroundTextColor",type:"splitButtonColor",handler:"_fontBackgroundColorPlg",localeProperties:{"data-localeid":"textHighlightButtonTitle","data-localeattr":"title",title:this._getLocaleValue("textHighlightButtonTitle")},props:{items:{value:[{name:"backgroundTextColor",iconClass:"ui-igbutton-backcolor"}]},defaultItemName:{value:"backgroundTextColor"},selectedTextBackgroundColor:{value:"",action:"_spltButtonColorAction"}}}]},{name:"insertObjectToolbar",displayName:this._getLocaleValue("insertObjectToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"image",type:"button",localeProperties:{"data-localeid":"insertPictureButtonTitle","data-localeattr":"title"},handler:"_insertImageDialogPlg",props:{isImage:{value:false,action:"_isSelectedAction"},imageButtonTooltip:{value:this._getLocaleValue("insertPictureButtonTitle"),action:"_tooltipAction"},imageButtonIcon:{value:"ui-igbutton-addimage",action:"_buttonIconAction"}}},{name:"link",type:"button",handler:"_insertLinkPlg",localeProperties:{"data-localeid":"insertLinkButtonTitle","data-localeattr":"title"},props:{isLink:{value:false,action:"_isSelectedAction"},linkButtonTooltip:{value:this._getLocaleValue("insertLinkButtonTitle"),action:"_tooltipAction"},linkButtonIcon:{value:"ui-igbutton-addlink",action:"_buttonIconAction"}}},{name:"table",type:"button",handler:"_insertTablePlg",localeProperties:{"data-localeid":"insertTableButtonTitle","data-localeattr":"title"},props:{isTable:{value:false,action:"_isSelectedAction"},tableButtonTooltip:{value:this._getLocaleValue("insertTableButtonTitle"),action:"_tooltipAction"},tableButtonIcon:{value:"ui-igbutton-table",action:"_buttonIconAction"}}},{name:"addRow",type:"button",handler:"_addTableRowPlg",localeProperties:{"data-localeid":"addRowButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isAddRow:{value:false,action:"_isSelectedAction"},addRowButtonTooltip:{value:this._getLocaleValue("addRowButtonTitle"),action:"_tooltipAction"},addRowButtonIcon:{value:"ui-igbutton-addrow",action:"_buttonIconAction"}}},{name:"addColumn",type:"button",handler:"_addTableColumnPlg",localeProperties:{"data-localeid":"addColumnButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isAddColumn:{value:false,action:"_isSelectedAction"},addColumnButtonTooltip:{value:this._getLocaleValue("addColumnButtonTitle"),action:"_tooltipAction"},addColumnButtonIcon:{value:"ui-igbutton-addcolumn",action:"_buttonIconAction"}}},{name:"removeRow",type:"button",handler:"_removeTableRowPlg",localeProperties:{"data-localeid":"removeRowButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isRemoveRow:{value:false,action:"_isSelectedAction"},removeRowButtonTooltip:{value:this._getLocaleValue("removeRowButtonTitle"),action:"_tooltipAction"},removeRowButtonIcon:{value:"ui-igbutton-removerow",action:"_buttonIconAction"}}},{name:"removeColumn",type:"button",handler:"_removeTableColumnPlg",localeProperties:{"data-localeid":"removeColumnButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isRemoveColumn:{value:false,action:"_isSelectedAction"},removeColumnButtonTooltip:{value:this._getLocaleValue("removeColumnButtonTitle"),action:"_tooltipAction"},removeColumnButtonIcon:{value:"ui-igbutton-removecolumn",action:"_buttonIconAction"}}}]},{name:"copyPasteToolbar",displayName:this._getLocaleValue("copyPasteToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"copy",type:"button",scope:null,localeProperties:{"data-localeid":"copyButtonTitle","data-localeattr":"title"},props:{isCopy:{value:false,action:"_isSelectedAction"},copyButtonTooltip:{value:this._getLocaleValue("copyButtonTitle"),action:"_tooltipAction"},copyButtonIcon:{value:"ui-igbutton-copy",action:"_buttonIconAction"}}},{name:"cut",type:"button",scope:null,localeProperties:{"data-localeid":"cutButtonTitle","data-localeattr":"title"},props:{isCut:{value:false,action:"_isSelectedAction"},cutButtonTooltip:{value:this._getLocaleValue("cutButtonTitle"),action:"_tooltipAction"},cutButtonIcon:{value:"ui-igbutton-cut",action:"_buttonIconAction"}}},{name:"paste",type:"button",scope:null,localeProperties:{"data-localeid":"pasteButtonTitle","data-localeattr":"title"},props:{isPaste:{value:false,action:"_isSelectedAction"},pasteButtonTooltip:{value:this._getLocaleValue("pasteButtonTitle"),action:"_tooltipAction"},pasteButtonIcon:{value:"ui-igbutton-paste",action:"_buttonIconAction"}}},{name:"undo",type:"button",scope:null,localeProperties:{"data-localeid":"undoButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isUndo:{value:false,action:"_isSelectedAction"},undoButtonTooltip:{value:this._getLocaleValue("undoButtonTitle"),action:"_tooltipAction"},undoButtonIcon:{value:"ui-igbutton-undo",action:"_buttonIconAction"}}},{name:"redo",type:"button",scope:null,localeProperties:{"data-localeid":"redoButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isRedo:{value:false,action:"_isSelectedAction"},redoButtonTooltip:{value:this._getLocaleValue("redoButtonTitle"),action:"_tooltipAction"},redoButtonIcon:{value:"ui-igbutton-redo",action:"_buttonIconAction"}}}]}]},_createWidget:function(){this._superApply(arguments)},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_render:function(){var html="",inputName=this.options.inputName;this.element.addClass(this.css.htmlEditor);html+='
';html+='
';html+='';html+='';html+="
";$(html).appendTo(this.element);$("#"+this._id("_source")).hide();this.element.height(this.options.height);this.element.width(this.options.width)},_createWorkspace:function(content){var iFrameContent="<"+"!"+"DOCTYPE html"+">"+""+""+"igHtmlEditor"+""+''+"

";if(!document.all){iFrameContent+="
"}iFrameContent+="

";this.workspace=this.element.find("#"+this._id("_editor"))[0];this.workspace.contentWindow.document.open("text/html","replace");this.workspace.contentWindow.document.write(iFrameContent);this.workspace.contentWindow.document.close();if(content&&content.length>0){$(this.workspace).contents().find("body").html(content)}if($.ig.util.isWebKit){this.workspace.contentWindow.document.body.contentEditable=true}if(!document.all){var showUI=false,comandValue=true;this.workspace.contentWindow.document.execCommand("styleWithCSS",showUI,comandValue)}},_getToolbar:function(index){if(!isNaN(parseInt(index,10))){return this._toolbars.eq(index)}if(typeof index==="string"){return this._toolbars.find("#"+this._id("_toolbars_"+index))}},_getToolbarSettings:function(name){var curToolbar,result,i;for(i=0;i${text}',height:this._comboHeight,dropDownOrientation:"bottom"})},_initFormatsListCombo:function(){var formatsListCombo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList");formatsListCombo.igCombo("option",{language:this.options.language,itemTemplate:'<${text} unselectable="on">${value}',height:this._comboHeight,dropDownOrientation:"bottom"})},_initFontSizeCombo:function(){var fontSizesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize");fontSizesCombo.igCombo("option",{language:this.options.language,itemTemplate:'${value}',height:this._comboHeight,dropDownOrientation:"bottom"})},_getFontFamilies:function(){return this._getLocaleValue("fontNames")[/^win/gi.test(navigator.platform)?"win":"mac"]},_setOption:function(name,value){var self=this;if(name===undefined||value===undefined){return}if(name==="toolbarSettings"){$.each(value,function(index,toolbar){$.each(toolbar,function(tbPropName,tbPropVal){if(tbPropName!=="name"){self._getToolbar(self._allToolbars[index].name).igToolbar("option",tbPropName,tbPropVal)}})})}else if(this._toolbarsActiveState[name]){this._showToolbar(this._toolbarsActiveState[name].name,value)}else if(name==="width"){this.element.width(value)}else if(name==="height"){this.element.height(value);this.resizeWorkspace()}else if(name==="value"){this.setContent(value,"text")}this._super(name,value)},_changeLocaleForToolbars:function(){this._allToolbars.forEach(function(toolbar){this._getToolbar(toolbar.name).igToolbar("option",{displayName:this._getLocaleValue(toolbar.name),language:this.options.language})},this)},changeLocale:function(){this._superApply(arguments);this._changeLocaleForToolbars();if(this._insertLinkDialog){this._insertLinkDialog.remove();this._insertLinkDialog=null}if(this._imageDialog){this._imageDialog.remove();this._imageDialog=null}this._changeLocaleForFontFamilies();this._changeLocaleForFontSizes();this._changeLocaleForFormatsList()},_changeLocaleForFontFamilies:function(){var selectedValue,$combo=this._getToolbar("textToolbar").igToolbar("getItem","fontFamily"),comboInstance=$combo.data("igCombo");if(comboInstance){selectedValue=comboInstance.value();comboInstance._setOption("dataSource",this._getFontFamilies());comboInstance._setOption("language",this.options.language);comboInstance.value(selectedValue)}},_changeLocaleForFontSizes:function(){var selectedValue,$combo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize"),comboInstance=$combo.data("igCombo");if(comboInstance){selectedValue=comboInstance.value();comboInstance._setOption("dataSource",this._getLocaleValue("fontSizes"));comboInstance._setOption("language",this.options.language);comboInstance.value(selectedValue)}},_changeLocaleForFormatsList:function(){var selectedValue,$combo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList"),comboInstance=$combo.data("igCombo");if(comboInstance){selectedValue=comboInstance.value();comboInstance._setOption("dataSource",this._getLocaleValue("formatsList"));comboInstance._setOption("language",this.options.language);comboInstance.value(selectedValue)}},_showToolbar:function(name,show){if(show){this._getToolbar(name).removeClass("hidden").show()}else{this._getToolbar(name).addClass("hidden").hide()}},_initToolbars:function(){this._allToolbars=$.extend(true,[],this.defaultToolbars.concat(this.options.customToolbars));this._toolbars=this.element.find("#"+this._id("_toolbars"));this._mergeToolbarSettings();this._createToolbars()},_mergeToolbarSettings:function(){var customSettings=this.options.toolbarSettings,curSettings,curCustomSettings,curName,items,curItem,curItemProps,propFound,property,i,j;for(i=0;i").attr("id",this._id("_toolbars")+"_"+curName).appendTo(this._toolbars).igToolbar(curSettings);if(options[showToolbarOption]!==undefined){showToolbar=options[showToolbarOption]}this._toolbarsActiveState[showToolbarOption]={name:curName,value:showToolbar};this._showToolbar(curName,showToolbar)}if($.ig.util.isIE){this._toolbars.find("*").attr("unselectable","on")}},_initialWorkspaceFormatting:function(){var i,curSettings,property,command,args,toolbarSettings=this.options.toolbarSettings,commands={isBold:"bold",isItalic:"italic",isUnderline:"underline",isStrikethrough:"strikethrough",isJustifyLeft:"justifyleft",isJustifyRight:"justifyright",isJustifyCenter:"justifycenter",isJustifyFull:"justifyfull",isUnorderedList:"InsertUnorderedList",isOrderedList:"InsertOrderedList"},argsCommands={selectedFontFamily:"fontName",selectedFontSize:"fontSize",selectedFormat:"formatBlock",selectedTextColor:"forecolor",selectedTextBackgroundColor:"backcolor"};for(i=0;i"}this._initialSelectionSetup();this._execCommand(command,args);this._emptyAndCollapseSelection()}}}}},_initialSelectionSetup:function(){var lastNode=$(this.contentDocument()).find(":not(br)").last(),sel=this._selectionWrapperSaved._getSelection(),range=this._selectionWrapperSaved._getRange();lastNode.html(" ");range.selectNode(lastNode[0]);sel.removeAllRanges();sel.addRange(range)},_emptyAndCollapseSelection:function(){var lastNode=$(this.contentDocument()).find(":not(br)").last(),sel=this._selectionWrapperSaved._getSelection(),range=this._selectionWrapperSaved._getRange();lastNode.html("
");if(lastNode.length>0){range.setStart(lastNode[0],0);range.setEnd(lastNode[0],0);range.collapse(true);sel.removeAllRanges();sel.addRange(range)}},_execCommand:function(name,args){this._selectionWrapperSaved.focus();if($.ig.util.isIE){this._selectionWrapperSaved._updateSelection(this._selectionWrapperSaved._getRange())}this._selectionWrapperSaved.execCommand(name.toLowerCase(),args);this._onSelectionChange()},_hideDialogs:function(){this.element.find(":ui-igLinkPropertiesDialog").igLinkPropertiesDialog("hide");this.element.find(":ui-igTablePropertiesDialog").igTablePropertiesDialog("hide");this.element.find(":ui-igImagePropertiesDialog").igImagePropertiesDialog("hide")},_bindToToolbarEvents:function(){var self=this,events="igtoolbartoolbarbuttonclick igtoolbartoolbarcomboselected "+"igtoolbartoolbarcustomitemclick igtoolbarcollapsing "+"igtoolbarcollapsed igtoolbarexpanding igtoolbarexpanded",splitBtnArrowSelector=".ui-splitbutton-arrow",toolbarEvents={igtoolbarcollapsing:this.events.toolbarCollapsing,igtoolbarcollapsed:this.events.toolbarCollapsed,igtoolbarexpanding:this.events.toolbarExpanding,igtoolbarexpanded:this.events.toolbarExpanded};this._toolbars.delegate(":ui-igToolbar",events,function _onToolbarItemClick(e,ui){var scope=ui.scope,handler=ui.handler,$eTarget=$(e.originalEvent.currentTarget),noCancel;delete ui.scope;delete ui.handler;self._hideDialogs();if($eTarget.is(splitBtnArrowSelector)){e.stopImmediatePropagation();return}if(toolbarEvents.hasOwnProperty(e.type)){self.resizeWorkspace();self._trigger(toolbarEvents[e.type],e,ui);return}ui.selectedItem=self._selectionWrapperSaved&&self._selectionWrapperSaved.getSelectedItem();noCancel=self._trigger(self.events.actionExecuting,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});if(noCancel){if(!handler&&!scope){self._execCommand(ui.name,ui.value)}else if(handler&&!scope){self[handler](self.workspace.contentWindow.document,ui)}else if(handler&&scope){handler.call(ui.scope,self.workspace.contentWindow.document,ui)}self._trigger(self.events.actionExecuted,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});e.stopImmediatePropagation()}})},_bindWorkspaceEvents:function(){var self=this,$workspaceDocument=$(this.contentDocument()),$workspaceBody=$(this.contentEditable()),KEYS={webKitIE:{CTRLZ:90,CTRLY:89},moz:{CTRLZ:90,CTRLY:89}};$workspaceDocument.find("html").bind("click",function(e){var target=$(e.target);if(target.is("html")){self.workspace.contentWindow.document.body.focus()}self._isDirty=true;self._hideDialogs();e.stopPropagation()}).bind("mouseup",function(){self._onSelectionChange()});$workspaceDocument.bind("keydown",function(e){var $children,$firstChild;self._isDirty=true;if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLZ||e.which===KEYS.moz.CTRLZ)){self._trigger(self.events.undo,e,{owner:self})}if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLY||e.which===KEYS.moz.CTRLY)){self._trigger(self.events.redo,e,{owner:self})}if(e.keyCode===8||e.keyCode===46){$children=$workspaceBody.children();$firstChild=$children.first();if($children.length===1&&$firstChild.html()==="
"){e.preventDefault()}}self._onSelectionChange()});$workspaceDocument.bind("cut copy paste",function(e){self._trigger(e.type,e,{owner:self})});this.element.bind("ightmleditoractionexecuted",function(e,ui){if(ui.actionName.toLowerCase()===self.events.undo||ui.actionName.toLowerCase()===self.events.redo){self._trigger(ui.actionName.toLowerCase(),e,{owner:self});e.stopImmediatePropagation()}});$(document).click(function(e){var $tarParents=$(e.target).parents();if(!$tarParents.is(".ui-igpopover")&&!$tarParents.is(".ui-igcombo-list")){self._hideDialogs()}});$(window).on("resize",$.proxy(this._resizeWorkspaceHandler,this))},_viewSource:function(){var workspace=$(this.workspace),workSpaceBody=workspace.contents().find("body");if(workspace.is(":visible")){workSpaceBody.attr("contentEditable",false);this.sourceWindow.val($.trim(workSpaceBody.html()));workspace.hide();this.sourceWindow.show()}else{workSpaceBody.attr("contentEditable",true);workSpaceBody.html($.trim(this.sourceWindow.val()));workspace.show();this.sourceWindow.hide();this.sourceWindow.val(encodeURIComponent(this.sourceWindow.val()))}},_viewSourcePlg:function(){this._viewSource()},_insertImageDialogPlg:function(workspace,plgUI){var image=$("",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("img")){image=plgUI.selectedItem}this._imageDialog=$("#"+this._id("_imageDialog"));if(!this._imageDialog.length){this._imageDialog=$('
').appendTo(this.element).igImagePropertiesDialog({item:image,target:plgUI.toolbarItem,language:this.options.language,locale:this.options.locale,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.image)}})}else{if(this._imageDialog.igImagePropertiesDialog("option","isHidden")){this._imageDialog.igImagePropertiesDialog("show",image)}else{this._imageDialog.igImagePropertiesDialog("hide",image)}}},_insertLinkPlg:function(workspace,ui){var self=this,selectedItem=this._selectionWrapperSaved.getSelectedItem(),selectedItemNodeType=selectedItem[0].nodeType,anchor=$("",this.workspace.contentWindow.document);if(selectedItem.parent().is("a")){anchor=selectedItem.parent()}else if(selectedItemNodeType===this.NODE._Text||selectedItemNodeType===this.NODE._Element){anchor.html(this._selectionWrapperSaved.getSelectionAsText())}if(!this._insertLinkDialog){this._insertLinkDialog=$('
').appendTo(this.element).igLinkPropertiesDialog({item:anchor,target:ui.toolbarItem,language:this.options.language,locale:this.options.locale,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.anchor)}})}else{if(this._insertLinkDialog.igLinkPropertiesDialog("option","isHidden")){this._insertLinkDialog.igLinkPropertiesDialog("show",anchor)}else{this._insertLinkDialog.igLinkPropertiesDialog("hide",anchor)}}},_fontNamePlg:function(workspace,ui){this._execCommand("fontname",ui.value)},_fontSizePlg:function(workspace,ui){this._execCommand("fontsize",ui.value)},_formatsListPlg:function(workspace,ui){this._execCommand("formatBlock","<"+ui.value+">")},_insertTablePlg:function(workspace,plgUI){var table=$("
",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("table")){table=plgUI.selectedItem}if(!this.insertTableDialog){this.insertTableDialog=$("
").appendTo(this.element).igTablePropertiesDialog({item:table,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.insertTable(ui.table)}});return}if(this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("show",table);return}if(!this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("hide")}},_addTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addRow",selectedItem.parent().index())}},_removeTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeRow",selectedItem.parent().index())}},_addTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addColumn",selectedItem.index())}},_removeTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeColumn",selectedItem.index())}},_fontColorPlg:function(workspace,ui){if(/^rgb/.test(ui.value)){ui.value=$.ig.util.rgbToHex(ui.value)}this._execCommand("forecolor",ui.value)},_fontBackgroundColorPlg:function(workspace,ui){var command=this._getFirefoxVersion()?"hilitecolor":"backcolor";this._execCommand(command,ui.value)},_domPathToolbar:function(){var self=this,tableItemPref="#"+this._id("_toolbars_insertObjectToolbar_item_"),tableItemAddRowID=tableItemPref+"addRow",tableItemAddColID=tableItemPref+"addColumn",tableItemRemRowID=tableItemPref+"removeRow",tableItemRemColID=tableItemPref+"removeColumn",doNotEnableToolbarButtonsSelector=tableItemAddRowID+", "+tableItemAddColID+", "+tableItemRemRowID+", "+tableItemRemColID;this._viewSourceBtn=$('
').appendTo(this.element).igButton({labelText:" ",title:this._getLocaleValue("viewSourceButtonTitle"),icons:{primary:"ui-igbutton-viewsource-icon"},onlyIcons:true,click:function(){self._viewSourcePlg();if(self._domPathToolbar.igPathFinder("option","disabled")){self._domPathToolbar.igPathFinder("option","disabled",false); self._toolbars.find(":ui-igToolbarButton").not(doNotEnableToolbarButtonsSelector).igToolbarButton("option","disabled",false).end().end().find(":ui-igCombo").igCombo("enable");self._analyser._disableUnsupportedItems();self._onSelectionChange()}else{self._domPathToolbar.igPathFinder("option","disabled",true);self._toolbars.find(":ui-igToolbarButton").igToolbarButton("option","disabled",true).end().find(":ui-igCombo").igCombo("disable")}}}).attr({"data-localeid":"viewSourceButtonTitle","data-localeattr":"title"});this._domPathToolbar=$('
').appendTo(this.element).igPathFinder({click:function(e,ui){var selectionWrapper=self._selectionWrapperSaved;self.workspace.contentWindow.document.body.focus();if(self._domPathToolbar.igPathFinder("option","disabled")){return}e.preventDefault();if(ui.item.is("html")){selectionWrapper.select(ui.item.children("body"))}else if(ui.item.is("body")){selectionWrapper.select(ui.item)}else{selectionWrapper.select(ui.item)}}})},_onSelectionChange:function(callback){var self=this,selectionWrapper,workSpaceBody=$(this.workspace).contents().find("body"),selectionCallback=callback||function(){var selectedItem=this.getSelectedItem();if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("span").length>0){selectedItem=selectedItem.children("span").first()}else if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("font").length>0){selectedItem=selectedItem.children("font").first()}if(selectedItem[0].nodeType===self.NODE._Text){selectedItem=selectedItem.parent()}self._analyser.analyse(selectedItem);if(selectedItem.length){self._domPathToolbar.igPathFinder("option","items",$.merge(selectedItem,selectedItem.parents()))}};selectionWrapper=new $.ig.SelectionWrapper(this.workspace.contentWindow,function(){self._selectionWrapperSaved=this;self.sourceWindow.val(encodeURIComponent(workSpaceBody.html()));selectionCallback.call(this)})},_destroyPopovers:function(){var el=this.element[0];$(':data("igPopover")').each(function(){if($.contains(el,this)){$(this).igPopover("destroy")}})},resizeWorkspace:function(){var $clonedElement,height=this.element.height(),$editor=$("#"+this._id("_editor")),$toolbars=$("#"+this._id("_toolbars"));if(!$toolbars.is(":visible")){$clonedElement=$toolbars.clone();$clonedElement.css({display:"initial",position:"absolute",top:"-10000px",width:this.element.width()});$("body").append($clonedElement);height-=$clonedElement.height()+$toolbars.outerHeight(true);$clonedElement.remove()}else{height-=$toolbars.outerHeight(true)}height-=$(".ui-igbutton-viewsource").outerHeight(true);height-=$editor.outerHeight(true)-$editor.height();$editor.height(height);$("#"+this._id("_source")).height(height)},getContent:function(format){if(format==="text"){return $(this.workspace).contents().find("body").text()}if(format==="html"){return $(this.workspace).contents().find("body").html()}},setContent:function(content,format){if(format==="text"){$(this.workspace).contents().find("body").text(content)}else if(format==="html"){$(this.workspace).contents().find("body").html(content)}this.sourceWindow.val(encodeURIComponent(content))},destroy:function(){this._superApply(arguments);$(this.workspace.contentWindow).undelegate();this._destroyPopovers();this._viewSourceBtn.igButton("destroy");this.element.removeClass(this.css.htmlEditor).find("#"+this._id("_content")).removeClass(this.css.htmlEditorContent).end().find("#"+this._id("_domPathToolbar")).removeClass(this.css.pathFinder).end().find("#"+this._id("_toolbars")).removeClass(this.css.toolbarsContainer).end().find(":ui-igToolbar").igToolbar("destroy").end().empty()},executeAction:function(actionName,args){this._selectionWrapperSaved.execCommand(actionName.toLowerCase(),args);this._onSelectionChange()},isDirty:function(){return this._isDirty},contentWindow:function(){return this.workspace.contentWindow},contentDocument:function(){return this.contentWindow().document},contentEditable:function(){return this.contentDocument().body},selection:function(){return this._selectionWrapperSaved._getSelection()},range:function(){return this._selectionWrapperSaved._getRange()},insertAtCaret:function(element){var el,range;if($.ig.util.isDomElement(element)){element=$(element)}if(element instanceof $){element=$("
").append(element).html()}else if(typeof element!=="string"){return}el=$(element,this._selectionWrapperSaved._document)[0];range=this.range();range.insertNode(el)}});$.widget("ui.igPathFinder",{options:{items:null},css:{button:"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only "+"ui-igbutton ui-widget-content",buttonLabel:"ui-button-text",stateDefault:"ui-state-default",firstButton:"ui-first-button",overflowMarker:"ui-igpathfinder-overflowMarker"},_create:function(){var self=this,o=this.options;this._addStyles();this.element.attr("disabled",o.disabled).attr("aria-disabled",o.disabled).on("mouseover","div",function(){if(!o.disabled){$(this).addClass("ui-state-hover")}}).on("mouseleave","div",function(){if(!o.disabled){$(this).removeClass("ui-state-hover")}}).on("click","div",function(e){if(!o.disabled){$(this).siblings(".ui-state-active").removeClass("ui-state-active");$(this).addClass("ui-state-active");self._trigger("click",e,{item:self.options.__currentParents.eq(self.options.__currentButtonList.index(this))})}})},_addStyles:function(){this.element.addClass("ui-igPathFinder")},_setOption:function(name,value){$.Widget.prototype._setOption.apply(this,arguments);switch(name){case"items":this._updateToolbar();break;case"disabled":this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value);break;default:break}},_addOverflowMarker:function(){var overflowMarker=$("
...
").addClass(this.css.overflowMarker).addClass(this.css.stateDefault);overflowMarker.prependTo(this.element)},_updateToolbar:function(){var i,parents,btn,buttonsList,self=this,o=this.options,path=[],html="",viewSrcBtn=$(".ui-igbutton-viewsource"),overflowMarkerWidth=20,maxWidth=viewSrcBtn.parent().width()-viewSrcBtn.outerWidth(true)-overflowMarkerWidth,maxWidthReached=false;if(o.items.length){o.items.each(function(index,element){html='
'+''+element.nodeName+""+"
";path.push(html)});this.element.empty();parents=$(o.items.toArray().reverse());buttonsList=$(path.reverse().join(""));for(i=buttonsList.length-1;i>=0&&!maxWidthReached;i--){buttonsList.removeClass(this.css.firstButton);btn=buttonsList.eq(i).addClass(this.css.firstButton).prependTo(this.element);if(i===0){maxWidth+=overflowMarkerWidth}if(this.element.outerWidth(true)>maxWidth){btn.remove();buttonsList.eq(i+1).addClass(this.css.firstButton);this._addOverflowMarker();maxWidthReached=true}}this.options.__currentButtonList=buttonsList;this.options.__currentParents=parents}}});$.widget("ui.igHtmlEditorPopover",$.ui.igWidget,{localeWidgetName:"HtmlEditor",options:{item:null,target:null,isHidden:true},css:{igHtmlEditorPropertiesDialog:"ui-ightmleditor-dialog",igHtmlEditorPropertiesDialogContainer:"ui-ightmleditor-dialog-container"},events:{apply:"applyform",cancel:"cancelform",show:"show",hide:"hide"},_id:function(id){return this.element[0].id+id},_create:function(){this.element.igPopover({closeOnBlur:false,position:"balanced",direction:"bottom",renderCloseButton:false,showOn:null,maxWidth:"90%",width:"95%",maxHeight:"300px",minWidth:"160px"});this.poContent=this.element.igPopover("container");this._createForm()},_init:function(){this._item=this.options.item;this.poContent.addClass(this.css.igHtmlEditorPropertiesDialog);this.element.addClass(this.css.igHtmlEditorPropertiesDialogContainer);this._attachFormEvents();this.show(this._item)},_createForm:function(){},_attachFormEvents:function(){},_dataBind:function(){},show:function(item){this._item=item;this._dataBind(item);this.options.isHidden=false;this.element.igPopover("show",this.options.target);this._trigger(this.events.show)},hide:function(){this.options.isHidden=true;if(this.options.target.igToolbarButton("option","isSelected")){this.options.target.igToolbarButton("toggle")}this.element.igPopover("hide");this._trigger(this.events.hide)}});$.widget("ui.igLinkPropertiesDialog",$.ui.igHtmlEditorPopover,{_txtUrl:"",_cbTarget:"",_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_cmbOpenIn")).igCombo({initialSelectedItems:[{index:0}],enableClearButton:false,width:"100%",mode:"dropdown"});this.poContent.find("#"+this._id("_btnCancel")).igButton({click:function(){self.hide()}});this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){e.stopImmediatePropagation();self._item.attr({href:self._txtUrl.val(),target:self._cbTarget.igCombo("value")}).html(self._displayText.val().length>0?self._displayText.val():self._txtUrl.val());self._trigger(self.events.apply,e,{anchor:self._item});self.hide()}});this.poContent.bind("keypress",function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){self.hide()}});this.element.bind("igpopovershown",function(){self.poContent.find("#"+self._id("_linkHref")).focus()})},_createForm:function(){var html="";html+="
"+'
    '+"
  1. "+'"+''+"
  2. "+"
  3. "+'"+''+"
  4. "+"
  5. "+'"+'"+"
  6. "+'
  7. '+'"+'"+"
  8. "+"
"+"
";$(html).appendTo(this.poContent)},_dataBind:function(anchor){this._txtUrl=this.poContent.find("#"+this._id("_linkHref")).val(anchor.attr("href"));this._cbTarget=this.poContent.find("#"+this._id("_cmbOpenIn")).val(anchor.attr("target"));this._displayText=this.poContent.find("#"+this._id("_linkDisplayText")).val(anchor.html())}});$.widget("ui.igTablePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this.rowsNumField=this.element.find("#"+this._id("_tableRows"));this.columnsNumField=this.element.find("#"+this._id("_tableColumns"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="
"+'
    '+"
  1. "+"
  2. "+"
  3. "+'
    '+''+''+"
    "+"
  4. "+"
"+"
";$(html).appendTo(this.poContent);this._sampleTable=$('
').tableManipulator({rows:8,columns:6}).appendTo(this.poContent.find(".layoutList li:first"))},_attachFormEvents:function(){var tablePreview=this.poContent.find("table"),cells=tablePreview.find("td").addClass("ui-state-default"),rows=tablePreview.find("tr"),self=this;tablePreview.delegate("td","mouseover",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1,i;cells.removeClass("ui-state-hover");for(i=0;i';html+="
";html+='
    ';html+="
  1. ";html+=' ";html+=' ';html+="
  2. ";html+="
  3. ";html+=' ";html+=' ';html+="
  4. ";html+='
  5. ';html+=' ";html+=' ";html+="
  6. ";html+="
";html+="
";html+="
";this.poContent.append(html)},_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){self._item.attr({src:self._imgSrcFld.val(),alt:self._imgAltFld.val()});self._trigger(self.events.apply,e,{image:self._item});self.hide()}}).end().find("#"+this._id("_btnCancel")).igButton({click:function(e){self._trigger(self.events.cancel,e);self.hide()}})},_dataBind:function(image){this._imgSrcFld.val(image.attr("src"));this._imgAltFld.val(image.attr("alt"))}});var table,tableNumRows=0,tableNumCols=0,settings={document:document,rows:0,columns:0,addSpacingChar:false},spacingChar="",methods={init:function(options){return this.each(function(){var tRows;$.extend(settings,options);if(this.nodeName.toLowerCase()!=="table"){return}if(settings.addSpacingChar){spacingChar=" "}table=$(this);tRows=methods.getTableRows();if(settings.rows&&settings.rows>0){tableNumRows=settings.rows}else{tableNumRows=tRows.length}if(settings.columns&&settings.columns>0){tableNumCols=settings.columns}else if(tRows[0]){tableNumCols=tRows[0].cells.length}if(!table.children().length){methods.create()}})},create:function(){var newRow,i,j;table.empty();for(i=0;i",settings.document).appendTo(table);for(j=0;j"+spacingChar+"",settings.document).appendTo(newRow)}}},addRow:function(position){var newRow=$("",settings.document),j;if(position!==undefined){newRow.insertAfter(methods.getTableRows().eq(position))}else{newRow.appendTo(table)}for(j=0;j"+spacingChar+"",settings.document).appendTo(newRow)}return newRow},removeRow:function(position){var rows=methods.getTableRows(),removedRow;if(position!==undefined){removedRow=rows.eq(position).remove()}else{removedRow=rows.last().remove()}return removedRow},addColumn:function(position){var columnCellsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el),columns=row.children("td"),newColumn=$(""+spacingChar+"",settings.document);if(position!==undefined&&columns.length){columnCellsArr.push(newColumn.insertAfter(columns.eq(position))[0]);return true}columnCellsArr.push(newColumn.appendTo(row)[0])});return $([]).pushStack(columnCellsArr)},removeColumn:function(position){var removedRowsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el);if(position!==undefined){removedRowsArr.push(row.children("td").eq(position).remove());return true}removedRowsArr.push(row.children("td:last").remove())});return $([]).pushStack(removedRowsArr)},getRowsNum:function(){return methods.getTableRows().length},getColumnsNum:function(){return methods.getTableCols().length},getTableRows:function(){return table.children("tbody").children("tr")},getTableCols:function(){return table.children("tbody").children("tr").first().children("td")}};$.fn.tableManipulator=function(method){if(methods[method]){if(table===undefined||this!==table[0]){table=$(this)}return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}if(typeof method==="object"||!method){return methods.init.apply(this,arguments)}$.error("Method "+method+" does not exist on jQuery.tableManipulator")};$.ig.SelectionWrapper=$.ig.SelectionWrapper||Class.extend({_selection:null,_range:null,_window:null,_document:null,_commands:{insertunorderedlist:{name:"_insertList",browsers:null,args:["insertunorderedlist"]},insertorderedlist:{name:"_insertList",browsers:null,args:["insertorderedlist"]}},_css:{larger:"ui-ightmleditor-larger",smaller:"ui-ightmleditor-smaller"},NODE:new $.ig.XmlNodeType,init:function(window,callback){var self=this;this._window=window;this._document=this._window.document;this._selection=this._window.getSelection();this._window.setTimeout(function(){self._range=self._getSelection().rangeCount===0?self._document.createRange():self._selection.getRangeAt(0);self._selectClosestTextNode();if($.isFunction(callback)){callback.call(self)}},50)},_getSelection:function(){return this._selection},_getRange:function(){return this._range},_isCommandSupportedByBrowser:function(command){var supportedBrowsers,i;if(command===null||!this._commands.hasOwnProperty(command.toLowerCase())){return}if(this._commands[command].browsers===null){return}supportedBrowsers=this._commands[command].browsers;for(i=0;i0){$nodeContents.each(function(){if(this.nodeType===3){allTextNodes.push(this)}else{self._findTextNodes(this,allTextNodes)}})}},_findAllTextNodes:function(node){var allTextNodes=[];this._findTextNodes(node,allTextNodes);return allTextNodes},_selectClosestTextNode:function(){var children,closestToCaretNode,allTextNodes,textNodeToFocus,range=this._range;if(($.ig.util.isIE||$.ig.util.isFF)&&range.collapsed&&range.startOffset>0&&range.startContainer.nodeType===this.NODE._Element){children=range.startContainer.childNodes;if(children.length>0){closestToCaretNode=children[range.startOffset-1];if(closestToCaretNode.nodeType===3){textNodeToFocus=closestToCaretNode}else{allTextNodes=this._findAllTextNodes($(closestToCaretNode));textNodeToFocus=allTextNodes[allTextNodes.length-1]}if(textNodeToFocus&&!$(textNodeToFocus).parent().is("a")){range.setStart(textNodeToFocus,textNodeToFocus.length);range.collapse(true);this._updateSelection(range)}}}},getSelectedItem:function(){var range=this._getRange(),rangeParent=$(range.commonAncestorContainer);if(range.collapsed&&range.endContainer.nodeType===this.NODE._Text){if(rangeParent.parent().is("img")||rangeParent.parent().is("td")){return rangeParent.parent()}return $(range.startContainer)}if(range.collapsed){return $(range.commonAncestorContainer)}if(range.collapsed&&range.endContainer.nodeType===this.NODE._Element){return $(range.commonAncestorContainer.childNodes[range.endOffset-range.startOffset])}return $(range.commonAncestorContainer)},getSelectionAsText:function(){if(this._getRange().text!==undefined){return this._getRange().text}return this._getRange().toString()},select:function(element){var selectedItem=element||this.getSelectedItem();this._range.selectNodeContents(selectedItem[0]);this._selection.removeAllRanges();this._selection.addRange(this._range)},insertElement:function(element){this._getRange().insertNode(element.get(0))},execCommand:function(name,args){var startEl,endEl,p,range=this._getRange(),customCommand=this._commands[name]?this[this._commands[name].name]:null,customCommandArgs=this._commands[name]?this._commands[name].args:null,browser=this._commands[name]?this._commands[name].browsers:null,isCommandSupported=this._isCommandSupportedByBrowser(name);if(this._selection.isCollapsed&&range.collapsed){if($(range.startContainer).is("body")){startEl=$(range.startContainer).find(":first");if(!startEl.length){startEl=$(range.startContainer)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Document){startEl=$(range.startContainer.body).find(":first");if(!startEl.length){startEl=$(range.startContainer.body)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Text){this._document.execCommand(name,false,args);return}else{startEl=$(range.startContainer)}if(startEl&&startEl.is("br")&&endEl&&endEl.is("br")){p=$("


",this._document);startEl.replaceWith(p);range.selectNodeContents(p[0]);this._updateSelection(range)}}if($.ig.util.isIE&&$.ig.util.browserVersion>=9||$.ig.util.isOpera){if(this._selection.focusNode.nodeType!==3){this._updateSelection(range)}}if($.isFunction(customCommand)&&browser===null){customCommand.call(this,name,args)}else if($.isFunction(customCommand)&&isCommandSupported){customCommand.apply(this,customCommandArgs)}else{this._document.execCommand(name,false,args)}},_insertList:function(listType,args){var self=this,textNodes;this._document.execCommand(listType,false,args);if(!this._document.queryCommandState(listType)){if(this._selection.anchorNode&&this._selection.anchorNode.nodeType===this.NODE._Text&&$(this._selection.focusNode).is("body")){textNodes=$(this._selection.focusNode).contents().filter(function(){if($(this).is("br")){$(this).remove();return false}return this.nodeType===self.NODE._Text})}}},_getTextNodesOnlyCallback:function(){return this.nodeType===this.NODE._Text},_wrapPartialString:function(string,start,end,wrapElName){var stack=[];stack.push(this._document.createTextNode(string.slice(0,start)));stack.push(wrapElName.text(string.substring(start,end))[0]);stack.push(this._document.createTextNode(string.slice(end)));return $(stack)},_updateSelection:function(range){this._selection.removeAllRanges();this._selection.addRange(range)},replaceNode:function(newNode){var range=this._getRange(),selItem=this.getSelectedItem();if(selItem.is(newNode)){return}if(range.startOffset!==range.endOffset){range.deleteContents()}if(range.insertNode!==undefined&&!selItem.parent().is("a")){range.insertNode(newNode[0])}else if(range.pasteHTML!==undefined){range.pasteHTML(newNode[0].outerHTML)}},insertTable:function(table){var $body,$firstP,selItem=this.getSelectedItem(),br=$("
",this._document);if(selItem[0].nodeType===this.NODE._Document){$body=selItem.find("body");$firstP=$body.children("p").first();if($firstP.length>0){this._range.selectNodeContents($firstP[0])}else{this._range.selectNodeContents($body[0])}this._range.insertNode(table[0])}else if(selItem.is("td")){table.appendTo(selItem)}else if(selItem.is("table")){selItem.replaceWith(table)}else if(selItem.is("br")){selItem.replaceWith(table)}else{this._range.insertNode(table[0])}if(this._range.selectNodeContents!==undefined){this._range.selectNodeContents(br.insertAfter(table)[0])}},focus:function(){var focusTarget;if((this._range.startContainer.nodeType===this.NODE._Document||$(this._range.startContainer).is("body"))&&this._range.collapsed){focusTarget=$(this._document.body).find(":not(br):first");if(focusTarget.length>0){this._range.setStart(focusTarget[0],0);this._range.setEnd(focusTarget[0],0);this._document.body.focus()}}else{if($.ig.util.isIE){if(this._selection&&this._selection.focusNode&&this._selection.focusNode.nodeType!==this.NODE._Text){this._updateSelection(this._range)}}else{this._document.body.focus()}}}});$.ig.ToolbarHelper=$.ig.ToolbarHelper||Class.extend({_toolbarsItemsLocation:{textToolbar:{name:"textToolbar",bold:{name:"bold"},italic:{name:"Italic"},underline:{name:"Underline"},strikethrough:{name:"Strikethrough"},fontFamily:{name:"fontFamily"},fontSize:{name:"fontSize"},formatsList:{name:"formatsList"}},formattingToolbar:{name:"formattingToolbar",justifyleft:{name:"justifyleft"},justifycenter:{name:"justifycenter"},justifyright:{name:"justifyright"},justifyfull:{name:"justifyfull"},bullets:{name:"bullets"},indent:{name:"indent"},outdent:{name:"outdent"},textColor:{name:"textColor"},backgroundTextColor:{name:"backgroundTextColor"}},insertObjectToolbar:{name:"insertObjectToolbar",image:{name:"image"},link:{name:"link"},table:{name:"table"},addRow:{name:"addRow"},addColumn:{name:"addColumn"},removeRow:{name:"removeRow"},removeColumn:{name:"removeColumn"}},copyPasteToolbar:{name:"copyPasteToolbar",copy:{name:"copy"},cut:{name:"cut"},paste:{name:"paste"},undo:{name:"undo"},redo:{name:"redo"}}},init:function(window,toolbars){this._toolbars={};this._w=window;this._d=window.document;var self=this;toolbars.each(function(idx,el){var igToolbarName=$(el).igToolbar("option","name");self._toolbars[igToolbarName]=$(el)});this._initAlignButtons(toolbars);this._disableUnsupportedItems();this._disableTableControls(true)},_initAlignButtons:function(toolbars){var alignButtonsToolbar=this._toolbars.formattingToolbar,alignButtons={justifyleft:alignButtonsToolbar.igToolbar("getItem","justifyleft").attr({"data-localeid":"alignTextLeftButtonTitle","data-localeattr":"title"}),justifycenter:alignButtonsToolbar.igToolbar("getItem","justifycenter").attr({"data-localeid":"alignTextCenterButtonTitle","data-localeattr":"title"}),justifyright:alignButtonsToolbar.igToolbar("getItem","justifyright").attr({"data-localeid":"alignTextRightButtonTitle","data-localeattr":"title"}),justifyfull:alignButtonsToolbar.igToolbar("getItem","justifyfull").attr({"data-localeid":"justifyButtonTitle","data-localeattr":"title"})};toolbars.bind("igtoolbartoolbarbuttonclick",function(e,ui){if(alignButtons.hasOwnProperty(ui.name)){$.each(alignButtons,function(buttonName,button){if(buttonName!==ui.name&&button.igToolbarButton("option","isSelected")){button.igToolbarButton("toggle");return}})}})},_disableUnsupportedItems:function(){var copyPasteToolbar=this._toolbars.copyPasteToolbar;if(!$.ig.util.isIE){copyPasteToolbar.igToolbar("disableItem","cut",true);copyPasteToolbar.igToolbar("disableItem","copy",true);copyPasteToolbar.igToolbar("disableItem","paste",true)}},_disableTableControls:function(toDisable){var insertObjectToolbar=this._toolbars.insertObjectToolbar;if(!toDisable&&this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",false);insertObjectToolbar.igToolbar("disableItem","removeColumn",false);insertObjectToolbar.igToolbar("disableItem","addRow",false);insertObjectToolbar.igToolbar("disableItem","removeRow",false);this._isTableControlsDisabled=false}else if(toDisable&&!this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",true);insertObjectToolbar.igToolbar("disableItem","removeColumn",true);insertObjectToolbar.igToolbar("disableItem","addRow",true);insertObjectToolbar.igToolbar("disableItem","removeRow",true);this._isTableControlsDisabled=true}},_callbackMap:{_isBold:"_onBold",_isItalic:"_onItalic",_isUnderlined:"_onUnderlined",_isLineThrough:"_onLineThrough",_isJustifyCenter:"_onAlign",_isJustifyFull:"_onAlign",_isJustifyLeft:"_onAlign",_isJustifyRight:"_onAlign",_isOrderedList:"_onList",_isUnorderedList:"_onList",_hasFontName:"_onFontName",_hasFontSize:"_onFontSize",_isTable:"_onTable"},analyse:function(el){var self=this,justify;this._resetToolbars();if(el[0].nodeType===9){this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(this._d.body)||this._d.body.currentStyle}else{this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(el[0])||el[0].currentStyle}if(el.is(":header")){this._onHeader(el)}$.each(this._callbackMap,function(isTrueFunc,callback){var isTrueRes=self[isTrueFunc](el);if($.isFunction(self[isTrueFunc])&&isTrueRes&&$.isFunction(self[callback])){self[callback](el,isTrueRes);if(callback==="_onAlign"){justify=true}}});if(!justify){this._onAlign(el,"justifyleft")}if(!el.is("table")&&!el.is("td")){this._disableTableControls(true)}},_isBold:function(){return this._d.queryCommandState("bold")},_isItalic:function(){return this._d.queryCommandState("italic")},_isUnderlined:function(){return this._d.queryCommandState("underline")},_isLineThrough:function(){return this._d.queryCommandState("strikethrough")},_isJustifyCenter:function(){if(this._d.queryCommandState("justifycenter")){return"justifycenter"}},_isJustifyFull:function(){if(this._d.queryCommandState("justifyfull")){return"justifyfull"}},_isJustifyLeft:function(){if(this._d.queryCommandState("justifyleft")){return"justifyleft"}},_isJustifyRight:function(){if(this._d.queryCommandState("justifyright")){return"justifyright"}},_isOrderedList:function(){if(this._d.queryCommandState("insertorderedlist")){return"InsertOrderedList"}},_isUnorderedList:function(){if(this._d.queryCommandState("insertunorderedlist")){return"InsertUnorderedList"}},_isTable:function(el){if(el.is("table")||el.is("td")){return true}},_hasFontName:function(){var fontName=this._getFontFamily();if(fontName==="serif"){fontName="Times New Roman"}return fontName},_getFontFamily:function(){var fontName=this._d.queryCommandValue("FontName");if(fontName===""){fontName=this._computedStyles.fontFamily}return fontName},_hasFontSize:function(){return this._computedStyles.fontSize},_onBold:function(){this._toolbars.textToolbar.igToolbar("getItem","Bold").igToolbarButton("toggle")},_onItalic:function(){this._toolbars.textToolbar.igToolbar("getItem","Italic").igToolbarButton("toggle")},_onUnderlined:function(){this._toolbars.textToolbar.igToolbar("getItem","Underline").igToolbarButton("toggle")},_onLineThrough:function(){this._toolbars.textToolbar.igToolbar("getItem","Strikethrough").igToolbarButton("toggle")},_onAlign:function(el,dir){this._toolbars.formattingToolbar.igToolbar("getItem",dir).igToolbarButton("toggle")},_onList:function(el,listType){ this._toolbars.formattingToolbar.igToolbar("getItem",listType).igToolbarButton("toggle")},_onFontName:function(el,fontName){var combo=this._toolbars.textToolbar.igToolbar("getItem","fontFamily");fontName=fontName.replace(/'|"/g,"");this._setComboValue(combo,$.ig.util.getLocaleValue("HtmlEditor","fontNames")[/^win/gi.test(navigator.platform)?"win":"mac"],fontName)},_onFontSize:function(){var pxTbl={11:1,13:2,16:3,19:4,24:5,32:6},fontSizeUnits=this._d.queryCommandValue("fontsize")||pxTbl[Math.round(parseFloat(this._computedStyles.fontSize))],fontSizeUnitsStr=fontSizeUnits?fontSizeUnits.toString():"",combo=this._toolbars.textToolbar.igToolbar("getItem","fontSize");this._setComboValue(combo,$.ig.util.getLocaleValue("HtmlEditor","fontSizes"),fontSizeUnitsStr)},_onHeader:function(element){var combo=this._toolbars.textToolbar.igToolbar("getItem","formatsList");this._setComboValue(combo,$.ig.util.getLocaleValue("HtmlEditor","formatsList"),element[0].nodeName.toLowerCase())},_onTable:function(){this._disableTableControls(false)},_setComboValue:function(combo,values,newValue,valueKey){var i,dsValueKey=valueKey||valueKey===undefined?"text":valueKey,currentValue=values[combo.igCombo("index")][dsValueKey],dataSourceValue;if(newValue===currentValue){return}for(i=0;i
").attr("id",this._id("_container")).insertBefore(this.element);this.element.appendTo(this.container)}else{throw new Error(this._getLocaleValue("nonDivException"))}this._oldWidth=this.element.css("width");this._oldHeight=this.element.css("height");this._renderControl()},_renderControl:function(){var o=this.options,video,css=this.css;this._prevReadyState=0;this._bookmarksRendered=false;if(this.supportsVideo()){this._renderBanners()}this.currentVideo=video=this._createMainVideoElement().addClass(css.videoClass);if(o.disabled){this.container.addClass("ui-state-disabled")}if(o.width){video.css("width",o.width);this.container.css("width",o.width)}if(o.height){video.css("height",o.height);this.container.css("height",o.height)}if(this.supportsVideo()){this._baseZIndex=parseInt(this.container.css("z-index"),10)||0;this._attachEvents(video);this._renderSources(o.sources,video);this._analyzeSource(video);setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT);this._createBigPlayButton();this._createWaitingIndicator();this._renderEmbeddedCommercials();this._renderCommercials();video[0].muted=o.muted;if(o.muted&&$.ig.util.isWebKit){video[0].volume=0}else if(o.volume>=this._const.VOLUME_MIN&&o.volume<=this._const.VOLUME_MAX){video[0].volume=o.volume}if(!o.browserControls){this._renderControls()}this._lastPausedState=video[0].paused;if(o.fullscreen){this._setOption("fullscreen",true,true)}this._renderRelatedVideos()}else{this.currentVideo.hide();$.ig.util._renderUnsupportedBrowser(this,this._getLocaleDictionary())}$("#"+this._id("_detectError")).appendTo(this.container).bind({click:function(event){event.preventDefault()}});this.container.addClass(css.baseClasses)},_createVideoElement:function(id){var video=$("").attr("id",id);return video},_saveExistingVideoProperties:function(video){this._oldAutoPlay=this._getVideoProperty(video,"autoplay");this._oldPreload=this._getVideoProperty(video,"preload");this._oldLoop=this._getVideoProperty(video,"loop");this._oldPoster=this._getVideoProperty(video,"poster");this._oldControls=this._getVideoProperty(video,"controls");this._oldSrc=this._getVideoProperty(video,"src");this._oldMuted=video[0].muted;this._oldVolume=video[0].volume;this._removeVideoProperty(video,"autoplay");this._removeVideoProperty(video,"preload");this._removeVideoProperty(video,"loop");if(this._oldPoster!==""){this._removeVideoProperty(video,"poster")}this._removeVideoProperty(video,"controls");this._removeVideoProperty(video,"src")},_restoreExistingVideoProperties:function(video){this._setVideoProperty(video,"autoplay",this._oldAutoPlay);this._setVideoProperty(video,"preload",this._oldPreload);this._setVideoProperty(video,"loop",this._oldLoop);this._setVideoProperty(video,"poster",this._oldPoster);this._setVideoProperty(video,"controls",this._oldControls);this._setVideoProperty(video,"src",this._oldSrc);video[0].muted=this._oldMuted;video[0].volume=this._oldVolume},_createMainVideoElement:function(){var o=this.options,isVideoExisting=this.element.is("video"),video=isVideoExisting?this.element:this._createVideoElement(this._id("_video"));if(isVideoExisting){this._saveExistingVideoProperties(video)}if(o.autoplay){this._setVideoProperty(video,"autoplay",true)}this._setVideoProperty(video,"preload","metadata");if(o.preload){this._setVideoProperty(video,"preload","auto")}if(o.browserControls){this._setVideoProperty(video,"controls",true)}if(o.loop){this._setVideoProperty(video,"loop",true)}if(o.posterUrl.length>0){this._setVideoProperty(video,"poster",o.posterUrl)}return video.appendTo(this.container)},_setVideoProperty:function(video,prop,value){if(video.prop){video.prop(prop,value)}else{video.attr(prop,value)}},_getVideoProperty:function(video,prop){if(video.prop){return video.prop(prop)}else{return video.attr(prop)}},_removeVideoProperty:function(video,prop){if(video.prop){return video.removeProp(prop)}else{return video.removeAttr(prop)}},_renderUnsupportedBrowser:function(){if(this._trigger(this.events.browserNotSupported)){var container=$("
").attr({"data-not-supported-browser":true}).addClass(this.css.unsupportedBrowserClass).appendTo(this.container),ul,browserUnsupported;if($.ig.util.isIE){browserUnsupported="Internet Explorer "+$.ig.util.browserVersion}else if($.ig.util.isOpera){browserUnsupported="Opera "+$.ig.util.browserVersion}else if($.ig.util.isWebKit){browserUnsupported="Webkit "+$.ig.util.browserVersion}else if($.ig.util.isFF){browserUnsupported="Mozilla Firefox "+$.ig.util.browserVersion}else{browserUnsupported=$.ig.util.browserVersion}$("
").addClass("ui-igvideoplayer-current-browser-label").html(this._getLocaleValue("currentBrowser").replace("{0}",browserUnsupported)).appendTo(container);$("
").addClass("ui-igvideoplayer-non-html5-text").html(this._getLocaleValue("unsupportedBrowser")).appendTo(container);ul=$("
    ").addClass("ui-igplayer-browsers-list").appendTo(container);$("").attr({href:this._getLocaleValue("chromeDownload"),target:"_blank"}).addClass("ui-igplayer-chrome-icon").html(this._getLocaleValue("chrome8")).appendTo($("
  • ").addClass("ui-corner-all").appendTo(ul));$("").attr("href",this._getLocaleValue("firefoxDownload")).attr("target","_blank").addClass("ui-igplayer-firefox-icon").html(this._getLocaleValue("firefox36")).appendTo($("
  • ").addClass("ui-corner-all").appendTo(ul));$("").attr("href",this._getLocaleValue("operaDownload")).attr("target","_blank").addClass("ui-igplayer-Opera-icon").html(this._getLocaleValue("opera11")).appendTo($("
  • ").addClass("ui-corner-all").appendTo(ul));$("").attr("href",this._getLocaleValue("safariDownload")).attr("target","_blank").addClass("ui-igplayer-safari-icon").html(this._getLocaleValue("safari5")).appendTo($("
  • ").addClass("ui-corner-all").appendTo(ul));$("").attr("href",this._getLocaleValue("ieDownload")).attr("target","_blank").addClass("ui-igplayer-ie-icon").html(this._getLocaleValue("ie9")).appendTo($("
  • ").addClass("ui-corner-all").appendTo(ul));this.container.addClass("ui-igvideoplayer-non-html5")}},_renderRelatedVideoBar:function(container){var css=this.css,control=this,relatedVideoBar=$("
    ").attr("id",this._id("_rv_bar")).addClass(css.relatedVideoBarClass).appendTo(container);$("").attr("id",this._id("_rv_bar_fs")).appendTo($("
    ").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(relatedVideoBar)).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:css.fullScreenIconClass}}).attr({title:this._getLocaleValue("enterFullscreen"),"data-localeid":"enterFullscreen","data-localeattr":"title"}).addClass(css.fullScreenClass).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}});$("").attr("id",this._id("_rv_bar_replay")).appendTo(relatedVideoBar).igButton({onlyIcons:false,labelText:this._getLocaleValue("replayButton"),icons:{primary:css.relatedVideoReplayIconClass},link:{href:this._const.HREF}}).attr({title:this._getLocaleValue("replayTooltip"),"data-localeid":"replayButton","data-localeattr":"title"}).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).addClass(css.relatedVideoReplayClass)},_renderScrollButtons:function(container){var css=this.css,ul;$("").attr("id",this._id("_rv_left")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollLeftIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollLeftClass).css("position","absolute").hide();ul=$("
      ").addClass(css.relatedVideoScrollListClass).appendTo(container);$("").attr("id",this._id("_rv_right")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollRightIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollRightClass).css("position","absolute");return ul},_renderRelatedVideos:function(){var o=this.options,related=o.relatedVideos||[],len=related.length,i=0,css=this.css,container,scrollContainer,ulContainer,ulContainerWidth=10,currentVideo,control=this;if(len>0){container=$("
      ").attr("id",this._id("_rvcc")).addClass(css.relatedVideosOuterContainerClass).appendTo(this.container).hide();$("
      ").html(this._getLocaleValue("relatedVideos")).attr({"data-localeid":"relatedVideos"}).addClass(css.relatedVideosHeaderClass).appendTo(container);scrollContainer=$("
      ").attr("id",this._id("_rvc")).appendTo(container).addClass(css.relatedVideosContainerClass);ulContainer=this._renderScrollButtons(scrollContainer);this._renderRelatedVideoBar(container);this._rvUlWidth=0;this._rvImagesToLoad=0;this._rvImagesLoaded=0;for(i;icontainer.width()&&ulContainerWidth>ulContainer.width()){ulContainer.width(ulContainerWidth)}this.relatedScrollers=$("a",scrollContainer).bind({mouseover:function(){if(!control._isScrolling){control._isScrolling=true;control._leftDirection=$(this).hasClass(control.css.relatedVideoScrollLeftClass);control._rvDoScroll()}},mouseout:function(){control._rvStopScroll()}});this.relatedVideoElements=$("."+this.css.relatedVideoClass.split(" ")[0],ulContainer).each(function(i){$(this).data("related-index",i)}).bind({mouseover:function(){$(this).addClass(control.css.relatedVideoHoverClass).children().filter("div").show()},mouseout:function(){$(this).removeClass(control.css.relatedVideoHoverClass).children().filter("div").hide()},click:function(event){var relatedVideo=control.options.relatedVideos[$(this).data("related-index")];if(control._relatedVideoClick(relatedVideo,$(this),event)){if(relatedVideo.link&&relatedVideo.link.length>0){window.open(relatedVideo.link,"_blank")}else if(relatedVideo.sources){control._renderSources(relatedVideo.sources,control.currentVideo);control._analyzeSource(control.currentVideo,true);control.play()}}}})}},_rvScrollOnce:function(){var container=$("#"+this._id("_rvc")),ul=$("ul",container),currentLeftStr=ul[0].style.left,currentLeft=parseInt(currentLeftStr===""||currentLeftStr==="auto"?"0px":currentLeftStr,10),pixelsToScroll=10,newLeft=this._leftDirection?currentLeft+pixelsToScroll:currentLeft-pixelsToScroll,left=$("#"+this._id("_rv_left")),right=$("#"+this._id("_rv_right")),ulWidth=ul.width(),scrollContainerWidth=container.width(),continueScrolling=true;ul[0].style.left=newLeft+"px";if(currentLeft===0&&newLeft<0){left.show()}if(newLeft>=0&¤tLeft!==0&&left[0].style.display!=="none"){left.hide();continueScrolling=false}if(scrollContainerWidth-newLeft>=ulWidth&&right[0].style.display!=="none"){continueScrolling=false;right.hide()}else if(right[0].style.display==="none"){right.show()}return continueScrolling},_rvDoScroll:function(){var continueScrolling=this._isScrolling&&this._rvScrollOnce();if(continueScrolling){this._scrollingTimoutId=setTimeout($.proxy(this._rvDoScroll,this),this._const.SCROLL_TIMEOUT)}else{this._rvStopScroll()}},_rvStopScroll:function(){if(this._isScrolling){clearTimeout(this._scrollingTimoutId);this._isScrolling=false}},_relatedVideoClick:function(relatedVideo,relatedElement,event){var args={relatedVideo:relatedVideo,relatedVideoElement:relatedElement};return this._trigger(this.events.relatedVideoClick,event,args)},_renderRelatedVideo:function(related,container,isFirst,isLast){var rv=$("
    • ").appendTo(container).addClass(this.css.relatedVideoClass),relatedImg=$("").appendTo(rv),self=this;if(isFirst||isLast){rv.addClass(isFirst?this.css.relatedVideoFirstClass:this.css.relatedVideoLastClass)}if(related.imageUrl&&related.imageUrl!==""){relatedImg.attr("src",related.imageUrl)}if(related.title&&related.title!==""){relatedImg.attr("title",related.title)}if(related.css&&related.css!==""){relatedImg.addClass(related.css)}if(related.width&&related.width!==""){relatedImg.css("width",related.width)}if(related.height&&related.height!==""){relatedImg.css("height",related.height)}$("
      ").appendTo(relatedImg.parent()).css("position","absolute").hide();relatedImg.bind({load:function(){self._imageLoaded(this)},error:function(){self._rvImagesLoaded++;self._onImagesLoaded()},readystatechange:function(){self._imageLoaded(this)}});return rv},_imageLoaded:function(img){var rs=img.readyState,width=parseInt(img.style.width,10),height=parseInt(img.style.height,10),spanSize;if(!rs||new RegExp("loaded|complete").test(rs)){this._rvUlWidth+=width+parseInt($(img).parent().css("marginRight"),10)+parseInt($(img).parent().css("marginLeft"),10);this._rvImagesLoaded++;if(width>24&&height>24){if(width>50&&height>50){spanSize=48}else if(width>34&&height>34){spanSize=32}else{spanSize=24}$(img).parent().children().filter("div").addClass("ui-igplayer-related-video-hover-x"+spanSize).css({width:spanSize,height:spanSize,top:height/2-spanSize/2,left:width/2-spanSize/2})}}this._onImagesLoaded()},_onImagesLoaded:function(){if(this._rvImagesLoaded===this._rvImagesToLoad){var container=$("#"+this._id("_rvc"));$("ul",container).css("width",this._rvUlWidth+4);container.parent().show();if(this._rvUlWidth0){this._embeddedCommercialsShow=$.extend(true,[],ec);this._embeddedCommercialIndex=0;this._renderAdMessage()}},_renderCommercials:function(){var o=this.options,com=o.commercials.linkedCommercials||[],control=this,video;if(com.length>0){video=this._createVideoElement(this._id("_com_video")).attr("preload","auto").appendTo(this.container).addClass(this.css.videoClass).bind({ended:function(){var slider=$("#"+control._id("_ctrls_s")),bookmarks=slider.data("igSlider").bookmarks;control._hideWaitingIndicator();control._commercialIndex++;control._commercialsShow.shift();control._commercialPlaying=false;control.currentVideo=control._getMainVideo();control.currentVideo.show();$(this).hide();slider.igSlider("option","disabled",false);if(bookmarks){bookmarks.show()}control.currentVideo[0].muted=this.muted;control.currentVideo[0].play();control.currentVideo.addClass(control.css.videoClass);control.controls[control._activeControlsIndex].css("z-index","");$("#"+control._id("_seek_tooltip")).css("z-index","");$("#"+control._id("_play")).css("z-index","")},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},timeupdate:function(event){control._changeCurrentTime(event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){event.preventDefault();var link=control.options.commercials.linkedCommercials[control._commercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}}).hide();if(video.prop&&video.prop("preload")!=="auto"){video.prop("preload","auto")}this._buildCommercialsShow();this._renderAdMessage()}},_renderAdClose:function(container){var control=this;$("").attr("id",this._id("_ad_msg_close")).appendTo(container).igButton({onlyIcons:true,icons:{primary:this.css.adMsgCloseIconClass},link:{href:this._const.HREF}}).addClass(this.css.adMsgCloseClass).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideAdMessage()})},_renderAdMessage:function(){if($("#"+this._id("_ad_msg_c")).length===0){var css=this.css,container;container=$("
      ").attr("id",this._id("_ad_msg_c")).addClass(css.adMsgContainerClass).prependTo(this.container).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide();$("").attr({id:this._id("_ad_msg"),"data-localeid":"adMessage"}).appendTo(container).addClass(css.adMsgClass).html(this._getLocaleValue("adMessage"));this._renderAdClose(container)}},_showAdMessage:function(seconds){var adMsgContainer=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;this._updateAdMessage(seconds,true);adMsgContainer.css("width",this.container.css("width"));if(msgOpt.animate){adMsgContainer.slideToggle(msgOpt.animationDuration)}else{adMsgContainer.show()}if(msgOpt.autoHide){this._adHideTimeout=setTimeout($.proxy(this.hideAdMessage,this),msgOpt.hideDelay)}},_updateAdMessage:function(seconds,force){var msg=$("#"+this._id("_ad_msg"));if(msg.is(":visible")||force){if(isNaN(seconds)){msg.html(this._getLocaleValue("adMessageNoDuration"))}else{seconds=parseInt(seconds,10);if(seconds>60){msg.html(this._getLocaleValue("adMessageLong").replace("$duration$",this._toTimeString(seconds)))}else{msg.html(this._getLocaleValue("adMessage").replace("$duration$",seconds))}}this._isHiddenAdMessage=false}else if(!this._isHiddenAdMessage){this._showAdMessage(seconds)}},hideAdMessage:function(){clearTimeout(this._adHideTimeout);var msg=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;if(msg.is(":visible")){if(msgOpt.animate){msg.slideToggle(msgOpt.animationDuration)}else{msg.hide()}this._isHiddenAdMessage=true}},_buildCommercialsShow:function(){var com=this.options.commercials.linkedCommercials||[],len=com.length,i=0;this._commercialsShow=[];this._commercialIndex=0;for(i;i0){comVideo.attr({title:this._getLocaleValue("adNewWindowTip"),"data-localeid":"adNewWindowTip","data-localeattr":"title"})}else{comVideo.removeAttr("title")}comVideo.css("top",videoOffset.top).css("left",videoOffset.left).css("width",this.currentVideo.css("width")).css("height",this.currentVideo.css("height")).show();this.currentVideo.hide();this.currentVideo=comVideo},_renderBanners:function(){var banners=this.options.banners||[],len=banners.length,i=0,parent=$("
      ").appendTo(this.container).addClass(this.css.bannerContainerClass),banner;this._bannerShow=[];for(i;i0){this._renderBannerContainer(banner,this._id("_banner_grid"+i),parent).data("banner-index",i)}this._bannerShow.push($.extend(true,[],banner.times))}},_buildBannersShow:function(){var banners=this.options.banners||[],len=banners.length,i=0;if(len>0){this._bannerShow=[]}for(i;i").attr("id",id+"_banner_close").appendTo($("
      ").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(container)).addClass(css.bannerCloseClass).igButton({onlyIcons:true,icons:{primary:css.bannerCloseIconClass},link:{href:this._const.HREF}}).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideBanner($(this).parent().parent().data("banner-index"))})},_renderBannerContainer:function(banner,id,parent){var css=this.css,control=this,container=$("
      ").attr("id",id).appendTo(parent),img=$("").attr("id",id+"_img").attr("src",banner.imageUrl).appendTo(container);this.banner=container.addClass(css.bannerClass);if(!banner.visible){container.hide()}if(banner.closeBanner){this._renderBannerClose(container,id)}if(banner.width){container.css("width",banner.width);img.attr("width",parseInt(banner.width,10))}if(banner.height){container.css("height",banner.height);img.attr("height",parseInt(banner.height,10))}if(banner.css){container.addClass(banner.css)}container.bind("click",function(event){var noCancel=true,args={bannerElement:$(event.currentTarget)};noCancel=control._trigger(control.events.bannerClick,event,args);if(banner.link&&banner.link.length>0&&noCancel){window.open(banner.link,"_blank")}});return container},showBanner:function(index){if(this.options.banners&&index>=0&&index=0&&index-1?qmIndex:source.length,extension=source.substring(extStartIndex,extEndIndex);$("").attr("src",source).attr("type",("video/"+source.substring(source.lastIndexOf(".")+1,source.length)).replace("/ogv","/ogg")).appendTo(video);video.data(extension,source)},_getMainVideo:function(){return this.element.is("video")?this.element:$("#"+this._id("_video"))},_setOption:function(key,value,force){var video=this.currentVideo,titleOption,videoElem=video[0],mainVideo=this._getMainVideo(),videoOffset=video.igOffset(),options=this.options,noCancel=true,fsVideoH=0;if(this.options[key]===value&&!force){return}switch(key){case"disabled":if(value){this.container.addClass("ui-state-disabled")}else{this.container.removeClass("ui-state-disabled")}break;case"sources":$("source",mainVideo).remove();this._renderSources(value,mainVideo);this._analyzeSource(mainVideo);break;case"width":if(value!==options.width){video.css("width",value);this.container.css("width",value);if(!options.browserControls){$("#"+this._id("_ctrls")).parent().css("width",value);$("#"+this._id("_title_ctrls")).parent().css("width",value)}options.width=value}break;case"height":if(value!==options.height){video.css("height",value);this.container.css("height",value);options.height=value}break;case"posterUrl":if(value!==options.posterUrl){this._setVideoProperty(video,"poster",value);options.posterUrl=value}break;case"loop":if(value!==options.loop){videoElem.loop=value;options.loop=value}break;case"browserControls":if($.ig.util.isTouchDevice()){return}if(value!==options.browserControls){if(!value){videoElem.controls=false;this._ensureVolume();this._renderControls();this._detectBuffered()}else{videoElem.controls=true;this._destroyControls()}options.browserControls=value}break;case"autohide":if(!options.browserControls){if(value){this._onControlMouseOut()}else{this._onControlMouseOver()}}options.autohide=value;break;case"fullscreen":if(value!==options.fullscreen||force){if(value){noCancel=this._enterFullScreen(videoElem.currentSrc);if(noCancel){this.container.data("style.position",this.container.css("position"));this.container.data("document.scrollTop",$(document).scrollTop());this.container.data("document.scrollLeft",$(document).scrollLeft());this.container.data("style.left",this.container.css("left"));this.container.data("style.top",this.container.css("top"));this.container.css("z-index",this._baseZIndex+1e4);$(document).scrollTop(0);$(document).scrollLeft(0);this.container.css("position","fixed").css("height","100%").css("width","100%").css("left","0px").css("top","0px");$("#"+this._id("_ctrls")).parent().css("width","100%");if(this._commercialPlaying){video.css("top",0).css("left",0);mainVideo.css("height","100%").css("width","100%")}video.css("height","100%").css("width","100%");if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).hide()}}}else{noCancel=this._exitFullScreen(videoElem.currentSrc);if(noCancel){this.container.css("position",this.container.data("style.position")).css("left",this.container.data("style.left")).css("top",this.container.data("style.top"));this.container.css("z-index",this._baseZIndex);$(document).scrollTop(this.container.data("document.scrollTop"));$(document).scrollLeft(this.container.data("document.scrollLeft"));if(options.height){if(options.bookmarks&&options.bookmarks.length>0){fsVideoH=parseInt(options.height,10)-parseInt($("#"+this._id("_bookmarks")).css("height"),10);if(this._commercialPlaying){mainVideo.css("height",fsVideoH)}video.css("height",fsVideoH)}else{if(this._commercialPlaying){mainVideo.css("height",options.height)}video.css("height",options.height)}this.container.css("height",options.height)}else{if(this._commercialPlaying){mainVideo.css("height","")}video.css("height","");this.container.css("height","")}if(options.width){ if(this._commercialPlaying){mainVideo.css("width",options.width)}video.css("width",options.width);$("#"+this._id("_ctrls")).parent().css("width",options.width);this.container.css("width",options.width)}else{if(this._commercialPlaying){mainVideo.css("width","")}video.css("width","");$("#"+this._id("_ctrls")).parent().css("width","");this.container.css("width","")}if(this._commercialPlaying){video.css("top",videoOffset.top).css("left",videoOffset.left)}if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).show()}}}if(!noCancel){return}if($("#"+this._id("_waiting")).is(":visible")){this._showWaitingIndicator()}if($("#"+this._id("_play")).is(":visible")){this._showCenterPlayButton()}if($("#"+this._id("_ad_msg_c")).is(":visible")){$("#"+this._id("_ad_msg_c")).css("width",this.container.css("width"))}if($("#"+this._id("_ctrls_vs")).is(":visible")){this._hideVolumeSlider()}if($("#"+this._id("_detectError")).is(":visible")){this._showUnsupportedVideoSourceMsg()}if(value){$("body").addClass("ui-igplayer-full-screen-mode")}else{$("body").removeClass("ui-igplayer-full-screen-mode")}if(!options.browserControls){$("#"+this._id("_ctrls_fs_btn")).attr({title:value?this._getLocaleValue("exitFullscreen"):this._getLocaleValue("enterFullscreen"),"data-localeid":"exitFullscreen","data-localeattr":"title"})}if($("#"+this._id("_rv_bar_fs")).is(":visible")){titleOption=value?"exitFullscreen":"enterFullscreen";$("#"+this._id("_rv_bar_fs")).attr({title:this._getLocaleValue(titleOption),"data-localeid":titleOption,"data-localeattr":"title"})}options.fullscreen=value}break;case"volume":if(value!==options.volume&&value>=this._const.VOLUME_MIN&&value<=this._const.VOLUME_MAX){options.volume=videoElem.volume=value;if(value>0&&videoElem.muted){options.muted=videoElem.muted=false}else if(value===0&&!videoElem.muted){options.muted=videoElem.muted=true}if(!options.browserControls){this._adjustVolumeButton(value);$("#"+this._id("_ctrls_vs")).igSlider("option","value",value*100)}}break;case"muted":if(value!==options.muted){options.muted=videoElem.muted=value;$("#"+this._id("_ctrls_vs")).igSlider("option","value",value?0:(options.volume!==0?options.volume:.3)*100);if(options.volume===0){options.volume=.3}if(!value&&videoElem.volume===0){videoElem.volume=options.volume}if(!options.browserControls){this._adjustVolumeButton($("#"+this._id("_ctrls_vs")).igSlider("option","value"))}}break;case"title":$("#"+this._id("_title_ctrls_t")).html(value);break;case"progressLabelFormat":options.progressLabelFormat=value;this._updateProgressLabel();break;case"alwaysPlayCommercials":if(value!==options.commercials.alwaysPlayCommercials){options.commercials.alwaysPlayCommercials=value;if(value){this.resetCommercialsShow()}}break;case"bookmarks":this._destroyBookmarks();options.bookmarks=value;this._renderBookmarks();break;case"relatedVideos":this._destroyRelatedVideos();options.relatedVideos=value;this._renderRelatedVideos();break;default:break}this._superApply(arguments)},_onVideoStateChange:function(){var video=this.currentVideo,videoElem=video[0],o=this.options,prevReadyState=this._prevReadyState,readyState=videoElem.readyState;if(prevReadyState>=videoElem.HAVE_FUTURE_DATA&&readyState<=videoElem.HAVE_CURRENT_DATA){if(!videoElem.ended){this._showWaitingIndicator()}}else if(prevReadyState<=videoElem.HAVE_CURRENT_DATA&&readyState===videoElem.HAVE_FUTURE_DATA){this._hideWaitingIndicator()}else if(readyState===videoElem.HAVE_ENOUGH_DATA){if(prevReadyState<=videoElem.HAVE_CURRENT_DATA){this._hideWaitingIndicator()}else{return}}this._prevReadyState=readyState;this._detectBuffered();if(this._lastPausedState!==videoElem.paused){if(this._lastPausedState){this._showCenterPlayButton().removeClass(this.css.centerPauseButtonClass).addClass(this.css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(this.css.centerPlayButtonClass).addClass(this.css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay);this._prepareForPlay();this._lastPausedState=videoElem.paused}this._setOption("muted",videoElem.muted);this._refreshDuration();this._onVideoStateChangeId=setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT)},_updateTitleControlsTimeString:function(timeString,title){if(this._activeControlsIndex===1&&timeString){if(!title){title=timeString}$("span.ui-igplayer-playbutton-text",$("#"+this._id("_title_ctrls"))).attr("title",title).html(timeString)}},_analyzeSource:function(video,doNotShowError){var detected=false;if(this.supportsH264BaselineVideo()&&video.data("mp4")!==undefined){video.attr("src",video.data("mp4"));detected=true}else if(this.supportsWebmVideo()&&video.data("webm")!==undefined){video.attr("src",video.data("webm"));detected=true}else if(this.supportsOggTheoraVideo()){if(video.data("ogv")!==undefined){video.attr("src",video.data("ogv"));detected=true}else if(video.data("ogg")!==undefined){video.attr("src",video.data("ogg"));detected=true}}video.data("sourceDetected",detected);if(!detected&&!doNotShowError){this._showUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",true)}}}else{this._hideUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",false)}}}},resetCommercialsShow:function(){this._buildCommercialsShow();this._embeddedCommercialsShow=$.extend(true,[],this.options.commercials.embeddedCommercials);this._embeddedCommercialIndex=0},_attachVideoEvents:function(video){var control=this;this._videoEvents={error:function(event){control._onVideoError(event)},progress:function(event){control._onVideoLoading(event)},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},seeking:function(){control._showWaitingIndicator()},seeked:function(){control._hideWaitingIndicator()},timeupdate:function(event){control._changeCurrentTime(event)},ended:function(event){control._showCenterPlayButton().removeClass("ui-igplayer-centerplaybutton-pause").addClass("ui-igplayer-centerplaybutton-play");control._hideWaitingIndicator();if(!control.options.browserControls){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause")}$("#"+control._id("_ctrls_pb")).igProgressBar("option","value",0);if(control.options.relatedVideos.length>0){control._onControlMouseOut(null);$("#"+control._id("_rvcc")).show()}control._buildBannersShow();if(control.options.commercials.alwaysPlayCommercials){control.resetCommercialsShow()}control._ended(this.currentSrc,this.duration,event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){var o=control.options;if(!o.browserControls){event.preventDefault()}if(event.button===0&&!o.disabled){control._onVideoClick(!o.browserControls)}},dblclick:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control._onVideoDblClick()}},selectstart:function(){return false},loadedmetadata:function(){control._refreshDuration()}};video.bind(this._videoEvents)},_onVideoClick:function(allowPlay){if(this._embeddedCommercialPlaying){var link=this.options.commercials.embeddedCommercials[this._embeddedCommercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}else if(allowPlay){this.togglePlay()}},_onVideoDblClick:function(){var o=this.options;this._setOption("fullscreen",!o.fullscreen);if(!o.browserControls){this._toggleCenterPlayButton()}},_attachEvents:function(video){var control=this;this._attachVideoEvents(video);this._generalEvts={keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){if(control.options.fullscreen){control._setOption("fullscreen",false);event.preventDefault();event.stopPropagation()}}else if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();event.stopPropagation();control.togglePlay()}}};this._documentEvts={contextmenu:function(e){if($(e.target).is("video")&&control.options.disabled){e.preventDefault();e.stopPropagation()}}};$(document).bind(this._documentEvts);if(!this.options.browserControls){this._controlsEvts={mouseenter:function(event){control._onControlMouseOver(event)},mouseleave:function(event){control._onControlMouseOut(event)}};this.container.bind(this._controlsEvts)}this.container.bind(this._generalEvts)},_handleKbNavigation:function(event){if(event.keyCode===$.ui.keyCode.HOME){$(this.controlButtons[0]).focus();event.stopPropagation();event.preventDefault()}else if(event.keyCode===$.ui.keyCode.END){$(this.controlButtons[this.controlButtons.length-1]).focus();event.stopPropagation();event.preventDefault()}},_handleBlurKb:function(){this.currentVideo.removeClass(this.css.activeVideoClass)},_handleFocusKb:function(){this.currentVideo.addClass(this.css.activeVideoClass)},_onVideoLoading:function(event){this._detectBuffered(event)},_detectBuffered:function(event){var videoElem=this.currentVideo[0],buffered=videoElem.buffered,duration=parseInt(videoElem.duration,10),len=buffered?buffered.length:0,firstBuffered=len>0?parseInt(buffered.start(len-1),10):0,lastBuffered=len>0?parseInt(buffered.end(len-1),10):0,bufferSize=lastBuffered/duration*100;if(len>0&&this._previouslyBuffered!==bufferSize){if(this._previousBuffer&&lastBuffered=0&&ai0&¤tTime>=show[i][0]){show[i].shift();this.showBanner(i)}}},_checkCommercialsShow:function(currentTime){if(this._commercialsShow&&this._commercialsShow.length>0&¤tTime>=this._commercialsShow[0]&&!this._commercialPlaying){this._commercialPlaying=true;if(currentTime-this._commercialsShow[0]>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(this._commercialsShow[0])}if(!this.options.browserControls){this.playCommercial(this.options.commercials.linkedCommercials[this._commercialIndex])}}},_checkEmbeddedCommercialShow:function(currentTime){if(this._embeddedCommercialsShow&&this._embeddedCommercialsShow.length>0&&!this.currentVideo[0].seeking){var currentCommercial=this._embeddedCommercialsShow[0];if(currentTime>=currentCommercial.startTime&&!this._embeddedCommercialPlaying){this._embeddedCommercialPlaying=true;if(currentTime-currentCommercial.startTime>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(currentCommercial.startTime)}$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true);this._showAdMessage(currentCommercial.endTime-currentCommercial.startTime);if(currentCommercial.link&¤tCommercial.link.length>0){this.currentVideo.attr({title:this._getLocaleValue("adNewWindowTip"),"data-localeid":"adNewWindowTip","data-localeattr":"title"})}}else if(currentTime>=currentCommercial.endTime&&this._embeddedCommercialPlaying){this._embeddedCommercialsShow.shift();this._embeddedCommercialIndex++;this._embeddedCommercialPlaying=false;this.hideAdMessage();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",false);if(currentCommercial.link&¤tCommercial.link.length>0){this.currentVideo.removeAttr("title")}}}},_updateProgressLabel:function(){var videoElem=this.currentVideo[0],progressLabel=$("#"+this._id("_ctrls_pl")),rawDuration=videoElem.duration,duration=parseInt(rawDuration,10),currentTime=parseInt(videoElem.currentTime,10),progressString=this.options.progressLabelFormat;progressString=progressString.replace("${currentTime}",this._toTimeString(currentTime)).replace("${duration}",rawDuration===Infinity?this._getLocaleValue("liveStream "):this._toTimeString(duration));progressLabel.html(progressString)},_toTimeString:function(val){if(typeof val==="number"){var secs=parseInt(val%60,10),mins=parseInt(val/60,10),hours=parseInt(mins/60,10),days=parseInt(hours/24,10),timeFormat="{0}d {1}:{2}:{3}";mins=parseInt(mins%60,10);hours=parseInt(hours%60,10);timeFormat=timeFormat.replace("{3}",secs<10?"0"+secs:secs).replace("{2}",mins);if(hours>0){timeFormat=timeFormat.replace("{1}",hours);if(days>0){timeFormat=timeFormat.replace("{0}",days)}else{timeFormat=timeFormat.replace("{0}d ","")}}else{timeFormat=timeFormat.replace("{0}d {1}:","")}return timeFormat}return"NaN"},_onVideoWaiting:function(){this._showWaitingIndicator()},_createUnsupportedVideoSourceMsg:function(){var css=this.css;return this._createButton(this._id("_detectError"),css.unsupportedVideoSourceClass,css.unsupportedVideoSourceIconClass,this._getLocaleValue("missingVideoSource")).attr({title:this._getLocaleValue("unsupportedVideoSource"),"data-localeid":"unsupportedVideoSource","data-localeattr":"title"})},_showUnsupportedVideoSourceMsg:function(){var error=$("#"+this._id("_detectError"));if(error.length===0){error=this._createUnsupportedVideoSourceMsg()}return error.show()},_hideUnsupportedVideoSourceMsg:function(){$("#"+this._id("_detectError")).hide()},_createBigPlayButton:function(){var control=this,css=this.css;this._createButton(this._id("_play"),css.centerPlayButtonClass,css.centerPlayButtonIconClass,"").bind({click:function(event){event.preventDefault();if(event.button===0){control._onVideoClick(true)}},dblclick:function(event){event.preventDefault();if(event.button===0){control._onVideoDblClick()}}})},_updateButtonLabel:function(buttonId,text){var $buttonLabel=$("#"+buttonId).find("[data-button-label]");if($buttonLabel.length){$buttonLabel.html(text)}},_createButton:function(buttonId,buttonClass,spanClass,text){$("").html(text).addClass(spanClass).appendTo($("").attr("id",buttonId).attr("href",this._const.HREF).attr("tabIndex",-1).addClass("ui-state-default").addClass(buttonClass).appendTo(this.container));return $("#"+buttonId).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide()},_showCenterPlayButton:function(){var video=this.currentVideo,button=$("#"+this._id("_play")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top);return button.show()},_toggleCenterPlayButton:function(){var videoElem=this.currentVideo[0],o=this.options,css=this.css;if(videoElem.paused||videoElem.ended){this._showCenterPlayButton().removeClass(css.centerPauseButtonClass).addClass(css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(css.centerPlayButtonClass).addClass(css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay)},_hideCenterPlayButton:function(){return $("#"+this._id("_play")).hide()},_createWaitingIndicator:function(){var css=this.css;this._createButton(this._id("_waiting"),css.waitingIndicatorClass,css.waitingIndicatorIconClass,this._getLocaleValue("buffering"))},_createSeekTimeToolTip:function(){$("
      ").attr("id",this._id("_seek_tooltip")).hide().igTooltip({text:"00:00",arrowLocation:"bottom"}).appendTo(this.container).addClass(this.css.seekTooltipClass)},_showSeekTimeToolTip:function(x,y,seconds){var toolTip=$("#"+this._id("_seek_tooltip"));toolTip.css("top",y-toolTip.outerHeight()).css("left",x-toolTip.width()/2).igTooltip("option","text",this._toTimeString(seconds)).show()},_showWaitingIndicator:function(){if($("#"+this._id("_detectError")).is(":visible")){return}var video=this.currentVideo,button=$("#"+this._id("_waiting")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top).show()},_hideWaitingIndicator:function(){$("#"+this._id("_waiting")).hide()},_renderTitleControls:function(){var title=this.options.title,control=this,controlsDiv,html='
      ';html+='
      ';html+='";html+='
      ';if(title&&title.length>0){html+=title}html+="
      ";controlsDiv=$(html).appendTo(this.container).wrap('
      ');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}$("#"+this._id("_title_ctrls_play")).bind({click:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control.togglePlay()}}});return controlsDiv},_hideTitleControls:function(){if(this._activeControlsIndex!==0){this._activeControlsIndex=0;$("#"+this._id("_title_ctrls")).addClass(this.css.controlsHideClass).parent().remove();$("#"+this._id("_ctrls")).parent().show()}},_convertBookmarks:function(prop,bookmarks,duration,css){var len=bookmarks.length,newBookmarks=[],i=0,mark,newMark,value;for(i;i0&&mark[prop]0){newMark.css=css}newBookmarks.push(newMark)}}return newBookmarks},_renderBookmarks:function(){var o=this.options,bookmarks=o.bookmarks||[],com=o.commercials,ads=com.linkedCommercials||[],eads=com.embeddedCommercials||[],duration=this.currentVideo[0].duration,newBookmarks=[],newAdBookmarks=[],newEAdBookmarks=[];if(com.showBookmarks){if(ads.length>0){newAdBookmarks=this._convertBookmarks("startTime",ads,duration,this.css.linkedBookmarkClass)}if(eads.length>0){newEAdBookmarks=this._convertBookmarks("startTime",eads,duration,this.css.adBookmarkClass)}}if(bookmarks.length>0){newBookmarks=this._convertBookmarks("time",bookmarks,duration);if(newBookmarks.length>0){this._renderBookmarkArea(newBookmarks)}}if(newAdBookmarks.length>0){$.merge(newBookmarks,newAdBookmarks)}if(newEAdBookmarks.length>0){$.merge(newBookmarks,newEAdBookmarks)}if(newBookmarks.length>0){$("#"+this._id("_ctrls_s")).igSlider("option","bookmarks",newBookmarks)}this._bookmarksRendered=true},_renderBookmarkArea:function(bookmarks){if(bookmarks&&bookmarks.length>0){var css=this.css,bookmarkStr='
    • $time$$title$
    • ',bookmarkAreaStr='
      '+'
      $headerText$
      '+'
        $list$
      ',bookmarkList="",bookmarkArea,mark,i=0,len=bookmarks.length,control=this;for(i;i',cachedTime;html+='\t\t\t
      ';html+='\t\t\t\t
      ';html+='\t\t\t\t\t';html+="\t\t\t\t
      ";html+='\t\t\t\t
      ';html+='\t\t\t\t\t
      ';html+="\t\t\t\t
      ";html+='\t\t\t\t
      ';html+='\t\t\t\t\t
      ';html+='\t\t\t\t\t\t
      ';html+='\t\t\t\t\t\t\t
      ';html+='\t\t\t\t\t\t\t\t';html+="\t\t\t\t\t\t\t
      ";html+='\t\t\t\t\t\t\t
      ';html+="\t\t\t\t\t\t\t\t
      ";html+='\t\t\t\t\t\t\t\t\t
      ';html+="\t\t\t\t\t\t\t\t\t
      ";html+='\t\t\t\t\t\t\t\t\t\t';html+="\t\t\t\t\t\t\t\t\t
      ";html+="\t\t\t\t\t\t\t\t
      ";html+="\t\t\t\t\t\t\t
      ";html+='\t\t\t\t\t\t\t
      ';html+='\t\t\t\t\t\t\t\t';html+="\t\t\t\t\t\t\t
      ";html+="\t\t\t\t\t\t
      ";html+="\t\t\t\t\t
      ";html+="\t\t\t\t
      ";html+="\t\t\t
      ";html+="\t\t
      ";html=html.replace("$playButtonClass$",this.css.playButtonClass).replace("$progressBarClass$",this.css.progressBarClass).replace("$fullScreenClass$",this.css.fullScreenClass).replace("$controlsClass$",this.css.controlsClass).replace("$volumeControlClass$",this.css.volumeControlClass).replace("$volumeSliderClass$",this.css.volumeSliderClass).replace("$progressLabelClass$",this.css.progressLabelClass);html=html.replace("$playButtonId$",this._id("_ctrls_play")).replace("$progressBarId$",this._id("_ctrls_s")).replace("$fullScreenId$",this._id("_ctrls_fs_btn")).replace("$volumeControlId$",this._id("_ctrls_vc_btn")).replace("$volumeSliderId$",this._id("_ctrls_vs")).replace("$progressLabelId$",this._id("_ctrls_pl"));controlsDiv=$(html).appendTo(this.container).wrap('
      ');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}controlsArray.push(controlsDiv);if(!autoPlay&&videoElem.currentTime===0){controlsDiv.parent().hide();this._activeControlsIndex=1;controlsArray.push(this._renderTitleControls())}else{this._activeControlsIndex=0}this.controls=$(controlsArray);titleOption=autoPlay?"playing":"paused";$("#"+this._id("_ctrls_play")).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(autoPlay?"ui-icon-pause ":"ui-icon-play ")+"ui-igplayer-playbutton-icon "}}).addClass("ui-priority-primary").attr({title:this._getLocaleValue(titleOption),"data-localeid":titleOption,"data-localeattr":"title"});$("#"+this._id("_ctrls_fs_btn")).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:this.css.fullScreenIconClass}}).attr({title:this._getLocaleValue("enterFullscreen"),"data-localeattr":"title","data-localeid":"enterFullscreen"});$('
      ').appendTo($("#"+this._id("_ctrls_s")).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return false}clearTimeout(control._slideTimeout);control._slideTimeout=setTimeout(control._createDelegate(control,control._slide,[ui]),control._const.SLIDE_SEEK_TIMEOUT)},start:function(){control._userSliding=true},stop:function(){control._userSliding=false},bookmarkhit:function(event,ui){var index=ui.bookmark.index,elems=control.bookmarkElements;if(elems&&elems.length>0){control._changeActiveBookmark(index);control._bookmarkHit(control.currentVideo[0].currentSrc,control.options.bookmarks[index],elems[index],event)}},bookmarkclick:function(event,ui){var mark;if($(ui.bookmarkElement).hasClass("ui-igplayer-linked-bookmark")){mark=control.options.commercials.linkedCommercials[ui.bookmark.index]}else if($(ui.bookmarkElement).hasClass("ui-igplayer-ad-bookmark")){mark=control.options.commercials.embeddedCommercials[ui.bookmark.index]}else{mark=control.options.bookmarks[ui.bookmark.index];control._changeActiveBookmark(ui.bookmark.index)}if(mark.time){cachedTime=mark.time}else{cachedTime=mark.startTime}control.currentTime(cachedTime);control._bookmarkClick(mark,ui.bookmarkElement,event);return false},min:0,max:100,animate:true}).css("display","block")).igProgressBar({range:true,endValue:0});$("#"+this._id("_ctrls_pb")).bind({mousemove:function(e){if(control.options.showSeekTime&&this.offsetWidth>0){var relativeX=e.pageX-this.offsetLeft-$(this).igOffset().left,percentLocation=parseInt(relativeX/this.offsetWidth*100,10),duration=videoElem.duration,seconds,controlOffset=control.container.igOffset();if(!isNaN(duration)&&duration!==Infinity&&!control._commercialPlaying){seconds=parseInt(percentLocation*duration/100,10);control._showSeekTimeToolTip(e.pageX-controlOffset.left,e.pageY-controlOffset.top,seconds)}}},mouseout:function(){$("#"+control._id("_seek_tooltip")).hide()}});$("#"+this._id("_ctrls_pl")).bind({click:function(event){event.preventDefault()}});$("#"+this._id("_ctrls_vc_btn")).bind({mouseover:function(){control._showVolumeSlider()},mouseout:function(event){if(!$.contains(event.currentTarget,event.relatedTarget)&&event.currentTarget!==event.relatedTarget){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}},click:function(event){event.preventDefault();control._setOption("muted",!control.options.muted)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(this.options.muted?"ui-icon-volume-off":"ui-icon-volume-on")+" ui-igbutton-icon"}}).attr({title:this._getLocaleValue("volume"),"data-localeid":"volume","data-localeattr":"title"});$("#"+this._id("_ctrls_vs")).hide().bind({mouseover:function(){control._volumeSliderMouseOut=false;clearTimeout(control._volumeSliderTimeoutId)},mouseout:function(){if(!control._userSlidingVolume){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}control._volumeSliderMouseOut=true}}).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return}control._setOption("volume",parseFloat(parseInt(ui.value,10)/100))},start:function(){control._userSlidingVolume=true},stop:function(){control._userSlidingVolume=false},min:0,max:100,step:10,orientation:"vertical",value:this.options.muted?0:this.options.volume*100});$("#"+this._id("_ctrls_vs")).data("igSlider").handle.attr("tabIndex",-1).bind({blur:function(){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}});this.controlButtons=$([document.getElementById(this._id("_ctrls_play")),$("a.ui-state-default",$("#"+this._id("_ctrls_s")))[0],document.getElementById(this._id("_ctrls_vc_btn")),document.getElementById(this._id("_ctrls_fs_btn"))]);this.controlButtons.each(function(i){$(this).data("index.control-button",i)});this.controlButtons.bind({keydown:function(event){control._handleKbNavigation(event)},focus:function(event){control._handleFocusKb(event)},blur:function(event){control._handleBlurKb(event); }});$("#"+this._id("_ctrls_vc_btn")).bind({focus:function(){control._showVolumeSlider()},blur:function(){if(!control._transferFocusFromVolumeButtonToVolumeSlider){control._hideVolumeSlider()}control._transferFocusFromVolumeButtonToVolumeSlider=false},keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();control._transferFocusFromVolumeButtonToVolumeSlider=true;$("#"+control._id("_ctrls_vs")).data("igSlider").handle.focus()}}});$("#"+control._id("_ctrls_vs")).data("igSlider").handle.bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();$("#"+control._id("_ctrls_fs_btn")).focus()}}})},_updateNotSupportedBrowserContainer:function(){var $container=this.container.find("[data-not-supported-browser]");if($container.length){$container.remove();$.ig.util._renderUnsupportedBrowser(this,this._getLocaleDictionary())}},changeLocale:function(){this._super();var $button=$("#"+this._id("_rv_bar_replay")),$progressLabel=$("#"+this._id("_ctrls_pl"));if($button.length){$button.igButton("option",{labelText:this._getLocaleValue("replayButton")})}if($progressLabel.length){this._updateProgressLabel()}this._updateButtonLabel(this._id("_waiting"),this._getLocaleValue("buffering"));this._updateButtonLabel(this._id("_detectError"),this._getLocaleValue("missingVideoSource"));this._refreshDuration(true);this._updateNotSupportedBrowserContainer()},_slide:function(ui){var value=ui.value,rawDuration=this.currentVideo[0].duration,currentTime=rawDuration*(value/100);if(!isNaN(rawDuration)&&rawDuration!==Infinity){this.currentTime(currentTime)}this._userSliding=false},_changeActiveBookmark:function(index){var activeBookmarkIndex=this._activeBookmarkIndex,bkElems=this.bookmarkElements;if(bkElems&&bkElems.length>0&&index!==activeBookmarkIndex){if(activeBookmarkIndex>=0&&activeBookmarkIndex=0&&index0){$("#"+this._id("_rvcc")).hide()}},togglePlay:function(){var videoElem=this.currentVideo[0];this._prepareForPlay();this._toggleCenterPlayButton();if(videoElem.paused||videoElem.ended){if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("playing"),"data-localeid":"playing","data-localeattr":"title"})}videoElem.play()}else{if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("paused"),"data-localeid":"paused","data-localeattr":"title"})}videoElem.pause()}},play:function(){var videoElem=this.currentVideo[0];if(videoElem.paused||videoElem.ended){this._prepareForPlay();this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("playing"),"data-localeid":"playing","data-localeattr":"title"})}videoElem.play()}},pause:function(){var videoElem=this.currentVideo[0];if(!videoElem.paused){this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("paused"),"data-localeid":"paused","data-localeattr":"title"})}videoElem.pause()}},currentTime:function(val){var videoElem=this.currentVideo[0],rawDuration=videoElem.duration;if(val!==null&&val!==undefined){try{if($.ig.util.isIE){$(videoElem).on("loadedmetadata",function(){this.currentTime=val})}videoElem.currentTime=val;$("#"+this._id("_ctrls_pb")).igProgressBar("option","value",(val/rawDuration).toFixed(2)*100);this._checkCommercialsShow(val);this._checkEmbeddedCommercialShow(val)}catch(ex){}if(videoElem.paused&&!isNaN(rawDuration)){$("#"+this._id("_ctrls_s")).igSlider("option","value",(val/rawDuration).toFixed(2)*100)}}return parseInt(videoElem.currentTime,10)},screenshot:function(scaleFactor){if(!scaleFactor||$.type(scaleFactor)!=="number"){scaleFactor=1}var videoElem=this.currentVideo[0],w=videoElem.videoWidth*scaleFactor,h=videoElem.videoHeight*scaleFactor,canvas=document.createElement("canvas"),ctx;if(canvas.getContext){canvas.width=w;canvas.height=h;ctx=canvas.getContext("2d");ctx.drawImage(videoElem,0,0,w,h)}return canvas},supportsVideo:function(){return!!document.createElement("video").canPlayType},supportsH264BaselineVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')!==""},supportsOggTheoraVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/ogg; codecs="theora, vorbis"')!==""},supportsWebmVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/webm; codecs="vp8, vorbis"')!==""},paused:function(){return this.currentVideo[0].paused},ended:function(){return this._getMainVideo()[0].ended},duration:function(){this._refreshDuration();return this._duration},_refreshDuration:function(forceUpdate){var duration=this.currentVideo[0].duration;if(duration!==this._duration||forceUpdate){this._duration=duration;if(duration===Infinity){this._updateTitleControlsTimeString(this._getLocaleValue("live"),this._getLocaleValue("liveStream"));$("#"+this._id("_ctrls_s")).data("igSlider").handle.hide();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true)}else if(!isNaN(duration)){if(this._commercialPlaying){this._showAdMessage(parseInt(duration,10))}else{this._updateTitleControlsTimeString(this._toTimeString(duration));if(!this._bookmarksRendered&&duration>0){this._renderBookmarks()}}}}},seeking:function(){return this.currentVideo[0].seeking},destroy:function(){var css=this.css;var isFullscreen=this.options.fullscreen;clearTimeout(this._scrollingTimoutId);clearTimeout(this._volumeSliderTimeoutId);clearTimeout(this._onVideoStateChangeId);clearTimeout(this._resizeBookmarkAreaTimeoutId);if(this._oldWidth){this.element.css("width",this._oldWidth)}if(this._oldHeight){this.element.css("height",this._oldHeight)}this.container.unbind(this._generalEvts);$(document).unbind(this._documentEvts);if(this._controlsEvts){this.container.unbind(this._controlsEvts)}this.container.removeClass(css.baseClasses);$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");$("#"+this._id("_seek_tooltip")).igTooltip("destroy");if(this._commercialsShow){delete this._commercialsShow;delete this._commercialIndex;delete this._commercialPlaying}if(this._embeddedCommercialsShow){delete this._embeddedCommercialPlaying;delete this._embeddedCommercialIndex;delete this._embeddedCommercialsShow}delete this.bookmarkElements;delete this.relatedVideoElements;delete this.controlButtons;delete this._bannerShow;delete this.banner;if(this.element.is("video")){this.element.unbind(this._videoEvents);this.element.removeClass(css.videoClass);this._restoreExistingVideoProperties(this.element);$(":not(video)",this.container).remove();this.element.unwrap()}else{this.container.children().remove()}if(isFullscreen){$(".ui-igplayer-full-screen-mode").removeClass("ui-igplayer-full-screen-mode")}this._superApply(arguments)},_destroyBookmarks:function(){if(this.bookmarkElements&&this.bookmarkElements.length>0){this.bookmarkElements.unbind();this.bookmarkElements.removeData();delete this.bookmarkElements;$("#"+this._id("_bookmarks")).remove();$("#"+this._id("_ctrls_s")).igSlider("clearBookmarks");this._bookmarksRendered=false}},_destroyRelatedVideos:function(){var related=this.options.relatedVideos;if(related&&related.length>0){$("#"+this._id("_rvcc")).remove();delete this.relatedVideoElements;related=[]}},_destroyControls:function(){var controls=this.options.browserControls;if(!controls){$("#"+this._id("_ctrls_play")).igButton("destroy");$("#"+this._id("_ctrls_vc_btn")).igButton("destroy");$("#"+this._id("_ctrls_fs_btn")).igButton("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");this.controls.each(function(){$(this).parent().remove()});delete this.controls;delete this.controlButtons;delete this._activeControlsIndex}}});$.extend($.ui.igVideoPlayer,{version:"19.1.20"})})($);/*!@license * Infragistics.Web.ClientUI Tree Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.shared.js * infragistics.util.js * infragistics.ui.grid.framework.js */ (function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igTreeGrid",$.ui.igGrid,{css:{containerClasses:"ui-igtreegrid",expandCellExpanded:"ui-icon ui-igtreegrid-expansion-indicator ui-icon-minus",expandCellCollapsed:"ui-icon ui-igtreegrid-expansion-indicator ui-icon-plus",dataSkipCell:"ui-igtreegrid-non-data-column",expandColumn:"ui-igtreegrid-expansion-indicator-cell",dataColumnExpandContainer:"ui-igtreegrid-expansion-indicator-container",expandColumnContainer:"ui-igtreegrid-expansion-column-container",expandContainer:"ui-igtreegrid-expandcell",expandHeaderCell:"ui-igtreegrid-expansion-indicator-header-cell ui-iggrid-header ui-widget-header",rowLevel:"ui-igtreegrid-rowlevel"},options:{indentation:30,initialIndentationLevel:-1,showExpansionIndicator:true,expandTooltipText:null,collapseTooltipText:null,foreignKey:null,initialExpandDepth:-1,foreignKeyRootValue:-1,renderExpansionIndicatorColumn:false,renderFirstDataCellFunction:null,childDataKey:"childData",renderExpansionCellFunction:null,enableRemoteLoadOnDemand:false,dataSourceSettings:{propertyExpanded:null,propertyDataLevel:null,expandedKey:"__ig_options.expanded",dataLevelKey:"__ig_options.dataLevel",initialFlatDataView:false},locale:{expandTooltipText:undefined,collapseTooltipText:undefined},virtualizationMode:"continuous",avgColumnWidth:null,avgRowHeight:25,columnVirtualization:null,restSettings:{}},events:{rowExpanding:"rowExpanding",rowExpanded:"rowExpanded",rowCollapsing:"rowCollapsing",rowCollapsed:"rowCollapsed"},_isHierarchicalDataSource:true,_create:function(){this._checkForUnsoppertedScenarios();var func=this.options.renderFirstDataCellFunction;if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderFirstDataCellHandler=func}else{this._renderFirstDataCellHandler=$.proxy(this._renderFirstDataCell,this)}func=this.options.renderExpansionCellFunction;if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderExpandCellHandler=func}else{this._renderExpandCellHandler=$.proxy(this._renderExpandCell,this)}this._overrideFunctions();this._attachEvents();this.element.data($.ui.igGrid.prototype.widgetName,this.element.data($.ui.igTreeGrid.prototype.widgetName));this.options.dataSourceSettings.expandedKey=this.options.dataSourceSettings.propertyExpanded||this.options.dataSourceSettings.expandedKey;this.options.dataSourceSettings.dataLevelKey=this.options.dataSourceSettings.propertyDataLevel||this.options.dataSourceSettings.dataLevelKey;$.ui.igGrid.prototype._create.apply(this,arguments);this.element.attr("role","treegrid")},_changeLanguage:function(language){var self=this,i,f,features=this.options.features,featureInstance;this.options.language=language;for(i=0;istrIgGrid.length&&(argsLen===2||argsLen===3)){name="igtreegrid"+name.substr(strIgGrid.length);if(argsLen===2){return func.call(e,name,arg1)}return func.call(e,name,arg1,arg2)}else if($.type(name)==="object"){for(evtName in name){if(name.hasOwnProperty(evtName)){if($.type(evtName)==="string"&&evtName.indexOf(strIgGrid)===0){oEvtName=evtName;evtName="igtreegrid"+evtName.substr(strIgGrid.length);name[evtName]=name[oEvtName]}}}}return func.apply(e,arguments)}},_updateParentRowAfterDelete:function($pRow,dataLevel){var dl,found,rowId,children,ds=this.dataSource,primaryKeyCol,rec,identation=this.dataSource.getDataBoundDepth();if(isNaN(dataLevel)||dataLevel<=0){return}while($pRow.length===1){dl=parseInt($pRow.attr("aria-level"),10);if(isNaN(dl)){break}if(dl0){transaction=transactions[i];tr=this.element.find("tr[data-id='"+transaction.rowId+"']");if(transaction.type==="insertnode"){tridx=this.element.children("tbody").children("tr:not([data-container],[data-grouprow])").index(tr);prevTr=tr.prev("tr");dataLevel=parseInt(tr.attr("aria-level"),10);tr.remove();this._reapplyZebraStyle(tridx);this._updateParentRowAfterDelete(prevTr,dataLevel)}}}else{this.dataBind()}}return transactions},dataBind:function(){if(!this._initialized){this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this._headerInitCallbacks.push({type:"TreeGrid",func:this._renderExtraHeaderCellHandler});this._footerInitCallbacks.push({type:"TreeGrid",func:this._renderExtraFooterCellHandler})}else{if(this._inferOpType()==="remote"&&this.dataSource&&this.dataSource.schema()){this.dataSource._data=[]}}$.ui.igGrid.prototype.dataBind.apply(this,arguments)},_generateDataSourceOptions:function(){var o=this.options,ds=o.dataSource,instanceOfDs,tds,opts=$.ui.igGrid.prototype._generateDataSourceOptions.apply(this,arguments);opts.treeDS={childDataKey:o.childDataKey,initialExpandDepth:o.initialExpandDepth,foreignKey:o.foreignKey,foreignKeyRootValue:o.foreignKeyRootValue};opts.treeDS=$.extend(opts.treeDS,o.dataSourceSettings);opts.treeDS.enableRemoteLoadOnDemand=o.enableRemoteLoadOnDemand;opts.treeDS.dataSourceUrl=o.dataSourceUrl;if(o.dataSourceUrl===null&&typeof ds==="string"){opts.treeDS.dataSourceUrl=ds}instanceOfDs=ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function";if(instanceOfDs){if(ds._isHierarchicalDataSource!==undefined){ds.settings.treeDS=ds.settings.treeDS||{};ds.settings.treeDS=$.extend(ds.settings.treeDS,opts.treeDS)}else{if($.type(ds.settings.dataSource)==="array"||$.type(ds.settings.dataSource)==="object"){tds=ds.settings.dataSource}else if($.type(ds.settings.dataSource)!=="string"){tds=ds.data()}else{tds=[]}ds.settings.dataSource=null;ds.settings.data=null;if(opts&&opts.dataSource){opts.dataSource=null}opts=$.extend(true,{},ds.settings,opts);opts.dataSource=tds;tds=null;o.dataSource=new $.ig.TreeHierarchicalDataSource(opts)}}else{opts.dataSource=ds}if(o.dataSourceType!==null){opts.type=o.dataSourceType}return opts},_getDataColumns:function(cols){var i,j,res=[],colsLength=cols.length,dCols;for(i=0;i0){schema={};schema.fields=[];j=0;for(i=0;itr>td>span[data-expandcell-indicator]"}else{selector="td[data-expand-cell=1]"}$cont.off(".toggleTreegrid");$cont.on({"mouseup.toggleTreegrid":$.proxy(this._onMouseUpExpander,this),"keydown.toggleTreegrid":$.proxy(this._onKeyDownExpander,this),"click.toggleTreegrid":function(e){e.stopPropagation()}},selector)},_getTotalRowCount:function(){return this._getDataView().length},_getDataView:function(){return this.dataSource.flatDataView()},_renderVirtualRecordsContinuous:function(from){var to,$scrollContainer,scrllToBttm=false,$ae,$cell,$row,rowId,cellInd,$tr;if(_aNull(from)){$.ui.igGrid.prototype._renderVirtualRecordsContinuous.apply(this,arguments)}else{this._totalRowCount=this._getTotalRowCount();if(from>this._totalRowCount){return $.ui.igGrid.prototype._renderVirtualRecordsContinuous.apply(this,arguments)}this._virtualRowCount=this._determineVirtualRowCount();if(this._virtualRowCount>this._totalRowCount){this._virtualRowCount=this._totalRowCount}to=from+parseInt(this._virtualRowCount,0);if(to>this._totalRowCount){to=this._totalRowCount-1;from=to-this._virtualRowCount;scrllToBttm=true;if(from<0){from=0}}$ae=$(document.activeElement);$cell=$ae.closest("td");$row=$ae.closest("tr");cellInd=$cell.index();rowId=$row.attr("id");this._renderRecords(from,to);this._avgRowHeight=this._calculateAvgRowHeight();this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight);if(scrllToBttm){$scrollContainer=this._scrollContainer();$scrollContainer[0].scrollTop=this._totalRowCount*this._avgRowHeight+1}if(rowId){$tr=$("#"+rowId.replace(/(:|\.|\[|\]|,|\/)/g,"\\$1"));if($tr.length){if($ae.is("tr")){$ae=$tr;$tr.focus()}else if($ae.is("td")){$ae=$tr.children("td:nth-child("+(cellInd+1)+")");$ae.focus()}else if($ae.attr("data-expand-button")!==undefined){$ae=$tr.find("[data-expand-button]");$ae.focus()}this._fireInternalEvent("_virtualRecordsRendered",{row:$tr,activeElement:$ae,cellInd:cellInd})}}}},_rerenderDataSkipColumn:function(){var $cntnr=this.container();$cntnr.find("thead").find("th").find("[data-treegrid-th]").remove();this._rerenderColgroups();if(this.options.width===null){this._updateContainersWidthOnGridWidthNull()}else{this._adjustLastColumnWidth(true)}},_addDataSkipColumn:function(dbd){if(!this.options.renderExpansionIndicatorColumn){return}var optInd=this.options.indentation,indent,$thDataSkip,$gridColgroup,$headersTbl,$footersTbl,cf;if(_aNull(dbd)){dbd=this.options.initialIndentationLevel>0?this.options.initialIndentationLevel:this.dataSource.getDataBoundDepth()}dbd=dbd||1;if(dbd>=0){indent=parseInt(optInd,10)*dbd;if(optInd&&optInd.indexOf&&optInd.indexOf("%")>=0){indent=indent+"%"}cf=this.hasFixedColumns()&&this.fixingDirection()==="left";if(cf){$gridColgroup=this.fixedBodyContainer().find("colgroup:first")}else{$gridColgroup=this.element.find("colgroup:first")}this._addColHelper($gridColgroup,indent);if(cf){$headersTbl=this.fixedHeadersTable()}else{$headersTbl=this.headersTable()}if($headersTbl.attr("id")!==this.element.attr("id")){this._addColHelper($headersTbl.find("colgroup:first"),indent)}if(cf){$footersTbl=this.fixedFootersTable()}else{$footersTbl=this.footersTable()}if($footersTbl.attr("id")!==this.element.attr("id")){this._addColHelper($footersTbl.find("colgroup"),indent)}if(!$headersTbl.find("> thead th[data-treegrid-th]").length){if(!$headersTbl.find("> thead tr:nth-child(1) th.ui-iggrid-rowselector-header").length){$thDataSkip=$("").prependTo($headersTbl.find("> thead tr:nth-child(1)"))}else{$thDataSkip=$("").insertAfter($headersTbl.find("> thead tr:nth-child(1) th.ui-iggrid-rowselector-header"))}$thDataSkip.addClass(this.css.expandHeaderCell).attr("data-skip",true).attr("data-treegrid-th",true);if(this._isMultiColumnGrid){$thDataSkip.attr("rowspan",this._maxLevel+1)}}}},_addColHelper:function($colgroup,width){var $col=$colgroup.find("col[data-treegrid-col]");if($col.length===0){$col=$("").prependTo($colgroup).attr("data-skip","true").attr("data-treegrid-col","true")}if(width){$col.width(width)}},_renderHeader:function(){$.ui.igGrid.prototype._renderHeader.apply(this,arguments);this.container().addClass(this.css.containerClasses)},_getHtmlForDataView:function(ds,isFixed,start,end){var i,dsLen,html="";ds=ds||this._getDataView();dsLen=ds.length;if(start===undefined){start=0;end=dsLen-1}if(start!==undefined&&end===undefined){end=start;start=0}start=start<0?0:start;end=end>dsLen-1?dsLen-1:end;for(i=start;i<=end;i++){html+=this._renderRecord(ds[i],i,isFixed)}return html},_renderRecord:function(data,rowIndex,isFixed,rowData){return this._renderRecordInternal(data,rowIndex,isFixed,rowData)},_renderRecordInternal:function(data,rowIndex,isFixed,rowData){var html="",markup,isContainerOnTheLeft,idxStart,children,hasChildren,o=this.options,key=this.options.primaryKey,dataBoundDepth,cssClass,id=this.id(),owns="";if(!rowData){children=data[o.childDataKey];hasChildren=children&&(children===true||$.type(children)==="array"&&(o.enableRemoteLoadOnDemand||children.length>0));rowData={dataBoundDepth:data[o.dataSourceSettings.dataLevelKey],parentCollapsed:false,hasExpandCell:hasChildren,children:children,expand:data[o.dataSourceSettings.expandedKey]}}dataBoundDepth=rowData.dataBoundDepth;cssClass=this.css.rowLevel+dataBoundDepth;html+="0){html+=' style="display: none;"'}if(rowData.hasExpandCell){$(rowData.children).each(function(){owns+=id+"_"+this[key]+" "});owns=owns.trimEnd();if(owns!==""){html+=' aria-owns="'+owns}html+='" aria-expanded="'+rowData.expand+'"'}html+=' role="row" tabIndex="'+this.options.tabIndex+'">';isContainerOnTheLeft=this._isDataContainerOnTheLeft(isFixed);if(this._shouldRenderDataSkipColumn(isFixed)){if(this._selection&&this._selection instanceof $.ig.SelectedRowsCollection){html+=this._editCellStyle(this._renderExpandCellHandler(rowData),data,key)}else{html+=this._renderExpandCellHandler(rowData)}}markup=$.ui.igGrid.prototype._renderRecord.call(this,data,rowIndex,isFixed);if(isContainerOnTheLeft){html+=this._renderFirstDataCellHandler(markup,rowData)}else{idxStart=markup.indexOf("",2);otherTDSmarkup=TDSmarkup.substring(tdContentFirstInd+1);newTDSmarkup=TDSmarkup.substring(0,tdContentFirstInd);if(this.options.renderExpansionIndicatorColumn){newTDSmarkup+=' data-cell-shift-container="1">'}else{classIdx=newTDSmarkup.indexOf('class="');if(classIdx>-1){newTDSmarkup=newTDSmarkup.substring(0,classIdx+7)+this.css.expandColumn+" "+newTDSmarkup.substr(classIdx+7)}else{newTDSmarkup+=' class="'+this.css.expandColumn+'"'}newTDSmarkup+=' data-expand-cell="1">'}newTDSmarkup+=this._renderExpandCellContainer(rowData);newTDSmarkup+=otherTDSmarkup;return newTDSmarkup},_renderExpandCellContainer:function(rowData){var span="",margin,dataBoundDepth=rowData.dataBoundDepth;margin=dataBoundDepth>0?parseInt(this.options.indentation,10)*dataBoundDepth:0;if(this.options.renderExpansionIndicatorColumn){span=''}else{span=this._renderExpandCellContainerHelper(rowData)}return span},_renderExpandCellContainerHelper:function(rowData){var span="",css,title,margin,dataBoundDepth=rowData.dataBoundDepth,cssEC=this.css.expandContainer,renderExpandButton=rowData.hasExpandCell;if(this.options.renderExpansionIndicatorColumn){cssEC=this.css.expandColumnContainer}margin=dataBoundDepth>0?parseInt(this.options.indentation,10)*dataBoundDepth:0;if($.type(this.options.indentation)==="string"&&this.options.indentation.indexOf("%")>0){margin+="%"}else{margin+="px"}span='';if(renderExpandButton&&this.options.showExpansionIndicator){if(rowData.expand){css=this.css.expandCellExpanded;title=this._getLocaleValue("collapseTooltip")}else{css=this.css.expandCellCollapsed;title=this._getLocaleValue("expandTooltip")}span+='"}span+="";return span},_renderExpandCell:function(rowData){if(!rowData.hasExpandCell){return this._renderDataSkipCell()}var html,css;css=(this.css.expandColumn+" "+this.css.dataSkipCell).trim();html='';if(this.options.showExpansionIndicator){html+=this._renderExpandCellContainerHelper(rowData)}return html+""},_renderDataSkipCell:function(){return''},_rerenderColgroups:function(){$.ui.igGrid.prototype._rerenderColgroups.apply(this,arguments);this._addDataSkipColumn()},_columnsGenerated:function(){var cols=this.options.columns,key,i,sDS=this.options.dataSourceSettings,arrSkipColumns=[this.options.childDataKey,sDS.expandedKey,sDS.dataLevelKey];for(i=0;i tbody > tr[data-row-idx="+$row.attr("data-row-idx")+"]");diff=$curRow.igOffset().top-offsetTop;if(Math.abs(diff)>1){callAsync=true;setTimeout(function(){$scrollContainer[0].scrollTop=$scrollContainer.scrollTop()+diff},50)}}}else{callAsync=true;this._updateVirtualScrollContainer()}}}if(callAsync){setTimeout(function(){$this._callDataToggledEventsAndCallbacks(customCallback,expand,eArgs,triggerEvents);$this._refreshIgScrollBars()},55)}else{this._callDataToggledEventsAndCallbacks(customCallback,expand,eArgs,triggerEvents);this._refreshIgScrollBars()}},_avgRowHeightChanged:function(){var top=this._getScrollContainerScrollTop(),h=this._getScrollContainerHeight();this._updateVirtualScrollContainer();this._correctVirtVertScrollTop(top,h)},_callDataToggledEventsAndCallbacks:function(customCallback,expand,eArgs,triggerEvents){var hasHeight=this.options.height&&parseInt(this.options.height,10)>0,isVirt=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true;if(customCallback){$.ig.util.invokeCallback(customCallback,[this,{unfixedRow:eArgs.row,fixedRow:eArgs.fixedRow},eArgs.dataRecord,expand])}if(hasHeight&&!isVirt&&this._hasVerticalScrollbar!==this.hasVerticalScrollbar()){this._adjustLastColumnWidth()}if(expand){this._fireInternalEvent("_rowExpanded",eArgs)}else{this._fireInternalEvent("_rowCollapsed",eArgs)}if(triggerEvents){if(expand){this._trigger(this.events.rowExpanded,null,eArgs)}else{this._trigger(this.events.rowCollapsed,null,eArgs)}}},toggleRow:function(row,callback){var $row,state,expand,ds=this.dataSource;if(row instanceof $){$row=row}else{$row=this.element.find("tr[data-id="+row+"]")}state=$row.attr("aria-expanded");if(!$row.length){expand=!ds.getExpandStateById(row)}else{expand=state==="false"}this._expandCollapseRow(row,expand,false,callback)},expandRow:function(row,callback){this._expandCollapseRow(row,true,false,callback)},collapseRow:function(row,callback){this._expandCollapseRow(row,false,false,callback)},_onMouseUpExpander:function(event){var $et=$(event.target);if($et.attr("data-expandcell-indicator")!==undefined){$et.find("[data-expand-button]").focus()}this._toggleRow($et.closest("tr"))},_onKeyDownExpander:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){this._toggleRow($(event.target).closest("tr"));event.preventDefault();event.stopPropagation()}},_toggleRow:function($row){if(!$row.length){return}var state=$row.attr("aria-expanded"),expand;if(state===undefined){return}expand=state==="false"||state==="0";this._expandCollapseRow($row,expand,true)},_expandCollapseRow:function(row,expand,triggerEvents,callback){var primaryKeyCol,noCancel=true,func,args,callbackArgs,rowId,$row,me=this,rows,$fRow,$ufRow,isExpanded=expand,$tr,$ae,$cell,cellInd;if(row instanceof $){$row=row;if(!_aNull(this.options.primaryKey)){primaryKeyCol=this.columnByKey(this.options.primaryKey);rowId=$row.attr("data-id");if(primaryKeyCol&&(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric")){rowId=parseInt(rowId,10)}}else{rowId=$row.index()}}else{rowId=row;$row=this.element.find("tr[data-id="+row+"]")}if($row.length===1&&$row.attr("aria-expanded")===isExpanded.toString()){return}func=$.proxy(this._onDataRecordToggled,this);callbackArgs={callback:func,args:{row:$row,triggerEvents:triggerEvents}};if(callback){callbackArgs.args.customCallback=callback}rows=this._getRows($row);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow;args={owner:this,row:$ufRow,fixedRow:$fRow,dataLevel:parseInt($row.attr("aria-level"),10)};if(triggerEvents){if(expand){noCancel=this._trigger(this.events.rowExpanding,null,args)}else{noCancel=this._trigger(this.events.rowCollapsing,null,args)}}if(noCancel){this._loadingIndicator.show();$ae=$(document.activeElement);$cell=$ae.closest("td");cellInd=$cell.index();me.dataSource.setExpandedStateByPrimaryKey(rowId,expand,callbackArgs);if(me._rerenderGridRowsOnToggle()){$tr=me.element.find('[data-id="'+rowId+'"]');if($tr.length){if($ae.is("tr")){$ae=$tr;$tr.focus()}if($ae.is("td")){$ae=$tr.children("td:nth-child("+(cellInd+1)+")");$ae.focus()}else if($ae.attr("data-expand-button")!==undefined){$ae=$tr.find("[data-expand-button]");$ae.focus()}}}}},_toggleRowSuccessors:function($row){var $nextRow=$row,foundUpperLevel=false,dL,$fRow,$ufRow=$row,levelCollapsed=null,$container,dataBoundDepth=parseInt($row.attr("aria-level"),10),isExpanded=$row.attr("aria-expanded"),styleDisplay="",expanded=isExpanded==="true";if(expanded){styleDisplay="none"}if(this.hasFixedColumns()){if(this._isFixedElement($row)){$fRow=$row;if(this._rowVirtualizationEnabled()){$container=this._vdisplaycontainer()}else{$container=this.scrollContainer()}$ufRow=$container.find("tbody > tr").eq($row.index())}else{$fRow=this.fixedBodyContainer().find("tbody > tr").eq($row.index())}}while($nextRow.length===1&&!foundUpperLevel){$nextRow=$nextRow.next("tr[aria-level]");dL=parseInt($nextRow.attr("aria-level"),10);if(isNaN(dL)||dL<=dataBoundDepth){foundUpperLevel=true;break}if(!expanded){if(levelCollapsed!==null){if(dL<=levelCollapsed){levelCollapsed=null}else{continue}}if($nextRow.attr("aria-expanded")==="false"){levelCollapsed=dL}}this._showHideRow($nextRow,styleDisplay)}if(expanded){$ufRow.add($fRow).attr({"data-populated":"1","aria-expanded":false}).find("[data-expand-button]").attr({title:this._getLocaleValue("expandTooltip"),"data-localeid":"expandTooltip","data-localeattr":"title"}).removeClass(this.css.expandCellExpanded).addClass(this.css.expandCellCollapsed)}else{$ufRow.add($fRow).attr("aria-expanded",true).find("[data-expand-button]").attr({title:this._getLocaleValue("collapseTooltip"),"data-localeid":"collapseTooltip","data-localeattr":"title"}).removeClass(this.css.expandCellCollapsed).addClass(this.css.expandCellExpanded)}},_showHideRow:function($row,styleDisplay){var rows,$ufRow=$row,$fRow,fixedColumns=this.hasFixedColumns();if(fixedColumns){rows=this._getRows($row);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow}$ufRow.css("display",styleDisplay);if($fRow){$fRow.css("display",styleDisplay)}if(styleDisplay===""){this._trigger("_rowShown",this,{fRow:$fRow,ufRow:$ufRow})}else{this._trigger("_rowHidden",this,{fRow:$fRow,ufRow:$ufRow})}},_renderExtraHeaderCells:function(row,colgroup,prepend){if(!this.options.renderExpansionIndicatorColumn){return}if(prepend===true){$("").prependTo(row).css("border-width",0).attr("data-skip",true);if(colgroup){$("").prependTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}else{$("").appendTo(row).css("border-width",0).attr("data-skip",true);if(colgroup){$("").appendTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}},_isFixedNonDataColumnsOnly:function(){if(this.hasFixedColumns()&&(!this._fixedColumns||!this._fixedColumns.length)){return true}return false},_isDataContainerOnTheLeft:function(isFixed){var fdLeft=this.fixingDirection()==="left";if(!this.hasFixedColumns()){return true}if($.type(this._fixedColumns)==="array"&&!this._fixedColumns.length){return true}if(isFixed){return fdLeft}return!fdLeft},_getRows:function($row){var index,$fRow,$ufRow=$row;if(this.hasFixedColumns()){index=$row.index();if(this._isFixedElement($row)){$fRow=$row;$ufRow=$(this.rowAt(index))}else{$fRow=$(this.fixedRowAt(index))}}return{fixedRow:$fRow,unfixedRow:$ufRow}},_renderRow:function(rec,tr){var funcCallbak;funcCallbak=function(rec,tr){return $.ui.igGrid.prototype._renderRow.call(this,rec,tr)};return this._persistExpansionIndicator(rec,tr,funcCallbak,this)},renderNewChild:function(rec,parentId){var tbody=this.element.children("tbody"),tbodyFixed=this.fixedBodyContainer().find("tbody"),virt=this.options.virtualization===true||this.options.rowVirtualization===true,prevRow,dlprop=this.options.dataSourceSettings.dataLevelKey,dl,parent,rowData,fixing=this.hasFixedColumns(),unfixedRow,fixedRow,dataId,index=this._recordIndexInFlatView(rec[this.options.primaryKey]);if(parentId===undefined||parentId===null){this.renderNewRow(rec)}else{if(virt){this._renderVirtualRecordsContinuous();this._startRowIndex=0;this.virtualScrollTo(index)}else{parent=this.dataSource.findRecordByKey(parentId);if(parent===null){throw new Error(this._getLocaleValue("recordNotFound").replace("{id}",parentId))}parent[this.options.dataSourceSettings.expandedKey]=true;this.dataSource.generateFlatDataView();dl=parent[dlprop]+1;prevRow=this.rowById(parentId);while(prevRow.nextAll(":not(.ui-iggrid-addrow)").first().length>0){if(parseInt(prevRow.nextAll(":not(.ui-iggrid-addrow)").first().attr("aria-level"),10)>=dl){prevRow=prevRow.nextAll(":not(.ui-iggrid-addrow)").first()}else{break}}prevRow=prevRow?prevRow:this.rowById(parentId);rowData={dataBoundDepth:dl};dataId=prevRow.attr("data-id");this._fireInternalEvent("_childRowRendering",{id:rec[this.options.primaryKey],parentId:parentId});unfixedRow=this._renderRecord(rec,prevRow.index()+1,false,rowData);if(fixing){fixedRow=this._renderRecord(rec,prevRow.index()+1,true,rowData)}if(prevRow.length>0){$(prevRow).after(unfixedRow);if(fixing){tbodyFixed.find("tr[data-id="+dataId+"]").after(fixedRow); }}else{tbody.append(unfixedRow);if(fixing){tbodyFixed.append(fixedRow)}}}}},_recordIndexInFlatView:function(rowId){var dv=this.dataSource.flatDataView(),pk=this.options.primaryKey,index=-1;for(var i=0;i0){$span.prependTo($td)}return trRes},_detachEvents:function(){if(this._columnsGeneratedHandler){this.element.unbind("igtreegrid_columnsgenerated",this._columnsGeneratedHandler)}if(this._containersRenderedHandler){this.element.unbind("iggrid_gridcontainersrendered",this._containersRenderedHandler)}if(this._avgRowHeightChangedHandler){this.element.unbind("iggridavgrowheightchanged",this._avgRowHeightChangedHandler)}$.ui.igGrid.prototype._detachEvents.apply(this,arguments)},_attachEvents:function(){this._columnsGeneratedHandler=$.proxy(this._columnsGenerated,this);this.element.bind("igtreegrid_columnsgenerated",this._columnsGeneratedHandler);this._containersRenderedHandler=$.proxy(this._containersRendered,this);this.element.bind("iggrid_gridcontainersrendered",this._containersRenderedHandler);if(this.options.virtualization||this.options.rowVirtualization){this._avgRowHeightChangedHandler=$.proxy(this._avgRowHeightChanged,this);this.element.bind("iggridavgrowheightchanged",this._avgRowHeightChangedHandler)}},_initFeature:function(featureObject){if(!featureObject){return}if(featureObject.name===undefined){return}var widgetTreeGrid="igTreeGrid"+featureObject.name;if($.type(this.element[widgetTreeGrid])==="function"){if(this.element.data(widgetTreeGrid)){this.element[widgetTreeGrid]("destroy")}featureObject.language=this.options.language;this.element[widgetTreeGrid](featureObject);this.element.data(widgetTreeGrid)._injectGrid(this)}else{return $.ui.igGrid.prototype._initFeature.apply(this,arguments)}},_destroyFeatures:function(){var i,features=this.options.features,e=this.element;for(i=0;i=9){this._syncTableHeights()}},_rowExpanded:function(){this._syncHeigthsOnToggle()},_rowCollapsed:function(){this._syncHeigthsOnToggle()},_renderFixedRecord:function(data,rowIndex,onlyRows,tr){if(onlyRows){return $.ui.igGridColumnFixing.prototype._renderFixedRecord.apply(this,arguments)}return this.grid._renderRecord(data,rowIndex,true)},_rowShown:function(e,args){if(!this.options.syncRowHeights||!this.grid.hasFixedColumns()){return}this.syncRowsHeights(args.fRow,args.ufRow)},_syncContainersHeights:function(){if(!this.grid.hasFixedColumns()){return}var grid=this.grid,id=grid.id(),scrollContainer;$("#"+id+"_fixedBodyContainer").find("table")[0].style.height="";if(grid._rowVirtualizationEnabled()){scrollContainer=grid._vdisplaycontainer()}else{scrollContainer=grid.scrollContainer()}if(scrollContainer.length===0){scrollContainer=grid.element}scrollContainer.find("table")[0].style.height=""},_renderRow:function(rec,tr,rowId){if(!this.grid.hasFixedColumns()){return $.ui.igGridColumnFixing.prototype._renderRow.apply(this,arguments)}var rows,$fRow,$ufRow,$tr=$(tr),col,funcCallback;rows=this.grid._getRows($tr);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow;funcCallback=function(rec,tr){return this._updateRowContent(rec,tr)};this.grid._persistExpansionIndicator(rec,$fRow[0],funcCallback,this);this.grid._persistExpansionIndicator(rec,$ufRow[0],funcCallback,this)},_buildDOMOnToggle:function(e,args){if(!this.grid.hasFixedColumns()||!this.options.syncRowHeights){return}var $fRows=args.fRows,me=this,$ufRows=args.ufRows;if(!$fRows||!$ufRows||$fRows.length!==$ufRows.length){return}$fRows.each(function(ind){var $fRow=$($fRows[ind]),$ufRow=$($ufRows[ind]);me.syncRowsHeights($fRow,$ufRow)});this._syncHeigthsOnToggle()},_updateRowContent:function(rec,tr){var $this=this,grid=this.grid,$tr=$(tr),cells=$tr.children(":visible:not([data-skip])");cells.each(function(ind){var $td=$(this),content,col=grid.getColumnByTD($td);if(!col){return true}col=col.column;if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);if(content.indexOf("tr:first>td:not([data-skip])").eq(0);$span=$td.find("[data-shift-container],[data-expand-cell]");if($span.length===1){return}if(this._isContinuousVirtualization()){this.grid._renderVirtualRecords()}else{this.grid._renderRecords();this.grid._fireInternalEvent("_dataRendered")}},_detachEvents:function(){$.ui.igGridColumnFixing.prototype._detachEvents.apply(this,arguments);if(this._rowShownHandler){this.grid.element.unbind("igtreegrid_rowshown",this._rowShownHandler)}if(this._onColumnFixedHandler){this.grid.element.unbind("igtreegridcolumnfixing_columnfixed",this._onColumnFixedHandler)}if(this._onColumnUnfixedHandler){this.grid.element.unbind("igtreegridcolumnfixing_columnunfixed",this._onColumnUnfixedHandler)}if(this._buildDOMOnToggleHandler){this.grid.element.unbind("igtreegrid_builddomontoggle",this._buildDOMOnToggleHandler)}},_attachEvents:function(){this._rowShownHandler=$.proxy(this._rowShown,this);this.grid.element.bind("igtreegrid_rowshown",this._rowShownHandler);this._onColumnFixedHandler=$.proxy(this._onColumnFixed,this);this._onColumnUnfixedHandler=$.proxy(this._onColumnUnfixed,this);this.grid.element.bind("igtreegridcolumnfixing_columnfixed",this._onColumnFixedHandler);this.grid.element.bind("igtreegridcolumnfixing_columnunfixed",this._onColumnUnfixedHandler);this._buildDOMOnToggleHandler=$.proxy(this._buildDOMOnToggle,this);this.grid.element.bind("igtreegrid_builddomontoggle",this._buildDOMOnToggleHandler)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridColumnFixing.prototype.widgetName)},_injectGrid:function(grid,isRebind){$.ui.igGridColumnFixing.prototype._injectGrid.apply(this,arguments);this._attachEvents()}});$.extend($.ui.igTreeGridColumnFixing,{version:"19.1.20"})})($);/*!@license * Infragistics.Web.ClientUI Tree Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.shared.js * infragistics.ui.treegrid.js * infragistics.util.js * infragistics.ui.grid.framework.js * infragistics.ui.grid.filtering.js */ (function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igTreeGridFiltering",$.ui.igGridFiltering,{css:{recordMatchFiltering:"ig-igtreegrid-filter-matching-row",cellMatchFiltering:"ig-igtreegrid-filter-matching-cell",recordNotMatchFiltering:"ui-igtreegrid-record-not-matchfiltering"},options:{recordCountKey:null,fromLevel:0,toLevel:-1,displayMode:"showWithAncestors",matchFiltering:"__matchFiltering",filterSummaryInPagerTemplate:null,locale:{filterSummaryInPagerTemplate:undefined},inherit:false},_create:function(){this.element.data($.ui.igGridFiltering.prototype.widgetName,this.element.data($.ui.igTreeGridFiltering.prototype.widgetName));$.ui.igGridFiltering.prototype._create.apply(this,arguments)},_getFilterSummaryPagerTemplate:function(){var template=this._getLocaleValue("filterSummaryInPagerTemplate"),matchesCount,countMatchesPerPage=0;if(!template){return null}if(template.indexOf("${currentPageMatches}")>-1){countMatchesPerPage=this.grid.dataSource.getFilteredRecordsCountFromDataView();template=template.replace("${currentPageMatches}",countMatchesPerPage)}if(template.indexOf("${totalMatches}")>-1){matchesCount=this.getFilteringMatchesCount();template=template.replace("${totalMatches}",matchesCount)}return template},_transformCss:function(cssClass,dataRow){var matchFiltering,grid=this.grid,ds=grid.dataSource;if(this._gridTransformCssCallback){cssClass=this._gridTransformCssCallback.apply(grid,arguments)}if(this._filteringApplied()){matchFiltering=ds.settings.treeDS.filtering.matchFiltering;if(cssClass!==""){cssClass+=" "}if(!_aNull(matchFiltering)){if(dataRow[matchFiltering]){cssClass+=this.css.recordMatchFiltering}else{cssClass+=this.css.recordNotMatchFiltering}}}return cssClass},_filteringApplied:function(){var ds=this.grid.dataSource,expr=ds.settings.filtering.expressions;if(this.options&&this.options.type==="local"){return ds._filter}return expr&&expr.length},getFilteringMatchesCount:function(){var o=this.options,ds=this.grid.dataSource,matches;if(o.type==="local"||o.type==="remote"&&ds.hasTotalRecordsCount()===false){if(ds._filter){matches=ds.getFilteredRecordsCount()}else{matches=ds.flatDataView().length}}else{matches=ds.getFilteringMatchRecordsCount()}return matches},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridFiltering.prototype.widgetName)},_injectGrid:function(gridInstance,isRebind){var ds,o=this.options;$.ui.igGridFiltering.prototype._injectGrid.apply(this,arguments);if(!isRebind){if(this.grid._transformCssCallback){this._gridTransformCssCallback=this.grid._transformCssCallback}this.grid._transformCssCallback=$.proxy(this._transformCss,this)}ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.filtering.enabled=true;ds.settings.treeDS.filtering.fromLevel=o.fromLevel;ds.settings.treeDS.filtering.toLevel=o.toLevel;ds.settings.treeDS.filtering.displayMode=o.displayMode;ds.settings.treeDS.filtering.matchFiltering=o.matchFiltering}if(o.recordCountKey!==null){ds.settings.responseTotalRecCountKey=o.recordCountKey}}});$.extend($.ui.igTreeGridFiltering,{version:"19.1.20"})})($);/*!@license * Infragistics.Web.ClientUI Tree Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.shared.js * infragistics.ui.treegrid.js * infragistics.util.js * infragistics.ui.grid.framework.js * infragistics.ui.grid.hiding.js */ (function($){$.widget("ui.igTreeGridHiding",$.ui.igGridHiding,{css:{},options:{inherit:false},_create:function(){this.element.data($.ui.igGridHiding.prototype.widgetName,this.element.data($.ui.igTreeGridHiding.prototype.widgetName));$.ui.igGridHiding.prototype._create.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridHiding.prototype.widgetName)},_injectGrid:function(){$.ui.igGridHiding.prototype._injectGrid.apply(this,arguments)}});$.extend($.ui.igTreeGridHiding,{version:"19.1.20"})})($);/*!@license * Infragistics.Web.ClientUI Tree Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.shared.js * infragistics.ui.treegrid.js * infragistics.util.js * infragistics.ui.grid.framework.js * infragistics.ui.grid.multicolumnheaders.js */ (function($){$.widget("ui.igTreeGridMultiColumnHeaders",$.ui.igGridMultiColumnHeaders,{css:{},options:{inherit:false},_create:function(){this.element.data($.ui.igGridMultiColumnHeaders.prototype.widgetName,this.element.data($.ui.igTreeGridMultiColumnHeaders.prototype.widgetName));$.ui.igGridMultiColumnHeaders.prototype._create.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridMultiColumnHeaders.prototype.widgetName)},_injectGrid:function(){$.ui.igGridMultiColumnHeaders.prototype._injectGrid.apply(this,arguments)}});$.extend($.ui.igTreeGridMultiColumnHeaders,{version:"19.1.20"})})($);/*!@license * Infragistics.Web.ClientUI Tree Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.shared.js * infragistics.ui.treegrid.js * infragistics.util.js * infragistics.ui.grid.framework.js * infragistics.ui.grid.paging.js */ (function($){$.widget("ui.igTreeGridPaging",$.ui.igGridPaging,{css:{contextRow:"ui-igtreegrid-contextrow",contextRowIcon:"ui-igtreegrid-contextrow-icon ui-icon ui-icon-bookmark",contextRowContent:"ui-igtreegrid-contextrow-content",contextRowTextContainer:"ui-igtreegrid-contextrow-container"},rowsToShowLoadingMessage:3e5,events:{contextRowRendering:"contextRowRendering",contextRowRendered:"contextRowRendered"},options:{mode:"rootLevelOnly",contextRowMode:"none",contextRowLoadingText:null,contextRowRootText:null,breadcrumbKey:null,breadcrumbDelimiter:" > ",renderContextRowFunc:null,locale:{contextRowLoadingText:undefined,contextRowRootText:undefined},inherit:false},_create:function(){this.element.data($.ui.igGridPaging.prototype.widgetName,this.element.data($.ui.igTreeGridPaging.prototype.widgetName));$.ui.igGridPaging.prototype._create.apply(this,arguments)},changeLocale:function(){this._super(this.grid.container().find("[data-treegrid-contextrow-content]"));this._renderContextRow(this.options.contextRowMode)},_getDSLocalRecordsCount:function(){if(this.grid.dataSource._filter&&this.options.mode==="allLevels"){return this.grid.dataSource.totalLocalRecordsCount()}return $.ui.igGridPaging.prototype._getDSLocalRecordsCount.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridPaging.prototype.widgetName)},_dataRendered:function(){var $tr;$.ui.igGridPaging.prototype._dataRendered.apply(this,arguments);switch(this.options.contextRowMode){case"breadcrumb":case"parent":this._renderContextRow(this.options.contextRowMode);break;default:$tr=this.getContextRow();if($tr.length){$tr.remove();this.grid._initializeHeights()}break}},_renderContextRow:function(mode){var grid=this.grid,dv=grid.dataSource.flatDataView(),dataRow,noCancel,eArgs,self=this;if(dv&&dv[0]){dataRow=dv[0]}eArgs={owner:this,dataRow:dataRow,currentPageIndex:this.options.currentPageIndex,contextRowMode:mode};noCancel=this._trigger(this.events.contextRowRendering,null,eArgs);if(noCancel){this._renderLoading(dataRow);setTimeout(function(){if(mode==="breadcrumb"){self._renderBreadcrumb(dataRow)}else if(mode==="parent"){self._renderParentRow(dataRow)}},10)}},getContextRow:function(){var $thead=this.grid.headersTable().children("thead"),$row=this.grid.headersTable().find(">thead>tr[data-treegrid-contextrow]");if($row.length){return $row}$row=$('').appendTo($thead);$row.addClass(this.css.contextRow);return $row},getContextRowTextArea:function(){var $thead=this.grid.headersTable().children("thead"),$tr,$td,$container,$colspan,colspan=0;$container=$thead.find("[data-treegrid-contextrow-content]");if($container.length){return $container}$tr=this.getContextRow();$tr.empty();$colspan=$thead.closest("table").children("colgroup");$colspan.find("col").each(function(){var $col=$(this),cs;cs=parseInt($col.attr("colspan"),10);if(isNaN(cs)){cs=1}colspan+=cs});$td=$("").attr("colspan",colspan).appendTo($tr);$container=$('
      '+''+'"+""+"
      ").appendTo($td);return this.getContextRowTextArea()},_callRenderContextRowFunc:function(dataRow,$textArea,parents,mode){var func=this.options.renderContextRowFunc,f;if($.type(func)==="function"){f=func}else if(window[func]&&typeof window[func]==="function"){f=window[func]}if(f){return f(dataRow,$textArea,parents,mode)}},_renderLoading:function(dataRow){var self=this,$textArea,o=this.options,grid=this.grid,html;if(o.renderContextRowFunc){$textArea=self.getContextRowTextArea();html=self._callRenderContextRowFunc(dataRow,$textArea,null,"loading");if(!html){return}}if(grid.dataSource._flatVisibleData&&grid.dataSource._flatVisibleData.length>=this.rowsToShowLoadingMessage){if(!html){if(!$textArea){$textArea=self.getContextRowTextArea()}$textArea.html(this._getLocaleValue("contextRowLoadingText"))}self.grid._initializeHeights()}},_renderRootRecord:function(){this.getContextRowTextArea().html(this._getLocaleValue("contextRowRootText"))},_renderBreadcrumb:function(dataRow){var i,$text,ds=this.grid.dataSource,parents,parentsLen,row,o=this.options,eArgs,breadcrumbKey=o.breadcrumbKey,html="";parents=ds.getParentRowsForRow(dataRow);$text=this.getContextRowTextArea();if(o.renderContextRowFunc){html=this._callRenderContextRowFunc(dataRow,$text,parents,"breadcrumb");if(!html){return}}if(html){$text.html(html)}else{if($.type(parents)==="array"){parentsLen=parents.length;if(breadcrumbKey===null||breadcrumbKey===undefined){breadcrumbKey=this.grid.options.primaryKey}if(parentsLen<=1){this._renderRootRecord()}else{for(i=0;i")+1);html=html.substr(0,html.lastIndexOf("0,id,index,pageSize,targetPage;if(this.options.type==="remote"||this.options.mode!=="allLevels"&&isChildRow||!this.grid.options.autoCommit){return}else if(this.options.mode!=="allLevels"&&!isChildRow){this._super(row);return}id=this.grid._normalizedKey(row.attr("data-id"));index=this.grid._recordIndexInFlatView(id);pageSize=this.options.pageSize;if(index===undefined||index<0){return}targetPage=Math.floor(index/pageSize);this.pageIndex(targetPage)},_injectGrid:function(){var ds,i;$.ui.igGridPaging.prototype._injectGrid.apply(this,arguments);ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.treeDS.paging.mode=this.options.mode;ds.settings.treeDS.paging.contextRowMode=this.options.contextRowMode;if(this.options.type==="remote"&&this.options.mode==="allLevels"){ds.settings.treeDS.persistExpansionStates=true}}if(this.options.contextRowMode!=="none"){for(i=0;i0?this.grid.container().igLoading().data("igLoading"):this.grid.element.igLoading().data("igLoading").indicator()},_mouseUp:function(event){var target=event&&event.target?$(event.target):null;if(!target.is("[data-expand-button]")&&(!target.is("td[data-expand-cell]")||!this.grid.options.renderExpansionIndicatorColumn)){$.ui.igGridSelection.prototype._mouseUp.apply(this,arguments)}},_virtualRecordsRendered:function(info){var $ae=info.activeElement;if($ae.is("tr")||$ae.is("td")){this._selection.activate(this._identifierForTarget($ae),$ae,true)}},selectRowById:function(id){if(this.options.mode==="cell"){return}if(!this._selection.isSelected(id,this.grid)){if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}this._selection.select(id,true,{element:this._getRowsByIdentifier(id),id:id},true)}},_select:function(info){var element=info.element||this._selection.elementFromIdentifier(info.id);if(element.is("tr")&&this.grid.options.renderExpansionIndicatorColumn){element.children("td.ui-igtreegrid-non-data-column").addClass(this.css.selectedCell)}$.ui.igGridSelection.prototype._select.apply(this,arguments)},_preventDefault:function(event){var target=$(event.target);if(target.is("td")&&(!target.is("td[data-expand-cell]")||!this.grid.options.renderExpansionIndicatorColumn)){event.preventDefault()}else if(target.attr("data-expandcell-indicator")){event.preventDefault();event.stopPropagation()}}});$.extend($.ui.igTreeGridSelection,{version:"19.1.20"})})($);/*!@license * Infragistics.Web.ClientUI Tree Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.shared.js * infragistics.ui.treegrid.js * infragistics.util.js * infragistics.ui.grid.framework.js * infragistics.ui.grid.sorting.js */ (function($){$.widget("ui.igTreeGridSorting",$.ui.igGridSorting,{css:{},options:{fromLevel:0,toLevel:-1,inherit:false},_create:function(){this.element.data($.ui.igGridSorting.prototype.widgetName,this.element.data($.ui.igTreeGridSorting.prototype.widgetName));$.ui.igGridSorting.prototype._create.apply(this,arguments)},changeLocale:function(){this._superApply(arguments)},isColumnSorted:function(columnKey){var i,se=this.grid.dataSource.settings.sorting.expressions;if(!se||!columnKey||!se.length){return false}for(i=0;i0){cellToFocus=fixedRow.find("td").not('[data-skip="true"]').eq(0)}cfInst=this.grid.element.data("igTreeGridColumnFixing");if(cfInst&&cfInst.options.syncRowHeights){cfInst.syncRowsHeights(fixedRow,newRow)}}cellToFocus=cellToFocus||newRow.find("td").not('[data-skip="true"]').eq(0);this._startEditForRow(null,!raiseEvents,null,null,cellToFocus);return true},_renderAddChildButton:function(){var addChildButton,addChildSelector="#"+this.grid.id()+"_updating_add_child_hover",addChildContainer,ubodySelector="#"+this.grid.id()+">tbody",fbodySelector="#"+this.grid.id()+"_fixed>tbody",pe=window.navigator.msPointerEnabled||window.navigator.pointerEnabled,addChildTitle=this._getLocaleValue("addChildTooltip");if($(addChildSelector).length){return}addChildButton=$("").css("position","absolute").addClass(this.css.deleteButton);addChildButton.attr({id:addChildSelector.substring(1),unselectable:"on",title:addChildTitle,"data-localeid":"addChildTooltip","data-localeattr":"title"});addChildButton.hide();$("").addClass(this.css.addChildIcon).attr("unselectable","on").appendTo(addChildButton);addChildContainer=this._addElementToScrollContainer(addChildButton);this.grid.container().on({"mouseenter.addchildbutton":this._buttonHandlers.mouseEnter,"mouseleave.addchildbutton":this._buttonHandlers.mouseLeave,"click.addchildbutton":this._buttonHandlers.addChildClick,"keyup.addchildbutton":this._buttonHandlers.addChildClick},addChildSelector);if(pe){this.grid.container().on({"pointerenter.deletebutton":this._handlers.pointerEnter,"mspointerenter.deletebutton":this._handlers.pointerEnter},ubodySelector+">tr,"+fbodySelector+">tr")}else{this.grid.container().on({"mouseenter.addchildbutton":this._handlers.mouseEnter},ubodySelector+">tr,"+fbodySelector+">tr")}if(this._renderTouchUI){this.grid.container().on({"touchstart.addchildbutton":this._handlers.touchStart,"touchend.addchildbutton":this._handlers.touchEnd},ubodySelector+">tr,"+fbodySelector+">tr")}if(addChildContainer[0]===this.grid.container()[0]){this.grid.container().bind("mouseleave.addchildbutton",this._handlers.mouseLeave)}else{this.grid.container().on({"mouseleave.addchildbutton":this._handlers.mouseLeave},"#"+addChildContainer.attr("id"))}},_removeAddChildButton:function(){var button=$("#"+this.grid.id()+"_updating_add_child_hover");if(button.length===1){button.remove();this.grid.container().off(".addchildbutton");this.grid.container().unbind(".addchildbutton")}},_toggleAddRow:function(){var isAddChild=this._isAddChild(),newRow;if(isAddChild){newRow=this.grid.element.find("tr[data-child-row]");if(this.grid.hasFixedColumns()){newRow=newRow.add(this.grid.fixedBodyContainer().find("tr[data-child-row]"))}if(newRow.length!==0){newRow.remove()}}else{this._super()}},_addChildButtonClick:function(evt){var rowId=$(evt.target).closest(".ui-iggrid-deletebutton").data("button-for");if(this.options.editMode==="dialog"){this._startEditDialog(evt,false,null,true,null,null,rowId)}else{if(this._startAddChildFor(rowId,true)){this.hideAddChildButton()}}},_touchAddChildClick:function(evt){var rowId=this._editingForRowId,target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)){return}if(this.isEditing()){this._endEdit(evt,false,false);this._startAddChildFor(rowId)}},_touchAddChildKeyUp:function(evt){var rowId=this._editingForRowId,target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)||evt.keyCode!==$.ui.keyCode.ENTER){return}if(this.isEditing()){this._endEdit(evt,false,false);this._startAddChildFor(rowId)}},_touchStart:function(evt){this._super(evt);this.hideAddChildButton()},_touchEnd:function(evt){var changedTouchX=evt.originalEvent.changedTouches&&evt.originalEvent.changedTouches[0]?evt.originalEvent.changedTouches[0].pageX:evt.originalEvent.clientX;this._storedScrollLeft-=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth-=this.grid.scrollContainer().width()||0;if(this.options.enableAddChild&&Math.abs(changedTouchX-this._firstTouchX)>parseInt(this.options.swipeDistance,10)&&this._firstTouchRow&&this._storedScrollLeft===0&&this._storedScrollWidth===0){this.showAddChildButtonFor(this._firstTouchRow);if(this.options.enableDeleteRow){this.showDeleteButtonFor(this._firstTouchRow)}}delete this._firstTouchX;delete this._firstTouchRow;delete this._storedScrollLeft;delete this._storedScrollWidth;delete this._firstTouchRow},_pointerUp:function(evt){var oe=evt.originalEvent,changedTouchX;if(oe.pointerType!=="touch"){return}changedTouchX=oe.pageX;this._storedScrollLeft-=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth-=this.grid.scrollContainer().width()||0;if(this.options.enableDeleteRow&&Math.abs(changedTouchX-this._firstTouchX)>parseInt(this.options.swipeDistance,10)&&this._firstTouchRow&&this._storedScrollLeft===0&&this._storedScrollWidth===0){this.showAddChildButtonFor(this._firstTouchRow);if(this.options.enableDeleteRow){this.showDeleteButtonFor(this._firstTouchRow)}}delete this._firstTouchX;delete this._firstTouchRow;delete this._storedScrollLeft;delete this._storedScrollWidth;delete this._firstTouchRow},_rowMouseEnter:function(evt){this._super(evt);var row=$(evt.target).closest("tr");if(!this.isEditing()&&this._isEditableRow(row)){if(!row.hasClass("ui-iggrid-modifiedrecord")&&this.grid.dataSource.findRecordByKey(this.grid._normalizedKey(row.attr("data-id")))){this.showAddChildButtonFor(row)}else{this.hideAddChildButton()}}else{this.hideAddChildButton()}},_containerMouseLeave:function(){this._super();this.hideAddChildButton()},_renderDoneCancelButtons:function(){var buttonContainer=this._super(),addChildButton,addChildSelector="#"+this.grid.id()+"_updating_add_child_touch";if(this._renderTouchUI&&this.options.enableAddChild){addChildButton=$("").attr("id",this.grid.id()+"_updating_add_child_touch").addClass(this.css.button).addClass(this.css.doneButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:this._getLocaleValue("addChildTooltip"),"data-localeid":"addChildTooltip","data-localeattr":"title"});addChildButton.prependTo(buttonContainer);addChildButton.css({"float":"left",position:"relative"});$("").css({display:"inline-block",left:0}).addClass(this.css.addRowIcon).attr("unselectable","on").appendTo(addChildButton);$("").css("display","inline-block").attr({unselectable:"on","data-localeid":"addChildButtonLabel"}).html(this._getLocaleValue("addChildButtonLabel")).appendTo(addChildButton);this.grid.container().on({"mouseenter.donecancel":this._buttonHandlers.mouseEnter,"mouseleave.donecancel":this._buttonHandlers.mouseLeave,"focus.donecancel":this._buttonHandlers.focus,"blur.donecancel":this._buttonHandlers.blur},addChildSelector);this.grid.container().on({"click.donecancel":this._buttonHandlers._touchAddChildClick,"keyup.donecancel":this._buttonHandlers._touchAddChildKeyUp},addChildSelector)}return buttonContainer},_updateTouchButtons:function(isAdding){var addChildButton,isInDS;this._super(isAdding);if(this.options.enableAddChild){isInDS=this.grid.findRecordByKey(this._editingForRowId)!==null;addChildButton=$("#"+this.grid.id()+"_updating_add_child_touch");if(isAdding||this._isAddChild()||!isInDS){addChildButton.addClass(this.css.buttonDisabled);if(addChildButton.hasClass("ui-iggrid-buttonhover")){addChildButton.removeClass(this.css.buttonHover)}}else{addChildButton.removeClass(this.css.buttonDisabled)}}},_isAddChild:function(){return this.grid.element.find("tr[data-child-row]").length!==0},_removeChildrenFromUI:function($row,dataLevel){if(!$row||!$row.length){return}var dl,$tmp,rowId,$fRow,$cntnr,fixedCols=this.grid.hasFixedColumns();if(isNaN(dataLevel)){return}$cntnr=this.grid.container();while($row.length===1){dl=parseInt($row.attr("aria-level"),10);if(isNaN(dl)){break}if(dl<=dataLevel){break}$tmp=$row;rowId=$row.attr("data-id");$row=$row.next("tr");if(fixedCols){$fRow=$cntnr.find('tr[data-id="'+rowId+'"]');$fRow.remove()}$tmp.remove()}},_updateParentRowAfterAddChild:function(parentId){var span,rowData,parentRow,expCol=this.grid.options.renderExpansionIndicatorColumn,fixed=this.grid.hasFixedColumns()&&this.grid.fixingDirection()==="left";parentRow=this.grid.rowById(parentId,fixed);if(parentRow.find("span.ui-igtreegrid-expansion-indicator").length>0){return}rowData={dataBoundDepth:parseInt(parentRow.attr("aria-level"),10),hasExpandCell:true,expand:true};span=this.grid._renderExpandCellContainerHelper(rowData);if(expCol){parentRow.find("td.ui-igtreegrid-non-data-column").attr("data-expand-cell",1).append(span)}else{parentRow.find("span[data-expandcell-indicator]").append($(span).find("span.ui-igtreegrid-expansion-indicator"))}parentRow.attr("aria-expanded",true)},_generatePrimaryKeyValue:function(e,col){var value,ds=this.grid.dataSource;if(col){value=Math.max(this._recCount||1,ds._totalRecordsCount||1,ds._data.length);if(this._getPKType()==="string"){value=String(value)}if(this.element.find("tr[data-id="+value+"]").length||this.grid.findRecordByKey(value)){value=parseInt(value)+1}this._recCount=value;col.value=value}},_scroll:function(){if(this.isEditing()&&this._isAddChild()){this._positionDoneCancelButtons(this.grid.element.find("tr[data-new-row][data-child-row]"))}else{this._super()}},_attachEvents:function(){this._generatePrimaryKeyValueHandler=$.proxy(this._generatePrimaryKeyValue,this);this.element.bind("igtreegridupdatinggenerateprimarykeyvalue",this._generatePrimaryKeyValueHandler)},_detachEvents:function(){if(this._generatePrimaryKeyValueHandler){this.element.unbind("igtreegridupdatinggenerateprimarykeyvalue",this._generatePrimaryKeyValueHandler);delete this._generatePrimaryKeyValueHandler}},addChild:function(values,parentId){var settings=this.options.columnSettings,i=settings?settings.length:0,defVals={},key,val,rec=this.grid.findRecordByKey(parentId);if(rec===null){throw new Error(this._getLocaleValue("recordNotFound").replace("{id}",parentId))}while(i-- >0){key=settings[i].columnKey;val=settings[i].defaultValue;if(val!==undefined&&key!==undefined&&key!==null){defVals[key]=val}}this._addRow(null,$.extend(defVals,values),defVals,true,parentId)},startAddChildFor:function(parentId,raiseEvents){var rec=this.grid.findRecordByKey(parentId);if(rec===null){throw new Error(this._getLocaleValue("recordNotFound").replace("{id}",parentId))}this._startAddChildFor(parentId,raiseEvents)},showAddChildButtonFor:function(row){var acb=$("#"+this.grid.id()+"_updating_add_child_hover"),go=this.grid.options,v,hasHeight=go.height!==null&&go.height!==undefined,sbw=this.grid.hasVerticalScrollbar()===true?this.grid._scrollbarWidth():0,left,top,sc,offset=0,scrContainer,dbw=0,rowId=this._getRowId(row);if(acb.length){if(this.options.enableDeleteRow){dbw+=$("#"+this.grid.id()+"_updating_deletehover").outerWidth()+5}acb.show();sc=acb.parent();if(!hasHeight){v=go.virtualization||go.rowVirtualization||go.columnVirtualization;scrContainer=v?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(scrContainer.length){offset=scrContainer.igPosition().top}}left=sc.outerWidth()-acb.outerWidth()-sbw-dbw+sc.scrollLeft()-5;top=row.igPosition().top+row.outerHeight()/2-acb.outerHeight()/2+sc.scrollTop()+offset;acb.css({top:top,left:left});acb.data("button-for",rowId)}},hideAddChildButton:function(){var acb=$("#"+this.grid.id()+"_updating_add_child_hover");if(acb.length){acb.hide()}},_create:function(){this.element.data($.ui.igGridUpdating.prototype.widgetName,this.element.data($.ui.igTreeGridUpdating.prototype.widgetName));$.ui.igGridUpdating.prototype._create.apply(this,arguments)},_addRow:function(evt,addObj,defVals,suppress,parentId){var arg,key,t,row,index,dataLevelKey=this.grid.options.dataSourceSettings.dataLevelKey,expandedKey=this.grid.options.dataSourceSettings.expandedKey,parentRecord;addObj=$.extend({},defVals,addObj);if(dataLevelKey&&!addObj.hasOwnProperty(dataLevelKey)){addObj[dataLevelKey]=0}if(expandedKey&&!addObj.hasOwnProperty(expandedKey)){addObj[expandedKey]=true}if(parentId!==undefined&&parentId!==null){parentRecord=this.grid.dataSource.findRecordByKey(parentId);if(parentRecord===null){throw new Error($.ig.Grid.locale.recordNotFound.replace("{id}",parentId))}parentRecord[expandedKey]=true;addObj[dataLevelKey]=parentRecord[dataLevelKey]+1;arg={owner:this,values:addObj,oldValues:defVals,addChild:true,parentID:parentId};if(!suppress){if(!this._trigger(this.events.rowAdding,evt,arg)){return false}}key=addObj[this.grid.options.primaryKey];index=this.grid.dataSource.getChildrenByKey(parentId)?this.grid.dataSource.getChildrenByKey(parentId).length:0;index+=this._pendingChildrenCount(parentId);t=this.grid.dataSource.insertRow(key,addObj,index,this.grid.options.autoCommit,parentId);row=this._updateUIForTransaction(t);this._notifyRowAdded(row);if($.type(this._pkVal)==="number"){this._pkVal++}if(!suppress){this._trigger(this.events.rowAdded,evt,arg)}}else{this._super(evt,addObj,defVals,suppress,parentId)}},_pendingChildrenCount:function(parentId){var t=this.grid.pendingTransactions(),count=0;for(var i=0;i"+(this._recordNumbers[rowData[pKey]]||"")+""}if(!$.isEmptyObject(this._nCache)){if(rowData.hasOwnProperty("__fr")){path=this._getCurrentNumberForNewChild(rowData.__fr)}else if(this._nCache[rowData[pKey]]){path=this._nCache[rowData[pKey]].path||""}else{this._nCache[rowData[pKey]]={children:0,path:String(this._getNextNumberForParent())};path=this._nCache[rowData[pKey]].path}return""+path+""}return this._super(rowData)},_getCurrentNumberForNewChild:function(parentId,rowId){var childIdx=this._nCache[parentId].path+"."+(this._nCache[parentId].children+1);if(rowId!==undefined){this._nCache[rowId]={path:childIdx,children:0}}return childIdx},_getNextNumberForParent:function(){var i,pt=this.grid.dataSource.pendingTransactions(),count=0;for(i=0;i";if(o.enableRowNumbering){markup+=this._getCurrentNumber(rowData)}if(o.enableCheckBoxes){markup+=this._getTriStateCheckBox(rowData,selected&&o.checkBoxMode!=="triState"||checkStateDefined)}markup+="";return markup},_getTriStateCheckBox:function(rowData,checked){var markup="",dataChk="off",checkBoxState=this.css.checkBoxOff,pKey=this.grid.options.primaryKey;if(checked){dataChk="on";checkBoxState=this._checkboxStates[rowData[pKey]]===0?this.css.checkBoxP:this.css.checkBoxF}markup+="";markup+="";return markup},_numberRecordsWithParents:function(data,currentPath){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,counter=1,cPath,dataLen,i,dataRow;if($.type(data)==="array"){dataLen=data.length;for(i=0;i=0;i--){parentRow=parents[i].row;element=this._getRowById(parentRow[pKey]);res=this._rowSelectorFromSelection({element:element});action(parentRow,res)}},_checkParent:function(parentRow,res){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,parentRowId=parentRow[pKey];if(this._areAllChildrenChecked(parentRow[childDataKey])){this._checkboxStates[parentRowId]=1;res.checkbox.parent().addClass(this.css.rowSelectorChecked)}else{this._checkboxStates[parentRowId]=0;res.checkbox.parent().addClass(this.css.rowSelectorChecked)}this._alterTriStateCheckbox(res.checkbox,this._checkboxStates[parentRowId])},_uncheckParent:function(parentRow,res){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,parentRowId=parentRow[pKey];if(this._hasCheckedChildren(parentRow[childDataKey])){this._checkboxStates[parentRowId]=0;this._alterTriStateCheckbox(res.checkbox,0)}else{delete this._checkboxStates[parentRowId];res.checkbox.parent().removeClass(this.css.rowSelectorChecked);this._alterTriStateCheckbox(res.checkbox)}},_changeChildrenCheckState:function(rowId,toCheck){var grid=this.grid,children=grid.dataSource.getChildrenByKey(rowId,grid.dataSource._data)||[],pKey=grid.options.primaryKey,childDataKey=grid.options.childDataKey,i,childId,child,element,res;for(i=0;i0&&inner.length>0){if(checkState===0){checkbox.attr("data-chk","mixed");inner.removeClass(this.css.checkBoxOff).removeClass(this.css.checkBoxF).addClass(this.css.checkBoxP)}else if(checkState===1){checkbox.attr("data-chk","on");inner.removeClass(this.css.checkBoxOff).removeClass(this.css.checkBoxP).addClass(this.css.checkBoxF)}else{checkbox.attr("data-chk","off");inner.removeClass(this.css.checkBoxP).removeClass(this.css.checkBoxF).addClass(this.css.checkBoxOff)}}},_clearSelection:function(){var rsCells,self=this;if(this.grid.hasFixedColumns()&&this.grid.fixingDirection()==="left"){rsCells=this.grid.fixedBodyContainer().find("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}else{rsCells=this.grid.element.children("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}if(this.options.enableCheckBoxes&&this.options.checkBoxMode!=="triState"){$.each(rsCells,function(){self._alterCheckbox($(this).children("span:last"),false)});this._alterCheckbox(this._headerCheckbox(),false)}},_areAllRecordsChecked:function(sl,dvl){var size=0;for(var key in this._checkboxStates){if(this._checkboxStates.hasOwnProperty(key)){if(this._checkboxStates[key]===0){return false}if(this._checkboxStates[key]===1){size++}}}return size===dvl},_getDataView:function(){return this.grid.dataSource.flatDataView()},_getAllData:function(){if(this._flatData){return this._flatData}else{this._flatData=this.grid.dataSource.generateFlatData().flatData;return this._flatData}},_handleTriStateCheck:function(checkbox){var row,rowId,upd,sel,offset;if(!checkbox){return}upd=this.grid.element.data("igGridUpdating");sel=this._getSelectionInstance();if(sel&&sel._suspend){if(upd){if(upd.findInvalid()){return}upd._endEdit(null,true)}else{return}}offset=this._v?this.grid._startRowIndex:0;row=checkbox.parent().parent();if(this.grid.hasFixedColumns()){if(this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){row=row.add(this.grid.element.find("tbody > tr").eq(row.index()))}else{row=row.add(this.grid.fixedBodyContainer().find("tbody > tr").eq(row.index()))}}rowId=this.grid._fixPKValue(row.attr("data-id"));if(rowId===null||rowId===undefined){rowId=row.closest("tbody").children("tr:not([data-container])").index(row)+offset}this.changeCheckStateById(rowId,checkbox.attr("data-chk")==="off");if(!this._suspendHeader){this._updateHeader()}},_handleTriStateHeaderCheck:function(checkbox){var dv=this._getDataView(),elem=this.grid.element,toCheck=checkbox.attr("data-chk")==="off",templateData,c,all;this._changeCheckStateForRows(dv,toCheck);this._alterCheckbox(checkbox,toCheck);if(this.options.enableSelectAllForPaging&&elem.data("igGridPaging")){c=this.checkedRows().length;all=this._getAllData().length;templateData=[{checked:c,unchecked:all-c,allCheckedRecords:c,totalRecordsCount:all}];this._renderOverlay(templateData,toCheck)}},_selectAllFromOverlay:function(){if(this.options.checkBoxMode==="biState"){this._changeCheckStateForAllRecords(this._getSelectionInstance(),true)}else{this._changeCheckStateForRows(this._getAllData(),true)}},_deselectAllFromOverlay:function(){if(this.options.checkBoxMode==="biState"){this._changeCheckStateForAllRecords(this._getSelectionInstance(),false)}else{this._changeCheckStateForRows(this._getAllData(),false)}},_getRowById:function(identifier){var urow,frow=$();if(this.grid.hasFixedColumns()){frow=this.grid.rowById(identifier,true)}urow=this.grid.rowById(identifier,false);return urow instanceof $?urow.add(frow):$()},_changeCheckStateForRows:function(dv,toCheck){var i,res,element,rowId,pKey=this.grid.options.primaryKey;for(i=0;i0?this._hscroller:this.grid.scrollContainer();this._cache.columns={};this._cache.siblings={};this._cache.fixedSiblings={};this._updateLayoutPerLevel(cols,true);this._createMovingOptions();delete this._movingDirty},_registerEvents:function(){this.grid.element.bind("igtreegridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("igtreegridheaderrendering",this._headerRenderingHandler);this.grid.element.bind("igtreegridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("igtreegridrendered",this._gridFullyRenderedHandler);this.grid.element.bind("igtreegridresizingcolumnresized",this._columnStateChanged);this.grid.element.bind("igtreegridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.bind("igtreegridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.bind("igtreegrid_columnsmoved",this._columnStateChanged)},_unregisterEvents:function(){this.grid.element.unbind("igtreegridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("igtreegridheaderrendering",this._headerRenderingHandler);this.grid.element.unbind("igtreegridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("igtreegridrendered",this._gridFullyRenderedHandler);this.grid.element.unbind("igtreegridresizingcolumnresized",this._columnStateChanged);this.grid.element.unbind("igtreegridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.unbind("igtreegridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.unbind("igtreegrid_columnsmoved",this._columnStateChanged);this.grid.headersTable().find("th").unbind("moving")}});$.extend($.ui.igTreeGridColumnMoving,{version:"19.1.20"})})($);/*!@license * Infragistics.Web.ClientUI Tree Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.shared.js * infragistics.ui.treegrid.js * infragistics.util.js * infragistics.ui.grid.framework.js * infragistics.ui.grid.resizing.js */ (function($){$.widget("ui.igTreeGridResizing",$.ui.igGridResizing,{options:{inherit:false},css:{},_create:function(){this.element.data($.ui.igGridResizing.prototype.widgetName,this.element.data($.ui.igTreeGridResizing.prototype.widgetName));$.ui.igGridResizing.prototype._create.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridResizing.prototype.widgetName)}});$.extend($.ui.igTreeGridResizing,{version:"19.1.20"})})($)});