PageSourceSearch

https://gocheok.or.kr/UserData/gocheok/Layouts/gocheok_Layout/scripts/layout.js?ver=2026100823i32

js gocheok.or.kr collected 2026-10-08 14:47:02 UTC 10,136 bytes, 266 lines download raw bytes

1
2
3
4(function ($) {
5    
6    /////////////////////////
7    $(function () {
8
9      
10        // 편집 모드 스크립트가 포함된 페이지인지 확인
11var isEditMode =
12    $('script[src*="dimode.page.editmode.theme.js"]').length > 0;
13
14// mmenu는 편집 모드에서는 초기화하지 않음
15// 일반 페이지에서는 DOM Ready 시점에 먼저 초기화
16if (
17    !isEditMode &&
18    $("#my-menu").length &&
19    !$("#my-menu").hasClass("mm-menu")
20) {
21    $("#my-menu").mmenu({
22        "slidingSubmenus": false,
23        "extensions": [
24            "effect-menu-slide",
25            "pageshadow",
26            "pagedim-black"
27        ],
28        "offCanvas": {
29            "position": "right",
30            "zposition": "front"
31        },
32        "navbar": {
33            "title": "고척교회"
34        }
35    });
36}
37
38// 아래 메뉴 이벤트는 window.load까지 기다릴 필요가 없음
39$(".sub_depth2 li.active i.fa-plus").hide();
40$(".sub_depth2 li.active i.fa-minus").show();
41
42$(".sub_depth2 li i.fa-plus").off("click").on("click", function () {
43    $(this).next().next().next("ul.sub_depth3").addClass("active");
44    $(this).hide();
45    $(this).next().show();
46});
47
48$(".sub_depth2 li i.fa-minus").off("click").on("click", function () {
49    $(this).next().next("ul.sub_depth3").removeClass("active");
50    $(this).hide();
51    $(this).prev().show();
52}); 
53
54
55
56
57
58
59		// // // // //새로운 gnb 방식 - 호버 시 열림 
60		// // // // $(function () {
61			// // // // var menuCloseTimer = null;
62
63			// // // // // 메뉴 항목에 마우스를 올렸을 때
64			// // // // $("#gnb > .depth1 > li").on("mouseenter", function () {
65				// // // // clearTimeout(menuCloseTimer); // 닫힘 타이머 중단
66
67				// // // // var d2 = $(this).children(".depth2").html();
68				// // // // $("#gnb > .depth1 > li").removeClass("active");
69				// // // // $(this).addClass("active");
70
71				// // // // $("#menubar .container .row").html(d2);
72				// // // // $("#menubar").stop(true, true).fadeIn(200);
73			// // // // });
74
75			// // // // // gnb 또는 menubar에서 마우스가 벗어날 때 딜레이 후 닫기
76			// // // // $("#gnb, #menubar").on("mouseleave", function () {
77				// // // // menuCloseTimer = setTimeout(function () {
78					// // // // $("#gnb > .depth1 > li").removeClass("active");
79					// // // // $("#menubar").stop(true, true).fadeOut(200);
80				// // // // }, 100); // 딜레이 시간 (ms)
81			// // // // });
82
83			// // // // // gnb 또는 menubar로 다시 마우스 들어오면 닫힘 취소
84			// // // // $("#gnb, #menubar").on("mouseenter", function () {
85				// // // // clearTimeout(menuCloseTimer);
86			// // // // });
87		// // // // });
88
89	/////////////////////////////////////////////////////////////////////////////////////////////
90	/////////////////////////////////////////////////////////////////////////////////////////////
91 
92	function resetWidth($sub) {
93      // 폭 220 기본으로 (닫을 때만 호출)
94      $sub.removeClass('expanded').css('width', '');
95    }
96
97    // 현재 px → 목표 px(숫자)로 한 번에 전환
98    function smoothSetHeightPx($el, targetPx) {
99      const el = $el[0];
100      const current = el.getBoundingClientRect().height;
101      $el.css('height', current + 'px');
102      el.offsetHeight; // reflow
103      $el.css('height', Math.max(0, Math.round(targetPx)) + 'px');
104    }
105
106    // depth3 모두 닫힌 "기본 컨텐츠" 높이 측정/저장
107    function updateBaseHeight($sub) {
108      const $opened = $sub.find('> li > .depth3.is-open'); // 클래스만 기준
109      $opened.removeClass('is-open').css({ opacity: '', display: '' });
110
111      const prev = $sub.css('height');
112      $sub.css('height', 'auto');
113      const h = $sub[0].scrollHeight;
114      $sub.css('height', prev);
115      $sub.data('baseH', h);
116
117      // 측정 끝: 원상복구 필요 없음(닫혀 있어야 기본 높이가 맞음)
118    }
119
120    // depth3 표시/숨김 (클래스만)
121    function d3Open($d3) {
122      $d3.css('display', '').addClass('is-open').css({ opacity: 0 });
123      requestAnimationFrame(() => $d3.css('opacity', 1));
124	  
125	  $d3.addClass('is-open');
126    }
127    function d3Close($d3) {
128      $d3.removeClass('is-open').css({ opacity: '', display: '' });
129	  
130	  $d3.removeClass('is-open');
131    }
132
133    /* ─────────────────────────────────────────────────────────
134       전환 로직 (항목 간 이동)
135    ───────────────────────────────────────────────────────── */
136    let pendingRaf = 0;
137    function atomicSwitchToItem($sub, $toItem) {
138      // 클릭 중이면 전환 금지(히트박스 흔들리지 않게)
139      if ($sub.closest('#gnb > li').data('clickLock')) return;
140
141      cancelAnimationFrame(pendingRaf);
142      pendingRaf = requestAnimationFrame(() => {
143        const padTop = parseInt($sub.css('padding-top')) || 0;
144        const baseH = $sub.data('baseH') ?? (updateBaseHeight($sub), $sub.data('baseH'));
145        const $toD3 = $toItem.children('.depth3');
146        const $fromD3 = $sub.find('> li > .depth3.is-open').not($toD3);
147
148        if ($toD3.length) {
149          // 폭 잠금(330) — 닫을 때까지 유지
150          //$sub.addClass('expanded');
151
152          // depth3 열기 + 높이 직행
153          d3Open($toD3);
154          //const need = $toItem.position().top + $toD3.outerHeight(true) + padTop;
155          //smoothSetHeightPx($sub, Math.max(baseH, need));
156
157          // 이전 depth3는 다음 프레임에 닫기
158          requestAnimationFrame(() => d3Close($fromD3));
159        } else {
160          // 하위 없음: 폭은 유지, 높이만 기본으로
161          smoothSetHeightPx($sub, baseH);
162          d3Close($fromD3);
163        }
164      });
165    }
166
167    /* ─────────────────────────────────────────────────────────
168       열기/닫기
169    ───────────────────────────────────────────────────────── */
170    const CLOSE_DELAY = 240;
171
172    function openSub($li) {
173      clearTimeout($li.data('hideTimer'));
174      const $sub = $li.children('.subal');
175      const liH = $li.outerHeight();
176
177      // 보여주고(정확한 top), 기본 폭/높이로 시작
178      $sub.css({ visibility: 'visible', opacity: 1, top: liH + 'px' });
179      resetWidth($sub); // 항상 220으로 시작
180      $sub.removeData('baseH');
181      updateBaseHeight($sub);
182      smoothSetHeightPx($sub, $sub.data('baseH'));
183
184      $li.addClass('open')
185        .siblings().removeClass('open')
186        .children('.subal').each(function () {
187          const $s = $(this);
188          $s.css({ visibility: 'hidden', opacity: 0, top: (liH + 4) + 'px' });
189          smoothSetHeightPx($s, 0);
190          resetWidth($s);
191          d3Close($s.find('.depth3'));
192        });
193    }
194
195    function closeSub($li) {
196      // 클릭 중엔 닫지 않음 (클릭 완료 후 문서 mouseup에서 해제)
197      if ($li.data('clickLock')) return;
198
199      clearTimeout($li.data('hideTimer'));
200      const $sub = $li.children('.subal');
201      const liH = $li.outerHeight();
202
203      const t = setTimeout(() => {
204        $li.removeClass('open');
205        d3Close($sub.find('.depth3'));
206        $sub.removeClass('expanded')
207            .css({ opacity: 0, top: (liH + 4) + 'px', visibility: 'hidden' });
208        smoothSetHeightPx($sub, 0);
209        resetWidth($sub);
210      }, CLOSE_DELAY);
211
212      $li.data('hideTimer', t);
213    }
214
215    /* ─────────────────────────────────────────────────────────
216       이벤트 바인딩 (PC hover 전용)
217    ───────────────────────────────────────────────────────── */
218    // 기존 바인딩 제거(중복 방지)
219    $("#gnb-child > li").off("mouseenter mouseleave focusin focusout");
220    $("#gnb-child > li .subal").off("mouseenter mouseleave");
221
222    // hover로 열고 닫기
223    $("#gnb-child > li").on("mouseenter", function () { openSub($(this)); });
224    $("#gnb-child > li").on("mouseleave", function () { closeSub($(this)); });
225
226    // 서브 항목에 올렸을 때 전환
227    $(".subal > li").on("mouseenter", function () {
228      const $item = $(this);
229      const $sub = $item.closest('.subal');
230      atomicSwitchToItem($sub, $item);
231    });
232
233    // depth3 위에서도 유지(같은 전환 로직 재사용)
234    $(".subal .depth3").on("mouseenter", function () {
235      const $sub = $(this).closest('.subal');
236      const $li = $(this).closest('.subal > li');
237      atomicSwitchToItem($sub, $li);
238    });
239
240    // 클릭 중 잠금(깜빡임/오클릭 방지)
241    $('#gnb-child').on('mousedown', '#gnb-child > li .subal, #gnb-child > li .subal *', function () {
242      const $li = $(this).closest('#gnb-child > li');
243      $li.data('clickLock', true);
244      $li.children('.subal').addClass('expanded'); // 클릭 순간 폭/높이 유지
245    });
246    $(document).on('mouseup', function () {
247      // 약간의 유예 후 잠금 해제
248      setTimeout(() => { $('#gnb-child > li').removeData('clickLock'); }, 200);
249    }); 
250	/////////////////////////////////////////////////////////
251        
252         
253
254        $('.all-menu').click(function () {
255            $(this).find('ul').toggleClass('active');
256            $('.gnb-all').slideToggle(500);
257        });
258        $('.close').click(function () {
259            $(this).parents('all-menu').find('ul').toggleClass('active');
260            $('.gnb-all').slideToggle(500);
261        });
262
263
264
265    });
266})(jQuery);

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.