PageSourceSearch

https://stlfkpc.org/modu/js/modu_event.js

js stlfkpc.org collected 2026-10-04 20:41:24 UTC 3,338 bytes, 108 lines download raw bytes

1/***************** 공통 이벤트 / 링크 참조 시 defer 추가 *****************/
2
3// 숫자만 입력
4$(document).on('keyup','input.ipt_txt.regex_num',function () {
5	$(this).val($(this).val().replace(/[^0-9]/g, ''));
6});
7
8// 숫자만 입력( - 가능)
9$(document).on('keyup','input.ipt_txt.regex_num_h',function () {
10	$(this).val($(this).val().replace(/[^0-9-]/g, ''));
11});
12
13// 숫자만 입력( / 가능)
14$(document).on('keyup','input.ipt_txt.regex_num_s',function () {
15	$(this).val($(this).val().replace(/[^0-9/]/g, ''));
16});
17
18// 천 단위 콤마
19$(document).on('keyup','input.ipt_txt.regex_money',function () {
20  let val = $(this).val();
21
22  // 숫자와 - 만 허용
23  val = val.replace(/[^0-9-]/g, '');
24
25  // - 는 맨 앞에 하나만 허용
26  val = val.replace(/(?!^)-/g, '');
27
28  // 숫자 부분만 포맷
29  const isNegative = val.startsWith('-');
30  const number = val.replace(/-/g, '');
31
32  if (number === '') {
33    $(this).val(isNegative ? '-' : '');
34    return;
35  }
36
37  const formatted = Number(number).toLocaleString('k
37o-KR');
38  $(this).val(isNegative ? '-' + formatted : formatted);
39});
40
41// input 입력시 capslock 체크
42var caps_ipts = document.querySelectorAll('.chk_capslock');
43[].forEach.call(caps_ipts, function (ipt) {
44  ipt.addEventListener('keyup', keyup_capslock, false);
45});
46function keyup_capslock(e) {
47  if (e.getModifierState('CapsLock')) {
48    document.querySelector('.chk_capslock_pop').style.cssText = 'display:block;'
49  } else {
50    document.querySelector('.chk_capslock_pop').style.cssText = 'display:none;'
51  }
52}
53
54// input 값 지우기 버튼
55document.querySelectorAll('.btn_text_del').forEach(btn => {
56  btn.addEventListener('click', function () {
57    const input = this.parentElement.querySelector('.ipt_txt');
58    if (input) input.value = '';
59  });
60});
61
62// 비밀번호 보이기 버튼
63document.querySelectorAll('.btn_pass_eye').forEach(btn => {
64  btn.addEventListener('click', function () {
65    const container = this.parentElement;
66    const input = container.querySelector('input[type="password"], input[type="text"]');
67
68    if (!input) return;
69
70    if (input.type === 'password') {
71      input.type = 'text';
72      this.classList.add('active'); // 아이콘 상태 변경용 (선택)
73    } else {
74      input.type = 'password';
75      this.classList.remove('active');
76    }
77  });
78});
79
80// 파일업로드 파일명
81$(document).on('change', '.ipt_file', function () {
82  // 이미지 경로 보기
83	var $ipt_file = $(this);
84	if (window.FileReader) {
85		var filename = $ipt_file[0].files[0].name;
86	} else {
87		var filename = $ipt_file.val().split('/').pop().split('\\').pop();
88	}
89	$ipt_file.parent().siblings('.file_alt').text(filename);
90
91  // 이미지 미리보기 기능
92  const file_preview = $ipt_file.parent().siblings('.file_preview');
93  if(file_preview.length > 0){
94    if (this.files && this.files[0]) {
95      let reader = new FileReader();
96      reader.onload = function(e) {
97        file_preview.attr('src', e.target.result);
98        file_preview.addClass('show');
99      };
100      reader.readAsDataURL(this.files[0]);
101    } else {
102      file_preview.attr('src','');
103      file_preview.removeClass('show');
104    }
105  }
106
107	$ipt_file.closest('.ipt_file_area').addClass('selected');
108});

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.