misMemo.xjs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type ="xscript4.0"><![CDATA[
  3. // <script type="javascript" src="../../.._mis_miscommonweb_js_misMemo.js"/>
  4. // misfViewMemoList();
  5. var memoSeq = 0;
  6. var topObjectName = "";
  7. // 메모창 생성
  8. function misfCreateMemoWindow(titleRef,textRef,left,top) {
  9. if(titleRef == null || textRef == null) {
  10. return;
  11. }
  12. if(left == null) left = 100;
  13. if(top == null) top = 100;
  14. memoSeq++;
  15. //dsf_makeValue( ds_temp_memo, "memotitle", "string", + memoSeq,title);
  16. //dsf_makeValue( ds_temp_memo, "memotext", "string", + memoSeq,text);
  17. var mainObj = document.body.createChild("xforms:group", "id:grp_memo_" + memoSeq + "; left:" + left + "px; top:" + top + "px; width:250px; height:180px; background-color:transparent;");
  18. mainObj.visible = false;
  19. mainObj.createChild("xforms:shape", "id:_memo_shape_" + memoSeq + "; class:roundrect_search; appearance:roundrect; ellipsewidth:10; ellipseheight:10; left:0px; top:0px; width:250px; height:180px; background-color:#ffff99; border-color:#800000;");
  20. mainObj.createChild("xforms:input", "id:_memo_title_" + memoSeq + "; ref:" + titleRef + "; editable:false; left:8px; top:1px; width:190px; height:19px; font-size:10pt; font-weight:bold; background-color:transparent; border-color:#ffff99;");
  21. mainObj.createChild("xforms:textarea", "id:_memo_text_" + memoSeq + "; ref:" + textRef + "; overflow:scroll; scroll:autovscroll; editable:false; left:10px; top:23px; width:225px; height:145px; background-color:transparent; border-color:#ffff99;");
  22. //mainObj.createChild("xforms:button", "id:_memo_close_" + memoSeq + "; left:205px; top:3px; width:45px; height:17px; background-image:../../.._com_commonweb_images_icon_close.gif;");
  23. mainObj.createChild("xforms:button", "id:_memo_close_" + memoSeq + "; text:Ⅹ; left:230px; top:0px; width:20px; height:20px; font-size:11pt; font-weight:bold; text-align:center;");
  24. eval("_memo_close_" + memoSeq).attribute("onclick") = "misfMemoClose(grp_memo_" + memoSeq + ");";
  25. eval("grp_memo_" + memoSeq).attribute("onclick") = "misMemoOnTop(grp_memo_" + memoSeq + ");";
  26. mainObj.visible = true;
  27. //mainObj.refresh();
  28. topObjectName = "grp_memo_" + memoSeq;
  29. }
  30. function misfViewMemoList(memoRef,titleNode,textNode) {
  31. misfRemoveAllMemo();
  32. if(memoRef == null) memoRef = "ds_memo_memolist";
  33. if(titleNode == null) titleNode = "title";
  34. if(textNode == null) textNode = "text";
  35. var memoNode = instance1.selectNodes(memoRef);
  36. if(memoNode == null || memoNode.length == 0) return;
  37. var memoCnt = memoNode.length;
  38. var baseX = 30 + (20 * (memoCnt - 1));
  39. var baseY = parseInt(document.body.attribute("height").replace('px','')) - 230 - (20 * (memoCnt - 1));
  40. for(var i=memoCnt; i>0; i--) {
  41. baseX -= 20;
  42. baseY += 20;
  43. misfCreateMemoWindow(memoRef + "[" + i + "]/" + titleNode,memoRef + "[" + i + "]/" + textNode,baseX,baseY);
  44. }
  45. }
  46. function misfRemoveAllMemo() {
  47. var allElements = document.body.children;
  48. var result = "";
  49. for(var idx=allElements.length-1; idx>=0; idx--) {
  50. var selItem = allElements.item(idx);
  51. if(selItem.attribute("id") != "" && selItem.attribute("id").indexOf("grp_memo_") >= 0) {
  52. document.body.removeChild(selItem.attribute("id"));
  53. }
  54. }
  55. }
  56. function misfMemoClose(currentObj) {
  57. currentObj.visible = false;
  58. currentObj.attribute("onclick") = "";
  59. }
  60. function misMemoOnTop(currentObj) {
  61. if(topObjectName == currentObj.attribute("id")) return;
  62. var seq = currentObj.attribute("id").replace("grp_memo_","");
  63. var titleRef = eval("_memo_title_" + seq).attribute("ref");
  64. var textRef = eval("_memo_text_" + seq).attribute("ref");
  65. var left = currentObj.attribute("left");
  66. var top = currentObj.attribute("top");
  67. left = left.replace('px','');
  68. top = top.replace('px','');
  69. misfMemoClose(currentObj);
  70. misfCreateMemoWindow(titleRef,textRef,left,top);
  71. }]]></Script>