var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); var __aspxCDDPTableIDSuffix = "_IT"; var __aspxCDDPTableCellIDSuffixPart = "_IC"; var __aspxCDDPTableCellIndexAttribute = "_dxIPIndex"; var __aspxCDDPItemPickerClientId = "ItemPicker"; var __aspxHEItemPickerCellCssClassName = "dxHEIPCell"; ASPxClientToolbarItemPicker = _aspxCreateClass(ASPxClientControl, { constructor: function (name) { this.constructor.prototype.constructor.call(this, name); this.ItemPickerItemClick = new ASPxClientEvent; this.itemsValues = []; this.useItemPickerImageMode = __aspxHEItemPickerImageMode.ExecuteSelectedItemAction; this.curIndex = 0; this.tableCellStyleCssClassName = ""; this.tableCellStyleCssText = ""; this.tableCellStyleImageSpacing = ""; this.imagePosition = "Left"; this.itemHeight = 0; this.itemWidth = 0; this.menuID = 0; }, Initialize: function () { this.constructor.prototype.Initialize.call(this); var index = 0; var table = this.GetPickerTableElement(); if(!table) return; this.InitializeStyles(); for (var i = 0; i < table.rows.length; i++) { var cellCount = table.rows[i].cells.length; for (var j = 0; j < cellCount; j++) { var cell = table.rows[i].cells[j]; if(i * cellCount + j < this.itemsValues.length) { _aspxSetAttribute(cell, __aspxCDDPTableCellIndexAttribute, index); cell.className = this.tableCellStyleCssClassName + " " + this.GetStyleName(); _aspxSetAttribute(cell, "id", this.GetPickerTableCellElementID(index++)); } } } if(this.itemHeight > 0 || this.itemWidth > 0) this.PrepareCellSize(); }, InitializeStyles: function() { var styleSheet = _aspxGetCurrentStyleSheet(); _aspxAddStyleSheetRule(styleSheet, "." + this.GetStyleName(), this.tableCellStyleCssText); _aspxAddStyleSheetRule(styleSheet, "." + this.GetStyleName(), "white-space: nowrap;"); _aspxAddStyleSheetRule(styleSheet, "." + this.GetStyleName(), "text-align: center;"); if(this.tableCellStyleImageSpacing != "") { var imageMarginRule = (this.imagePosition == "Left" ? "margin-right" : "margin-bottom") + ": " + this.tableCellStyleImageSpacing + ";"; var imageMarginSelector = "." + this.GetStyleName() + " img"; _aspxAddStyleSheetRule(styleSheet, imageMarginSelector, imageMarginRule); } }, PrepareCellSize: function() { var styleSheet = _aspxGetCurrentStyleSheet(); var table = this.GetPickerTableElement(); var firstCell = table.rows[0].cells[0]; var curStyle = _aspxGetCurrentStyle(firstCell); if(!curStyle) curStyle = firstCell.style; if(this.itemWidth > 0) { this.itemWidth -= _aspxPxToInt(curStyle.paddingLeft) + _aspxPxToInt(curStyle.paddingRight); this.itemWidth -= _aspxPxToInt(curStyle.borderLeftWidth) + _aspxPxToInt(curStyle.borderRightWidth); _aspxAddStyleSheetRule(styleSheet, "." + this.GetStyleName(), "width: " + this.itemWidth + "px;"); } if(this.itemHeight > 0) { this.itemHeight -= _aspxPxToInt(curStyle.borderTopWidth) + _aspxPxToInt(curStyle.borderBottomWidth); if(__aspxIE || __aspxWebKitFamily) this.itemHeight -= _aspxPxToInt(curStyle.paddingTop) + _aspxPxToInt(curStyle.paddingBottom); _aspxAddStyleSheetRule(styleSheet, "." + this.GetStyleName(), "height: " + this.itemHeight + "px;"); } }, GetPickerTableElement: function() { return _aspxGetElementById(this.name + __aspxCDDPTableIDSuffix); }, GetPickerTableCellElementID: function(itemIndex) { return this.name + __aspxCDDPTableCellIDSuffixPart + itemIndex.toString(); }, OnControlClick: function(clickedElement, htmlEvent) { var element = clickedElement.tagName == "TD" ? clickedElement : clickedElement.parentNode; if(element.tagName == "TD") { var index = _aspxGetAttribute(element, __aspxCDDPTableCellIndexAttribute); if(index >= 0 && this.itemsValues.length > index){ this.curIndex = index; this.RaiseItemClickEvent(this.GetValue()); } } aspxGetMenuCollection().HideAll(); }, RaiseItemClickEvent: function(value) { if(!this.ItemPickerItemClick.IsEmpty()){ var args = new ASPxClientToolbarItemPickerItemClickEventArgs(value); this.ItemPickerItemClick.FireEvent(this, args); } }, GetValue: function() { return this.itemsValues[this.curIndex]; }, GetImage: function() { var cell = _aspxGetElementById(this.GetPickerTableCellElementID(this.curIndex)); return cell && _aspxGetChildByTagName(cell, "IMG" ,0) || null; }, GetImageUrl: function() { var image = this.GetImage(); return image || ""; }, GetText : function() { var cell = _aspxGetElementById(this.GetPickerTableCellElementID(this.curIndex)); return cell ? _aspxGetInnerText(cell) : ""; }, GetTooltip : function() { var cell = _aspxGetElementById(this.GetPickerTableCellElementID(this.curIndex)); return cell ? cell.title : ""; }, GetStyleName: function() { return __aspxHEItemPickerCellCssClassName + "_" + this.name; } }); ASPxClientToolbarItemPicker.FindControlByMenuItem = function(menuItem) { var name = menuItem.menu.GetMenuTemplateContainerID(menuItem.indexPath) + "_" + __aspxCDDPItemPickerClientId; return aspxGetControlCollection().Get(name); } ASPxClientToolbarItemPickerItemClickEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function (value) { this.value = value; } }); } /* playback timings (ms): RedisCDXSource: 4.948 load_resource: 822.848 esindex: 0.021 exclusion.robots.policy: 0.325 exclusion.robots: 0.347 LoadShardBlock: 117.075 (3) captures_list: 157.283 PetaboxLoader3.datanode: 282.102 (4) CDXLines.iter: 28.995 (3) PetaboxLoader3.resolve: 617.813 */