Index: build/chrome/ui.html ================================================================== --- build/chrome/ui.html +++ build/chrome/ui.html @@ -5,8 +5,9 @@

CACKey for Chrome

Certificate Provider:
+
Smartcard Readers:
Certificates:
Index: build/chrome/ui.js ================================================================== --- build/chrome/ui.js +++ build/chrome/ui.js @@ -33,11 +33,14 @@ html += ""; delete certObj; htmlObject.innerHTML = html; + + return; } + function updateCertificates(htmlObject) { var html = ""; if (globalCerts == null) { htmlObject.innerHTML = "Updating..."; @@ -55,10 +58,12 @@ } globalCerts = certs; displayCerts(htmlObject, certs); + + return; }); return; } @@ -73,10 +78,44 @@ htmlObject.innerHTML = resultHTML; return; } + +function updateSmartcardReaders(htmlObject) { + parentWindow.cackeyListReaders(function(readers) { + var idx; + var reader; + var resultHTML; + + resultHTML = "Count: " + readers.length; + + if (readers.length > 0) { + resultHTML += "
"; + + resultHTML += "
    "; + for (idx = 0; idx < readers.length; idx++) { + reader = readers[idx]; + + resultHTML += "
  1. " + reader.readerName.trim() + ", card inserted: " + (reader.cardInserted ? "yes" : "no") + "
  2. "; + } + + resultHTML += "
"; + } else { + resultHTML += " (is the Smartcard Manager Application working?)"; + } + + htmlObject.innerHTML = resultHTML; + + return; + }); + + return; +} setTimeout(function() { updateCertificates(document.getElementById('certificates')); + updateSmartcardReaders(document.getElementById('smartcard_readers')); updateCertificateProvider(document.getElementById('certificate_provider')); + + return; }, 1);