function NoteObject(id) { this.m_expObj = g_dc.getElemFormID(id); this.m_icnObj = this.CreateIcnObj(this.m_expObj); this.m_expObj.style.position = 'absolute'; this.m_origxPos = this.m_xPos = toInt(this.m_expObj.getAttribute("X"))+g_dc.GetWorkAreaRC().m_left; this.m_origyPos = this.m_yPos = toInt(this.m_expObj.getAttribute("Y"))+g_dc.GetWorkAreaRC().m_top; this.m_origW = this.m_width = this.m_expObj.getAttribute("W"); this.m_origH = this.m_height = this.m_expObj.getAttribute("H"); this.m_noteID = this.m_expObj.getAttribute("noteID"); this.m_origIsIcn = this.m_isIcn = (this.m_expObj.getAttribute("isIcn")==0)?false:true; this.m_expObj.style.fontSize=NOTE_FONT_SIZE; this.m_expObj.style.fontFamily=NOTE_FONT_FAMILY; this.m_expObj.style.fontWeight=NOTE_FONT_WEIGHT; this.m_selected = true; this.m_expObj.dragContainer = this.m_icnObj.dragContainer = this; this.m_icnObj.onmousedown = g_eventRouter.OnIconMouseDown; this.m_icnObj.onmouseup = g_eventRouter.OnIconMouseUp; this.m_expObj.onmousedown = g_eventRouter.OnIconMouseDown; this.m_expObj.ondblclick =g_eventRouter.OnHeaderDblClick; this.m_deleted = false; this.InitClipButton("IcnExpandBtn", "onExpandClick", this.m_icnObj); g_dc.InitRegularTT("IcnExpandBtn",this.m_icnObj,"Expand note", this.m_noteID+"exp"); this.InitClipButton("IcnDeleteBtn", "onDeleteClick", this.m_icnObj); g_dc.InitRegularTT("IcnDeleteBtn",this.m_icnObj,"Delete note", this.m_noteID+"del"); this.InitClipButton("clipButtonClose", "onDeleteClick", this.m_expObj); g_dc.InitRegularTT("clipButtonClose",this.m_expObj,"Delete note", this.m_noteID+"delex"); this.InitClipButton("clipButtonIconize", "onIconizeClick", this.m_expObj); g_dc.InitRegularTT("clipButtonIconize",this.m_expObj,"Switch to icon", this.m_noteID+"tic"); this.CreateResizeHandles(); this.ResizeTo(this.m_width, this.m_height); this.MoveTo(this.m_xPos,this.m_yPos); this.Show(); this.SetSelected(false); this.ondblclick = g_eventRouter.OnHeaderDblClick; this.m_origTxt = this.Edit_getText(); } NoteObject.prototype.Delete = function() { try { //g_dc.m_aElements[this.m_expObj.id]= null; this.m_expObj.parentNode.removeChild(this.m_expObj); this.m_icnObj.parentNode.removeChild(this.m_icnObj); this.m_deleted = true; g_dc.setDirty(true); //delete this; } catch (err){ alert(err.description) } } NoteObject.prototype.CreateIcnObj = function(expOb) { if (expOb==null){alert('error1');return;} var div = document.createElement('div'); if (!(div) || div==null){alert('error3');return;} g_dc.SetClass(div, "noteIconDiv"); div.innerHTML = "
"+ ""+ ""+ "
" + "
" + "
"; div.setAttribute('id',expOb.getAttribute("id")+"_note"); g_dc.docBody.appendChild(div); //div.ondblclick = g_eventRouter.OnIcnDblClick; ///////////////////////////////////////////////////////////// // Tooltip Implementation div.TTShow = function() { try{ var prnt = this.dragContainer; var rc = prnt.GetCurrRC(this.m_icnObj); var expndRc = prnt.CalcExpndRC(rc); prnt.MoveTo(expndRc.m_left, expndRc.m_top,prnt.m_expObj, false); prnt.ShowAsTT(true); } catch(err) {alert(err);} } div.TTHide = function() { var prnt = this.dragContainer; prnt.ShowAsTT(false); } div.TTGetID = function() { return (this.dragContainer.m_noteID); } div.TTIsSame = function(other) { return (this.TTGetID() == other.TTGetID()); } div.TTInBounds = function(x,y) { var prnt = this.dragContainer; var frmWrapTD = prnt.m_expObj; var rc = new Rect(g_dc.getDocY(frmWrapTD), g_dc.getDocX(frmWrapTD), toInt(frmWrapTD.offsetWidth), toInt(frmWrapTD.offsetHeight)); return rc.isPtWithin(x,y); } return div; } NoteObject.prototype.ShowAsTT = function(bShow) { if (bShow) { g_dc.showElem(this.m_expObj, true); var bar = g_dc.GetObjInnerByName(this.m_expObj, "noteIconDivTop")[0]; var rz = g_dc.GetObjInnerByName(this.m_expObj, "resizeHandle")[0]; g_dc.showElem(bar, false); g_dc.showElem(rz, false); g_dc.maxZ(this.m_expObj); } else { g_dc.showElem(this.m_expObj,false); var bar = g_dc.GetObjInnerByName(this.m_expObj, "noteIconDivTop")[0]; var rz = g_dc.GetObjInnerByName(this.m_expObj, "resizeHandle")[0]; g_dc.showElem(bar, true); g_dc.showElem(rz, true); } } NoteObject.prototype.CreateResizeHandles = function() { this.m_resizeHandle = g_dc.CreateResizeHandleObj(); this.m_expObj.appendChild(this.m_resizeHandle); this.m_resizeHandle.dragContainer = this; } NoteObject.prototype.DragElem = function(diffX,diffY) { return this.MoveBy(diffX, diffY); } NoteObject.prototype.Show = function() { if (!this.m_isIcn) { g_dc.showElem(this.m_expObj, true); g_dc.showElem(this.m_icnObj, false); } else { g_dc.showElem(this.m_expObj, false); g_dc.showElem(this.m_icnObj, true); } } NoteObject.prototype.GetXmlChanges = function() { var bNew = (this.m_noteID.indexOf("newNote")>=0); if (bNew && this.m_deleted) return ""; var str = "