PageSourceSearch

http://mycaryoucar.com/admin/js/site_manage.js?1755727259

js mycaryoucar.com collected 2026-10-02 16:11:17 UTC 5,459 bytes, 198 lines download raw bytes

1var SITE_MANAGE = function(){
2	var type;
3	var url_prefix = '/admin/ajax/site_manage/';
4	var init = function(t){
5		type = t;
6		url_prefix = '/admin/ajax/site_manage/';
7		if(type == 'main'){
8			url_prefix = '/_/api/io-legacy/ajax/site_manage/';
9		}else if(type=='site'){
10			url_prefix = '/admin/ajax/site_manage/';
11		}
12	}; 
13	var openDeleteSite = function(site_code){
14		if(IS_MAIN) init('main');
15		$.cocoaDialog.close();
16		$.ajax({
17			type : 'POST',
18			data : {code : site_code},
19			url : (url_prefix+'dialog_delete_site.cm'),
20			dataType : 'json',
21			async : false,
22			cache : false,
23			success : function(res){
24				if(res.msg == 'SUCCESS'){
25					var $html = $(res.html);
26					$html.find('._confirm').on('click', function(){
27						if (!$("#chk_agree").is(":checked")) return alert('사이트 삭제 정책 동의에 체크해 주셔야 삭제를 진행할 수 있습니다.');
28						const passwd = $("#passwd").val();
29						if(!passwd) return alert('비밀번호를 입력해주세요.');
30						deleteSite(site_code, res.delete_key, passwd);
31					});
32					$.cocoaDialog.open({'type' : 'modal_site_delete', 'custom_popup' : $html});
33				}else if(res.msg === 'site_deleted'){
34					alert('삭제된 사이트입니다.');
35					location.reload();
36				}else
37					alert(res.msg);
38			}
39		});
40	};
41
42	var deleteSiteFlag=false;
43	var deleteSite = function(site_code, token, passwd){
44		if (deleteSiteFlag) { alert(getLocalizeString("설명_버튼은1번만눌러주세요", "", "버튼은 1번만 눌러주세요")); return false; }
45		deleteSiteFlag=true;
46		$(".se-pre-con ._loader_text").text(
47				getLocalizeString(
48						"",
49						"",
50						"사이트를 삭제 중입니다. 잠시만 기다려주세요."
51				)
52		);
53		$(".se-pre-con").css("display", "");
54		$.ajax({
55			type : 'POST',
56			data : {'code' : site_code, 'token':token, 'passwd':passwd},
57			url : (url_prefix+'delete_site.cm'),
58			dataType : 'json',
59			cache : false,
60			success : function(result){
61				$(".se-pre-con").css("display", "none");
62				$(".se-pre-con ._loader_text").text(
63						getLocalizeString(
64								"사이트를구성중입니다",
65								"",
66								"사이트를 구성 중입니다. 잠시만 기다려주세요."
67						)
68				);
69				deleteSiteFlag=false;
70				if(result.msg == 'SUCCESS'){
71					location.reload();
72				} else if (result.msg === 'FREE_24HOURS_LIMIT') {
73					var $html = $(result.html);
74					$.cocoaDialog.close();
75					$.cocoaDialog.open({'type': 'global_del', 'custom_popup': $html});
76        } else if(result.msg === 'site_deleted'){
77					alert('삭제된 사이트입니다.');
78					location.reload();
79				}else {
80					alert(result.msg);
81					$.cocoaDialog.close();
82				}
83			}
84		});
85	};
86
87	var openAddUnit = function(site_code){
88		$.ajax({
89			type : 'POST',
90			data : {'site_code' : site_code},
91			url : (url_prefix+'dialog_add_unit.cm'),
92			dataType : 'json',
93			cache : false,
94			success : function(res){
95				if(res.msg == 'SUCCESS'){
96					var $html = $(res.html);
97					$html.find('._confirm').on('click',function(){
98						addUnit();
99					});
100					$.cocoaDialog.open({'type': 'global_add', 'custom_popup': $html});
101          (function () {
102            const cocoaModalModifyByID = document.querySelector('#cocoaModal');
103            cocoaModalModifyByID.style.display= "flex";
104            cocoaModalModifyByID.style.justifyContent= "center";
105          })();
106				}else{
107					alert(res.msg);
108				}
109			}
110		});
111
112	};
113
114	var addUnit_flag=false;
115	var addUnit = function(){
116		$('.se-pre-con').css("display","");
117		if (addUnit_flag) { alert(getLocalizeString("설명_버튼은1번만눌러주세요", "", "버튼은 1번만 눌러주세요")); return false; }
118		var $f = $('#add_unit_form');
119		var data = $f.serializeObject();
120		addUnit_flag=true;
121		$.ajax({
122			type : 'POST',
123			data : data,
124			url : (url_prefix+'add_unit.cm'),
125			dataType : 'json',
126			cache : false,
127			success : function(result){
128				addUnit_flag=false;
129				if(result.msg == 'SUCCESS'){
130					location.reload();
131				}else{
132					alert(result.msg);
133				}
134				$('.se-pre-con').css("display","none");
135			}
136		});
137	};
138
139	var openDeleteUnit = function(site_code,unit_code){
140		$.cocoaDialog.close();
141		$.ajax({
142			type : 'POST',
143			data : {'site_code' : site_code, 'unit_code' : unit_code},
144			url : (url_prefix+'dialog_delete_unit.cm'),
145			dataType : 'json',
146			async : false,
147			cache : false,
148			success : function(res){
149				if(res.msg == 'SUCCESS'){
150					var $html = $(res.html);
151					$html.find('._confirm').on('click', function(){
152						deleteUnit(site_code, unit_code, res.delete_key);
153					});
154					$.cocoaDialog.open({'type' : 'global_del', 'custom_popup' : $html});
155				}else
156					alert(res.msg);
157			}
158		});
159
160	};
161	
162	var deleteUnit = function(site_code, unit_code, token){
163		$.ajax({
164			type : 'POST',
165			data : {'site_code' : site_code, 'unit_code' : unit_code, 'token':token},
166			url : (url_prefix+'delete_unit.cm'),
167			dataType : 'json',
168			async : false,
169			cache : false,
170			success : function(result){
171				if(result.msg == 'SUCCESS'){
172					if(result.move_default_unit){
173						window.location.href='http://'+result.default_unit_domain+'/admin/'
174					}else{
175						location.reload();
176					}
177				}else{
178					alert(result.msg);
179				}
180			}
181		});
182	};
183  
184  return {
185		'init' : function(t){
186			init(t);
187		},
188		'openAddUnit' : function(s){
189			openAddUnit(s);
190		},
191		'openDeleteSite' : function(site_code){
192			openDeleteSite(site_code);
193		},
194		'openDeleteUnit' : function(s,u){
195			openDeleteUnit(s,u);
196		},
197	}
198}();

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.