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"); ClientReportToolbar = _aspxCreateClass(ASPxClientControl, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.reportViewer = null; this.menu = null; this.ignoreItems = new Object(); this.enabledItems = new Array(); this.delayUpdate = false; }, Initialize: function() { this.constructor.prototype.Initialize.call(this); this.reportViewer = aspxGetControlCollection().Get(this.reportViewerID); this.menu = aspxGetControlCollection().Get(this.menuID); if(this.disableOnInit) this.disableMenuItems(); if(!_aspxIsExists(this.reportViewer) || !_aspxIsExists(this.menu)) return; for(var i = 0; i < this.menu.GetItemCount(); i++) { var item = this.menu.GetItem(i); if(item.GetEnabled() == false) this.ignoreItems[item.name] = item; } var instance = this; this.reportViewer.PageLoad.AddHandler(function(s, a) { instance.pageLoadEventHanler(s, a) }); this.reportViewer.BeginCallback.AddHandler(function(s, a) { instance.beginCallbackEventHanler(s, a) }); this.reportViewer.EndCallback.AddHandler(function(s, a) { instance.endCallbackEventHanler(s, a) }); this.setElemEnabled("Search", this.reportViewer.IsSearchAllowed()); }, AfterInitialize: function() { this.constructor.prototype.AfterInitialize.call(this); if(this.delayUpdate) { this.updateView(); this.delayUpdate = false; } }, disableMenuItems: function() { if(this.enabledItems == undefined) this.enabledItems = []; else if(this.enabledItems.length > 0) return; for(var i = 0; i < this.menu.GetItemCount(); i++) { var item = this.menu.GetItem(i); if(item.GetEnabled()) { this.enabledItems[this.enabledItems.length] = item; item.SetEnabled(false); } } }, beginCallbackEventHanler: function(s, a) { this.disableMenuItems(); }, endCallbackEventHanler: function(s, a) { for(var i = 0; i < this.enabledItems.length; i++) this.enabledItems[i].SetEnabled(true); this.updateElements(); }, pageLoadEventHanler: function(s, a) { this.pageIndex = a.PageIndex; this.pageCount = a.PageCount; if(this.isInitialized) this.updateView(); else this.delayUpdate = true; }, handleButton: function(btnId) { if(!_aspxIsExists(this.reportViewer)) return; if(btnId.indexOf("Search") >= 0) { this.reportViewer.Search(); return; } if(btnId.indexOf("Print") >= 0) { var val = (btnId.indexOf("PrintPage") >= 0) ? this.pageIndex : ""; this.reportViewer.Print(val); return; } if(btnId.indexOf("SaveToWindow") >= 0) { this.reportViewer.SaveToWindow(this.getSaveFormat()); return; } if(btnId.indexOf("SaveToDisk") >= 0) { this.reportViewer.SaveToDisk(this.getSaveFormat()); return; } if(this.pageIndex < 0 || this.pageCount <= 0) return; var index = this.pageIndex; if(btnId.indexOf("FirstPage") >= 0) { index = 0; } else if(btnId.indexOf("PreviousPage") >= 0) { index = this.pageIndex - 1; } else if(btnId.indexOf("NextPage") >= 0) { index = this.pageIndex + 1; } else if(btnId.indexOf("LastPage") >= 0) { index = this.pageCount - 1; } else if(btnId.indexOf("PageNumber") >= 0) { index = this.getControlIntValue("PageNumber") - 1; } this.reportViewer.GotoPage(index); }, getSaveFormat: function() { return this.getControlValue("SaveFormat"); }, updateView: function() { this.updatePageIndexes(); this.setElemSize("PageCount", this.pageCount.toString().length); this.setControlValue("PageCount", this.pageCount); this.updateElements(); }, updateElements: function() { var val = this.pageIndex != 0; this.setElemEnabled("FirstPage", val); this.setElemEnabled("PreviousPage", val); val = this.pageIndex < this.pageCount - 1; this.setElemEnabled("NextPage", val); this.setElemEnabled("LastPage", val); }, updatePageIndexes: function() { var cbx = this.getTemplateControl("PageNumber"); if(cbx == null) return; if(cbx.GetItemCount() != this.pageCount) { cbx.BeginUpdate(); cbx.ClearItems(); for(var i = 0; i < this.pageCount; i++) cbx.AddItem((i + 1).toString()); cbx.EndUpdate(); } cbx.SetSelectedIndex(this.pageIndex); if(__aspxWebKitFamily) cbx.GetInputElement().value = (this.pageIndex + 1).toString(); }, setElemSize: function(name, size) { var ctl = this.getTemplateControl(name); if(ctl == null) return; var el = ctl.GetInputElement(); if(el == null) return; el.style.width = size + "em"; }, setControlValue: function(name, val) { var ctl = this.getTemplateControl(name); if(ctl != null) ctl.SetValue(val); }, getControlValue: function(name) { var ctl = this.getTemplateControl(name); if(ctl != null) return ctl.GetValue(); return null; }, getTemplateControl: function(name) { var item = this.menu.GetItemByName(name); if(item != null) { var templateControlName = this.menu.name + "_ITCNT" + item.GetIndexPath() + "_" + name; return aspxGetControlCollection().Get(templateControlName); } return null; }, getControlIntValue: function(name) { var val = this.getControlValue(name); return (val != null) ? parseInt(val) : -1; }, setElemEnabled: function(name, val) { if(this.ignoreItems[name] != null) return; var item = this.menu.GetItemByName(name); if(item != null && item.GetEnabled() != val) item.SetEnabled(val); } }); ASPxClientReportToolbar = ClientReportToolbar; ASPxClientReportToolbar.Cast = ASPxClientControl.Cast; ASPxClientReportToolbar.prototype.GetItemTemplateControl = function(name) { return this.getTemplateControl(name); }; } /* playback timings (ms): LoadShardBlock: 91.25 (3) captures_list: 122.237 RedisCDXSource: 8.534 exclusion.robots.policy: 0.143 esindex: 0.009 CDXLines.iter: 19.064 (3) exclusion.robots: 0.153 load_resource: 774.82 PetaboxLoader3.resolve: 696.574 PetaboxLoader3.datanode: 141.366 (4) */