Check-in [e0f544bc9b]
Overview
SHA1:e0f544bc9b4b1ca3419f6b8111d2e5f2520217dc
Date: 2016-03-09 04:48:56
User: rkeene
Comment:ChromeOS: Added list of readers detected to smartcard UI
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-03-09
04:53
[e99cc9c924] ChromeOS: Updated to deal with the UI if the smartcard manager app isn't running (user: rkeene, tags: trunk)
04:48
[e0f544bc9b] ChromeOS: Added list of readers detected to smartcard UI (user: rkeene, tags: trunk)
04:40
[40765d7728] ChromeOS: Fix issue where multiple calls made close together may have used the same ID (user: rkeene, tags: trunk)
Changes

Modified build/chrome/ui.html from [cc97e7803b] to [e2cfa8c888].

     3      3   		<title>CACKey</title>
     4      4   		<script type="text/javascript" src="jsrsasign.js"></script>
     5      5   		<script type="text/javascript" src="ui.js"></script>
     6      6   	</head>
     7      7   	<body>
     8      8   		<h1>CACKey for Chrome</h1>
     9      9   		<div>Certificate Provider: <span id="certificate_provider"></span></div>
           10  +		<div>Smartcard Readers: <span id="smartcard_readers"></span></div>
    10     11   		<div>Certificates: <span id="certificates"></span></div>
    11     12   	</body>
    12     13   </html>

Modified build/chrome/ui.js from [2cf5ac6095] to [fb29748971].

    31     31   	}
    32     32   
    33     33   	html += "</ol>";
    34     34   
    35     35   	delete certObj;
    36     36   
    37     37   	htmlObject.innerHTML = html;
           38  +
           39  +	return;
    38     40   }
           41  +
    39     42   function updateCertificates(htmlObject) {
    40     43   	var html = "";
    41     44   
    42     45   	if (globalCerts == null) {
    43     46   		htmlObject.innerHTML = "<i>Updating...</i>";
    44     47   	} else {
    45     48   		displayCerts(htmlObject, globalCerts);
................................................................................
    53     56   		if (!certs) {
    54     57   			certs = [];
    55     58   		}
    56     59   
    57     60   		globalCerts = certs;
    58     61   
    59     62   		displayCerts(htmlObject, certs);
           63  +
           64  +		return;
    60     65   	});
    61     66   
    62     67   	return;
    63     68   }
    64     69   
    65     70   function updateCertificateProvider(htmlObject) {
    66     71   	var resultHTML;
................................................................................
    71     76   		resultHTML = "<b>No, informational only.</b>";
    72     77   	}
    73     78   
    74     79   	htmlObject.innerHTML = resultHTML;
    75     80   
    76     81   	return;
    77     82   }
           83  +
           84  +function updateSmartcardReaders(htmlObject) {
           85  +	parentWindow.cackeyListReaders(function(readers) {
           86  +		var idx;
           87  +		var reader;
           88  +		var resultHTML;
           89  +
           90  +		resultHTML = "Count: " + readers.length;
           91  +
           92  +		if (readers.length > 0) {
           93  +			resultHTML += "<br>";
           94  +
           95  +			resultHTML += "<ol type=\"1\">";
           96  +			for (idx = 0; idx < readers.length; idx++) {
           97  +				reader = readers[idx];
           98  +
           99  +				resultHTML += "<li>" + reader.readerName.trim() + ", card inserted: " + (reader.cardInserted ? "yes" : "no") + "</li>";
          100  +			}
          101  +
          102  +			resultHTML += "</ol>";
          103  +		} else {
          104  +			resultHTML += " (is the Smartcard Manager Application working?)";
          105  +		}
          106  +
          107  +		htmlObject.innerHTML = resultHTML;
          108  +
          109  +		return;
          110  +	});
          111  +
          112  +	return;
          113  +}
    78    114   
    79    115   setTimeout(function() {
    80    116   	updateCertificates(document.getElementById('certificates'));
          117  +	updateSmartcardReaders(document.getElementById('smartcard_readers'));
    81    118   	updateCertificateProvider(document.getElementById('certificate_provider'));
          119  +
          120  +	return;
    82    121   }, 1);