1var _GPKIApiCertJS = (function(context) { 2 var targetOrigin = ConfigObject.targetOrigin; 3 var targetSrc = ConfigObject.targetOrigin + ConfigObject.targetSrc; 4 5 _GPKIApiCertJS.addEventListener = function(message, callback) { 6 if (window.addEventListener) { 7 window.addEventListener("message", callback, false); 8 } else if(window.attachEvent) { 9 window.attachEvent("onmessage", callback ); 10 } 11 12 var iframeWindow = document.getElementById('GPKIcert').contentWindow; 13 iframeWindow.postMessage(message, targetOrigin); 14 } 15 16 _GPKIApiCertJS.removeEventListener = function(callback) { 17 if (window.addEventListener) { 18 window.removeEventListener("message", callback, false); 19 } else if(window.attachEvent) { 20 window.detachEvent("onmessage", callback ); 21 } 22 } 23 24 _GPKIApiCertJS.prototype.init = function(callback) { 25 var body = document.getElementsByTagName('body')[0]; 26 var div = document.createElement('div'); 27 var iframe = document.createElement('iframe'); 28 29 iframe.setAttribute("id", "GPKIcert"); 30 iframe.setAttribute("name", "GPKIcert"); 31 iframe.setAttribute("src", targetSrc); 32 iframe.setAttribute("scrolling", "no"); 33 iframe.setAttribute("width", "100%"); 34 iframe.setAttribute("height", "100%"); 35 iframe.setAttribute("frameBorder", "2"); 36 iframe.setAttribute("translate", "yes"); 37 iframe.setAttribute("style", "position:fixed; z-index:100010; top:0px; left:0px; width:100%; height:100%;"); 38 iframe.onload = iniComplete; 39 40 div.id = "GPKIcertContainer"; 41 div.style.display = "none"; 42 div.appendChild(iframe); 43 44 body.appendChild(div); 45 46 function iniComplete() { 47 var request = new Object(); 48 49 request.protocol = "init"; 50 51 _GPKIApiCertJS.addEventListener(request, function(event){ 52 _GPKIApiCertJS.removeEventListener(arguments.callee); 53 54 if (typeof(callback) == "function" && typeof(event.data)) { 55 callback(event.data); 56 } 57 }); 58 } 59 60 return 0; 61 } 62 63 _GPKIApiCertJS.prototype.SaveCert = function(certbag, password, callback) { 64 var request = new Object(); 65 66 request.protocol = "SaveCert"; 67 request.certbag = certbag; 68 request.password = password; 69 70 _GPKIApiCertJS.addEventListener(request, function(event){ 71 _GPKIApiCertJS.removeEventListener(arguments.callee); 72 73 if (typeof(callback) == "function" && typeof(event.data)) { 74 callback(event.data); 75 } 76 }); 77 } 78 79 _GPKIApiCertJS.prototype.GetCertList = function(callback) { 80 var request = new Object(); 81 82 request.protocol = "GetCertList"; 83 84 _GPKIApiCertJS.addEventListener(request, function(event){ 85 _GPKIApiCertJS.removeEventListener(arguments.callee); 86 87 if (typeof(callback) == "function" && typeof(event.data)) { 88 callback(event.data); 89 } 90 }); 91 } 92 93 _GPKIApiCertJS.prototype.DeleteCert = function(storageCertIdx, callback) { 94 var request = new Object(); 95 96 request.protocol = "DeleteCert"; 97 request.storageCertIdx = storageCertIdx; 98 99 _GPKIApiCertJS.addEventListener(request, function(event){ 100 _GPKIApiCertJS.removeEventListener(arguments.callee); 101 102 if (typeof(callback) == "function" && typeof(event.data)) { 103 callback(event.data); 104 } 105 }); 106 } 107}); 108 109if(ConfigObject.isUseDomainStorage){ 110 if (!window.GPKICERTJS) { 111 var _GPKICERTJS = new _GPKIApiCertJS(); 112 window.GPKICERTJS = _GPKICERTJS; 113 } else { 114 delete window.GPKICERTJS; 115 window.GPKICERTJS = new _GPKIApiCertJS(); 116 } 117}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.