sectokenselect.js 6.1 KB

1
  1. var __sectokenselect=function(a){var v=function(d){function r(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 n(c){h.restoreOnMouseEvent();if(null==d.args||null==d.args.list)return a.uiUtil().msgBox(c.IDS_MSGBOX_ERROR_NO_SELECTED_DRIVER),!1;var b=d.args.list,l=d.args.list.length;if(0>=l)return a.uiUtil().msgBox(c.IDS_MSGBOX_ERROR_NO_SELECTED_DRIVER),!1;for(var k=!1,f=parseInt(h.selectedIndex()),e=0;e<l;e++)if(b[e].index===f){k="invalid"==b[e].validity?!1:!0;break}if(0==k&&0==confirm(c.IDS_MSGBOX_CONFIRM_TRUSTLESS_DRIVER))return!1;d.onConfirm(f,b[e].name);return!0}function g(c){if(null==d.args||null==d.args.list||0>=d.args.list.length)var b=null;else{b=d.args.list;for(var g=d.args.list.length,k=[],f=0;f<g;f++){var e=[];e[0]=b[f].name;e[1]=b[f].driver;e[2]=b[f].validity;e[3]=b[f].index;k[f]=e}b={list:k}}m=a.loadUI("gridlist");h=m({type:"driverslist",tblid:"us-sectoken-select-tbl-list",tbltitleid:"us-sectoken-select-tbl-list-th",titlelistid:"us-sectoken-select-grid-head-div",titlerowid:"us-sectoken-select-list-title-row",titleelementid:"us-sectoken-select-list-title-element",titledividerid:"us-sectoken-select-list-title-divider",titlelistcn:"us-layout-sectoken-select-grid-head-div",titlerowcn:"us-layout-sectoken-select-grid-head-row",titleelementcn:"us-layout-sectoken-select-grid-row-title-element",titledividercn:"us-layout-sectoken-select-grid-row-title-divider",tblbodyid:"us-sectoken-select-tbl-list-td",datalistid:"us-sectoken-select-grid-body-div",datarowid:"us-sectoken-select-list-body-row",dataelementid:"us-sectoken-select-list-data-element",datalistcn:"us-layout-sectoken-select-grid-body-div",datarowcn:"us-layout-sectoken-select-grid-body-row",dataelementcn:"us-layout-sectoken-select-grid-row-data-element",dataselectcn:"us-layout-sectoken-select-grid-row-data-selected-element"});g=!0;"opera"==a.browserName&&(g=!1);b?h.drawList(c,c.length,b.list,b.list.length,l+2,g):h.drawList(c,c.length,null,0,l+2,g)}var p=function(){var c=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");c.open("GET",a.ESVS.SRCPath+"unisignweb/rsrc/layout/sectokenselect.html?version="+a.ver,!1);c.send(null);return c.responseText},u=function(){var c=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");c.open("GET",a.ESVS.SRCPath+"unisignweb/rsrc/lang/"+a.ESVS.Language+"/sectokenselect_"+a.ESVS.Language+".js?version="+a.ver,!1);c.send(null);return c.responseText},m=null,h=null,l=a.ESVS.TabIndex;return function(){var c=a.CustomEval(p),b=a.CustomEval(u,!0);r(c());c=document.getElementById("us-sectoken-select-lbl-title");c.appendChild(document.createTextNode(b.IDS_SECTOKEN_SELECTION));c.setAttribute("tabindex",l,0);var m=document.getElementById("us-sectoken-select-lbl-notice");m.innerHTML=b.IDS_SECTOKEN_NOTICE;m.setAttribute("tabindex",l+1,0);var k=document.getElementById("us-sectoken-select-lbl-notice-txt");k.innerHTML=b.IDS_SECTOEKN_SUGGESTION;k.setAttribute("tabindex",l+3,0);var f=document.getElementById("us-sectoken-select-install-driver-btn");f.setAttribute("value",b.IDS_SECTOKEN_DRIVER_INSTALL,0);f.setAttribute("title",b.IDS_LINK_TITLE,0);f.setAttribute("tabindex",l+4,0);f.onclick=function(){"firefox"==a.browserName?window.open("http://rootca.or.kr/kor/hsm/hsm.jsp","hsm_url","scrollbars=1"):window.open("http://rootca.or.kr/kor/hsm/hsm.jsp");this.focus()};f.onfocus=function(a){f.style.border="2px dotted black"};f.onblur=function(a){f.style.border=""};var e=document.getElementById("us-fp-sectoken-select-install-driver-btn");e.setAttribute("value",b.IDS_FP_SECTOKEN_DRIVER_INSTALL,0);e.setAttribute("title",b.IDS_LINK_TITLE,0);e.setAttribute("tabindex",l+4,0);e.onclick=function(){"firefox"==a.browserName?window.open("https://www.crosscert.com/common/popup/popup_20120104.html","hsm_url","scrollbars=1"):window.open("https://www.crosscert.com/common/popup/popup_20120104.html");this.focus()};e.onfocus=function(a){e.style.border="2px dotted black"};e.onblur=function(a){e.style.border=""};k=document.getElementById("us-sectoken-select-confirm-btn");k.setAttribute("value",b.IDS_CONFIRM,0);k.setAttribute("tabindex",l+5,0);k.onclick=function(){n(b)};var q=document.getElementById("us-sectoken-select-cancel-btn");q.setAttribute("value",b.IDS_CANCEL,0);q.setAttribute("tabindex",l+6,0);q.onclick=function(){h.restoreOnMouseEvent();d.onCancel()};var t=document.getElementById("us-sectoken-select-cls-img-btn");t.setAttribute("title",b.IDS_SECTOKEN_SELECTION_CLOSE,0);t.setAttribute("tabindex",l+7,0);t.onclick=function(){h.restoreOnMouseEvent();d.onCancel()};document.getElementById("us-sectoken-select-cls-btn-img").setAttribute("src",a.ESVS.SRCPath+"unisignweb/rsrc/img/x-btn.png",0);a.uiUtil().setRotationTabFocus(q,k,c);a.uiUtil().setRotationTabFocus(c,q,m);g([{title:b.IDS_SECTOKEN_PRODUCT_NAME},{title:b.IDS_SECTOKEN_DRIVER_NAME},{title:b.IDS_SECTOKEN_EXAMINATION_PASSAGE}]);return document.getElementById("us-div-sectoken-select")}()};return function(d){var r=a.uiLayerLevel,n=a.uiUtil().getOverlay(r),g=v({type:d.type,args:d.args,onConfirm:d.onConfirm,onCancel:d.onCancel});g.style.zIndex=r+1;document.body.insertBefore(n,document.body.firstChild);var p=window.onresize;return{show:function(){a.ActiveUI=this;draggable(g,document.getElementById("us-div-sectoken-select-title"));n.style.display="block";var d=document.getElementById("us-div-cert-select"),m=document.getElementById("us-div-cert-manage"),h=null;d?(h=document.getElementById("us-div-list"),h=d.offsetTop+h.offsetTop+"px"):m&&(h=document.getElementById("us-div-cert-manage-list"),h=m.offsetTop+h.offsetTop+"px");a.uiUtil().offsetResize(g);h&&(g.style.top=h);window.onresize=function(){a.uiUtil().offsetResize(g);p&&p()};a.uiLayerLevel+=10;a.ESVS.TabIndex+=30;setTimeout(function(){var a=g.getElementsByTagName("p");if(0<a.length)for(var c=0;c<a.length;c++)"us-sectoken-select-lbl-title"==a[c].id&&a[c].focus()},10)},hide:function(){n.style.display="none";g.style.display="none"},dispose:function(){window.onresize=function(){p&&p()};g.parentNode.parentNode.removeChild(g.parentNode);n.parentNode.removeChild(n);a.uiLayerLevel-=10;a.ESVS.TabIndex-=30}}}};