1/** 2 * news ì²ë¦¬ 3 */ 4 5var newsFunc = null; 6 7$(function() { 8 $.funcNews = function() { 9 var _this = this; 10 11 this.opt = { 12 "nId":"" 13 , "lastNId":"" 14 , "recordCountPerPage": 6 15 , "searchType":"" 16 , "searchText":"" 17 , "orderBy":"show_date" 18 , "moreCnt":0 19 } 20 21 //리ì¤í¸ íë©´ ì´ê¸°í 22 this.listInit = function() { 23 24 $('#more_btn').on('click', function(e) { 25 26 e.preventDefault(); 27 28 _this.getListMoreData(); 29 }) 30 31 $(document).on('click', '#news_list .news-list a', function(e) { 32 33 e.preventDefault(); 34 35 var linkUrl = $(this).closest('.news-list').attr('data-linkUrl'); 36 var nId = $(this).closest('.news-list').attr('data-nId'); 37 38 _this.goView(linkUrl, nId); 39 }) 40 41 _this.getListMoreData(); 42 } 43 44 //보기 íë©´ ì´ê¸°í 45 this.infoInit = function(nId) { 46 _this.opt.nId = nId; 47 48 //목ë¡ë²í¼ í´ë¦½ì´ë²¤í¸ 49 $('.view-nav-wrap .view-back a').on('click', function(e) { 50 e.preventDefault(); 51 document.location.href = '/board/' + _this.opt.bbsCd + '/list/1'; 52 }) 53 54 _this.getInfoData(); 55 } 56 57 //리ì¤í¸ íì´ì§ ì´ë 58 this.goList = function(page) { 59 if (page == "" || page == null) { 60 page = 1; 61 } 62 document.location.href = "/news"; 63 } 64 65 //리ì¤í¸ íì´ì§ ì´ë 66 this.goView = function(linkUrl, nId) { 67 $.cookie('c_searchType', _this.opt.searchType, {path:'/news'}); 68 $.cookie('c_searchText', _this.opt.searchText, {path:'/news'}); 69 $.cookie('c_scrollTop', $(document).scrollTop(), {path:'/news'}); 70 $.cookie('c_nId', nId, {path:'/news'}); 71 72 //var orderBy = "postId"; 73 $.cookie('c_orderBy', _this.opt.orderBy, {path:'/news'}); 74 //$.cookie('c_page', _this.opt.page, {path:'/board/' + _this.opt.bbsCd}); 75 //_this.opt.orderBy = orderBy; 76 77 $.cookie('c_moreCnt', _this.opt.moreCnt, {path:'/news'}); 78 79 document.location.href = linkUrl + '?orderBy=' + _this.opt.orderBy; 80 } 81 82 this.isLogin = function(){ 83 if(mebrweb_user_id == null || mebrweb_user_id == ""){ 84 openPopup('loginPopup'); 85 return false; 86 } 87 return true; 88 } 89 90 //리ì¤í¸ ë보기 ííë¡ ê°ì ¸ì¤ê¸° 91 this.getListMoreData = function() { 92 93 var param = { 94 "recordCountPerPage":_this.opt.recordCountPerPage 95 , "lastNId": _this.opt.lastNId 96 , "orderBy":_this.opt.orderBy 97 } 98 99 if ($.cookie('c_sort') != undefined) { 100 101 $.removeCookie('c_sort', {path:'/news'}); 102 } 103 104 $.ajax({ 105 url: '/api/v1/news/listMoreData', // ìì² í 주ì 106 async:true, // false ì¼ ê²½ì° ë기 ìì²ì¼ë¡ ë³ê²½ 107 type:'GET', // GET, PUT, DELETE 108 data: param, // ì ì¡í ë°ì´í° 109 dataType:'json', // xml, json, script, html 110 beforeSend:function(jqXHR) { // ìë² ìì² ì í¸ì¶ ëë í¨ì return false; ì¼ ê²½ì° ìì² ì¤ë¨ 111 //addLoading(); 112 }, 113 success:function(jqXHR) { // ìì² ìë£ ì 114 115 var resultCode = jqXHR.header.code; 116 var resultMsg = jqXHR.header.message; 117 118 var listMoreCnt = jqXHR.data.listMoreCnt; 119 120 if (resultCode == "C000") { 121 122 if (_this.opt.lastNId == '') { 123 $('#news_list .news-list').remove(); 124 } 125 126 $(jqXHR.data.newsList).each(function(idx) { 127 news = jqXHR.data.newsList[idx]; 128 129 thumbImg = _this.getFileData(news.lstFile, 'thumb'); 130 131 addRow = ' <div class="news-list type0' + (idx + 1) % 3 + '" data-linkUrl="/news/info/' + news.nId + '" data-nId="'+ news.nId + '">'; 132 addRow += ' <a href="#" class="row no-gutters" title="ë´ì¤ ë·°íì´ì§ë¡ ì´ë">'; 133 addRow += ' <div class="col-md-6">'; 134 addRow += ' <p class="thumb"><img src="/common/imageShow/' + thumbImg.fileId + '" class="w-100" alt=""></p>'; 135 addRow += ' </div>'; 136 addRow += ' <div class="col-md-6 tit-wrap">'; 137 addRow += ' <div class="tit">'; 138 addRow += ' <p class="headline">' + news.title + '</p>'; 139 addRow += ' <p class="date"><span></span>' + news.showDate + '</p>'; 140 addRow += ' </div>';
141 addRow += ' </div>'; 142 addRow += ' <span class="clearfix"></span>'; 143 addRow += ' <p class="btn-arrow-right"><span></span></p>'; 144 addRow += ' </a>'; 145 addRow += ' </div>'; 146 147 $('#news_list').append(addRow); 148 _this.opt.lastNId = news.nId; 149 }); 150 151 if (listMoreCnt > jqXHR.data.newsList.length) { 152 $('#more_btn').show(); 153 } else { 154 $('#more_btn').hide(); 155 } 156 157 _this.opt.moreCnt++; 158 159 if ($.cookie('c_moreCnt') != undefined && parseInt($.cookie('c_moreCnt'), 10) > _this.opt.moreCnt) { 160 if ($.cookie('c_nId') != undefined && $('#news_list .news-list[data-nId="' + $.cookie('c_nId') + '"]').length < 1) { 161 $('#more_btn').click(); 162 return; 163 } 164 } else { 165 $.removeCookie('c_moreCnt', {path:'/news'}); 166 } 167 168 if ($.cookie('c_scrollTop') != undefined) { 169 170 $('html, body').animate({"scrollTop":$.cookie('c_scrollTop')}); 171 172 $.removeCookie('c_scrollTop', {path:'/news'}); 173 $.removeCookie('c_recordCountPerPage', {path:'/news'}); 174 $.removeCookie('c_nId', {path:'/news'}); 175 176 $.removeCookie('c_moreCnt', {path:'/news'}); 177 178 } 179 180 } else { 181 customAlert({message: resultMsg, btn_txt1:"íì¸"}); 182 } 183 }, 184 error:function(jqXHR) { // ìì² ì¤í¨. 185 186 }, 187 complete:function(jqXHR) { // ìì²ì ì¤í¨, ì±ê³µê³¼ ìê´ ìì´ ìë£ ë ê²½ì° í¸ì¶ 188 //removeLoading(); 189 } 190 }); 191 } 192 193 //ê²ì물 ì ë³´ ê°ì ¸ì¤ê¸° 194 this.getInfoData = function(mode = '') { 195 196 var param = { 197 "nId": _this.opt.nId 198 , "orderBy":$.cookie('c_orderBy') 199 } 200 201 $.ajax({ 202 url: '/api/v1/news/infoData', // ìì² í 주ì 203 async:true, // false ì¼ ê²½ì° ë기 ìì²ì¼ë¡ ë³ê²½ 204 type:'GET', // GET, PUT, DELETE 205 data: param, // ì ì¡í ë°ì´í° 206 dataType:'json', // xml, json, script, html 207 beforeSend:function(jqXHR) { // ìë² ìì² ì í¸ì¶ ëë í¨ì return false; ì¼ ê²½ì° ìì² ì¤ë¨ 208 //addLoading(); 209 }, 210 success:function(jqXHR) { // ìì² ìë£ ì 211 212 var resultCode = jqXHR.header.code; 213 var resultMsg = jqXHR.header.message; 214 215 if (resultCode == "C000") { 216 217 var newsInfo = jqXHR.data.newsInfo; 218 219 var newsPrevNextInfo = jqXHR.data.newsPrevNextInfo; 220 221 $('#title').html('<span></span>' + newsInfo.title.replace(/<br[^>]*>/gi," ")); 222 $('#showDate').text(newsInfo.showDate); 223 224 $('#contents').html(newsInfo.contents); 225 226 var lstAtchFileVO = newsInfo.lstFile; 227 228 /* 229 fileUploadFunc.setFilesInfoForView(bbsPostInfo.bbsId, lstAtchFileVO); 230 */ 231 232 if (newsPrevNextInfo != undefined) { 233 //ì´ì ê¸ ë²í¼ 234 $('.paging-wrap .prev .title').html(newsPrevNextInfo.prevTitle == "" ? '첫ë²ì§¸ ê²ì물 ì ëë¤.':newsPrevNextInfo.prevTitle); 235 $('.paging-wrap .prev a').on('click', function(e) { 236 e.preventDefault(); 237 238 if (newsPrevNextInfo.prevNId == "") { 239 return; 240 } else { 241 document.location.href = '/news/info/' + newsPrevNextInfo.prevNId + '?orderBy=' + $.cookie('c_orderBy'); 242 } 243 }); 244 245 //ë¤ìê¸ ë²í¼ 246 $('.paging-wrap .next .title').html(newsPrevNextInfo.nextTitle == "" ? 'ë§ì§ë§ ê²ì물 ì ëë¤.':newsPrevNextInfo.nextTitle); 247 $('.paging-wrap .next a').on('click', function(e) { 248 e.preventDefault(); 249 250 if (newsPrevNextInfo.nextNId == "") { 251 return; 252 } else { 253 document.location.href = '/news/info/' + newsPrevNextInfo.nextNId + '?orderBy=' + $.cookie('c_orderBy'); 254 } 255 }); 256 } 257 } else { 258 alert(resultMsg); 259 } 260 }, 261 error:function(jqXHR) { // ìì² ì¤í¨. 262 263 }, 264 complete:function(jqXHR) { // ìì²ì ì¤í¨, ì±ê³µê³¼ ìê´ ìì´ ìë£ ë ê²½ì° í¸ì¶ 265 //removeLoading(); 266 } 267 }); 268 } 269 270 this.getFileData = function(lstFile, fileKnd) { 271 var fileInfo = []; 272 if (lstFile != "") { 273 for (var i = 0 ; i < lstFile.length ; i++) { 274 if (lstFile[i].fileKnd == fileKnd) { 275 fileInfo.push(lstFile[i]) 276 } 277 } 278 279 if (fileInfo.length == 1) { 280 fileInfo = fileInfo[0]; 281 } 282 } 283 284 return fileInfo; 285 } 286 } 287}); 288
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.