var HistoryPath = Class.create({ delimiter: " > ", initialize: function(params) { //LogL("HistoryPath created: "+params.htmlid); this.id=params.id; this.htmlid=params.htmlid; this.winID=params.winID; if (typeof(params.delimiter) != "undefined") this.delimiter = String(params.delimiter); this.separateTitle = params.separateTitle; if (typeof(this.separateTitle) == "undefined") this.separateTitle = false; this.workspaceID=this.htmlid+'_eWorkspace'; this.workspaceDiv=$(this.workspaceID); if (!this.workspaceDiv) { LogE("HistoryPath(): Workspace node not found: "+this.workspaceID); return; } this.pathID=this.htmlid+'_ePath'; this.pathDiv=$(this.pathID); if (!this.pathDiv) { LogE("HistoryPath(): Path node not found: "+this.pathID); return; } if (this.separateTitle && this.pathDiv){ this.separateTitleDiv = new Element("div", {"class": "HPathSeparateTitle", id: this.htmlid+"_TITLE"}); this.pathDiv.parentNode.insertBefore(this.separateTitleDiv, this.pathDiv); } this.path=[]; this.pathDiv.JSControl=this; this.nTabBase=0; this.rootsrc = this.pathDiv.readAttribute('rootsrc'); if (this.separateTitleDiv) this.separateTitleDiv.innerHTML="`Top`"; else this.RepaintPath(); SubscribeOnEvent("WM_CLEAR", this.winID, this.TreeClicked, this); SubscribeOnEvent("WM_PUSH", this.winID, this.MainClicked, this); SubscribeOnEvent("WM_BACK", this.winID, this.Back, this); SubscribeOnEvent("WM_TABBAR", this.winID, this.Tabbar, this); SubscribeOnEvent("HIST_GET", this.winID, this.PrepareHist, this); new AEvent("WM_LINKOPENER", { Callback: this.OpenLink.bind(this) }, this.id); if (!this.hasSrc && this.rootsrc) { this.OpenLink({ 'src': this.rootsrc }); } }, ID: function() { return this.htmlid; }, ClearPath: function() { this.path.length = 0; this.path.push({ title: '`Top`', src: this.rootsrc, params: '', parent: this.winID, htmlid: this.workspaceDiv.readAttribute('id') }); }, RepaintPath: function() { if (this.separateTitleDiv) this.separateTitleDiv.innerHTML=''; this.pathDiv.innerHTML=''; for(var i=0; i 0 ? index : 1); // this.RepaintPath(); if(winHnd.object) { var ctrl=$(winHnd.htmlid); Element.replace(ctrl.select('DIV')[0], winHnd.object); new AEvent("WM_RESTORE", {}, winHnd.object.JSControl.ID()); } else { var currWin = GWindowManager.RefreshWindow({ sURL: winHnd.src, sParent: winHnd.parent, sControlID: winHnd.htmlid, sParams: winHnd.params, sInstanceID: winHnd.instanceID, 'bCheckChanges': bCheckChanges }); if(!currWin) return; currWin.Subscribe("WM_CREATE", this.OnChildLoad, this); } this.path.length = (index > 0 ? index : 1); this.RepaintPath(); if (winHnd.object) this.displayLastChild(winHnd.title); // else it will be done in OnChildLoad GWindowManager.SetAddress(winHnd.src, winHnd.params); //for(var i=this.pathDiv.childNodes.length-1; i>=index*2+1; --i) { // $(this.pathDiv.childNodes[i]).remove(); //} if (GPopupContainer) GPopupContainer.RemoveAllPopups(); }, Back: function(evt) { var data=evt.Data(); var step=parseInt(data.step); if(this.path.length-step>=0) this.SegmentClick(this.path.length-step, false); evt.Stop(); }, PrepareHist: function(evt) { var evtArgs=evt.Data().args; evt.Stop(); var necessaryPathInfo = []; for (var i = 0; i < this.path.length; i++) { necessaryPathInfo.push({ src: this.path[i].src, params: this.path[i].params }); } // push current wnd var win=this.workspaceDiv.select('DIV')[0].JSControl; necessaryPathInfo.push({ src: win.XMLSource(), params: win.sParams_ }); new AEvent("HIST-READY", { args: { Path: necessaryPathInfo, HistGetArgs: evtArgs } }, this.pathID); } });