PageSourceSearch

https://www.b2bmotoyildirim.com/user-assets/js/phone-mask.js?v=QWYpfRYClNJfd8hmFTJVX8zjIrVOF6rxg9qwLWZ-QZ4

js b2bmotoyildirim.com collected 2026-10-02 16:10:01 UTC 1,479 bytes, 37 lines download raw bytes

1// Telefon numarası maskeleme - Cleave.js ile
2// Kullanım: <input data-phone-mask>
3// Görüntü: 0546 809 53 53
4// Gönderilen değer: 0546 809 53 53 → Backend PhoneHelper.FormatForLogo ile 05468095353'e çevirir
5document.addEventListener('DOMContentLoaded', function () {
6    document.querySelectorAll('[data-phone-mask]').forEach(function (input) {
7        if (typeof Cleave === 'undefined') return;
8
9        var cleaveInstance = new Cleave(input, {
10            blocks: [4, 3, 2, 2],
11            delimiter: ' ',
12            numericOnly: true
13        });
14
15        // Cleave instance'ını element'e bağla (dışarıdan erişim için)
16        input._cleaveInstance = cleaveInstance;
17    });
18});
19
20// Telefon mask'lı input'a değer set etmek için yardımcı fonksiyon
21// Kullanım: setPhoneValue("#Telefon", "05551234567") veya setPhoneValue("#Telefon", "+90 555 123 45 67")
22function setPhoneValue(selector, value) {
23    var input = document.querySelector(selector);
24    if (!input) return;
25    var digits = (value || '').replace(/\D/g, '');
26    // Ülke kodunu temizle, her zaman '0' ile başlayan 11 haneye normalize et
27    if (digits.startsWith('90') && digits.length === 12) {
28        digits = '0' + digits.substring(2);
29    } else if (digits.length === 10) {
30        digits = '0' + digits;
31    }
32    if (input._cleaveInstance) {
33        input._cleaveInstance.setRawValue(digits);
34    } else {
35        input.value = digits;
36    }
37}

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.