PageSourceSearch

https://visualpython.ai/js/one_page.js?1739170491

js visualpython.ai collected 2026-09-24 09:47:32 UTC 3,756 bytes, 109 lines download raw bytes

1var ONE_PAGE = function(){
2	var $win;
3	var window_position;
4	var $sections;
5	var section_selector = '_one_page_section';
6	var sections_length;
7	var active_class = 'active';
8	var active_real_class = 'active-real';
9	var $menu_wrap,$mobile_menu_wrap;
10	var $mobile_carousel_wrap,$mobile_carousel_items;
11	var $mobile_table_wrap,$mobile_table_items;
12
13	var menu_height, menu_height_offset;
14	var $menu_items, $mobile_menu_items;
15	var active_timeout = {};
16
17	var init = function(){
18		// 해쉬 값이 있을 경우 해당 위치로 이동
19		var init_st = false;
20		const hashHost = new URL(location.href).href.split('#')[1];
21		$(window).off('scroll.one_page').on('scroll.one_page',function(){
22			if(init_st)
23				menuActivate();
24		});
25		$(window).off('resize.one_page').on('resize.one_page',function(){
26			if(init_st)
27			menuActivate();
28		});
29		$(window).off('load.one_page').on('load.one_page',function(){
30			if(init_st) menuActivate();
31			if (hashHost) {
32				// ios 아니면 예외처리
33				if (![isSafari(), isIos()].some(Boolean)) return;
34
35				setTimeout(()=>{
36					const $target = $(`#${hashHost}`);
37					const targetTop = $target.offset().top;
38					window.scrollTo(0, targetTop);
39				}, 500);
40
41			}
42		});
43
44		$sections = $('.' + section_selector);
45		sections_length = $sections.length;
46
47		$win = $(window);
48		init_st = true;
49		menu_height_offset = 50;
50	};
51	var menuActivate = function(){
52		clearTimeout(active_timeout);
53		active_timeout = setTimeout(function(){
54			$menu_wrap = $('#doz_header');
55			$mobile_menu_wrap = $('#mobile_slide_menu');
56			$mobile_carousel_wrap = $('#mobile_carousel_nav');
57			$mobile_table_wrap = $('#mobile_carousel_menu');
58			var target = 0;
59			var new_target = target-1;
60
61			$menu_items = $menu_wrap.find('._main_menu_wrap a, ._inline_menu_container a');
62			$mobile_menu_items = $mobile_menu_wrap.find('._menu_wrap a');
63			$mobile_carousel_items = $mobile_carousel_wrap.find('._mobile_navigation_menu ._item');
64			$mobile_table_items = $mobile_table_wrap.find('._mobile_nav ._item');
65
66			var $popup_banner_wrap = $('.popup-banner-wrap ._banner_wrap');
67			var banner_height = 0;
68
69			$popup_banner_wrap.each(function() {
70				banner_height += $(this).data('height') || 0;
71			});
72
73			menu_height = $menu_wrap.outerHeight() + menu_height_offset + banner_height;
74			window_position = $win.scrollTop();
75			//TODO 모바일 환경 일때 스크롤 위치에 따라 메뉴 활성화 필요가 없음 예외 처리 필요
76
77
78			$menu_items.toggleClass(active_class,false);
79			$mobile_menu_items.toggleClass(active_class,false);
80			$mobile_menu_items.toggleClass(active_real_class,false);
81			$mobile_carousel_items.toggleClass(active_class,false);
82			$mobile_table_items.toggleClass(active_class,false);
83
84			$sections.each(function(e) {
85				var top = $(this).offset().top - menu_height;
86				var bottom = $(this).outerHeight(true) + top;
87				if ((window_position >= top) && (window_position <= bottom) || e == sections_length-1) {
88					$menu_wrap.find('a[data-url="' + $(this).data('url') + '"]').toggleClass(active_class,true);
89					$mobile_menu_wrap.find('a[data-url="' + $(this).data('url') + '"]').toggleClass(active_class,true).toggleClass(active_real_class,true);
90					$mobile_table_wrap.find('td[data-url="' + $(this).data('url') + '"]').toggleClass(active_class,true);
91
92					if($mobile_carousel_wrap.length > 0){
93						$mobile_carousel_wrap.find('div[data-url="' + $(this).data('url') + '"]').toggleClass(active_class,true);
94						// var new_target = $mobile_carousel_wrap.find('div[data-url="' + $(this).data('url') + '"]').index();
95						// $mobile_carousel_wrap.find('._mobile_navigation_menu').slick('slickGoTo',new_target);
96					};
97					return false;
98
99				}
100			});
101		},100);
102
103	};
104	return {
105		init : function(){
106			init();
107		}
108	}
109}();

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.