PageSourceSearch

https://heybarak.com/assets/js/root/utils.js?v=3

js heybarak.com collected 2026-10-09 22:14:58 UTC 2,991 bytes, 81 lines download raw bytes

1function removeSpace(str) {
2    const pattern = /\s/g;
3    if (str.match(pattern)) {
4        str = str.replace(pattern, '');
5    }
6    return str;
7}
8function isAlphaNumeric(str) {
9    const pattern = /^[a-zA-Z0-9]*$/g;
10    if (str.match(pattern)) return true;
11    return false;
12}
13function handleFocusOut(textField) {
14    if (textField.value.indexOf(" ") !== -1) textField.value = removeSpace(textField.value);
15}
16function clearErrorPattern(obj) {
17    let $input = $('#' + obj.id);
18    $input.parent().removeClass('has-error');
19}
20function insertErrorPattern(id) {
21    id.parent().addClass('has-error');
22}
23function isNumeric(str) {
24    const pattern = /^[0-9]*$/g;
25    if (str.match(pattern)) return true;
26    return false;
27}
28function isAlphaSpace(str) {
29    const pattern = /^[a-zA-Z ]*$/g;
30    if (str.match(pattern)) return true;
31    return false;
32}
33function isNumberKey(evt) {
34    var charCode = (evt.which) ? evt.which : event.keyCode;
35    if (charCode > 31 && (charCode < 48 || charCode > 57)) return false;
36    else return true;
37}
38function checkLimit(obj) {
39    if (!$(obj).attr("maxlength")) return true;
40    else return ($(obj).val().length < $(obj).attr("maxlength"));
41}
42function isEmail(str) {
43    const pattern = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g;
44    if (str.match(pattern)) return true;
45    return false;
46}
47function isLetterKeyWithSpace(evt) {
48    var charCode = (evt.which) ? evt.which : event.keyCode;
49    if ((charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || charCode == 32) return true;
50    else return false;
51}
52function isAlphanumericKey(evt) {
53    var charCode = (evt.which) ? evt.which : event.keyCode;
54    if ((charCode >= 48 && charCode <= 57) || (charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || charCode == 46) return true;
55    else return false;
56}
57function isAlphanumericKeyWithSpace(evt) {
58    var charCode = (evt.which) ? evt.which : event.keyCode;
59    if ((charCode >= 48 && charCode <= 57) || (charCode >= 65 && charCode <= 90) || (charCode >
59= 97 && charCode <= 122) || charCode == 46 || charCode == 32) return true;
60    else return false;
61}
62function formatAmountNumber(obj) {
63    obj.val(obj.val().replace(/\D+/gm, '').replace(/^0*/, ''));
64    const maxLength = parseInt(obj.data("maxlength"));
65    const value = obj.val().replace(/\./g, '');
66    if (value.length > maxLength) {
67        let result = value.substring(0, (maxLength));
68        obj.val(result);
69    }
70    obj.val(obj.val().replace(/\D+/gm, '').replace(/(\d)(?=(\d{3})+\b)/g, numGroupSeperator));
71}
72function formatNumber(obj) {
73    obj.val(obj.val().replace(/\D+/gm, '').replace(/^0*/, ''));
74    const maxLength = parseInt(obj.data("maxlength"));
75    const value = obj.val().replace(/\./g, '');
76    if (value.length > maxLength) {
77        let result = value.substring(0, (maxLength));
78        obj.val(result);
79    }
80    obj.val(obj.val().replace(/\D+/gm, ''));
81}

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.