1'use strict'; 2 3function MainListView(globalCodeArray, targetDiv, showRealtor, detailUrl, articleOnMouseOverListener, articleOnMouseOutListener) { 4 this.globalCodeArray = globalCodeArray; 5 this.listView = targetDiv; 6 this.pagingSearch = null; 7 this.zoomLevel = null; 8 this.param = null; 9 this.showRealtor = showRealtor; 10 this.detailUrl = detailUrl; 11 if(this.showRealtor == null) this.showRealtor = true; 12 if(this.detailUrl == null) this.detailUrl = '/hompyArticle/detail/'; 13 if(articleOnMouseOverListener != null) 14 this.articleOnMouseOverListener = articleOnMouseOverListener; 15 if(articleOnMouseOutListener != null) 16 this.articleOnMouseOutListener = articleOnMouseOutListener; 17} 18 19// 물건 리ì¤í¸ë¥¼ ê°ì ¸ì¨ë¤. 20MainListView.prototype.load = function (pagingSearch, zoomLevel, param, pagingReset) { 21 if (zoomLevel != null) 22 this.zoomLevel = zoomLevel; 23 if (param != null) 24 this.param = param; 25 26 this.pagingSearch = pagingSearch; 27 28 var newParam = this.param + "&zoomLevel=" + zoomLevel; 29 if (this.pagingSearch != null) { 30 newParam += "&" + hompyUtil.objectToQueryString(this.pagingSearch, "=", "&"); 31 } 32 33 var that = this; 34 var url = "/hompyArticle/list"; 35 hompyUtil.ajax(url, newParam).then(function (response) { 36 var result = response.result; 37 if (result != null && result.list != null) { 38 that.setList(result.list, result.paging); 39 } 40 }, function (reason) { 41 console.log(reason); 42 return false; 43 }); 44}; 45 46// 물건리ì¤í¸ë¥¼ ë·°ì ë£ëë¤. 47MainListView.prototype.setList = function (list, paging) { 48 this.pagingSearch = paging; 49 this.listView.find("#hompyArticleTotalCount").text(paging.totalCount); 50 51 var that = this; 52 var ul = $(".land_sale_sort_inner ul"); 53 ul.empty(); 54 $(".land_sale_sort_inner").mCustomScrollbar("update"); 55 for (var i = 0; i < list.length; i++) { 56 var item = list[i]; 57 var article = $(this.addArticle(item)); 58 if(this.articleOnMouseOverListener != null) { 59 var f = function(data) { 60 article.mouseover(function () { 61 that.articleOnMouseOverListener(data); 62 }); 63 }; 64 f(item); 65 } 66 if(this.articleOnMouseOutListener != null) { 67 var f = function(data) { 68 article.mouseout(function () { 69 that.articleOnMouseOutListener(data); 70 }); 71 }; 72 f(item); 73 } 74 ul.append(article); 75 } 76 ul.append(this.generatePager(paging, 10, "fn.goMainListPage", "fn.goMainListPage", "fn.goMainListPage")); 77 $(".land_sale_sort_inner").mCustomScrollbar("update"); 78}; 79 80// ê°ë³ 물건ì htmlë¡ ë§ë¤ì´ ë¦¬í´ 81MainListView.prototype.addArticle = function (item) { 82 var feature = hompyUtil.shrinkString(item.feature, 50); 83 var description = hompyUtil.shrinkString(item.description, 50); 84 85 var html = "<li>"; 86 html += "<a href='" + this.detailUrl + item.seq + "' target='_blank'>"; 87 html += "<div class='txt'>"; 88 html += "<p class='land_prod_name'>"; 89 var firstrow = ""; 90 if (item.danji != null) 91 firstrow += item.danji.aptName; 92 if (item.legalDong != null) { 93 if (!hompyUtil.isEmptyString(firstrow)) firstrow += "·"; 94 firstrow += item.legalDong.dongName; 95 } 96 html += firstrow; 97 html += "</p>"; 98 html += "<strong class='land_prod_price'>"; 99 html += hompyUtil.getOptionTextByCode(globalCodeArray["30051"], item.tradeTypeCode) + " "; 100 html += hompyUtil.convertTradeMoney(item.price1, item.price2); 101 html += "</strong>"; 102 html += "<span class='land_prod_ex'>"; 103 html += hompyUtil.getOptionTextByCode(globalCodeArray["30000"], item.categoryCode) + " "; 104 html += hompyUtil.getSupplySpace(item); 105 if(!hompyUtil.isEmptyString(hompyUtil.getExclusiveSpace(item))) 106 html += "/" + hompyUtil.getExclusiveSpace(item); 107 html += "ã¡"; 108 html += "<br />" + feature + "</span>"; 109 html += "</div>"; 110 if (!hompyUtil.isEmptyString(item.titlePhotoUrl)) 111 html += "<figure><img width='140' height='120' src='" + item.titlePhotoUrl + "'></figure>"; 112 //else 113 // html += "<figure><img width='140' height='120' src='/img/mem/no_img.jpg'></figure>"; 114 html += "</a>"; 115 // ì¦ê²¨ì°¾ê¸° ìì html += "<i class='icon_heart'></i>"; 116 if(this.showRealtor == true) { 117 html += "<div class='land_offi_info'>"; 118 html += "<a href='/realtor/" + item.realtorUserId + "' target='_blank'>" + item.realtorName + "</a>"; 119 html += "</div>"; 120 } 121 html += "<div class='land_offi_info2'>"; 122 if (!hompyUtil.isEmptyString(item.tradeCompletedDate)) 123 html += "<p style='color:#f15326;'>ê±°ëìë£ " + hompyUtil.toDotDate(item.tradeCompletedDate) + "</p>"; 124 else { 125 if(item.naverUid == null) 126 html += "<p style='color:;'>ì¼ë°ë§¤ë¬¼ "; 127 else 128 html += "<p style='color:;'>íì¸ë§¤ë¬¼ "; 129 html += hompyUtil.toDotDate(item.showStartDate) + "</p>"; 130 } 131 html += "</div>"; 132 html += "</li>"; 133 134 return html; 135}; 136 137// íë¨ íì´ì§ ë²í¼ ìì± 138MainListView.prototype.generatePager = function (paging, pagingLimit, goPageFuncName, prevPageFuncName, nextPageFuncName) { 139 if (paging.totalPage == 0) return ""; 140 var pageNo = paging.pageNo; 141 142 var startPage = pageNo - parseInt(pagingLimit / 2); 143 if (startPage < 1) startPage = 1; 144 var endPage = startPage + pagingLimit - 1; 145 if (endPage > paging.totalPage) endPage = paging.totalPage; 146 if (endPage - startPage != pagingLimit) { 147 startPage = endPage - pagingLimit + 1; 148 if (startPage < 1) startPage = 1; 149 } 150 151 var prevPage = startPage - 1; 152 if (prevPage < 1) prevPage = 1; 153 var nextPage = endPage + 1; 154 if (nextPage > paging.totalPage) nextPage = paging.totalPage; 155 156 var html = "<li><div class='board_pager'>"; 157 html += "<p class='prev'>"; 158 html += "<a href='javascript:" + prevPageFuncName + "(" + prevPage + ");'>< PREV</a>"; 159 html += "</p>"; 160 161 var on = ""; 162 for (var i = startPage; i <= endPage; i++) { 163 if (i == pageNo) on = "on"; 164 html += "<p class='num'><a class='" + on + "' href='javascript:" + goPageFuncName + "(" + i + ");'>" + i + "</a></p>"; 165 on = ""; 166 } 167 168 html += "<p class='next'>"; 169 html += "<a href='javascript:" + nextPageFuncName + "(" + nextPage + ");'>NEXT ></a>"; 170 html += "</p>"; 171 html += "</div></li>"; 172 return html; 173}; 174 175// í¹ì íì´ì§ë¡ ì´ë 176MainListView.prototype.goPage = function (pagingSearch, zoomLevel) { 177 this.load(pagingSearch, zoomLevel); 178};
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.