XFormsSecret.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. XFormsSecret.prototype = new XFormsInput;
  2. function XFormsSecret (strParentId, strAlert, strHelp, strHint, strAccesskey, bAutonext, strBind, strClass, bDisabled,
  3. bDragMode, bDropMode, bEditable, bEditmenu, strFormat, strId, strImemode, strInputtype, strInvalidcharaters,
  4. bIsemptyformatted, strMask, nMaxbyte, nMaxlength, nNavindex, strOverflow, strPastemode, strRef, bRequired, strRoundmode,
  5. nRoundposition, strScroll, strShowEffect, bShowmask, nSecretEndPosition, strSecretMark, nSecretStartPosition, strStyle, strTag, bValidateformat, strVisibility, strUserDefineAttrib)
  6. {
  7. if (!strId)
  8. {
  9. return;
  10. }
  11. XFormsInput.call(this, strParentId, strAlert, strHelp, strHint, strAccesskey, bAutonext, strBind, strClass, bDisabled,
  12. bDragMode, bDropMode, bEditable, bEditmenu, strFormat, strId, strImemode, strInputtype, strInvalidcharaters,
  13. bIsemptyformatted, strMask, nMaxbyte, nMaxlength, nNavindex, strOverflow, strPastemode, strRef, bRequired, strRoundmode,
  14. nRoundposition, strScroll, strShowEffect, bShowmask, false/*showtoday*/, strStyle, strTag, bValidateformat, strVisibility, strUserDefineAttrib);
  15. /**
  16. * Property
  17. */
  18. // Web Browser에서 지원 안함.
  19. this.attribute["secretendposition"] = String(nSecretEndPosition);
  20. this.attribute["secretmark"] = strSecretMark;
  21. this.attribute["secretstartposition"] = String(nSecretStartPosition);
  22. };
  23. XFormsSecret.create = function (strParentId, clAttribute, strStyle)
  24. {
  25. // 메인노드 생성
  26. var xnSecret = XFormsSecret.createMainNode(clAttribute);
  27. var xnParent = document.getElementById("HE_"+strParentId);
  28. xnParent.appendChild(xnSecret);
  29. // 하위노드 생성
  30. xnSecret = XFormsSecret.createSubNodes(xnSecret, clAttribute);
  31. // object 생성
  32. return XFormsSecret.createObject(strParentId, xnSecret, clAttribute, strStyle);
  33. };
  34. XFormsSecret.createMainNode = function (clAttribute)
  35. {
  36. var xnSecret = XFormsInput.createMainNode(clAttribute);
  37. xnSecret.type = "password";
  38. return xnSecret;
  39. };
  40. XFormsSecret.createSubNodes = function (xnSecret, clAttribute)
  41. {
  42. return xnSecret;
  43. };
  44. XFormsSecret.createObject = function (strParentId, xnSecret, clAttribute, strStyle)
  45. {
  46. var strAlert = "";
  47. var strHelp = "";
  48. var strHint = "";
  49. var strAccesskey = "";
  50. var strBind = "";
  51. var strClass = "";
  52. var bDisabled = false;
  53. var bDragMode = false;
  54. var bDropMode = false;
  55. var bEditable = true;
  56. var bEditMenu = true;
  57. var strId = "";
  58. var strImeMode = "";
  59. var nMaxLength = -1;
  60. var nNavindex = 9007199254740992;
  61. var strRef = "";
  62. var nSecretEndPosition = -1;
  63. var strSecretMark = "";
  64. var nSecretStartPosition = -1;
  65. var strRoundmode = "";
  66. var strVisibility = "visible";
  67. var strUserDefineAttrib = "";
  68. for (var i=0; i<clAttribute.count(); i++)
  69. {
  70. var strAttributeName = clAttribute.keys()[i];
  71. switch (strAttributeName)
  72. {
  73. case "alert" :
  74. {
  75. strAlert = clAttribute.item(strAttributeName);
  76. break;
  77. }
  78. case "help" :
  79. {
  80. strHelp = clAttribute.item(strAttributeName);
  81. break;
  82. }
  83. case "hint" :
  84. {
  85. strHint = clAttribute.item(strAttributeName);
  86. break;
  87. }
  88. case "accesskey" :
  89. {
  90. strAccesskey = clAttribute.item(strAttributeName);
  91. break;
  92. }
  93. case "bind" :
  94. {
  95. strBind = clAttribute.item(strAttributeName);
  96. break;
  97. }
  98. case "class" :
  99. {
  100. strClass = clAttribute.item(strAttributeName);
  101. break;
  102. }
  103. case "disabled" :
  104. {
  105. if ("true" == clAttribute.item(strAttributeName))
  106. {
  107. bDisabled = true;
  108. }
  109. break;
  110. }
  111. case "dragmode" :
  112. {
  113. if ("true" == clAttribute.item(strAttributeName))
  114. {
  115. bDragMode = true;
  116. }
  117. break;
  118. }
  119. case "dropmode" :
  120. {
  121. if ("true" == clAttribute.item(strAttributeName))
  122. {
  123. bDropMode = true;
  124. }
  125. break;
  126. }
  127. case "editable" :
  128. {
  129. if ("false" == clAttribute.item(strAttributeName))
  130. {
  131. bEditable = false;
  132. }
  133. break;
  134. }
  135. case "editmenu" :
  136. {
  137. if ("false" == clAttribute.item(strAttributeName))
  138. {
  139. bEditMenu = false;
  140. }
  141. break;
  142. }
  143. case "id" :
  144. {
  145. strId = clAttribute.item(strAttributeName);
  146. break;
  147. }
  148. case "imemode" :
  149. {
  150. strImeMode = clAttribute.item(strAttributeName);
  151. break;
  152. }
  153. case "maxlength" :
  154. {
  155. nMaxLength = parseInt(clAttribute.item(strAttributeName));
  156. break;
  157. }
  158. case "navindex" :
  159. {
  160. nNavindex = parseInt(clAttribute.item(strAttributeName));
  161. break;
  162. }
  163. case "ref" :
  164. {
  165. strRef = clAttribute.item(strAttributeName);
  166. break;
  167. }
  168. case "secretendposition" :
  169. {
  170. nSecretEndPosition = parseInt(clAttribute.item(strAttributeName));
  171. break;
  172. }
  173. case "secretmark" :
  174. {
  175. strSecretMark = clAttribute.item(strAttributeName);
  176. break;
  177. }
  178. case "secretstartposition" :
  179. {
  180. nSecretStartPosition = parseInt(clAttribute.item(strAttributeName));
  181. break;
  182. }
  183. case "visibility" :
  184. {
  185. strVisibility = clAttribute.item(strAttributeName);
  186. break;
  187. }
  188. default :
  189. {
  190. if (!STYLE_LIST[strAttributeName])
  191. {
  192. strUserDefineAttrib += strAttributeName + ":" + clAttribute.item(strAttributeName) + "; ";
  193. }
  194. break;
  195. }
  196. }
  197. }
  198. // TODO SecretEndPosition, SecretMark, SecretStartPosition
  199. var objSecret = new XFormsSecret (strParentId, strAlert, strHelp, strHint, strAccesskey, false, strBind, strClass, bDisabled, bDragMode, bDropMode, bEditable, bEditMenu, "", strId, strImeMode, "secret", "", false, "", -1, nMaxLength, nNavindex, "", "", strRef, false, strRoundmode, 0, "none", "", false, ""/*secretEndPosition*/, ""/*secretMark*/, ""/*secretStartPosition*/, strStyle, "xforms:secret", false, strVisibility, strUserDefineAttrib);
  200. return objSecret;
  201. };
  202. XFormsSecret.createAttribute = function (xnHtmlNode, clAttribute)
  203. {
  204. xnHtmlNode = XFormsInput.createAttribute(xnHtmlNode, clAttribute);
  205. return xnHtmlNode;
  206. };