Commit ebdea705 by Ganesh Ananthan

New

parents
@echo off
:: Copyright (c) 2013 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
EIDSampleConsole.exe
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
</startup>
</configuration>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "ae.eid.chrome",
"description": "chrome extension to read EID",
"path": "EIDSampleConsole.exe",
"type": "stdio",
"allowed_origins": [
"chrome-extension://ipcncgpbppgjclagpdlodiiapmggolkf/"
]
}
:: Copyright 2014 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
:: Change HKCU to HKLM if you want to install globally.
:: %~dp0 is the directory containing this bat script and ends with a backslash.
REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\ae.eid.chrome" /ve /t REG_SZ /d "%~dp0ae.eid.chrome.json" /f
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reader</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<script>
$(function(){
$('.btn-readCard').click(function(){
$('#txtNationalNumber').val('Scanning card...');
$('.eid-wrapper').addClass('loading');
readeid();
});
$('.simulateEidResponse').click(function(){
var response = $(this).html();
try {
//console.log(msg.response);
if(response=="NO DATA"){
throw "Could not read card.";
}
var json = $.parseJSON(response);
//console.log(json);
$(json).each(function (i, val) {
$.each(val, function (key, value) {
if (key == 'EIDNumber'){
$('.eid-wrapper').removeClass('loading');
$("#txtNationalNumber").val(value);
alert('Card scanned successfully.');
//overwrite clipboard with id
clearClipboard("no data");
//$('#btnFetchCards').trigger('click');
}
});
});
}
catch (e) {
alert(e);
$("#txtNationalNumber").val('');
$('.eid-wrapper').removeClass('loading');
}
});
});
function readeid() {
var event = document.createEvent('Event');
event.initEvent('EID_EVENT');
document.dispatchEvent(event);
}
</script>
<style>
.eid-wrapper .spinner-border{
display: none;
}
.eid-wrapper.loading .spinner-border{
display: inline-block;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
<div class="eid-wrapper">
<div class="spinner-border text-warning position-absolute" role="status" style="top:1px;right:10px;">
<span class="sr-only loader">Loading...</span>
</div>
<input type="text" id="txtNationalNumber" class="form-control" />
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
<button class="btn btn-success btn-readCard">Read Card</button>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
<span class="simulateEidResponse"><!--response from console app will come here--></span>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment