PageSourceSearch

https://gall.dcinside.com/_js/mgallery.js?251223

js dcinside.com collected 2026-09-24 08:58:07 UTC 16,408 bytes, 527 lines download raw bytes

1/*
2 * 마이너 & 미니 공통
3 */
4
5// 부재중 팝업
6function toggle_absence_pop() {
7	var elm = $('#absence_pop');
8
9	toggle_layer(elm);
10}
11
12// 부매니저 부재중 팝업
13var mng_nick_zIndex = 1;
14function toggle_absence_pop_sub(popupId) {
15	var popup = document.getElementById('popup_' + popupId);
16	var target = document.querySelector('#absence_' + popupId);
17
18	if (popup.style.display === "block") {
19		popup.style.display = "none";
20	} else {
21        mng_nick_zIndex++;
22        popup.style.zIndex = mng_nick_zIndex;
23
24        var targetRect = target.getBoundingClientRect();
25		var scrollY = window.scrollY || window.pageYOffset;
26        var targetTop = targetRect.top + scrollY;
27
28        popup.style.position = "absolute";
29        popup.style.top = targetTop + target.offsetHeight - 255 + 'px';
30
31        popup.style.display = "block";
32
33	}
34}
35
36// 흥한갤 설명
37function toggle_hot_tip_pop() {
38	var elm = $('#hot_tip_pop');
39	
40	toggle_layer(elm);
41}
42
43// 흥한갤 순위
44var json_mgallery_hot = function(data) {
45	//console.log(data);
46	var j = 1;
47    var k = 1;
48    var idx = 0;
49    var top_ten = "";
50    var str = "";
51    var rank_100 = "";
52    var rank_200 = "";
53    var rank_300 = "";
54	var nLen = data.length;
55	var gall_path = 'mgallery';
56	var block_cls = "";
57	var block_tag = "";
58	var profile_img = "";
59	var def_profile_img = "https://nstatic.dcinside.com/dc/w/images/minorbg.png";
60	
61	if(_GALLERY_TYPE_ == "MI") {
62		gall_path = "mini";
63		def_profile_img = "https://nstatic.dcinside.com/dc/w/images/mibg.png";
64	}
65	
66	if(_GALLERY_TYPE_ == "PR") {
67		gall_path = "person";
68	}
69
70    if(data){
71        for(i=0;i<nLen;i++){
72            if(k > 5) {
73                j++;
74                k = 1;
75            }
76            if(j>20) j=1;
77            
78	        idx = ((k-1)*20) + j;
79	        idx = idx-1;
80	            
81	        if(i>=100 && i<200) idx = idx+100;
82	        if(i>=200 && i<300) idx = idx+200;
83            
84            if(idx < 20) top_ten = " font_red";
85            else top_ten = "";
86            //console.log(idx);
87            if(idx > nLen-1) {
88            	str = '<li>&nbsp;</li>';
89            	if(idx<=100) rank_100 += str;
90                else if(idx>100 && idx<=200) rank_200 += str;
91                else rank_300 += str;
92            	i--;
93            } else {
94            	if(data[idx].gate_img == null) {
95            		data[idx].gate_img = def_profile_img;
96            		profile_img = def_profile_img;
97            	} else {
98            		profile_img = data[idx].gate_img;
99            	}
100            	
101            	
102                //console.log(data[idx].gall_state);
103                if(data[idx].gall_state == 'N') {
104                	//console.log(data[idx].id);
105                	block_cls = 'restriction';
106                	block_tag = '<span><em class=\"blind\">접근제한</em><em class=\"sp_img icon_restriction\"></em></span>';
107                } else {
108                	block_cls = '';
109                	block_tag = '';
110                }
111                if(_GALLERY_TYPE_ == "MI" && data[idx].profile_img == null) {
112                	profile_img = def_profile_img;
113                } else {
114                	profile_img = (_GALLERY_TYPE_ == 'MI')?data[idx].profile_img:data[idx].gate_img;
115                }
116                
117                str = "<li><a class=\""+block_cls+"\" href=\"/"+gall_path+"/board/lists/?id="+data[idx].id+"\" onmouseout=\"hide_hot_img();\" onmouseover=\"show_hot_img('"+profile_img+"');\" onmousemove=\"move_hot_img();\"><span class=\"num"+top_ten+"\">"+data[idx].rank+".</span> "+data[idx].ko_name+block_tag+"</a></li>";
118                if(data[idx].rank<=100) rank_100 += str;
119                else if(data[idx].rank>100 && data[idx].rank<=200) rank_200 += str;
120                else rank_300 += str;
121            	
122            }
123            //console.log('r:'+idx);
124            
125            k++;
126            if(nLen < 300) {
127	            idx++;
128            }
129        }
130
131        $('#heung_list_ul_top').empty();
132        $('#heung_list_ul_top').html(rank_100);
133        
134        if(nLen >= 100) {
135	        $('#heung_list_ul_2_top').empty();
136	        $('#heung_list_ul_2_top').html(rank_200);
137	        $('#heung_gall_page_nums').attr('data-heung-gall-totalpage','2');
138	        $('#heung_gall_page_total_num').text(2);
139	        
140	        if(nLen > 200) {
141		        $('#heung_list_ul_3_top').empty();
142		        $('#heung_list_ul_3_top').html(rank_300);
143		        $('#heung_gall_page_nums').attr('data-heung-gall-totalpage','3');
144		        $('#heung_gall_page_total_num').text(3);
145	        }
146        } else {
147        	//$('#heung_gall_page_nums').attr('data-heung-gall-totalpage','1');
148        	//$('#heung_gall_page_total_num').text(1);
149        	$("#heung_list_page_div").hide();
150        }
151    }
152	
153}
154
155function toggle_hot_rank_pop() {
156	var rank_hot_file = 'mgallery_hot.php';
157	
158	if(_GALLERY_TYPE_ == 'MI') rank_hot_file = 'migallery_hot.php';
159	if(_GALLERY_TYPE_ == 'PR') rank_hot_file = 'prgallery_hot.php';
160	
161	var elm = $('#hot_rank_pop2');
162	$('#hot_rank_thumb').hide();
163	
164	if($('.hot_rank_list_wrap', elm).attr('data-loaded') == 'true') {
165		toggle_layer(elm);
166	}
167	else {
168		$.ajax({
169	        url:'//json2.dcinside.com/json0/mgallmain/'+ rank_hot_file,
170	        dataType:"jsonp",
171	        jsonpCallback: 'json_mgallery_hot',
172	        cache: true,
173	        jsonp:"jsoncallback",
174	        success:function(data){
175	        //	json_mgallery_hot(data);
176	        }
177	    });
178		toggle_layer(elm);
179	}
180}
181
182//흥한갤 리스트 썸네일 show
183function show_hot_img(img) {
184	
185    img = img ? img : $('#hot_rank_thumb img').attr('data-noimg');
186    //console.log(img);
187    img = img.replace('http://','https://');
188
189    $('#hot_rank_thumb img').attr('src', img);
190    $('#hot_rank_thumb').show();
191}
192
193//흥한갤 리스트 썸네일 hide
194function hide_hot_img() {
195    $('#hot_rank_thumb_top').hide();
196    $('#gallery_thump').hide();
197}
198
199// 흥한갤 리스트 썸네일 move
200function move_hot_img() {
201	var clientX = event.pageX - $('#hot_rank_pop2').offset().left + ($('.issue_wrap').outerWidth() - 840);
202	var clientY = event.pageY - 200;
203	if(_GALLERY_TYPE_ == 'MI') {
204		clientX = clientX+172;
205		if($('.issue_wrap').outerWidth() > 840) clientX = clientX-320;	
206	}
207	//console.log($('#hot_rank_pop').offset().left);
208	$('#hot_rank_thumb').css('left', clientX +'px');
209	$('#hot_rank_thumb').css('top', clientY +'px');
210}
211
212//이용안내
213function open_minor_guide(tab) {
214	$.ajax({
215		url: "/ajax/minor_ajax/minor_guide",
216		type : "GET",
217		cache: true,
218	    async: false,
219		success: function(htmlData) {
220			$('.dcfoot .info_policy').append(htmlData);
221			
222			if(typeof(tab) != 'undefined') {
223				m_guide(tab);
224			}
225		}
226	});
227}
228
229// 부매니저 임명 체크
230function chk_request_manager(gall_id) {
231
232    gall_id = typeof(gall_id) == 'undefined' ? '' : gall_id;
233    
234    const cache_name = _GALLERY_TYPE_+'_req_mng';
235    
236    const cached = StorageCache.get(cache_name);
237    
238    //console.log(cached);
239    
240    if(cached !== null) return;
241	
242	//매니저 정보 불러오기
243	$.ajax({
244	    url: "/ajax/minor_ajax/chk_request_manager",
245	    data: { 'ci_t' : get_cookie('ci_c'), 'gall_id': gall_id, '_GALLTYPE_': _GALLERY_TYPE_ },
246		type : "POST",
247		cache: false,
248	    async: true,
249	    dataType: 'json',
250	    success: function(ajaxData) {
251	    	if(ajaxData.result == 'success') {
252	    		var act = '';
253	    		if(ajaxData.status == 'W') act = 'submanager';
254	    		if(ajaxData.status == 'M') act = 'manager';
255	    		if(ajaxData.status == 'S') act = 'manager';
256
257	    		if(!act) {
258	    			return false;
259	    		}
260	    		
261	    		var req_cookie = get_cookie(ajaxData.status +'_next_chk_'+ ajaxData.gallery_id) !== 'Y';
262	    		
263	            if(req_cookie) {
264	                open_request_manager_pop(ajaxData.gallery_id, act);
265	            }
266            } else {
267                if(ajaxData.hasOwnProperty('count')) {
268                    if(ajaxData.count === 0) {
269                        
270                        StorageCache.set(cache_name,ajaxData,30);
271                    }
272                }
273            }
274	    }
275	});
276}
277
278// 매니저 요청 팝업 출력
279function open_request_manager_pop(gall_id, act) {
280	//console.log(get_cookie('ci_c'));
281	$.ajax({
282	    url: "/ajax/minor_ajax/minor_req_manager_pop",
283	    data: { 'ci_t' : get_cookie('ci_c'), 'act' : act, 'gall_id' : gall_id, '_GALLTYPE_': _GALLERY_TYPE_ },
284		type : "POST",
285		cache: false,
286	    async: false,
287	    success: function(htmlData) {
288			//console.log(htmlData);
289	    	$('body').append(htmlData);
290	    }
291	});
292}
293
294// 요청 팝업 다음에 다시 보기
295function req_open_again(elm) {
296	var gall_id = $(elm).closest('.pop_wrap').attr('data-id');
297	var type = $(elm).closest('.pop_wrap').attr('data-type');
298	
299    document.cookie = type +'_next_chk_'+ gall_id + '=Y; path=/; domain=dcinside.com; expires=0;';
300    
301    $(elm).closest('.pop_wrap').remove();
302}
303
304// 매니저 요청 응답
305function req_manager_answer(elm, act, answer) {
306	var gall_id = $(elm).closest('.pop_wrap').attr('data-id');
307	var chkbox  = $('.chk_opt input[type="checkbox"]', $(elm).closest('.pop_wrap'));
308	var di_auth_yn = $("#di_auth_yn").val();
309	
310	if(_GALLERY_TYPE_ == 'MI' && act == 'manager' && di_auth_yn == 'Y') {
311		var di_auth_rst = $("#di_auth_rst").val();
312		if(di_auth_rst != 'T' && answer == 'Y') {
313			alert('본인 인증을 한 고정닉만 매니저 위임이 가능합니다.');
314			return false;
315		}
316	}
317	
318	if(chkbox.index() >= 0 && answer == 'Y') {
319		if(chkbox.is(':not(:checked)')) {
320			alert('개인정보 보호정책과 운영 원칙에 동의하셔야 위임 수락이 가능합니다.');
321			return false;
322		}
323	}
324	
325    $.ajax({
326        url:'/ajax/minor_ajax/req_manager_answer',
327        data:{ 'ci_t' : get_cookie('ci_c'), 'gall_id' : gall_id, '_GALLTYPE_': _GALLERY_TYPE_, 'act' : act, 'answer' : answer},
328		type : "POST",
329		cache: false,
330	    async: false,
331	    dataType: 'json',
332        success: function(ajaxData){
333        	if(ajaxData.msg) {
334    			alert(ajaxData.msg);
335			}
336        	
337        	if(ajaxData.result == 'ipin_sex') {
338        		if(confirm('여성 인증이 필요한 마이너 갤러리입니다. 아이핀을 통해 본인 인증을 하시겠습니까?')){
339        			open_ipin('SEX', ajaxData.ipinEncData, elm, act, answer);
340        		}
341        	}
342        	else if(ajaxData.result == 'ipin_adult') {
343        		if(confirm('성인 인증이 필요한 마이너 갤러리입니다. 아이핀을 통해 본인 인증을 하시겠습니까?')){
344        			open_ipin('ADULT', ajaxData.ipinEncData, elm, act, answer);
345        		}
346        	}
347        	else if(ajaxData.result == 'success') {
348        		location.reload();
349        	}
350        	
351        	$(elm).closest('.pop_wrap').remove();
352        }
353    });
354}
355
356// 폐쇄신청&접근제한 안내 팝업 닫기
357function rm_closure_pop(pop_type, cookie ,day) {
358	
359	var cooke_nm_prefix = 'closure_next_chk_';
360	if(typeof(day) != 'undefined') {
361		day = 8760;
362	}
363	if(cookie) {
364	    var gall_id = $.getURLParam('id');
365	    if(pop_type == 'N_INFO'){
366	    	cooke_nm_prefix = 'mini_info_layer_chk';
367	    	gall_id = '';
368	    }else if(pop_type != 'C') cooke_nm_prefix = 'block_'+pop_type+'_next_chk_';
369		//document.cookie = cooke_nm_prefix + gall_id + '=Y; path=/; domain=dcinside.com; expires=' + day + ';';	// 365일
370	    set_cookie(cooke_nm_prefix + gall_id, "Y", day, "dcinside.com");
371	}
372	
373	$('.closure-lightpop').remove();
374	$('#closure-popup').remove();
375}
376
377// 아이핀 인증
378function open_ipin(mode, ipinEncData, elm, act, answer) {
379	$.ipin.setup({
380		ipinEncData: ipinEncData,
381		result: function(result) {
382			popIpin.close();
383
384	        if(result == 1) {
385	            alert('해당 카테고리는 성인만 이용 가능합니다.');
386	        } else if(result == 2) {
387	            alert('해당 카테고리는 여성만 이용 가능합니다.');
388	        } else if(result != 3) {
389	            alert('가상주민번호가 정상적으로 처리 되지 않았습니다.');
390	        }
391	        
392	        req_manager_answer(elm, act, answer)
393		}
394	});
395	
396	$.ipin.openPopup(mode);
397}
398
399function heung_gall_page(page,lyr,obj) {
400	//console.log(page);
401	//console.log(lyr);
402	var target = $("#"+lyr).children('.pop_hot_mgall').find('[data-heunggall-page]');
403	
404	target.filter('[data-heunggall-page]').hide();
405	target.filter('[data-heunggall-page="'+page+'"]').show();
406}
407
408//ban_ip_singo ->singo.js로 이동
409
410function get_manage_report(type,search,page) {
411	//var gall_id = $.getURLParam('id');
412	const gall_id = new URL(document.location).searchParams.get('id');
413	
414	
415	if(search == '_SEARCH_') {
416		var temp_keyword = $("#search_keyword_report").val();
417		if(temp_keyword == '') {
418			alert('검색어를 입력해 주세요.');
419			return false;
420		}
421		
422		search = temp_keyword;
423	}
424	// init_lay();			
425	$.ajax({
426        url:'/ajax/minor_ajax/manage_report',
427        data:{ 'ci_t' : get_cookie('ci_c'), 'gall_id' : gall_id, '_GALLTYPE_': _GALLERY_TYPE_,'type':type, 'search' : search, 'p':page},
428		type : "POST",
429		cache: false,
430	    async: false,
431        success: function(htmlData){
432        	if(htmlData.indexOf('"result":"fail"') !== -1) {
433        		var obj = jQuery.parseJSON(htmlData); 
434        		alert(obj.msg);	
435        	} else {
436        	
437		        $("#pop_manage_report_list").remove();
438		        $('.minor_intro_box').append(htmlData);
439		        	
440		        $("#search_keyword_report").keydown(function(key) {
441		        	if (key.keyCode == 13) {
442		               	get_manage_report('delete','_SEARCH_',1);
443		            }
444		        });
445        	}
446        	
447        }
448    });
449}
450
451function open_user_guide(tab) {
452    
453    //let guide_url = '/ajax/minor_ajax/minor_guide';
454	let guide_url = '/ajax/gallery_top_ajax/user_guide';
455    
456   // if(gall_type == 'PR') guide_url = '/ajax/person_ajax/person_guide';
457    
458    $.ajax({
459        url: guide_url,
460        type : "GET",
461        cache: true,
462        async: false,
463        success: function(htmlData) {
464			/*
465            $('.dcfoot .info_policy').append(htmlData);
466            
467            if(typeof(tab) != 'undefined') {
468                m_guide(tab);
469            }*/
470				var segment = window.location.pathname.split('/');
471				var style = segment[2] == 'lists' ? 'position:fixed;left:50%;top:23.4%;margin-left:-305px;display:block;z-index:1000;' : 'position:fixed;left:50%;top:23.4%;margin-left:-305px;display:block;z-index:1000;';
472				
473				htmlData = htmlData.replace('{_JS_ADD_STYLE_}', style);	
474				
475				// $('.issuebox').append(htmlData);
476				$('#visit_history').append(htmlData);
477        }
478    });
479}
480
481function hot_gall_overflow() {
482    $('ol.pop_hotgall_listbox li, ol.rank_list li').each(function() {
483        const $listItem = $(this);
484       
485        const $nameSpan = $listItem.find('.rank_txt');
486        //console.log($nameSpan[0].innerText + ":"+$nameSpan[0].clientWidth);
487        const $jobSpan = $listItem.find('.rank_job');
488
489        if ($nameSpan[0].scrollWidth > $nameSpan[0].clientWidth) {
490            $jobSpan.hide();
491        }
492    });
493}
494
495$(function() {
496    var gall_id = $.getURLParam('id');
497    
498    if($('#container .login_box .nickname').index() >= 0) {
499		// 알림
500		chk_minor_notify('gall');
501		
502		// 부매니저 임명 알림
503		if(gall_id) {
504			chk_request_manager(gall_id);
505		}
506		
507    }
508    
509    /*$(document).on('click','.heung_gall_prev, .heung_gall_next', function(e) {
510    	//console.log('next');
511		var page = $(this).siblings('div.page_num').children('strong.now_num').attr('data-heung-gall-page');
512		var tot_page = $(this).siblings('div.page_num').children('strong.now_num').attr('data-heung-gall-totalpage');
513		if($(e.currentTarget).is('.heung_gall_prev')) {
514			page--;
515		} else {
516			page++;
517		}
518		
519		if(page <=0 || page > tot_page) return false;
520		$(this).siblings('div.page_num').children('strong.now_num').text(page);
521		$(this).siblings('div.page_num').children('strong.now_num').attr('data-heung-gall-page',page);
522		
523		heung_gall_page(page,$(this).parent('div.btn_box').attr('data-lyr'), $(this));
524	});*/
525    
526    
527});

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.