temporary branch

This commit is contained in:
BACHIR SOULDI
2024-10-17 11:30:20 +01:00
parent cd115a234b
commit 742ec3e75e
212 changed files with 18396 additions and 1899 deletions

View 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>

View 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>