temporary branch
This commit is contained in:
47
src/main/webapp/index-foot.jsp
Normal file
47
src/main/webapp/index-foot.jsp
Normal file
@@ -0,0 +1,47 @@
|
||||
<script>
|
||||
$(document).on("click",".fa-check", function () {
|
||||
console.log("ok");
|
||||
$(this).parent().parent().parent().removeClass("hilite-info-text");
|
||||
$(this).parent().parent().parent().removeClass("hilite-warning-text");
|
||||
$(this).parent().parent().parent().addClass("hilite-success-text");
|
||||
$(this).parent().parent().siblings(".l11").text("Accepté")
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click", ".fa-times", function () {
|
||||
$(this).parent().parent().parent().removeClass("hilite-info-text");
|
||||
$(this).parent().parent().parent().removeClass("hilite-success-text");
|
||||
$(this).parent().parent().parent().addClass("hilite-warning-text");
|
||||
$(this).parent().parent().siblings(".l11").text("Refusée")
|
||||
});
|
||||
|
||||
|
||||
|
||||
var html5QrcodeScanner = null;
|
||||
|
||||
$(document).on("click","[name='scan']",function(){
|
||||
console.log("clicked");
|
||||
document.getElementsByName("scanPlaceHolder")[0].innerHTML = '<div id="qr-reader" style="width: 600px"></div>'
|
||||
var html5QrcodeScanner = new Html5QrcodeScanner(
|
||||
"qr-reader", { fps: 10, qrbox: 250 });
|
||||
html5QrcodeScanner.render(onScanSuccess,onScanError);
|
||||
})
|
||||
|
||||
function onScanSuccess(decodedText, decodedResult) {
|
||||
// $("[name='rack'] input").val(decodedText);
|
||||
// var scope = angular.element(document.querySelector("[name='product'] input")).scope()
|
||||
// $("[name='product'] input").val(decodedText);
|
||||
|
||||
console.log(document.querySelector("[name='productHolder']"));
|
||||
angular.element(document.querySelector('[name="productHolder"]')).scope().setValue(decodedText,true);
|
||||
html5QrcodeScanner.clear();
|
||||
}
|
||||
|
||||
function onScanError(errorMessage) {
|
||||
console.log(errorMessage);
|
||||
// handle on error condition, with error message
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
12
src/main/webapp/index-head.jsp
Normal file
12
src/main/webapp/index-head.jsp
Normal file
@@ -0,0 +1,12 @@
|
||||
<style>
|
||||
[name="scanPlaceHolder"] {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
<script src="https://unpkg.com/html5-qrcode" type="text/javascript"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.2.min.js" integrity="sha256-2krYZKh//PcchRtd+H+VyyQoZ/e3EcrkxhM8ycwASPA=" crossorigin="anonymous"></script>
|
||||
Reference in New Issue
Block a user