1 2/* ë¸ë¼ì°ì íì¸ 3--------------------------------------------------*/ 4var BrowserDetect = { 5 init: function () { 6 this.browser = this.searchString(this.dataBrowser) || "Other"; 7 this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown"; 8 }, 9 searchString: function (data) { 10 for (var i = 0; i < data.length; i++) { 11 var dataString = data[i].string; 12 this.versionSearchString = data[i].subString; 13 14 if (dataString.indexOf(data[i].subString) !== -1) { 15 return data[i].identity; 16 } 17 } 18 }, 19 searchVersion: function (dataString) { 20 var index = dataString.indexOf(this.versionSearchString); 21 if (index === -1) { 22 return; 23 } 24 25 var rv = dataString.indexOf("rv:"); 26 if (this.versionSearchString === "Trident" && rv !== -1) { 27 return parseFloat(dataString.substring(rv + 3)); 28 } else { 29 return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); 30 } 31 }, 32 33 dataBrowser: [ 34 { string: navigator.userAgent, subString: "Edge", identity: "MS Edge" }, 35 { string: navigator.userAgent, subString: "MSIE", identity: "Explorer" }, 36 { string: navigator.userAgent, subString: "Trident", identity: "Explorer" }, 37 { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, 38 { string: navigator.userAgent, subString: "Opera", identity: "Opera" }, 39 { string: navigator.userAgent, subString: "OPR", identity: "Opera" }, 40 { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, 41 { string: navigator.userAgent, subString: "Safari", identity: "Safari" } 42 ] 43}; 44 45 46/* ìëì° íì 47--------------------------------------------------*/ 48function popupChron(local, item, lang) // ì ìì°í 49{ 50 var url = 'http://chron.grandculture.net/?local=' + local + '&item=' + encodeURI(item) + '&lang=' + lang + '&v=2'; // íë ìì ë²ì íë¼ë¯¸í° ì¶ê° 51 popup(url, 'chron', 1000, 712, 100, 100, 1, 1); 52} 53function popupGis(local, item, lang) // ì ìì§ë 54{ 55 var url = 'http://map1.grandculture.net/?local=' + local + '&name=' + encodeURI(item) + '&lang=' + lang; 56 popup(url, 'map', 980, 600, 100, 100, 1); 57} 58function viewOriginImg(el) // ì본 ì´ë¯¸ì§ íì 59{ 60 popup('/' + $(el).data('local') + '/popup/multimedia/' + $(el).data('id'), 'mediaPop', 10, 10, 1, 1); 61} 62 63 64/* íì¼ ë¤ì´ë¡ë 65--------------------------------------------------*/ 66function downloadKOGL(link) // 공공ë리 ë¤ì´ë¡ë 67{ 68 $('#emptyWin')[0].src = '/' + $(link).data('local') + '/Post/Contents/DownloadKOGL?id=' + $(link).data('id') + '&ext=' + $(link).data('ext'); 69} 70function downloadXML(link) // XML ì문 ë¤ì´ë¡ë 71{ 72 $('#emptyWin')[0].src = '/' + $(link).data('local') + '/Post/Contents/DownloadXML?id=' + $(link).data('id'); 73} 74 75 76/* ë§ìì´ì¼ê¸° 77--------------------------------------------------*/ 78function townstory(localname, town, url, width, height) // old : vill 79{ 80 var popWidth = width || 900; 81 var popHeight = height || 700; 82 83 var name = 'townstory' 84 if (url) { 85 popup(url, name, popWidth, popHeight, null, null, 1, 1); 86 } 87 else if (localname) { 88 if (town) { 89 popup("http://story.grandculture.net/service/TownStory.aspx?NAME_AREA=" + localname + "&NAME_TOWN=" + town, name, popWidth, popHeight, null, null, 1, 1); 90 } 91 else { 92 popup("http://story.grandculture.net/service/TownMain.aspx?NAME_AREA=" + localname, name, popWidth, popHeight, null, null, 1, 1); 93 } 94 95 } 96 else { 97 alert("ëì ì§ì ì ë³´ ëë URL ì ë³´ê° íìí©ëë¤."); 98 } 99} 100 101/* ë³µì¬ ì ì¶ì²ì ë³´ ì½ì 102--------------------------------------------------*/ 103function addSource() 104{ 105 var selection = window.getSelection(); 106 var sourceInfo = '<br /><br />[ì¶ì²] íêµíì¤ìì°êµ¬ì - í¥í 문íì ìëì '; 107 var copytext = selection + sourceInfo; 108 var newdiv = document.createElement('div'); 109 110 newdiv.style.position = 'absolute'; 111 newdiv.style.left = '-99999px'; 112 113 document.body.appendChild(newdiv); 114 newdiv.innerHTML = copytext; 115 selection.selectAllChildren(newdiv); 116 117 window.setTimeout(function () { 118 document.body.removeChild(newdiv); 119 }, 100); 120} 121 122/* íµí©ê²ì 123--------------------------------------------------*/ 124function mainSearch(e) // íµí©ê²ì 125{ 126 e.preventDefault(); 127 var form = e.target; 128 129 if (form.input_keyword.value.length < 1) { 130 alert('ê²ìì´ë¥¼ ì ë ¥íì¬ ì£¼ììì!'); 131 form.input_keyword.focus(); 132 } 133 else { 134 var collection = form.collection.value.length > 0 ? "&collection=" + form.collection.value : "";
135 form.keyword.value = $.trim(form.input_keyword.value.replace(/["']/g, ' ')); // ì§ìì´ ì¸ì©ë¶í¸ ì ê±° 136 searchLog(form.local.value, form.keyword.value); 137 138 window.location = "/" + form.local.value + "/search?keyword=" + encodeURI(form.keyword.value) + collection; 139 } 140} 141function mainSearchKeyword(keyword) // íµí©ê²ì : ê²ìì´ ì§ì 142{ 143 if (keyword.length < 1) { 144 alert('ê²ìì´ë¥¼ ì ë ¥íì¬ ì£¼ììì!'); 145 } 146 else { 147 var form = document.getElementById("searchForm"); 148 keyword = $.trim(keyword.replace(/["']/g, ' ')); // ì§ìì´ ì¸ì©ë¶í¸ ì ê±° 149 searchLog(form.local.value, keyword); 150 151 if (form.local.value == '') { 152 window.location = "/search?keyword=" + encodeURI(keyword); 153 } else { 154 window.location = "/" + form.local.value + "/search?keyword=" + encodeURI(keyword); 155 } 156 } 157} 158 159function mainSearchKeywordForm(keyword, hashtag, collection, page, pagesize, facet, sort) // íµí©ê²ì : ê²ìì´ ì§ì 160{ 161 if ($.trim(keyword).length < 1) { 162 alert('ê²ìì´ë¥¼ ì ë ¥íì¬ ì£¼ììì¤.'); 163 } 164 else { 165 var form = document.getElementById("searchForm"); 166 keyword = $.trim(keyword.replace(/["']/g, ' ')); // ì§ìì´ ì¸ì©ë¶í¸ ì ê±° 167 searchLog(form.local.value, keyword); 168 169 form.keyword.value = keyword; 170 form.hashtag.value = (hashtag == null || typeof hashtag == undefined) ? '' : hashtag; 171 form.collection.value = (collection == null || typeof collection == undefined) ? '' : collection; 172 form.page.value = (page == null || typeof page == undefined) ? '' : page; 173 form.pageSize.value = (pagesize == null || typeof pagesize == undefined) ? '' : pagesize; 174 form.facet.value = (facet == null || typeof facet == undefined) ? '' : facet; 175 form.sort.value = (sort == null || typeof sort == undefined) ? '' : sort; 176 177 form.submit(); 178 } 179} 180 181function mainSearchKeywordHashTag(keyword, hashtag) // íµí©ê²ì : í¤ìë í´ì¬íê·¸ ê²ì 182{ 183 if (keyword.length < 1) { 184 alert('ê²ìì´ë¥¼ ì ë ¥íì¬ ì£¼ììì!'); 185 } 186 else if (hashtag.length < 1) { 187 alert('í´ì¬í그를 íì¸íì¸ì!'); 188 } 189 else { 190 var form = document.getElementById("searchForm"); 191 keyword = $.trim(keyword.replace(/["']/g, ' ')); // ì§ìì´ ì¸ì©ë¶í¸ ì ê±° 192 searchLog(form.local.value, keyword); 193 194 if (form.local.value == '') { 195 window.location = "/search?keyword=" + encodeURI(keyword) + "&hashtag=" + encodeURI(hashtag); 196 } else { 197 window.location = "/" + form.local.value + "/search?keyword=" + encodeURI(keyword) + "&hashtag=" + encodeURI(hashtag); 198 } 199 } 200} 201 202function mainSearchKeywordHashTagForm(keyword, hashtag) // íµí©ê²ì : í¤ìë í´ì¬íê·¸ ê²ì 203{ 204 if (keyword.length < 1) { 205 alert('ê²ìì´ë¥¼ ì ë ¥íì¬ ì£¼ììì!'); 206 } 207 else if (hashtag.length < 1) { 208 alert('í´ì¬í그를 íì¸íì¸ì!'); 209 } 210 else { 211 var form = document.getElementById("searchForm"); 212 keyword = $.trim(keyword.replace(/["']/g, ' ')); // ì§ìì´ ì¸ì©ë¶í¸ ì ê±° 213 searchLog(form.local.value, keyword); 214 215 form.keyword.value = keyword; 216 form.hashtag.value = hashtag; 217 form.collection.value = ''; 218 form.page.value = ''; 219 form.pageSize.value = ''; 220 form.facet.value = ''; 221 form.sort.value = ''; 222 223 form.submit(); 224 } 225} 226 227function mainSearchSubInput(e) // íµí©ê²ì : ê²ìì´ ì§ì 228{ 229 if (e.keyCode == 13) { 230 if ($(e.target).hasClass('action-search-form')) { 231 mainSearchKeywordForm(e.target.value); 232 } else { 233 mainSearchKeyword(e.target.value); 234 } 235 } 236} 237function searchLog(localName, requestKeyword) 238{ 239 if (localName == '') { 240 return; 241 } 242 243 var keyword = requestKeyword.toLowerCase(); 244 245 // ê²ìì´ì ì°ì°ìì ê´ë ¨ë ë´ì©ì´ ìì¼ë©´, ì´ë¥¼ ê²ìì´ ë¡ê·¸ì 기ë¡íì§ ìì - 기ê´ìì² [2009.11.23] 246 if (keyword.indexOf(' and ') >= 0 || keyword.indexOf(' or ') >= 0 || keyword.indexOf('&') >= 0 || keyword.indexOf('|') >= 0) { 247 return; 248 } 249 250 $.ajax({
251 url: '/' + localName + '/Post/Contents/WriteSearchLog', 252 async: false, 253 data: { 'keyword': $.trim(keyword) } 254 }); 255} 256 257 258/* ê²ìí ê²ì 259--------------------------------------------------*/ 260function boardSearch(e) 261{ 262 e.preventDefault(); 263 var form = e.target; 264 265 if (form.input_keyword.value.length < 1) { 266 alert('ê²ìì´ë¥¼ ì ë ¥íì¬ ì£¼ììì!'); 267 form.input_keyword.focus(); 268 } 269 else { 270 var category = form.category ? "&category=" + form.category.value : ""; 271 form.keyword.value = $.trim(form.input_keyword.value.replace(/["']/g, ' ')); // ì§ìì´ ì¸ì©ë¶í¸ ì ê±° 272 window.location = form.action + "?search=" + encodeURI(form.keyword.value) + "&searchType=" + form.searchType.value + category; 273 } 274} 275 276 277 278$(document).ready(function () { 279 280 BrowserDetect.init(); 281 282 var searchForm = document.getElementById("searchForm"); 283 if (searchForm && searchForm.addEventListener) { 284 searchForm.addEventListener("submit", mainSearch, false); 285 } 286 else if (searchForm && searchForm.attachEvent) { 287 searchForm.attachEvent("onsubmit", mainSearch, false); 288 } 289 290 var searchSubInput = document.getElementById("search-sub-input"); 291 if (searchSubInput && searchSubInput.addEventListener) { 292 searchSubInput.addEventListener("keydown", mainSearchSubInput, false); 293 } 294 else if (searchSubInput && searchSubInput.attachEvent) { 295 searchSubInput.attachEvent("onkeydown", mainSearchSubInput, false); 296 } 297 298 var searchSubInput2 = document.getElementById("input-sw"); 299 if (searchSubInput2 && searchSubInput2.addEventListener) { 300 searchSubInput2.addEventListener("keydown", mainSearchSubInput, false); 301 } 302 else if (searchSubInput2 && searchSubInput2.attachEvent) { 303 searchSubInput2.attachEvent("onkeydown", mainSearchSubInput, false); 304 } 305 306 var boardForm = document.getElementById("boardSearchForm"); 307 if (boardForm && boardForm.addEventListener) { 308 boardForm.addEventListener("submit", boardSearch, false); 309 } 310 else if (boardForm && boardForm.attachEvent) { 311 boardForm.attachEvent("onsubmit", boardSearch, false); 312 } 313 314});
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.