1/** 2 * Logo Language Module 3 * ì¸ì´ì ë°ë¼ ë¡ê³ 를 ë³ê²½íë 모ë 4 * - íêµì´(ko): íì´ì¤ì¹ íê¸ ë¬¸êµ¬ í¬í¨ ë¡ê³ 5 * - ë¤ë¥¸ ì¸ì´(en, ja, zh): íê¸ ë¬¸êµ¬ ìë ë¡ê³ 6 */ 7 8const LogoManager = (function() { 9 'use strict'; 10 11 // ë¡ê³ íì¼ëª ì¤ì 12 const LOGO_FILES = { 13 ko: { 14 white: 'logo.svg', 15 black: 'black-logo.svg' 16 }, 17 other: { 18 white: 'logo-en.svg', 19 black: 'black-logo-en.svg' 20 } 21 }; 22 23 /** 24 * ë¡ê³ ê° í°ìì¸ì§ ê²ììì¸ì§ íì¸ 25 */ 26 function isBlackLogo(imgElement) { 27 const src = imgElement.getAttribute('src') || ''; 28 return src.includes('black-logo'); 29 } 30 31 /** 32 * íì¬ srcìì 기본 ê²½ë¡ ì¶ì¶ (íì¼ëª ì ì¸) 33 */ 34 function getBasePath(src) { 35 const lastSlash = src.lastIndexOf('/'); 36 return lastSlash >= 0 ? src.substring(0, lastSlash + 1) : ''; 37 } 38 39 /** 40 * ì¸ì´ì ë°ë¼ ë¡ê³ ì ë°ì´í¸ 41 * @param {string} lang - ì¸ì´ ì½ë (ko, en, ja, zh) 42 */ 43 function updateLogoByLanguage(lang) { 44 const logos = document.querySelectorAll('.logo img'); 45 const langFiles = (lang === 'ko') ? LOGO_FILES.ko : LOGO_FILES.other; 46 47 logos.forEach(function(logo) { 48 const currentSrc = logo.getAttribute('src') || ''; 49 const basePath = getBasePath(currentSrc); 50 const newFileName = isBlackLogo(logo) ? langFiles.black : langFiles.white; 51 const newSrc = basePath + newFileName; 52 53 // íì¬ srcì ë¤ë¥¼ ëë§ ë³ê²½ (ë¶íìí 리ë¡ë ë°©ì§) 54 if (currentSrc !== newSrc) { 55 logo.setAttribute('src', newSrc); 56 } 57 }); 58 } 59 60 /** 61 * ì´ê¸°í - íì¬ ì¸ì´ì ë§ê² ë¡ê³ ì¤ì 62 */ 63 function init() { 64 // localStorageìì ì ì¥ë ì¸ì´ ê°ì ¸ì¤ê¸° 65 const savedLang = localStorage.getItem('faceweb_language') || 'ko'; 66 updateLogoByLanguage(savedLang); 67 68 // ì¸ì´ ë³ê²½ ì´ë²¤í¸ 리ì¤ë ë±ë¡ 69 document.addEventListener('faceweb:languageupdated', function(event) { 70 const lang = event.detail.lang; 71 updateLogoByLanguage(lang); 72 }); 73 } 74 75 // Public API 76 return { 77 init: init, 78 updateLogoByLanguage: updateLogoByLanguage 79 }; 80})(); 81 82// DOM ë¡ë í ì´ê¸°í 83document.addEventListener('DOMContentLoaded', function() { 84 LogoManager.init(); 85}); 86
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.