1// let environment = 'production' 2// let environment = 'development' 3let environment = 'local' 4 5let context = { 6 baseUrl: getBaseUrl(), 7 isDevelopment, 8} 9 10function getBaseUrl() { 11 if (localStorage.getItem('isProduction')) { 12 return 'https://ggtour.or.kr' 13 } 14 return location.origin 15} 16 17function getBaseStaticUrl() { 18 if (['localhost', 'd2j34t.ggtour.or.kr'].indexOf(location.hostname) !== -1) { 19 return `${location.origin}/resources` 20 } 21 return 'https://static.ggtour.or.kr' 22} 23 24function getBaseResourceUrl() { 25 return `${getBaseUrl()}/resource` 26} 27 28 29function getMySpotImageUrl() { 30 return `/resources/images/sub/img_notailor.png` 31} 32 33function getEmptyImageUrl() { 34 return Utils.isMobile() ? '/resources/images/no_image_mo.jpg' : '/resources/images/no_image_pc.jpg' 35} 36 37function getFullResourceUrlById(id) { 38 return `${getBaseResourceUrl()}/${id}` 39} 40 41function getFullResourceUrlByPath(path) { 42 return `${`https://image.ggtour.or.kr`}${path}` 43} 44 45function getWebResourceUrlByPath(path) { 46 return `${getBaseResourceUrl()}${path}` 47} 48 49function getGrandWebResourceUrlByPath(path) { 50 return `${getGrandResourceUrl()}${path}` 51} 52 53function getWebResourceViewUrlByPath(path) { 54 return `${getBaseResourceUrl()}/view${path}` 55} 56 57function downloadWebResourceUrlByPath(path) { 58 window.open(getWebResourceUrlByPath(path)) 59} 60 61function getFullNamedResourceUrlByPath(path) { 62 return `${getBaseResourceUrl()}/content/named-file${path}` 63} 64 65function getFullResourceUrlByDatabaseContentId(id) { 66 return `${getBaseResourceUrl()}/thumbnail/db-content/${id}` 67} 68 69function getFullResourceUrlByContentId(id) { 70 return `${getBaseResourceUrl()}/thumbnail/content/${id}` 71} 72 73function getGrandFullResourceUrlByContentId(id) { 74 return `${getBaseResourceUrl()}/thumbnail/grand/content/${id}` 75} 76 77function getJsResourceUrlByPath(path) { 78 return `${getBaseStaticUrl()}/js${path || ''}` 79} 80 81function isDevelopment() { 82 return location.hostname !== 'ggtour.or.kr' 83} 84 85function getCurrentURL() { 86 let { pathname, search } = location 87 if (search) { 88 if (pathname.slice(-1) === '/') { 89 pathname = pathname.slice(0, -1) 90 } 91 return `${getBaseUrl()}${pathname}/${search}` 92 } 93 return `${getBaseUrl()}${pathname}` 94} 95 96function openExternalUrl(url) { 97 window.open(url) 98} 99 100function redirectMain() { 101 location.href = '/main' 102} 103 104function redirectUrl(url) { 105 location.href = url 106} 107 108function redirectLogin(isRedirectBeforeUrl) { 109 if (isRedirectBeforeUrl) { 110 Utils.addCookie('_url_from_auth', location.href, 30) 111 } 112 redirectUrl('/login') 113} 114 115function doShare() { 116 let shareUrl = location.href 117 if (shareUrl.match('my-travel')) { 118 shareUrl = shareUrl.replace('my-travel', 'share-travel') 119 } 120 document.querySelector('#sharepop .url').value = shareUrl 121 layerPopup.layerShow('sharepop') 122} 123 124function doPrint() { 125 window.print() 126} 127 128function doStar() { 129 if(!storage.getSnsId()) { 130 return redirectLogin() 131 } else { 132 const path = location.pathname; 133 if (path.includes("/travel-info/tourism-info/")) { 134 const activeBtn = document.querySelector("#btn-pop-star"); 135 layerPopup.activeBtn = activeBtn; 136 } 137 layerPopup.layerShow('starreviewPop01') 138 } 139} 140 141function closeStarPopup() { 142 $("input:radio[name='rating']").prop("checked", false) 143 layerPopup.layerHide('starreviewPop01'); 144} 145 146function closeCommentPopup() { 147 document.querySelector('#commentWritePop .comment-area textarea').value = '' 148 Utils.replaceHtml('#commentWritePop .comment-area span', '<span>0/200ì</span>') 149 layerPopup.layerHide('commentWritePop') 150} 151 152function doGeoLocation() { 153 if (localStorage.getItem('location')) { 154 const expiryAt = JSON.parse(localStorage.getItem('location')).expiryAt 155 if (moment().isAfter(expiryAt)) { 156 layerPopup.layerShow('locationPop') 157 return 158 } 159 const elements = document.querySelectorAll('.header .header-wrap .btn_location') 160 for (let i = 0; i < elements.length; i++) { 161 const element = elements[i] 162 element.classList.remove("on") 163 } 164 localStorage.removeItem('location') 165 location.reload() 166 } else { 167 layerPopup.layerShow('locationPop') 168 } 169} 170 171function eventClose() { 172 return alert('ì´ë²¤í¸ê° ì¢ ë£ëììµëë¤.') 173} 174 175function doWrite() { 176 if (Utils.isMobile()) { 177 layerPopup.layerShow('iddeletePop04') 178 } else { 179 location.href = `/my-page/story` 180 } 181} 182 183function doLink(linkUrl, fileUrl) { 184 if(fileUrl && !linkUrl) { 185 openExternalUrl(getWebResourceViewUrlByPath(`${fileUrl}`)) 186 } else { 187 openExternalUrl(`${linkUrl}`) 188 } 189} 190 191function doAddContent({day}) { 192 document.querySelector('#tailorPop02').dataset.day = day 193 layerPopup.layerShow('tailorPop02') 194} 195 196function onCompleteGeoLocation() { 197 layerPopup.layerHide('locationPop') 198 if (_geoLocation.exists()) { 199 const elements = document.querySelectorAll('.header .header-wrap .btn_location') 200 for (let i = 0; i < elements.length; i++) { 201 const element = elements[i] 202 element.classList.add("on") 203 } 204 localStorage.setItem("location", _geoLocation.asJson()) 205 } 206 if (typeof callbackCompleteGeoLocation !== 'undefined') { 207 callbackCompleteGeoLocation() 208 } else { 209 // location.reload() 210 } 211} 212 213function getContentUri({ id, type, dbCategory1, dbCategory2, diningCode }) { 214 let baseUri 215 switch (type) { 216 case 'GG_BUSINESS_FESTIVAL': baseUri = '/information/tourism'; break 217 case 'GG_MOVIE': baseUri = '/information/in-video'; break 218 case 'ETC_PHOTO': baseUri = '/information/gallery'; break 219 case 'ETC_EVENT': baseUri = '/information/event'; break 220 case 'ETC_EVENT_WINNER': baseUri = '/information/event#winner'; break 221 case 'ATICLE_COURSE': baseUri = '/recommend-travel/course'; break 222 case 'ATICLE_SPOTS': baseUri = '/recommend-travel/spots'; break 223 case 'ATICLE_STORY': baseUri = '/recommend-travel/story'; break 224 case 'ATICLE_VISIT': baseUri = '/recommend-travel/visit'; break 225 case 'ETC_SCHEDULE': baseUri = '/fit-travel/course'; break 226 case 'SERVICE_NOTICE': baseUri = '/service/notice'; break 227 case 'ETC_PUBLICATION': baseUri = '/travel-info/e-book'; break 228 } 229 if (dbCategory1) { 230 switch (dbCategory1) { 231 case 'D01': baseUri = '/travel-info/tourism-info'; break 232 case 'D02': baseUri = '/travel-info/accommodation'; break 233 case 'D03': baseUri = '/travel-info/restaurant'; break 234 case 'D04': baseUri = '/travel-info/festival'; break 235 } 236 } 237 if (diningCode) { 238 baseUri = '/travel-info/restaurant' 239 } 240 if (baseUri) { 241 return `${baseUri}/${id}` 242 } 243} 244 245/** 246 * ê´ê´ì§/ìì° ì¹´í ê³ ë¦¬ ì¶ê°ì ë³´ í목 247 * - ì´ì©ìê° / í´ë¬´ì¼ / 주차ì ë³´ / ë°ë ¤ë물ëë°ê°ë¥ / ì´ì©ì기 / ì¸ê³ë¬¸íì ì° / ì¸ê³ìì°ì ì° / ì¸ê³ê¸°ë¡ì ì° 248 * 249 * 문íìì¤ ì¹´í ê³ ë¦¬ ì¶ê°ì ë³´ í목 250 * - ì´ì©ìê° / í´ë¬´ì¼ / 주차ì ë³´ / ë°ë ¤ë물ëë°ê°ë¥ 251 * 252 * ë í¬ì¸ ì¹´í ê³ ë¦¬ ì¶ê°ì ë³´ í목 253 * - ì´ì©ìê° / í´ë¬´ì¼ / 주차ì ë³´ / ë°ë ¤ë물ëë°ê°ë¥ / ê°ì¥ê¸°ê° 254 * 255 * ì¼í ì¹´í ê³ ë¦¬ ì¶ê°ì ë³´ í목 256 * - ì´ì©ìê° / í´ë¬´ì¼ / 주차ì ë³´ / ë°ë ¤ë물ëë°ê°ë¥ / ê°ì¥ì¼ / ì¥ìëë 257 * 258 * ìë° ì¹´í ê³ ë¦¬ ì¶ê°ì ë³´ í목 259 * - ì ì¤ìê° / í´ì¤ìê° / 주차ìì¤ / í½ì ìë¹ì¤ 260 * 261 * ì¶ì /íì¬ ì¹´í ê³ ë¦¬ ì¶ê°ì ë³´ í목 262 * - íì¬ì¥ì / íì¬ììì¼ / íì¬ì¢ ë£ì¼ / ê³µì°ìê° / ê´ëê°ë¥ì°ë ¹ 263 */ 264function isUseContentInfo(key) { 265 const accommodation = ['checkInTime', 'checkOutTime', 'parkingInfo', 'pickupInfo'] 266 const festival = ['eventPlace', 'eventStartDate', 'eventEndDate', 'spendtime', 'ageLimit'] 267 return [ 268 'useTime', 'openTime', 'restDate', 'parkingInfo', 'petInfo', 'openDate' 269 , 'openPeriod', 'fairDay', 'useSeason' 270 , 'cultureHeritage', 'naturalHeritage', 'documentaryHeritage', 271 ...accommodation, 272 ...festival 273 ].indexOf(key) !== -1 274} 275
276function findContentInfoLabel(key) { 277 const accommodation = { 278 checkInTime: 'ì ì¤ìê°', 279 checkOutTime: 'í´ì¤ìê°', 280 parkingInfo: '주차ìì¤', 281 pickupInfo: 'í½ì ìë¹ì¤', 282 } 283 const festival = { 284 eventPlace: 'íì¬ì¥ì', 285 eventStartDate: 'íì¬ììì¼', 286 eventEndDate: 'íì¬ì¢ ë£ì¼', 287 spendtime: 'ê³µì°ìê°', 288 ageLimit: 'ê´ëê°ë¥ì°ë ¹', 289 } 290 const map = { 291 carriageInfo: "ì 모차 ëì¬ ì ë³´", 292 count: "ìì© ì¸ì", 293 creditCardCheck: "ì ì©ì¹´ë ê°ë¥ ì ë³´", 294 experienceAge: "ì²´í ê°ë¥ ì°ë ¹", 295 experienceGuide: "ì²´í ìë´", 296 cultureHeritage: "ì¸ê³ 문íì ì°", 297 naturalHeritage: "ì¸ê³ ìì°ì ì°", 298 documentaryHeritage: "ì¸ê³ 기ë¡ì ì°", 299 infoCenter: "문ì ë° ì í", 300 openDate: "ê°ì¥ì¼", 301 openPeriod: "ê°ì¥ê¸°ê°", 302 fairDay: "ì¥ìëë ", 303 restDate: "í´ë¬´ì¼", 304 useTime: "ì´ì©ìê°", 305 openTime: "ì´ì©ìê°", 306 parkingInfo: "주차ì ë³´", 307 petInfo: "ë°ë ¤ë물ëë°ê°ë¥", 308 useSeason: "ì´ì©ì기", 309 ...accommodation, 310 ...festival 311 } 312 return map[key] 313} 314 315function getTourismInfoSortOrder(key) { 316 switch (key) { 317 case 'useTime': return 1 318 case 'openTime': return 1 319 case 'restDate': return 2 320 case 'parkingInfo': return 3 321 case 'petInfo': return 4 322 case 'openDate': return 5 323 case 'openPeriod': return 6 324 case 'fairDay': return 7 325 case 'useSeason': return 8 326 case 'cultureHeritage': return 9 327 case 'naturalHeritage': return 10 328 case 'documentaryHeritage': return 11 329 } 330} 331 332function getAccommodationSortOrder(key) { 333 switch (key) { 334 case 'checkInTime': return 1 335 case 'checkOutTime': return 2 336 case 'parkingInfo': return 3 337 case 'pickupInfo': return 4 338 } 339} 340 341function getFestivalSortOrder(key) { 342 switch (key) { 343 case 'eventPlace': return 1 344 case 'eventStartDate': return 2 345 case 'eventEndDate': return 3 346 case 'spendtime': return 4 347 case 'ageLimit': return 5 348 } 349}
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.