pin.js 4.4 KB

1
  1. var __pin=function(b){var n=function(e){function m(a){if(!a)return alert("UI load error."),!1;var b=document.createElement("div");document.body.insertBefore(b,document.body.firstChild);b.innerHTML=a;return!0}function l(a){if(!a)return!1;a=a||window.event;13==(a.which||a.keyCode)&&document.getElementById("us-pin-confirm-btn").click()}var h=function(){var a=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");a.open("GET",b.ESVS.SRCPath+"unisignweb/rsrc/layout/pin.html?version="+b.ver,!1);a.send(null);return a.responseText},g=function(){var a=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");a.open("GET",b.ESVS.SRCPath+"unisignweb/rsrc/lang/"+b.ESVS.Language+"/pin_"+b.ESVS.Language+".js?version="+b.ver,!1);a.send(null);return a.responseText},d=b.ESVS.TabIndex;return function(){var a=b.CustomEval(h),c=b.CustomEval(g,!0),k=e.type;m(a());a=document.getElementById("us-pin-lbl-title");"PIN_SAVE_TOKEN"==k?a.appendChild(document.createTextNode(c.IDS_SAVETOKEN_PIN)):a.appendChild(document.createTextNode(c.IDS_SECTOKEN_PIN));a.setAttribute("tabindex",d,0);document.getElementById("us-pin-cls-btn-img").setAttribute("src",b.ESVS.SRCPath+"unisignweb/rsrc/img/x-btn.png",0);a=document.getElementById("us-pin-sectoken-img");"PIN_SAVE_TOKEN"==k?a.setAttribute("src",b.ESVS.SRCPath+"unisignweb/rsrc/img/media_savetoken.png",0):a.setAttribute("src",b.ESVS.SRCPath+"unisignweb/rsrc/img/media_securitytoken.png",0);a=document.getElementById("us-pin-sectoken-name");"PIN_SAVE_TOKEN"==k?a.appendChild(document.createTextNode(c.IDS_SAVETOKEN)):a.appendChild(document.createTextNode(c.IDS_SECTOKEN));a=document.getElementById("us-pin-notice-text");"PIN_SAVE_TOKEN"==k?a.appendChild(document.createTextNode(c.IDS_SAVETOKEN_PIN_NOTICE)):a.appendChild(document.createTextNode(c.IDS_SECTOKEN_PIN_NOTICE));b.uiUtil().addCapsLockEvent("us-pin-input-textbox","us-pin-err-msg-capslock",c.IDS_MSGBOX_CAPSLOCK_ON,l);document.getElementById("us-pin-input-textbox").setAttribute("tabindex",d+1,0);a=document.getElementById("us-pin-confirm-btn");a.setAttribute("value",c.IDS_CONFIRM,0);a.setAttribute("title",c.IDS_CONFIRM+c.IDS_BUTTON,0);a.setAttribute("tabindex",d+2,0);a.onclick=function(){if(c){var a=document.getElementById("us-pin-input-textbox"),f=a.value;f&&4&b.ESVS.Mode&&("touchen"==b.ESVS.SecureKeyboardType&&b.bsUtil().isTouchEnKeyUsable()?f=b.bsUtil().GetEncryptPwd("us-keyboard-secure-frm","us-pin-input-textbox"):"ahnlab"==b.ESVS.SecureKeyboardType&&b.bsUtil().isAhnlabProtectorUsable()&&(f=b.bsUtil().GetAhnlabEncInputInfo("us-pin-input-textbox")));f?(e.onConfirm(f),a.value=""):(f=null,"PIN_SAVE_TOKEN"==e.type?f=c.IDS_MSGBOX_ERROR_PLEASE_INPUT_SAVETOKEN_PIN:"PIN_SECURITY_TOKEN"==e.type&&(f=c.IDS_MSGBOX_ERROR_PLEASE_INPUT_SECTOKEN_PIN),b.uiUtil().msgBox(f),a.focus())}};a=document.getElementById("us-pin-cancel-btn");a.setAttribute("value",c.IDS_CANCEL,0);a.setAttribute("title",c.IDS_CANCEL+c.IDS_BUTTON,0);a.setAttribute("tabindex",d+3,0);a.onclick=function(){e.onCancel()};a=document.getElementById("us-pin-cls-btn");"PIN_SAVE_TOKEN"==k?a.setAttribute("title",c.IDS_SAVETOKEN_PIN_CLOSE,0):a.setAttribute("title",c.IDS_SECTOKEN_PIN_CLOSE,0);a.setAttribute("tabindex",d+4,0);a.onclick=function(){e.onCancel()};return document.getElementById("us-div-pin")}()};return function(e){function m(){function a(){0<c.value.length?c.value="":(5>e&&setTimeout(a,10),e++)}var c=document.getElementById("us-pin-input-textbox"),e=0;a();var d=g.getElementsByTagName("p");if(0<d.length)for(var f=0;f<d.length;f++)"us-pin-lbl-title"==d[f].id&&d[f].focus();b.bsUtil().SetSecurityStatus("us-pin-input-textbox");b.bsUtil().SetReScan()}var l=b.uiLayerLevel,h=b.uiUtil().getOverlay(l),g=n({type:e.type,args:e.args,onConfirm:e.onConfirm,onCancel:e.onCancel});g.style.zIndex=l+1;b.ESVS.TargetObj.insertBefore(h,b.ESVS.TargetObj.firstChild);var d=window.onresize;return{show:function(){b.bsUtil().AhnlabClearText("us-pin-input-textbox");b.ActiveUI=this;draggable(g,document.getElementById("us-div-pin-title"));h.style.display="block";b.uiUtil().offsetResize(g);window.onresize=function(){b.uiUtil().offsetResize(g);d&&d()};b.uiLayerLevel+=10;b.ESVS.TabIndex+=30;b.bsUtil().ahnlabInit();setTimeout(function(){m()},10)},hide:function(){h.style.display="none";g.style.display="none"},dispose:function(){window.onresize=function(){d&&d()};g.parentNode.parentNode.removeChild(g.parentNode);h.parentNode.removeChild(h);b.uiLayerLevel-=10;b.ESVS.TabIndex-=30}}}};