PageSourceSearch

https://farmic.co.kr/ind-script/optimizer_user.php?filename=K05J5U…f7acc798f42d488d4fc92ef&t=1755589075&user=T

js farmic.co.kr collected 2026-10-08 07:25:15 UTC 6,641 bytes, 216 lines download raw bytes

1/**
2 * hasClass
3 */
4function hasClass(element, className){
5    return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1;
6};
7
8/**
9 *  toggle
10 */
11function toggleClassAll(element, handler, className){
12    var _handler = document.querySelector(handler);
13    document.querySelectorAll(handler).forEach(function(item){
14        item.addEventListener('click', function(){
15            var _element = item.parentNode;
16            if ( hasClass( _element, className ) ) {
17                _element.classList.remove( className );
18            } else {
19                _element.classList.add( className );
20            }
21        })
22    })
23};
24
25/**
26 *  findElements
27 */
28function findElements(element, findElement){
29    var resultElements = [];
30    document.querySelectorAll(element).forEach(function(item){
31        var findElementList = item.querySelectorAll(findElement);
32        findElementList = Array.prototype.slice.call(findElementList);
33        resultElements = resultElements.concat(findElementList);
34    })
35    return resultElements;
36};
37
38/**
39 *  setAttributeAl
40 */
41function setAttributeAll(elements, name, value){
42    elements.forEach(function(item){
43        item.setAttribute(name, value);
44    })
45};
46
47/**
48 *  상품 섬네일 로드되지 않을 경우, 기본값 설정
49 */
50function setDefaultImage(element) {
51    document.querySelectorAll(element).forEach(function(item){
52        var $img = new Image();
53        $img.onerror = function () {
54            item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
55        }
56        $img.src = item.src;
57    });
58};
59
60/**
61 *  tooltip
62 */
63function setTooltipEvent(){
64    var input = findElements('.eTooltip', 'input');
65    input.forEach(function(item){
66        item.addEventListener('focusin', function(event){
67            var targetName = returnTargetName(event.target);
68            targetName.nextElementSibling.style.display = 'block'
69        });
70        item.addEventListener('focusout', function(event){
71            var targetName = returnTargetName(event.target);
72            targetName.nextElementSibling.style.display = 'none'
73        });
74    });
75}
76
77/**
78 *  tooltip input focus
79 */
80function returnTargetName(_this){
81    var ePlacename = _this.parentElement.getAttribute("class");
82    var targetName;
83    if(ePlacename == "ePlaceholder"){ //ePlaceholder supported
84        targetName = _this.parentElement;
85    }else{
86        targetName = _this;
87    }
88    return targetName;
89}
90
91/**
92 * window load
93 */
94window.addEventListener('load', function(){
95    if (document.querySelector('.thumbnail')){
96        setDefaultImage('.thumbnail img');
97    }
98    if (document.querySelector('.eTooltip')){
99        setAttributeAll(findElements('.eTooltip', '.btnClose'),'tabIndex','-1');
100        setTooltipEvent();
101    }
102    if (document.querySelector('div.eToggle')){
103        toggleClassAll(false, 'div.eToggle .title', 'selected');
104    }
105}); 
106//window popup script
107function winPop(url) {
108    window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
109}
110/**
111 * document.location.href split
112 * return array Param
113 */
114function getQueryString(sKey)
115{
116    var sQueryString = document.location.search.substring(1);
117    var aParam       = {};
118
119    if (sQueryString) {
120        var aFields = sQueryString.split("&");
121        var aField  = [];
122        for(var i=0; i<aFields.length; i++){
123            aField = aFields[i].split('=');
124            aParam[aField[0]] = aField[1];            
125        }
126    }
127
128    aParam.page = aParam.page ? aParam.page : 1;
129    return sKey ? aParam[sKey] : aParam;
130};
131
132/**
133  *  구매버튼
134*/
135var globalBuyBtnScrollFunc = function() {
136    // 구매버튼 관련변수
137    var sFixId = $('#orderFixItem').length > 0  ? 'orderFixItem' : 'fixedActionButton',
138        $area = $('#orderFixArea'),
139        $item = $('#' + sFixId + '').not($area);
140
141    $(window).scroll(function(){
142        try {
143             // 구매버튼 관련변수
144            var iCurrentHeightPos = $(this).scrollTop() + $(this).height(),
145                iButtonHeightPos = $item.offset().top;
146
147            if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) {
148                if (iButtonHeightPos < $(this).scrollTop() - $item.height()) {
149                    $area.fadeIn('fast');
150                } else {
151                    $area.hide();
152                }
153            } else {
154                $area.fadeIn('fast');
155            }
156        } catch(e) { }
157    });
158};
159
160$(function(){
161    // tab
162    $.eTab = function(ul) {
163        $(ul).find('a').on('click', function() {
164            var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'),
165                _target = $(this).attr('href'),
166                _siblings = '.' + $(_target).attr('class');
167            $(_target).show().siblings(_siblings).hide();
168            return false
169        });
170    }
171    if ( window.call_eTab ) {
172        call_eTab();
173    };
174    globalBuyBtnScrollFunc();
175});
176(function($){
177    $.fn.extend({
178        center: function() {
179            this.each(function() {
180                var
181                    $this = $(this),
182                    $w = $(window);
183                $this.css({
184                    position: "absolute",
185                    top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px",
186                    left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px"
187                });
188            });
189            return this;
190        }
191    });
192    $(function() {
193        var $container = function(){/*
194    <div id="modalContainer">
195        <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe>
196    </div>');
197    */}.toString().slice(14,-3);
198        $('body')
199        .append($('<div id="modalBackpanel"></div>'))
200        .append($($container));
201        function closeModal () {
202            $('#modalContainer').hide();
203            $('#modalBackpanel').hide();
204        }
205        $('#modalBackpanel').on('click', closeModal);
206        zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) {
207            var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup;
208            $('#modalContent').attr('src', $url);
209            $('#modalContent').on("load",function(){
210                $(".header .close",this.contentWindow.document.body).on("click", closeModal);
211            });
212            $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show();
213            $('#modalContainer').center().show();
214        }
215    });
216})(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.