1let _otpInputs = null; 2let _DotNetObject = null; 3function OtpHandler(selector, componentInstance) { 4 _otpInputs = document.querySelectorAll(selector); 5 _DotNetObject = componentInstance; 6 console.log("Javascript"); 7 console.log(_otpInputs); 8 9 _otpInputs.forEach((input, index) => { 10 input.dataset.index = index; 11 input.addEventListener("paste", handleOTPPaste); 12 input.addEventListener("keyup", handleOtp); 13 }); 14} 15 16function handleOTPPaste(e) { 17 const data = e.clipboardData.getData("text"); 18 const value = data.split(""); 19 if (value.length === _otpInputs.length) { 20 _otpInputs.forEach((input, index) => { 21 input.value = value[index]; 22 _DotNetObject.invokeMethod('HandlePaste', index, value[index]); 23 }); 24 } 25}; 26 27function handleOtp(e) { 28 const input = e.target; 29 let value = input.value; 30 let fieldIndex = input.dataset.index; 31 if (e.key != "Tab") { 32 if (value.length > 0 && fieldIndex < _otpInputs.length - 1) { 33 _otpInputs[parseInt(fieldIndex) + 1].focus(); 34 } 35 if (e.key === "Backspace" && fieldIndex > 0) { 36 _otpInputs[parseInt(fieldIndex) - 1].focus(); 37 } 38 } 39}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.