1$(function uil_init_form_controls_v2() { 2 var open_select = function (element) { 3 var worked = false; 4 if (document.createEvent) { // all browsers 5 var e = document.createEvent("MouseEvents"); 6 e.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 7 worked = element.dispatchEvent(e); 8 } else if (element.fireEvent) { // ie 9 worked = element.fireEvent("onmousedown"); 10 } 11 if (!worked) { // unknown browser / error 12 alert("It didn't worked in your browser."); 13 } 14 }; 15 16 var input_file_handler = function ($input, $title) { 17 var path = $input.val(); 18 var filename = path.slice(path.lastIndexOf(path.lastIndexOf('\\') ? '\\' : '/') + 1); 19 var text = filename.length > 0 ? filename : $title.attr('data-default-title'); 20 if (text !== $title.text()) 21 $title.text(text); 22 }; 23 24 $(document) 25 .on('change', '.uil-form-controls-v2_type_button input[type=file]', function () { 26 var $input = $(this), 27 $title = $input 28 .closest('.uil-form-controls-v2__control') 29 .find('.uil-form-controls-v2__control__file-open'); 30 input_file_handler($input, $title); 31 if ($input.attr('data-uil-form-controls-v2-init') !== 'yes') { 32 $input.attr('data-uil-form-controls-v2-init', 'yes'); 33 setInterval(function () { 34 input_file_handler($input, $title); 35 }, 1000); 36 } 37 }) 38 // ÐÑи клике по видимой ÑаÑÑи ÑекÑÑового Ð¿Ð¾Ð»Ñ ÑокÑÑ Ð² ÑеалÑное поле 39 .on('click', '.uil-form-controls-v2_type_text, .uil-form-controls-v2_type_textarea', function () { 40 var $inputs = $(this).find('input[type=text], input[type=password], textarea'); 41 if ($inputs.length === 1) $inputs.focus(); 42 }) 43 // ÐÑи клике по видимой ÑаÑÑи кнопки клик по ÑеалÑной кнопке 44 .on('click', '.uil-form-controls-v2_type_button', function (e) { 45 e.stopPropagation(); 46 var $inputs = $(this).find('input[type=button], input[type=submit], input[type=reset], input[type=image], input[type=file], a, button, span'); 47 if ($inputs.length === 1) { 48 $inputs[0].click(); 49 } 50 }) 51 // ÐÑедоÑвÑаÑенеие ÑÑÑекÑа двойного клика по кнопке 52 .on('click', '.uil-form-controls-v2_type_button .uil-form-controls-v2__control > *', function (e) { 53 e.stopPropagation(); 54 }) 55 // ÐÑи клике по видимой ÑаÑÑи вÑпадаÑÑего ÑпиÑка оÑкÑÑÑие ÑеалÑного вÑпадаÑÑего ÑпиÑка 56 .on('click', '.uil-form-controls-v2_type_select', function () { 57 var $inputs = $(this).find('select'); 58 if ($inputs.length === 1) open_select($inputs[0]); 59 }) 60 // ÐÑедоÑвÑаÑенеие ÑÑÑекÑа двойного клика по вÑпадаÑÑÐµÐ¼Ñ ÑпиÑÐºÑ 61 .on('click', '.uil-form-controls-v2_type_select select', function (e) { 62 e.stopPropagation(); 63 }); 64});
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.