1var NEWEST_POST = function(){ 2 3 var mode; 4 5 /** 6 * 구매í ëë 문ì URLë¡ ë¦¬ë¤ì´ë í¸, íì¬ ìì½ììë§ ì¬ì©ë¨ 7 * moveReviewUrl ë±ì ì´ë¦ì´ ë§ì ë¯ íë ê³ ê° ì»¤ì¤í ì½ëë¡ ì¬ì©ë ê°ë¥ì±ì ê³ ë ¤íì¬ í¨ìëª ì ì§ 8 * @param type 9 * @param prod_url 10 * @param idx 11 */ 12 var getReviewUrl = function(type,prod_url,idx){ 13 if(type == 'shop_review'){ 14 location.href = prod_url+'#prod_detail_review!/'+idx; 15 }else{ 16 location.href = prod_url+'#prod_detail_qna!/'+idx; 17 } 18 }; 19 20 //bmode 구í´ì ë³ìì ì í 21 var setParameterByName = function(name){ 22 name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); 23 24 var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), 25 results = regex.exec(location.search); 26 27 mode = null === results ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")) 28 }; 29 30 var newestClickLike = function(post_code, like_token_key, like_token){ 31 event.stopPropagation(); 32 33 if(mode === 'view'){ //ê²ìê¸ ë³¸ë¬¸ê³¼ ê°ì íì´ì§ì ìì¼ë©´ ê°±ì ë²í¼ì 본문 ì¢ìì ë²í¼ì¼ë¡ ì í 34 post_like_reaction.init('post', post_code, $('#view_like_btn_' + post_code), $('#view_like_count_' + post_code)); 35 }else{ 36 post_like_reaction.init('post', post_code, $('#like_btn_' + post_code), $('#like_count_' + post_code)); 37 } 38 post_like_reaction.checkLikeToken(like_token_key, like_token, post_code); 39 post_like_reaction.toggleLike(); 40 }; 41 42 var viewReviewPostDetail = function(idx){ 43 $(function(){ 44 $.ajax({ 45 type : 'POST', 46 data : {idx : idx}, 47 url : ('/ajax/review_post_detail_view.cm'), 48 dataType : 'json', 49 async : false, 50 cache : false, 51 success : function(res){ 52 if(res.msg === 'SUCCESS'){ 53 $.cocoaDialog.open({ 54 type : 'prod_detail review', custom_popup : res.html, width : 800}); 55 if(history.replaceState && history.pushState){ 56 // ëª¨ë¬ íì¤í 리 커ì¤í (IE 10 ì´ì) 57 var current_url = location.href.indexOf('#') === -1 ? location.href : location.href.substr(0, location.href.indexOf('#')); 58 var back_url = document.referrer.indexOf('#') === -1 ? document.referrer : document.referrer.substr(0, document.referrer.indexOf('#')); 59 history.pushState(null, null, current_url); 60 history.replaceState(null, null, current_url + "#prod_detail_review!/" + res.idx); 61 }else{ 62 location.hash = "prod_detail_review!/" + res.idx; 63 } 64 $(window).off('hashchange').on('hashchange',function(){ 65 var hash_qna_spilt = location.hash.split('!/')[1]; 66 if(!hash_qna_spilt){ 67 $.cocoaDialog.close(); 68 }else{ 69 var hash_spilt_tab = location.hash.split('!/')[0]; 70 if(hash_spilt_tab === '#prod_detail_review'){ 71 viewReviewPostDetail(hash_qna_spilt); 72 }else if(hash_spilt_tab === '#prod_detail_qna'){ 73 viewQnaPostDetail(hash_qna_spilt); 74 } 75 } 76 }); 77 $('.modal_prod_detail').off('hidden.bs.modal').on('hidden.bs.modal', function (e) { 78 removeReviewHash(); 79 }); 80 }else{ 81 alert(res.msg); 82 } 83 } 84 }); 85 }); 86 }; 87 88 var removeReviewHash = function(){ 89 $(window).off('hashchange'); 90 $('html').toggleClass('modal-scroll-control', false); 91 var hash_review_spilt = location.hash.split('!/')[1]; 92 if(hash_review_spilt){ 93 if(history.replaceState && history.pushState){ 94 history.back(); 95 }else{ 96 location.href = '#prod_detail_review'; 97 } 98 } 99 }; 100 101 var viewQnaPostDetail = function(idx){ 102 $(function(){ 103 $.ajax({ 104 type : 'POST', 105 data : {idx : idx}, 106 url : ('/ajax/qna_post_detail_view.cm'), 107 dataType : 'json', 108 async : false, 109 cache : false, 110 success : function(res){ 111 if(res.msg === 'SUCCESS'){ 112 $.cocoaDialog.open({ 113 type : 'prod_detail review', custom_popup : res.html, width : 800}); 114 if(history.replaceState && history.pushState){ 115 // ëª¨ë¬ íì¤í 리 커ì¤í (IE 10 ì´ì) 116 var current_url = location.href.indexOf('#') === -1 ? location.href : location.href.substr(0, location.href.indexOf('#')); 117 var back_url = document.referrer.indexOf('#') === -1 ? document.referrer : document.referrer.substr(0, document.referrer.indexOf('#')); 118 history.pushState(null, null, current_url); 119 history.replaceState(null, null, current_url + "#prod_detail_qna!/" + res.idx); 120 }else{ 121 location.hash = "prod_detail_qna!!/" + res.idx; 122 } 123 $(window).off('hashchange').on('hashchange',function(){ 124 var hash_qna_spilt = location.hash.split('!/')[1]; 125 if(!hash_qna_spilt){ 126 $.cocoaDialog.close(); 127 }else{ 128 var hash_spilt_tab = location.hash.split('!/')[0]; 129 if(hash_spilt_tab === '#prod_detail_review'){ 130 viewReviewPostDetail(hash_qna_spilt); 131 }else if(hash_spilt_tab === '#prod_detail_qna'){ 132 viewQnaPostDetail(hash_qna_spilt); 133 } 134 } 135 }); 136 $('.modal_prod_detail').off('hidden.bs.modal').on('hidden.bs.modal', function (e) { 137 removeQnaHash(); 138 }); 139 }else{ 140 alert(res.msg); 141 } 142 } 143 }); 144 }); 145 }; 146 147 var viewQnaPostPassword = function(idx, code){ 148 var pw = prompt(LOCALIZE.ì¤ëª _ìì±ìë±ë¡íì ë¹ë°ë²í¸ë¥¼ì ë ¥í´ì£¼ì¸ì()); 149 if(pw == null) return false;
150 if(!pw) return alert(LOCALIZE.ì¤ëª _ìì±ìë±ë¡íì ë¹ë°ë²í¸ë¥¼ì ë ¥í´ì£¼ì¸ì()); 151 CheckSecret(code, pw, function () { 152 NEWEST_POST.viewQnaPostDetail(idx); 153 }); 154 }; 155 156 var CheckSecret = function(code, secret_pass, callback) { 157 $.ajax({ 158 type: 'post', 159 data: { code: code, secret_pass: secret_pass, type: 'qna' }, 160 url: '/ajax/check_review_pass.cm', 161 dataType: 'json', 162 success: function (result) { 163 if (result.msg == 'SUCCESS') { 164 if (typeof callback == 'function') 165 callback(); 166 } else { 167 alert(result.msg); 168 } 169 } 170 }); 171 }; 172 173 var removeQnaHash = function(){ 174 $(window).off('hashchange'); 175 $('html').toggleClass('modal-scroll-control', false); 176 var hash_qna_spilt = location.hash.split('!/')[1]; 177 if(hash_qna_spilt){ 178 if(history.replaceState && history.pushState){ 179 history.back(); 180 }else{ 181 location.href = '#prod_detail_qna'; 182 } 183 } 184 }; 185 186 var alertNoSale = function(){ 187 $.cocoaDialog.open({ 188 type: 'site_alert', 189 custom_popup: ` 190 <div class="layer_pop"> 191 <div class="container-fluid"> 192 <p class="tw-text-center tw-mb-0"> 193 ${getLocalizeString('ì¤ëª _ìííì´ì§ì´ëë¶ê°ìë´', '', 'í´ë¹ ìí íì´ì§ë¡ ì´ëí ì ììµëë¤.')} 194 </p> 195 </div> 196 <div class="btn-group-justified"> 197 <a href="javascript:" class="btn" onclick="$('.modal_site_alert').modal('hide');">${getLocalizeString('ë²í¼_íì¸', '', 'íì¸')}</a> 198 </div> 199 </div>` 200 }, function(){ 201 $('.modal_site_alert').css('z-index', 100002); 202 }); 203 } 204 205 return { 206 'getReviewUrl' : function(type,prod_url,idx){ 207 return getReviewUrl(type,prod_url,idx); 208 }, 209 'setParameterByName' : function(name){ 210 setParameterByName(name); 211 }, 212 'newestClickLike' : function(post_code, like_token_key, like_token){ 213 newestClickLike(post_code, like_token_key, like_token); 214 }, 215 'viewReviewPostDetail' : function(idx){ 216 viewReviewPostDetail(idx); 217 }, 218 'removeReviewHash' : function(){ 219 removeReviewHash(); 220 }, 221 'viewQnaPostDetail' : function(idx){ 222 viewQnaPostDetail(idx); 223 }, 224 'viewQnaPostPassword' : function(idx, code){ 225 viewQnaPostPassword(idx, code); 226 }, 227 'removeQnaHash' : function(){ 228 removeQnaHash(); 229 }, 230 'alertNoSale' : function(){ 231 alertNoSale(); 232 } 233 } 234}();
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.