var Collector = Class.create({ initialize: function(eleID) { this.ID_=eleID; this.root=$(eleID); this.body=$("BODY_"+eleID); this.optButton=$("OPT_"+eleID); this.clearButton=$("CLEAR_"+eleID); this.root.JSControl = this; var parent=AControl.GetParentWindowInstanceID(this.root); this.sSrc=this.body.readAttribute('src'); this.separator=this.body.readAttribute('separator'); if(!this.separator) this.separator='; '; var sdp=this.body.readAttribute('duplicates'); this.bAllowDuplicates=(sdp=='yes' || sdp=='true'); this.visibility=this.body.readAttribute('visibility'); if(!this.visibility) this.visibility='yes'; this.value=[]; this.show=[]; var rets=this.body.readAttribute('rets').split(' '); for(var i=0; i=400 || offset.top<=botDistance) { // popup down this.args.initialY=offset.top+this.optButton.offsetHeight; this.args.initialHeight=botDistance-5; // leave 5px to the screen bottom if(this.args.initialHeight<400) this.args.initialHeight=400; } else { //popup up this.args.initialHeight=offset.top-5; // leave 5px to the screen bottom if(this.args.initialHeight<400) this.args.initialHeight=400; this.args.initialY=offset.top-this.args.initialHeight; } //this.args.bFitToScreen=true; this.args.bTotalWidthHeight=true; this.popupWin = new CollectorPopup(this.args); this.popupWin.Subscribe("WM_BACK", this.OnWMBack, this); this.popupWin.Subscribe("WM_POPUP_RETURN", this.OnReturn, this); return this.popupWin; }, OptKeyUp: function(evt) { var event = Event.extend(evt || window.event); if (evt.altKey || evt.ctrlKey) return; var key = event.keyCode; if (key == 13 || key == 32) this.Open(); else return; StopEvent(event); return false; }, ClearKeyUp: function(evt) { var event = Event.extend(evt || window.event); if (evt.altKey || evt.ctrlKey) return; var key = event.keyCode; if (key == 13 || key == 32) this.ClearAll(); else return; StopEvent(event); return false; }, OnReturn: function(oEvent) { if (this.rets && oEvent.Data().args) { var args=oEvent.Data().args; var data={}; for(var p in this.rets) { if(args[this.rets[p]]) { data[p]=args[this.rets[p]]; } } var i=0; if(!this.bAllowDuplicates) for(; i=this.value.size()) { this.value.push(data); this.RefreshContent(); new AEvent("CHANGE", {}, this); this.body.scrollTop=100000; } } oEvent.Stop(); }, RemoveData: function(evt) { this.value.splice(evt.element().parentNode.previousSiblings().length, 1); this.RefreshContent(); new AEvent("CHANGE", {}, this); }, ClearAll: function() { this.value.length=0; this.RefreshContent(); new AEvent("CHANGE", {}, this); }, RefreshContent: function() { var content=" "; for(var pos=0; pos'; for(var i=0; i