PageSourceSearch

https://lgcorp.com/static/js/ko/main.js?20190226

js lgcorp.com collected 2026-09-24 17:14:45 UTC 4,154 bytes, 129 lines download raw bytes

1$(document).ready(function() {
2
3	var mediaDatas = [];
4	var $mediaObject = $("[data-type=media]").find("li");
5	if(0 < $mediaObject.length) {
6		$.each($mediaObject, function(idx, obj) {
7			var thisObj = $(obj);
8			var obj = {};
9			obj.link = thisObj.data("link");
10			obj.image = thisObj.data("image");
11			obj.subsidiary = thisObj.data("subsidiary");
12			obj.title = thisObj.data("title");
13
14			mediaDatas.push(obj);
15		});
16	}
17
18	var bannerDatas = [];
19	// 배너 데이터: 수동 퍼블리싱 버전(.main-banner-slide 안의 li)이 있으면 사용, 없으면 관리자 버전([data-type=banner])
20	var $bannerObject = $(".main-banner-slide").find("> li");
21	if(0 < $bannerObject.length) {
22		$.each($bannerObject, function(idx, obj) {
23			var thisObj = $(obj);
24			var obj = {};
25			obj.link = thisObj.find("a").attr("href");
26			obj.image = thisObj.find("img").attr("src");
27			obj.title = thisObj.find("img").attr("alt");
28			obj.target = thisObj.find("a").attr("target") || "_self";
29			// 이미지 위 글씨(p, txt-dimm 등): 슬라이드가 li를 다시 그릴 때 이미지 뒤에 붙임
30			obj.caption = $.map(thisObj.find("a").children().not("img"), function(el) { return el.outerHTML; }).join("");
31
32			bannerDatas.push(obj);
33		});
34		$(".main-banner-slide").empty();
35	} else {
36		$bannerObject = $("[data-type=banner]").find("li");
37		$.each($bannerObject, function(idx, obj) {
38			var thisObj = $(obj);
39			var obj = {};
40			obj.link = thisObj.data("link");
41			obj.image = thisObj.data("image");
42			obj.title = thisObj.data("title");
43			obj.target = thisObj.data("target");
44
45			bannerDatas.push(obj);
46		});
47	}
48
49//	var pcType = 'video'; //image or video
50	var pcType = $("div.main-video-area").length > 0 ? 'video' : 'image'; //image or video
51	var mobileType = 'image'; //image or video
52	var statusWid = lg.deviceWidth();
53	var breakPoint = 1025;
54	if (statusWid < breakPoint)
55	{
56		lgMain.narrowInteraction(mobileType);
57		//innovation.slide();
58		//csr.slide();
59		beforMobile.mediaSlide(mediaDatas);
60
61		var swiper2 = new Swiper('.csr-list', {
62			updateOnImagesReady: true,
63			 pagination: {
64				 el: '.csr-section .swiper-pagination',
65				 type: 'bullets',
66				 bulletActiveClass: 'custom-swiper-active',
67				 clickable: true
68			 },
69			on: {
70				'slideChangeTransitionEnd': function () {
71					setAccessibility(this);
72				},
73				'imagesReady': function () {
74					var pagination = $('.csr-section .swiper-pagination');
75					var bullets = pagination.find('.swiper-pagination-bullet');
76					bullets.attr('tabindex', 0);
77					setAccessibility(this);
78				},
79				'init': function () {
80					$('.csr-section .swiper-pagination').css({'position': 'static', 'margin-top': '17px'});
81					$('.csr-section').css('padding-bottom', 0);
82					setAccessibility(this);
83				}
84			},
85			a11y: {
86				'prevSlideMessage': '이전 슬라이드로 이동',
87				'nextSlideMessage': '다음 슬라이드로 이동',
88				'paginationBulletMessage': '슬라이드 {{index}}'
89			}
90		});
91
92		function setAccessibility (swiper) {
93			$(swiper.slides).each(function (i, slide) {
94				if ($(slide).hasClass('swiper-slide-active')) {
95					$(slide).find('a').attr('tabindex', 0);
96					$(slide).attr('aria-hidden', false);
97				} else {
98					$(slide).find('a').attr('tabindex', -1);
99					$(slide).attr('aria-hidden', true);
100				}
101			});
102			setTimeout(function () {
103				$(swiper.pagination.bullets).each(function (i, bullet) {
104					if ($(bullet).hasClass('custom-swiper-active')) {
105						$(bullet).attr('title', '선택됨');
106					} else {
107						$(bullet).attr('title', '');
108					}
109				});
110			}, 800);
111		}
112		
113		if($bannerObject.length != 1){
114	        beforMobile.bannerMobileSlide(bannerDatas);
115	    } else {
116			$('.btn-banner-pause').hide();
117	        var ul = $('.main-banner-slide');
118	        ul.append('<li data-index="' + 0 + '"><a href="' + bannerDatas[0].link + '" target="' + bannerDatas[0].target + '"><img src="' + bannerDatas[0].image + '" alt="' + bannerDatas[0].title + '">' + (bannerDatas[0].caption || '') + '</a></li>');
119	    }
120	}
121	else
122	{
123		lgMain.wideInteraction(pcType);
124		beforeData.mediaSlide(mediaDatas);
125		beforeData.bannerSlide(bannerDatas);
126		
127		jQuery("#second-paginatio").hide();
128	}
129});

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.