PageSourceSearch

https://www.ycart.kr/_u/js/common.js

js ycart.kr collected 2026-10-07 00:26:45 UTC 5,045 bytes, 175 lines download raw bytes

1$(document).ready(function() {
2
3	// 모달 창닫기 공통
4	$('.modal .modal_close').click(function() {
5		$(this).closest('div[id^=modal]').bPopup().close();
6		$(this).closest('div[id^=modal]').find('.tbl_head01 tbody tr').not('.tr_nothing').hide();
7	});
8
9});	// ehd of $(document).ready(function()	-------------
10
11
12//-- 번역 문장 -> 리턴
13// 활용 alert(_t('적용할 항목이 존재하지 않습니다.'));
14if(typeof(byte_check)!='_t') {
15function _t(string, domain) {
16	if(domain == undefined) domain = "default";
17	sp_string = "singular";
18	try {
19		string = (eval('lang_'+domain+'[string][sp_string]'))? eval('lang_'+domain+'[string][sp_string]'):string;
20	} catch (e) {}
21	return string;
22}
23}
24
25//-- 번역 문장 -> 출력(echo)
26if(typeof(byte_check)!='__t') {
27function __t(string, domain) {
28	if(domain == undefined) domain = "default";
29	sp_string = "singular";
30	try {
31		string = (eval('lang_'+domain+'[string][sp_string]'))? eval('lang_'+domain+'[string][sp_string]'):string;
32	} catch (e) {}
33	alert(string);
34}
35}
36
37//-- 복수 처리 번역 문장 -> 리턴
38//-- 활용 alert(sprintf('%2$s %3$s a %1$s', 'cracker', 'Polly', 'wants'));
39//alert( sprintf(_p('%d 개월','%d 개월들',3),3) );
40//alert( _p('%d 개월','%d 개월들',3) );
41if(typeof(byte_check)!='_p') {
42function _p(string1, string2, number, domain) {
43	var number = parseInt(number);
44	if(domain == undefined) domain = "default";
45	sp_string = (number > 1)? "plural":"singular";
46	string = (number > 1)? string2:string1;
47	try {
48		if(eval('lang_'+domain+'[string][sp_string]'))
49			string = (eval('lang_'+domain+'[string][sp_string]'))? eval('lang_'+domain+'[string][sp_string]'):string;
50		else
51			string = (number > 1)? string2:string1;
52	} catch (e) {}
53	return string;
54}
55}
56
57
58// SMS 80바이트 체크
59if(typeof(byte_check)!='function') {
60function byte_check(el_cont, el_byte) {
61    var cont = document.getElementById(el_cont);
62    var bytes = document.getElementById(el_byte);
63    var i = 0;
64    var cnt = 0;
65    var exceed = 0;
66    var ch = '';
67
68    for (i=0; i<cont.value.length; i++) {
69        ch = cont.value.charAt(i);
70        if (escape(ch).length > 4) {
71            cnt += 2;
72        } else {
73            cnt += 1;
74        }
75    }
76
77    //byte.value = cnt + ' / 80 bytes';
78    bytes.innerHTML = cnt + ' / 80 bytes';
79
80    if (cnt > 80) {
81        exceed = cnt - 80;
82        alert('메시지 내용은 80바이트를 넘을수 없습니다.\r\n작성하신 메세지 내용은 '+ exceed +'byte가 초과되었습니다.\r\n초과된 부분은 자동으로 삭제됩니다.');
83        var tcnt = 0;
84        var xcnt = 0;
85        var tmp = cont.value;
86        for (i=0; i<tmp.length; i++) {
87            ch = tmp.charAt(i);
88            if (escape(ch).length > 4) {
89                tcnt += 2;
90            } else {
91                tcnt += 1;
92            }
93
94            if (tcnt > 80) {
95                tmp = tmp.substring(0,i);
96                break;
97            } else {
98                xcnt = tcnt;
99            }
100        }
101        cont.value = tmp;
102        //byte.value = xcnt + ' / 80 bytes';
103        bytes.innerHTML = xcnt + ' / 80 bytes';
104        return;
105    }
106}
107}
108
109
110//금액 콤마찍기 천자리 쉼표 찍기
111if(typeof(thousand_comma)!='function') {
112function thousand_comma(n) {
113	var g5_decimals = 0;
114	var g5_thousands_sep = ',';
115	var g5_dec_point = ".";
116	n = Number(n).toFixed(g5_decimals); //소수점 표현 추가, 반올림 처리
117	nArray = n.split('.');	// 정수, 소수 분리 처리, nArray[0]->정수부, nArray[1]->소수부
118
119	var reg = /(^[+-]?\d+)(\d{3})/;
120	nArray[0] +='';
121	while(reg.test(nArray[0]))
122	nArray[0] = nArray[0].replace(reg, '$1' + g5_thousands_sep + '$2');
123	
124	n = (nArray[1] == undefined) ? nArray[0] : nArray[0] + g5_dec_point + nArray[1]; 
125	return n;
126}
127}
128
129// 날짜 관련 앞쪽을 0 으로 채우기
130if(typeof(leadingZeros)!='function') {
131function leadingZeros(n, digits) {
132	var zero = '';
133	n = n.toString();
134	if (n.length < digits) {
135		for (i = 0; i < digits - n.length; i++)
136			zero += '0';
137	}
138	return zero + n;
139}
140}
141if(typeof(removeZeros)!='function') {
142function removeZeros(n) {
143	return n.replace(/^0+/, '');
144}
145}
146
147
148// 모달 리스트 정리 함수
149if(typeof(ajtable_nothing_display)!='function') {
150function ajtable_nothing_display(tdom) {
151	// IE8 같은 느린 브라우저에서 에러가 있어서 0.1초 시간 차이를 둡니다.
152	setTimeout(function() {
153		if(tdom.find("tr").not('.tr_nothing, .tr_loading').length == 0) {
154			tdom.parents('div.modal_body:first').find('span.count_total').text(0);
155			tdom.find('.tr_nothing').show();
156			tdom.closest('table').next('nav').find('ul.pg').hide();
157		}
158		else {
159			tdom.find('.tr_nothing').hide();
160			tdom.closest('table').next('nav').find('ul.pg').show();
161		} 
162	},100);
163}
164}
165
166
167// jQuery 디버깅을 위한 공통 함수
168if(typeof(this_ajax_error)!='function') {
169function this_ajax_error(xmlRequest) {
170	alert('Status: ' + xmlRequest.status + ' \n\rstatusText: ' + xmlRequest.statusText
171	+ ' \n\rresponseText: ' + xmlRequest.responseText);
172	$('#bugReport').html(xmlRequest.responseText);
173}}
174
175

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.