PageSourceSearch

https://gofar.co.kr/js/skin_ui_functions.js?v=20260910110804

js gofar.co.kr collected 2026-09-25 13:30:21 UTC 9,580 bytes, 239 lines download raw bytes

1var WINDOWWIDTH = window.innerWidth;
2
3// 화면 넓이 체크
4function windowWidthCheck() {
5	WINDOWWIDTH = window.innerWidth;
6}
7
8// GNB 서브메뉴에 1뎁스 메뉴 추가( 서브 메뉴가 있는 경우 1뎁스 메뉴는 클릭 반응이 없으므로 )
9/*
10function gnbDepth1generation() {
11	windowWidthCheck();
12	$('#GnbMenu > li').each(function() {
13		if ( WINDOWWIDTH < respBreakPoint ) {
14			if ( $(this).find('.navi_depth2_wrap').length && !$(this).find('.depth1Copy').length ) {
15				var gonHtml = $(this).children('a')[0].outerHTML;
16				$(this).find('.navi_depth2_container').find('.navi_depth2').prepend( '<li class="depth1Copy">' + gonHtml + '</li>' );
17			}
18			$(this).find('.depth1Copy > a').css({ 'color': '', 'font-family': '', 'font-size': '' });
19			$(this).find('.navi_depth2_wrap').hide();
20		} else {
21			$(this).find('.depth1Copy').remove();
22			$(this).find('.navi_depth2_wrap').show();
23		}
24	});
25}
26*/
27
28
29
30// 플라잉 모드시 지지대
31function headerFlyingStand( delay, scrollTopFalse ) {
32	var timeDelay;
33	if ( delay ) timeDelay = delay;
34	else timeDelay = ( document.documentElement.scrollTop < flyingBreakPoint ) ? 0 : 320; // 헤더 flying 에서 복구된 경우 높이값을 측정
35	if ( !scrollTopFalse ) $('html').scrollTop(0);
36	setTimeout(function() {
37		$('#flyingStand').remove();
38		if ( $('#skinLayoutWrap').attr('data-layout-type') == 'type1' && $('#skinLayoutWrap').attr('data-header-flying') == 'yes' ) {
39			var flyingStandHeight = $('#skinHeaderSection .header_module').outerHeight();
40			var flyingStandHtml = '<div id="flyingStand" style="height:' + flyingStandHeight + 'px;"></div>';
41			$('#skinHeaderSection').prepend( flyingStandHtml );
42		} else if ( $('#skinLayoutWrap').attr('data-layout-type') == 'type2' && $('#skinLayoutWrap').attr('data-header-flying') == 'yes' && WINDOWWIDTH < respBreakPoint ) {
43			var flyingStandHeight = $('#skinHeaderSection .header_module').outerHeight();
44			var flyingStandHtml = '<div id="flyingStand" style="height:' + flyingStandHeight + 'px;"></div>';
45			$('#skinHeaderSection').prepend( flyingStandHtml );
46		}
47	}, timeDelay);
48}
49
50// type2에서 left 콘텐츠가 본문/화면보다 긴 경우 --> 본문 길이 조정
51function type2ContentsHeight() {
52	if ( $('#skinLayoutWrap').attr('data-layout-type') == 'type2' && $('#skinLayoutWrap').attr('data-header-flying') == 'no' && $('#skinHeaderSection .header_module').height() > $('#skinMainWrap').height() && $('#skinHeaderSection .header_module').height() > window.innerHeight ) {
53		$('#skinMainWrap').height( $('#skinHeaderSection .header_module').height() );
54	} else {
55		//$('#skinMainWrap').height( 0 );
56	}
57}
58
59// slide 리프레쉬
60function slideRefresh( moduleSelector, add_option ) {
61	if ( moduleSelector ) {
62		$( moduleSelector + ' .slide_nav').slick('refresh');
63		$( moduleSelector + ' .slide_banner').slick('refresh');
64		if ( add_option == 'swiper' ) {
65			$( moduleSelector + ' .productSwiperWrap')[0].swiper.update();
66			if ( $( moduleSelector + ' .productSwiperWrap')[0].swiper.autoplay.running ) {
67				$( moduleSelector + ' .productSwiperWrap')[0].swiper.autoplay.stop();
68				$( moduleSelector + ' .productSwiperWrap')[0].swiper.autoplay.start();
69			}
70		}
71	} else {
72		$('.slide_nav').slick('unslick');
73		$('.slide_banner').slick('unslick');
74
75		$('.productSwiperWrap').each(function() { // swiper destroy는 각각 시켜 줘야 함
76			if ( $(this)[0].swiper ) $(this)[0].swiper.destroy();
77		});
78
79		// slick, swiper 공통
80		var slideScriptArray = [];
81		$('script[class]').each(function() {
82			slideScriptArray.push( $(this)[0].outerHTML );
83			$('script[class]').remove();
84		});
85		$.each( slideScriptArray, function( key ) {
86			$('body').append( slideScriptArray[key] );
87		});
88	}
89}
90
91// 레이어
92function showCenterLayer( selector ) {
93	layerCenterPosition( selector );
94	$('#skinModal').show();
95	$( selector ).show();
96	//$('body').css( 'overflow', 'hidden' );
97}
98function layerCenterPosition( selector ) {
99	var htmlSelector;
100	if ( selector ) htmlSelector = $( selector );
101	else htmlSelector = $('.resp_layer_pop');
102	$(selector).css({
103		'top': '50%',
104		'left': '50%',
105		'marginLeft': (htmlSelector.outerWidth() / 2) * -1,
106		'marginTop': (htmlSelector.outerHeight() / 2) * -1
107	});
108}
109function hideCenterLayer() {
110	$('#skinModal').attr( 'class', 'modal_bg' ).hide();
111	$('.resp_layer_pop').hide();
112	//$('body').css( 'overflow', '' );
113}
114
115/* 슬라이드 type B, type D 모바일 텍스트 overflow 최적화( 에디터 반응형 view 에서 사용 ) */
116function slideMobileTextOpt( add_option ) {
117	$('[data-content-type2="slide-type-B"], [data-content-type2="slide-type-D"]').each(function() {
118		if ( Number($(this).children('.module_wrap').children('.module_container').data('slides-to-show')) == 1 ) {
119			$(this).find('.slide_contents').each(function() {
120				$(this).removeClass( 'sm_text_opt' );
121				$(this).css({ 'align-items' : '', 'left' : '', 'right' : '', 'top' : '' });
122				$(this).find('.text_wrap').removeAttr( 'style' );
123
124				var slideAreaHeight = $(this).height();
125				var textAreaHeight = $(this).find('.text_wrap').height();
126				if ( textAreaHeight > slideAreaHeight ) {
127					var textScale = (slideAreaHeight / textAreaHeight).toFixed(2);
128					if ( textScale > 0.6 ) textScale = 0.6; // 최소 scale 설정
129					var slideScale = ( (100 - textScale * 100) / (textScale * 2) ).toFixed(2) * -1;
130					$(this).addClass( 'sm_text_opt' );
131					$(this).css({
132						'align-items' : 'center',
133						'left' : slideScale + 'vw',
134						'right' : slideScale + 'vw',
135						'top' : '-20px'
136					});
137					$(this).find('.text_wrap').css({
138						'transform' : 'scale(' + textScale + ')',
139						'top' : 'auto' // slide_B003
140					});
141				} else {
142					if ( add_option == 'editorView' ) {
143						$(this).removeClass( 'sm_text_opt' );
144						$(this).css({ 'align-items' : '', 'left' : '', 'right' : '', 'top' : '' });
145						$(this).find('.text_wrap').removeAttr( 'style' );
146					}
147				}
148			});
149		}
150	});
151}
152/* // 슬라이드 type B, type D 모바일 텍스트 overflow 최적화( 에디터 반응형 view 에서 사용 ) */
153
154
155
156/* ========== 스페셜 페이지 에디터 모드 처리 ========== */
157// [커머스] 카테고리 페이지
158function categoryEditModeUi() {	
159	var lineMapHtml = '<li><a href="#none">홈</a></li><li><a href="#none">1차카테고리</a></li><li><a href="#none">2차카테고리</a></li><li><a href="#none">3차카테고리</a></li><li><a href="#none">4차카테고리</a></li>';
160	var categoryTitle = '카테고리명';
161	categoryPageAjaxContents( lineMapHtml, categoryTitle );
162	$( document ).on('ajaxComplete', function() {
163		if ( $('[data-module-id="module-category"] .special_title .main_category').text() != categoryTitle ) {
164			categoryPageAjaxContents( lineMapHtml, categoryTitle );
165		}
166	});
167	$('[data-module-id="module-category"]').find('.bottom_navi_map, .sorting_left, .category_list').hide();
168	$('[data-module-id="module-category"]').find( 'select, input' ).attr( 'disabled', 'disabled' );
169}
170function categoryPageAjaxContents( line_map, category_title, list_num ) {
171	$('[data-module-id="module-category"] .top_navi_map').html( line_map );
172	$('[data-module-id="module-category"] .special_title .main_category').text( category_title );
173}
174
175// [커머스] 검색 페이지
176function searchEditModeUi() {
177	$('[data-module-id="module-search"]').find( 'select, input, button' ).attr( 'disabled', 'disabled' );
178}
179
180// [커머스] 장바구니 페이지
181function cartEditModeUi() {
182	cartPageAjaxContents();
183	$( document ).on('ajaxComplete', function() {
184		cartPageAjaxContents();
185	});
186}
187function cartPageAjaxContents() {
188	$('[data-module-id="module-cart"]').find( 'button, input' ).attr( 'disabled', 'disabled' );
189	$('[data-module-id="module-cart"]').find( '.objProductCart, .objProductCartEmpty' ).hide();
190	$('[data-module-id="module-cart"]').find( '#all_check' ).prop( 'checked', false );
191	$('[data-module-id="module-cart"]').find('.sum_product_price, .sum_fee_price, .sum_order_price, .js_btn_cnt .no').text( '0' );
192	$('[data-module-id="module-cart"]').find('.bottom_bts button').css( 'opacity', '1' );
193}
194
195// [커머스] 주문 페이지
196function orderEditModeUi() {
197	$('#frame-order-payment').remove(); // 결제 iframe 삭제
198	orderPageAjaxContents();
199	$( document ).on('ajaxComplete', function() {
200		orderPageAjaxContents();
201	});
202}
203function orderPageAjaxContents() {
204	$('[data-module-id="module-order"]').find( 'button, input, select' ).attr( 'disabled', 'disabled' );
205	$('[data-module-id="module-order"]').find( '#div-order-products' ).hide();
206	$('[data-module-id="module-order"]').find( '[data-field="sum_product_price"], [data-field="sum_fee_price"], [data-field="sum_payment_price"]' ).text( '0' );
207}
208
209// 마이페이지
210function mypageEditModeUi() {
211	mypageAjaxContents();
212	$( document ).on('ajaxComplete', function() {
213		mypageAjaxContents();
214	});
215}
216function mypageAjaxContents() {
217	$('#mypageMainContents').find('.list_board').hide();
218	$('#mypageMainContents').find('.order_count .count').text('0');
219}
220/* ========== // 스페셜 페이지 에디터 모드 처리 ========== */
221
222// 탭선택에 따른 영역 show/hide
223function tabShowHide(el) {
224	var tabId = el.attr('data-tab-button');
225	
226	$(document).find('[data-tab-button]').each(function(){
227		var $this = $(this);
228		var elTabId = $this.attr('data-tab-button');
229		if( elTabId == tabId ){
230			$this.addClass('on');
231			$(document).find('[data-tab-area="'+elTabId+'"]').removeClass('hide');
232		}
233		else{
234			$this.removeClass('on');
235			if( !$(document).find('[data-tab-area="'+elTabId+'"]').hasClass('hide') )
236				$(document).find('[data-tab-area="'+elTabId+'"]').addClass('hide');
237		}
238	});
239}

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.