Alert.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>TrustForm Soonsu Viewer</title>
  5. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  6. <script type="text/javascript" >
  7. vbOKOnly = 0; vbOKCancel = 1; vbAbortRetryIgnore = 2; vbYesNoCancel = 3; vbYesNo = 4; vbRetryCancel = 5;
  8. vbNoIcon = 0; vbCritical = 16; vbQuestion = 32; vbExclamation = 48; vbInformation = 64;
  9. vbDefaultButton1 = 0; vbDefaultButton2 = 256; vbDefaultButton3 = 512; vbDefaultButton4 = 768;
  10. vbApplicationModal = 0; vbSystemModal = 4096;
  11. function ModalOnload ()
  12. {
  13. var htMessage = window.dialogArguments;
  14. var strMessage = htMessage["message"];
  15. var strTitle = htMessage["title"];
  16. var strType = htMessage["type"];
  17. if (strTitle)
  18. {
  19. document.title = strTitle;
  20. }
  21. var nButtonType = vbOKOnly;
  22. var nIconType = vbNoIcon;
  23. var nDefaultButton = vbDefaultButton1;
  24. var nModalType = vbApplicationModal;
  25. if (strType)
  26. {
  27. var nType = Number(strType);
  28. nButtonType = nType & 0XF;
  29. nIconType = nType & 0XF0;
  30. nDefaultButton = nType & 0XF00;
  31. nModalType = nType & 0XF000;
  32. // Modal Type 을 구한다.
  33. if (vbSystemModal & nType)
  34. {
  35. nModalType = vbSystemModal;
  36. }
  37. }
  38. MakeMassageDialog(strMessage, nButtonType, nIconType, nModalType);
  39. }
  40. function MakeMassageDialog (strMessage, nButtonType, nIconType, nModalType)
  41. {
  42. var heMessageBody = document.getElementById("__Message_Body");
  43. var heWholeDiv = document.createElement("div");
  44. heMessageBody.appendChild(heWholeDiv);
  45. var heMessageDiv = document.createElement("div");
  46. heMessageDiv.setAttribute("id", "__Message_Div");
  47. heMessageDiv.style.padding = "20px";
  48. heWholeDiv.appendChild(heMessageDiv);
  49. var heMessageTable = document.createElement("table");
  50. heMessageTable.cellPadding = "5";
  51. heMessageTable.cellSpacing = "0";
  52. heMessageTable.border = "0";
  53. heMessageTable.style.fontFamily = "굴림";
  54. heMessageTable.style.fontSize = "10pt";
  55. heMessageDiv.appendChild(heMessageTable);
  56. var heMessageTbody = document.createElement("tbody");
  57. heMessageTable.appendChild(heMessageTbody);
  58. var heMessageTr = document.createElement("tr");
  59. heMessageTbody.appendChild(heMessageTr);
  60. if (0 != nIconType)
  61. {
  62. var heIconTd = document.createElement("td");
  63. heMessageTr.appendChild(heIconTd);
  64. var strImagePath = "";
  65. switch (nIconType)
  66. {
  67. case vbCritical : strImagePath = "/TrustForm/kr/comsquare/image/alert/critical.png"; break;
  68. case vbQuestion : strImagePath = "/TrustForm/kr/comsquare/image/alert/question.png"; break;
  69. case vbExclamation : strImagePath = "/TrustForm/kr/comsquare/image/alert/exclamation.png"; break;
  70. case vbInformation : strImagePath = "/TrustForm/kr/comsquare/image/alert/information.png"; break;
  71. }
  72. var heIcon = document.createElement("img");
  73. heIcon.src = strImagePath;
  74. heIcon.width = 32;
  75. heIcon.height = 32;
  76. heIconTd.appendChild(heIcon);
  77. }
  78. var heMessageTd = document.createElement("td");
  79. if (null != heMessageTd.innerText)
  80. {
  81. heMessageTd.innerText = strMessage;
  82. }
  83. else
  84. {
  85. heMessageTd.textContent = strMessage;
  86. }
  87. heMessageTr.appendChild(heMessageTd);
  88. var heButtonDiv = document.createElement("div");
  89. heButtonDiv.style.fontFamily = "굴림";
  90. heButtonDiv.style.fontSize = "10pt";
  91. heButtonDiv.style.padding = "10px";
  92. heButtonDiv.style.backgroundColor = "#F0F0F0";
  93. heWholeDiv.appendChild(heButtonDiv);
  94. if (vbOKOnly == nButtonType)
  95. {
  96. var heButton = makeButton("확인");
  97. heButtonDiv.appendChild(heButton);
  98. }
  99. else if (vbOKCancel == nButtonType)
  100. {
  101. var heButton = makeButton("확인");
  102. heButtonDiv.appendChild(heButton);
  103. heButton = makeButton("취소");
  104. heButtonDiv.appendChild(heButton);
  105. }
  106. else if (vbAbortRetryIgnore == nButtonType)
  107. {
  108. var heButton = makeButton("중단(A)");
  109. heButtonDiv.appendChild(heButton);
  110. heButton = makeButton("다시 시도(R)");
  111. heButtonDiv.appendChild(heButton);
  112. heButton = makeButton("무시(I)");
  113. heButtonDiv.appendChild(heButton);
  114. }
  115. else if (vbYesNoCancel == nButtonType)
  116. {
  117. var heButton = makeButton("예(Y)");
  118. heButtonDiv.appendChild(heButton);
  119. heButton = makeButton("아니요(N)");
  120. heButtonDiv.appendChild(heButton);
  121. heButton = makeButton("취소");
  122. heButtonDiv.appendChild(heButton);
  123. }
  124. else if (vbYesNo == nButtonType)
  125. {
  126. var heButton = makeButton("예(Y)");
  127. heButtonDiv.appendChild(heButton);
  128. heButton = makeButton("아니요(N)");
  129. heButtonDiv.appendChild(heButton);
  130. }
  131. else if (vbRetryCancel == nButtonType)
  132. {
  133. var heButton = makeButton("다시 시도(R)");
  134. heButtonDiv.appendChild(heButton);
  135. heButton = makeButton("취소");
  136. heButtonDiv.appendChild(heButton);
  137. }
  138. if (window.dialogWidth)
  139. {
  140. window.dialogWidth = heMessageBody.scrollWidth + "px";
  141. window.dialogHeight = heMessageBody.scrollHeight + "px";
  142. }
  143. else
  144. {
  145. self.resizeTo(heWholeDiv.scrollWidth, heWholeDiv.scrollHeight);
  146. }
  147. }
  148. function makeButton (strValue)
  149. {
  150. var heButton = document.createElement("button");
  151. heButton.style.fontFamily = "굴림";
  152. heButton.style.fontSize = "9pt";
  153. heButton.style.width = "86px";
  154. heButton.style.height = "24px";
  155. if (heButton.childNodes[0])
  156. {
  157. heButton.childNodes[0].nodeValue = strValue;
  158. }
  159. else if (heButton.value)
  160. {
  161. heButton.value = strValue;
  162. }
  163. else
  164. {
  165. heButton.innerHTML = strValue;
  166. }
  167. return heButton;
  168. }
  169. </script>
  170. </head>
  171. <body id="__Message_Body" onload="ModalOnload();">
  172. </body>
  173. </html>