1 2function fn_Update_CommentReview() { 3 this.itemId = 0; 4 this.productItemId = 0; 5 this.paper = ""; 6 this.categoryId = 0; 7 this.rank = 0; 8 this.nemotype=0; 9 this.istwitter=false; 10 this.isfacebook=false; 11 this.isorderer=false; 12 this.savedHandler=""; 13 this.action = ""; 14 this.List = ""; 15 this.isspoiler = false; 16 var o = this; 17 18 19 this.callSaveHandler= function(){ 20 if(typeof this.savedHandler == "function"){ 21 this.savedHandler(); 22 } 23 } 24 25 26 this.Update = function() { 27 $j.ajax({ 28 url : "/ucl/shop/product/ajax/commentReviewAjax.aspx", 29 cache: false, 30 data: "ProductItemId=" + o.productItemId + "&ItemId=" + o.itemId + "&Paper=" + escape(o.paper) + "&CategoryId=" + o.categoryId + "&Rank=" + o.rank + "&NemoType=" + o.nemotype + "&action=" + o.action + "&dummy=" + escape(new Date().getTime()) + "&istwitter=" + (o.istwitter ? "1" : "0") + "&isfacebook=" + (o.isfacebook ? "1" : "0") + "&isorderer=" + (o.isorderer ? "1" : "0") + "&isspoiler=" + (o.isspoiler ? "1" : "0"), 31 success: function (data) { 32 if (data == "false"){ 33 alert("ë±ë¡ì´ ì¤í¨ëììµëë¤.") 34 return; 35 } 36 //alert("ë±ë¡ì´ ìë£ëììµëë¤.") 37 o.List.Refresh(); 38 o.callSaveHandler(); 39 }, 40 error:function (xhr, ajaxOptions, thrownError){ 41 alert(xhr.status); 42 alert(thrownError); 43 o.callSaveHandler(); 44 } 45 }); 46 } 47} 48 49function fn_paper_getList() 50{ 51 this.listId = ""; 52 this.communityType =""; 53 this.totalRowCount = 0; 54 this.currentPage = 1; 55 this.pageSize = 5; 56 this.itemId = 0; 57 this.sort = 1; 58 this.IsOrderer = 2; 59 this.BranchType = 1; 60 this.IsAjax = true; 61 this.startNumber = 1; 62 this.endNumber = 10; 63 this.pageType=0; //0:ìííì´ì§, 1:기ííì´ì§(í루í¹ê°) 64 this.nemoType = -1; //-1:ì ì²´ 65 this.productItemId = 0; //ìííì´ì§ ItemId 66 67 var o = this; 68 69 this.Refresh = function () { 70 $j.ajax({ 71 url : "/ucl/shop/product/ajax/GetCommunityListAjax.aspx", 72 cache: false, 73 data: "ProductItemId=" + o.productItemId + "&itemId=" + o.itemId + "&pageCount=" + o.pageSize + "&communitytype=" + o.communityType + "&nemoType=" + o.nemoType + "&page=" + o.currentPage + "&startNumber=" + o.startNumber + "&endNumber=" + o.endNumber + "&sort=" + o.sort + "&IsOrderer=" + o.IsOrderer + "&BranchType=" + o.BranchType + "&IsAjax=" + o.IsAjax + "&pageType=" + o.pageType, 74 success : function(data) { 75 $j(o.listId).html(data); 76 }, 77 error:function (xhr, ajaxOptions, thrownError){ 78 alert(xhr.status); 79 alert(thrownError); 80 o.callSaveHandler(); 81 } 82 }); 83 } 84 85 this.Update = function (callback) { 86 $j.get("/ucl/shop/product/ajax/GetCommunityListAjax.aspx?ProductItemId=" + o.productItemId +"&itemId=" + o.itemId + "&pageCount=" + o.pageSize + "&communitytype=" + o.communityType + "&nemoType=" + o.nemoType + "&page=" + o.currentPage + "&startNumber=" + o.startNumber + "&endNumber=" + o.endNumber + "&sort=" + o.sort + "&IsOrderer=" + o.IsOrderer + "&BranchType=" + o.BranchType + "&IsAjax=" + o.IsAjax + "&pageType=" + o.pageType, function (data) { 87 $j(o.listId).html(data); 88 if (typeof callback === "function") callback(); 89 }); 90 } 91} 92 93function Pager() 94{ 95 this.totalRowCount = 0; 96 this.pageSize = 5; 97 this.endNumber = 10; 98 this.pageCount = 0; 99 this.startNumber = 1; 100 this.pagerId = ""; 101 this.currentPage = 0; 102 this.communityType = ""; 103 this.itemId = 0; 104 this.productItemId = 0; 105 this.listId =""; 106 this.BranchType = 1; 107 this.IsOrderer = 2; 108 this.nemoType = -1; //-1:ì ì²´ 109 this.sort = 1; 110 var o = this; 111 112 this.Paging = function() { 113 if(o.totalRowCount <= o.pageSize) return; 114
115 o.pageCount = Math.ceil(o.totalRowCount / o.pageSize); 116 var pageLink; 117 118 var _pager = o.pagerId; 119 var _pager_first = _pager + "_first"; 120 var _pager_last = _pager + "_last"; 121 var _pager_prev = _pager + "_prev"; 122 var _pager_next = _pager + "_next"; 123 124 $j(_pager).empty(); 125 if (o.endNumber > o.pageCount) o.endNumber = o.pageCount; 126 var pageClass; 127 for (var page = o.startNumber; page <= o.endNumber; page++) { 128 if (page == o.currentPage) pageClass = "np_numon"; 129 else pageClass = "np_numoff"; 130 pageLink = $j("<div class=\"np_numbox\"><a href=\"#"+o.communityType+"\" class=" + pageClass + ">" + page + " </a></div>") 131 .addClass("np_numoff") 132 .click(function() { 133 o.currentPage = parseInt($j(this).text()); 134 o.GoPage(); 135 }); 136 $j(_pager).append(pageLink); 137 } 138 $j(_pager_first).empty(); 139 $j(_pager_prev).empty(); 140 if (o.currentPage > 10) { 141 $j(_pager_prev).append("<div class=\"np_numbox_pre\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\"><img src=\"https://image.aladdin.co.kr/img/browse/page_arr2.gif\" border=\"0\" align=\"absmiddle\" />" + (o.startNumber - 10) + "~" + (o.startNumber - 1) + "</a></div>") 142 .click(o.GoPrevPage); 143 $j(_pager_first).append("<div class=\"np_numbox_first\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\">ì²ì</a></div>").click(o.GoFirstPage); 144 } 145 else { 146 $j(_pager_prev).unbind("click", o.GoPrevPage); 147 } 148 149 $j(_pager_next).empty(); 150 $j(_pager_last).empty(); 151 if (o.pageCount > o.endNumber) { 152 var EndNumber = o.endNumber * 2; 153 if (EndNumber > o.pageCount) EndNumber = o.pageCount; 154 $j(_pager_next).append("<div class=\"np_numbox_next\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\">" + (o.endNumber + 1) + "~" + EndNumber + "<img src=\"https://image.aladdin.co.kr/img/browse/page_arr.gif\" border=\"0\" align=\"absmiddle\" /></a></div>") 155 .click(o.GoNextPage); 156 $j(_pager_last).append("<div class=\"np_numbox_last\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\">ë</a></div>").click(o.GoLastPage); 157 } 158 else { 159 $j(_pager_next).unbind("click", o.GoNextPage); 160 } 161 }; 162 163 this.GoPage = function () { 164 var MyPaper = new fn_paper_getList(); 165 MyPaper.communityType = o.communityType; 166 MyPaper.listId = o.listId; 167 MyPaper.pageSize = o.pageSize; 168 MyPaper.itemId = o.itemId; 169 MyPaper.productItemId = o.productItemId; 170 MyPaper.currentPage = o.currentPage; 171 MyPaper.startNumber = o.startNumber; 172 MyPaper.endNumber = o.endNumber; 173 MyPaper.BranchType = o.BranchType; 174 MyPaper.IsOrderer = o.IsOrderer; 175 MyPaper.nemoType = o.nemoType; 176 MyPaper.sort = o.sort; 177 MyPaper.Update(); 178 } 179 180 this.GoLastPage = function() { 181 o.endNumber = o.pageCount; 182 o.startNumber = Math.floor(o.endNumber / 10) * 10 + 1; 183 o.currentPage = o.endNumber; 184 o.GoPage(); 185 }; 186 187 this.GoFirstPage = function() { 188 o.startNumber = 1; o.endNumber = 10; 189 o.currentPage = o.startNumber; 190 o.GoPage(); 191 }; 192 this.GoNextPage = function() { 193 o.startNumber += 10; o.endNumber += 10; 194 if (o.endNumber > o.pageCount) o.endNumber = o.pageCount; 195 o.currentPage = o.startNumber; 196 o.GoPage(); 197 }; 198 199 this.GoPrevPage = function() { 200 o.startNumber -= 10; o.endNumber -= 10; 201 o.endNumber = Math.ceil(o.endNumber / 10) * 10; 202 if (o.startNumber < 1) o.endNumber = 1; 203 if (o.endNumber < 10) o.endNumber = 10; 204 o.currentPage = o.endNumber; 205 o.GoPage(); 206 }; 207} 208 209function fn_toggle_mypaper(paperId, communityType) 210{ 211 if($j("#paperAll_" + paperId).css("display") == "none") 212 { 213 fn_show_mypaper(paperId, communityType); 214 } 215 else 216 { 217 fn_hide_mypaper(paperId, communityType); 218 } 219} 220 221function fn_show_mypaper(paperId) 222{ 223 if($j("#paperAll_" + paperId).html().length < 1) 224 { 225 $j.get("/ucl/shop/product/ajax/viewmypaperall.aspx?paperid=" + paperId + "&IsMore=1", function(data) { 226 $j("#paperAll_" + paperId).html(data) 227 }); 228 } 229 $j("#paperAll_" + paperId).show(); 230 $j("#paperShort_" + paperId).hide(); 231} 232 233function fn_show_mypaper(paperId, communityType) 234{ 235 if($j("#paperAll_" + paperId).html().length < 1) 236 { 237 $j.get("/ucl/shop/product/ajax/viewmypaperall.aspx?paperid=" + paperId + "&IsMore=1&communityType=" + communityType, function(data) { 238 $j("#paperAll_" + paperId).html(data) 239 }); 240 } 241 $j("#paperAll_" + paperId).show(); 242 $j("#paperShort_" + paperId).hide(); 243} 244 245function fn_hide_mypaper(paperId) 246{ 247 if($j("#paperShort_" + paperId).html().length < 1) 248 { 249 $j.get("/ucl/shop/product/ajax/viewmypaperall.aspx?paperid=" + paperId + "&IsMore=0", function(data) { 250 $j("#paperShort_" + paperId).html(data) 251 }); 252 } 253 $j("#paperAll_" + paperId).hide(); 254 $j("#paperShort_" + paperId).show(); 255} 256 257function fn_toggle_mypaper_utf8(paperId, communityType) { 258 if ($j("#paperAll_" + paperId).css("display") == "none") { 259 fn_show_mypaper_utf8(paperId, communityType); 260 } 261 else { 262 fn_hide_mypaper_utf8(paperId, communityType); 263 } 264} 265 266function fn_show_mypaper_utf8(paperId) { 267 if ($j("#paperAll_" + paperId).html().length < 1) { 268 $j.get("/ucl/shop/product/ajax/viewmypaperall_v2.aspx?paperid=" + paperId + "&IsMore=1", function (data) { 269 $j("#paperAll_" + paperId).html(data) 270 }); 271 } 272 $j("#paperAll_" + paperId).show(); 273 $j("#paperShort_" + paperId).hide(); 274} 275 276function fn_show_mypaper_utf8(paperId, communityType) { 277 if ($j("#paperAll_" + paperId).html().length < 1) { 278 $j.get("/ucl/shop/product/ajax/viewmypaperall_v2.aspx?paperid=" + paperId + "&IsMore=1&communityType=" + communityType, function (data) { 279 $j("#paperAll_" + paperId).html(data) 280 }); 281 } 282 $j("#paperAll_" + paperId).show(); 283 $j("#paperShort_" + paperId).hide(); 284} 285 286function fn_hide_mypaper_utf8(paperId) { 287 if ($j("#paperShort_" + paperId).html().length < 1) { 288 $j.get("/ucl/shop/product/ajax/viewmypaperall_v2.aspx?paperid=" + paperId + "&IsMore=0", function (data) { 289 $j("#paperShort_" + paperId).html(data) 290 }); 291 } 292 $j("#paperAll_" + paperId).hide(); 293 $j("#paperShort_" + paperId).show(); 294} 295 296function fn_paper_util(type, paperId, countdiv) { 297 $j.ajax({ 298 type: "POST", 299 url: "/ucl/shop/product/ajax/CommunityPaperUtilAjax.aspx", 300 data: Common.format("action={0}&PaperId={1}", type, paperId), 301 cache: false, 302 success: function(data) { 303 var result, list, listData; 304 eval("result = " + data); 305 alert(result.Message); 306 } 307 }); 308} 309 310function fn_paper_recommend(communityType, action, paperId) { 311 $j.ajax({ 312 type: "POST", 313 url: "/ucl/shop/product/ajax/CommunityPaperUtilAjax.aspx", 314 data: Common.format("action={0}&PaperId={1}", action, paperId), 315 cache: false, 316 success: function (data) { 317 var result, list, listData; 318 eval("result = " + data); 319 alert(result.Message); 320 321 var page, orderer = 1; 322 var sort = 2; 323 switch(communityType) 324 { 325 case 'CommentReview': 326 if (typeof fn_CommentReview_Update === "function") { 327 fn_CommentReview_Update(); 328 } 329 break; 330 case 'MyReview': 331 page = $j('#hfMyReviewCurrentPage').val(); 332 orderer = $j('#hfMyReviewOrderer').val(); 333 sort = $j('#hfMyReviewSort').val(); 334 335 if (typeof fn_MyReview_Update === "function") { 336 fn_MyReview_Update(page, orderer, sort); 337 } 338 break; 339 case 'MyPaper': 340 page = $j('#hfMyPaperCurrentPage').val(); 341 sort = $j('#hfMyPaperSort').val(); 342 343 if (typeof fn_MyPaper_Update === "function") { 344 fn_MyPaper_Update(page, sort); 345 } 346 break; 347 } 348 349 } 350 }); 351} 352 353function fn_delete_thanksto(itemId) { 354 var param = { itemId: itemId, method: "DeleteThanksTo" }; 355 $j.ajax({ 356 type: "Get", 357 url: '/m/ajax/m_ajax_deleteThanksto.aspx', 358 data: param, 359 cache: false, 360 dataType: 'json', 361 success: function (data) { 362 if (data.Success == "True") { 363 alert('Thanks To를 ì·¨ìíì ¨ìµëë¤.'); 364 } 365 }, 366 error: function (xhr, ajaxOptions, thrownError) { 367 368 } 369 }); 370} 371 372 373function ProductList() { 374 this.divClass = ""; 375 this.totalCountId = ""; 376 this.name = ""; 377 this.pagerId = ""; 378 this.listId = ""; 379 this.communityType =""; 380 this.totalRowCount = 0; 381 this.currentPage = 1; 382 this.pageSize = 5; 383 this.pageCount = 0; 384 this.startNumber = 1; 385 this.endNumber = 10; 386 this.itemId = 0; 387 this.sort = 1; 388 this.IsOrderer = 2; 389 this.BranchType = 1; 390 var o = this; 391 392 this.ShowList = function() { 393 $j.ajax 394 ({ 395 url: "/ucl/shop/product/ajax/CommunityToJson.aspx", 396 data: "itemId="+ o.itemId +"&pageCount=" + o.pageSize + "&communitytype=" + o.communityType + "&page=" + o.currentPage + "&sort=" + o.sort + "&IsOrderer=" + o.IsOrderer + "&BranchType=" + o.BranchType, 397 success: function(data) { 398 var result, list, listData; 399 eval("result = " + data); 400 o.totalRowCount = result.Total; 401 o.IsEmptyContents(o.totalRowCount); 402 list = result.List; 403 $j(o.listId).empty(); 404 $j.each(list, function(index, paper) { 405 listData = o.GetListItem(paper); 406 $j(o.listId).append(listData); 407 }); 408 if(o.totalRowCount > o.pageSize) 409 o.Paging(); 410 } 411 }); 412 }; 413 414 this.IsEmptyContents = function(total) { 415 if(total < 1 && o.communityType != 'CommentReview') 416 $j(o.divClass).css("display","none"); 417 else 418 $j(o.divClass + " .total").text(total); 419 } 420 421 this.GetListItem = function(paper) { 422 if (o.communityType == "CommentReview") { 423 return Common.format($j(o.divClass + " .template").html(), 424 paper.PaperId, 425 paper.Rank,
426 paper.Paper, 427 paper.BlogUrl, 428 paper.NickName, 429 paper.PaperInDate, 430 paper.RecommendCount, 431 paper.CommentCount, 432 paper.IsOrderer 433 ); 434 } 435 if (o.communityType == "MyReview" || o.communityType == "MyPaper") { 436 return Common.format($j(o.divClass + " .template").html(), 437 paper.PaperId, 438 paper.Rank, 439 paper.Title, 440 Common.decodeHTML(paper.Paper), 441 paper.BlogUrl, 442 paper.NickName, 443 paper.PaperInDate, 444 paper.RecommendCount, 445 paper.CommentCount 446 ); 447 } 448 if (o.communityType == "PhotoReview") { 449 return Common.format($j(o.divClass + " .template").html(), 450 paper.PaperId, 451 paper.RecommendCount, 452 paper.BlogUrl, 453 paper.Title, 454 Common.decodeHTML(paper.htmPhoto), 455 paper.CommentCount, 456 paper.NickName, 457 paper.PaperInDate 458 ); 459 } 460 if (o.communityType == "MyList") { 461 return Common.format($j(o.divClass + " .template").html(), 462 paper.PaperId, 463 Common.decodeHTML(paper.Title), 464 Common.decodeHTML(paper.Paper), 465 paper.ItemCovers, 466 paper.ItemCount, 467 paper.CommentCount, 468 paper.RecommendCount, 469 paper.NickName, 470 paper.PaperInDate, 471 paper.BlogUrl 472 ); 473 } 474 if (o.communityType == "BlogThis") { 475 return Common.format($j(o.divClass + " .template").html(), 476 paper.PaperId, 477 paper.Title, 478 paper.LabelImg, 479 paper.NickName, 480 paper.PaperInDate, 481 paper.PostUrl 482 ); 483 } 484 }; 485 486 this.Paging = function() { 487 o.pageCount = Math.ceil(o.totalRowCount / o.pageSize); 488 var pageLink; 489 490 var _pager = o.pagerId; 491 var _pager_first = _pager + "_first"; 492 var _pager_last = _pager + "_last"; 493 var _pager_prev = _pager + "_prev"; 494 var _pager_next = _pager + "_next"; 495 496 $j(_pager).empty(); 497 if (o.endNumber > o.pageCount) o.endNumber = o.pageCount; 498 var pageClass; 499 for (var page = o.startNumber; page <= o.endNumber; page++) { 500 if (page == o.currentPage) pageClass = "np_numon"; 501 else pageClass = "np_numoff"; 502 pageLink = $j("<div class=\"np_numbox\"><a href=\"#"+o.communityType+"\" class=" + pageClass + ">" + page + " </a></div>") 503 .addClass("np_numoff") 504 .click(function() { 505 o.currentPage = parseInt($j(this).text()); 506 o.ShowList(); 507 }); 508 $j(_pager).append(pageLink); 509 510 } 511 $j(_pager_first).empty(); 512 $j(_pager_prev).empty(); 513 if (o.currentPage > 10) { 514 $j(_pager_prev).append("<div class=\"np_numbox_pre\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\"><img src=\"https://image.aladdin.co.kr/img/browse/page_arr2.gif\" border=\"0\" align=\"absmiddle\" />" + (o.startNumber - 10) + "~" + (o.startNumber - 1) + "</a></div>") 515 .click(o.GoPrevPage); 516 $j(_pager_first).append("<div class=\"np_numbox_first\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\">ì²ì</a></div>").click(o.GoFirstPage); 517 } 518 else { 519 $j(_pager_prev).unbind("click", o.GoPrevPage); 520 } 521 522 $j(_pager_next).empty(); 523 $j(_pager_last).empty(); 524 if (o.pageCount > o.endNumber) { 525 var EndNumber = o.endNumber * 2; 526 if (EndNumber > o.pageCount) EndNumber = o.pageCount; 527 $j(_pager_next).append("<div class=\"np_numbox_next\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\">" + (o.endNumber + 1) + "~" + EndNumber + "<img src=\"https://image.aladdin.co.kr/img/browse/page_arr.gif\" border=\"0\" align=\"absmid
527dle\" /></a></div>") 528 .click(o.GoNextPage); 529 $j(_pager_last).append("<div class=\"np_numbox_last\"><a href=\"#"+o.communityType+"\" class=\"np_numoff\">ë</a></div>").click(o.GoLastPage); 530 } 531 else { 532 $j(_pager_next).unbind("click", o.GoNextPage); 533 } 534 }; 535 536 this.GoLastPage = function() { 537 o.endNumber = o.pageCount; 538 o.startNumber = Math.floor(o.endNumber / 10) * 10 + 1; 539 o.currentPage = o.endNumber; 540 o.ShowList(); 541 }; 542 543 this.GoFirstPage = function() { 544 o.startNumber = 1; o.endNumber = 10; 545 o.currentPage = o.startNumber; 546 o.ShowList(); 547 }; 548 this.GoNextPage = function() { 549 o.startNumber += 10; o.endNumber += 10; 550 if (o.endNumber > o.pageCount) o.endNumber = o.pageCount; 551 o.currentPage = o.startNumber; 552 553 o.ShowList(); 554 }; 555 556 this.GoPrevPage = function() { 557 o.startNumber -= 10; o.endNumber -= 10; 558 o.endNumber = Math.ceil(o.endNumber / 10) * 10; 559 if (o.startNumber < 1) o.endNumber = 1; 560 if (o.endNumber < 10) o.endNumber = 10; 561 o.currentPage = o.endNumber; 562 563 o.ShowList(); 564 }; 565} 566 567Common = {}; 568 569Common.format = function(text) { 570 if (arguments.length <= 1) { 571 return text; 572 } 573 var tokenCount = arguments.length - 2; 574 for (var token = 0; token <= tokenCount; token++) { 575 text = text.replace(new RegExp("\\{" + token + "\\}", "gi"), arguments[token + 1]); 576 } 577 return text; 578}; 579Common.encodeHTML = function(str) { 580 str = str.replace(/&/g, '&'); 581 str = str.replace(/</g, '<'); 582 str = str.replace(/>/g, '>'); 583 return str; 584}; 585Common.decodeHTML = function(str) { 586 str = str.replace(/&/g, '&'); 587 str = str.replace(/</g, '<'); 588 str = str.replace(/>/g, '>'); 589 590 return str; 591}; 592Common.IsEncodeHTML = function(str) { 593 return (str.search(/&/g) != -1 || str.search(/</g) != -1 || str.search(/>/g) != -1) 594}; 595Common.decodeHTMLifEnc = function(str) { 596 if (Common.IsEncodeHTML(str)) 597 str = Common.decodeHTML(str); 598 return str; 599}; 600Common.queryString = function(name) { 601 var q = location.search.replace(/^\?/, '').replace(/\&$/, '').split('&'); 602 for (var i = q.length - 1; i >= 0; i--) { 603 var p = q[i].split('='), key = p[0], val = p[1]; 604 if (name.toLowerCase() == key.toLowerCase()) return val; 605 } 606 return ""; 607}; 608 609function TextLengthCheck(txt, limitLength, countId) 610{ 611 var str = $j(txt).val(); 612 var strLength = 0; 613 var result = ""; 614 for (i = 0; i < str.length; i++) 615 { 616 var code = str.charCodeAt(i) 617 var ch = str.substr(i,1).toUpperCase() 618 619 code = parseInt(code) 620 621 if ((ch < "0" || ch > "9") && (ch < "A" || ch > "Z") && ((code > 255) || (code < 0))) 622 strLength = strLength + 2; 623 else 624 strLength = strLength + 1; 625 626 if(strLength > limitLength){ 627 //alert(limitLength + ' ì ì´ì ì¸ì ììµëë¤.'); 628 alert("íê¸ 140ìê¹ì§ ì ë ¥í ì ììµëë¤. ë 긴 ë´ì©ì 리뷰ë \"ë§ì´ë¦¬ë·° ì°ê¸°\"를 ì´ì©í´ì£¼ì¸ì."); 629 $j(txt).val(result); 630 return; 631 } 632 else result += str.charAt(i); 633 } 634 $j(countId).text(strLength); 635} 636 637function fn_wrap_hanja(id) { 638 var obj = $j("#"+id); 639 if(obj) { 640 var htm = obj.text(); 641 var newHtm = ""; 642 for(i = 0; i< htm.length; i++) 643 { 644 var code = htm.charCodeAt(i); 645 if ( (0x3400 <= code && code <= 0x4DBF) || (0x4E00 <= code && code <= 0x9FBF) || (0x20000 <= code && code <= 0x2A6DF) || (0x2F800 <= code && code <= 0x2FA1F) || (0xF900 <= code && code <= 0xFAFF) || (0x9FA6 <= code && code <= 0x9FBB) ) { 646 newHtm += '<span class="hanja">' + htm.charAt(i) + '</span>'; 647 } 648 else newHtm += htm.charAt(i); 649 } 650 obj.html(newHtm); 651 } 652} 653 654function fn_helpLayer_Toggle(divId) 655{ 656 var id = "#" + divId; 657 $j(id).toggle(); 658} 659 660function fn_helpLayer_Toggle_V1(divId) 661{ 662 var id = "#help_" + divId; 663 if ($j(id).html().length < 1) { 664 var isbn = $j("input[class='hd_ISBN'][type='hidden']").val(); 665 if (isbn.length < 1 || isbn == "0") { 666 alert("ìíì ì íí´ì£¼ì¸ì."); 667 return; 668 } 669 670 $j.get("/shop/product/getContents.aspx?isbn=" + isbn + "&name=" + divId + "&t
670ype=1", function (data) { 671 $j(id).html(data).show(); 672 }); 673 674 if (divId.toLowerCase() == "timeline" || divId.toLowerCase() == "timeline_rebind") { 675 $j("#btnHelpLayer").addClass("imgOpen"); 676 } 677 } 678 else { 679 $j(id).toggle(); 680 681 if (divId.toLowerCase() == "timeline" || divId.toLowerCase() == "timeline_rebind") { 682 if($j("#btnHelpLayer").hasClass("imgOpen")) { 683 $j("#btnHelpLayer").removeClass("imgOpen"); 684 } 685 else { 686 $j("#btnHelpLayer").addClass("imgOpen"); 687 } 688 } 689 } 690} 691 692function fn_helpLayer_Toggle_V2(divId) { 693 var id = "#help_" + divId; 694 if ($j(id).html().length < 1) { 695 var isbn = $j("input[class='hd_ISBN'][type='hidden']").val(); 696 if (isbn.length < 1 || isbn == "0") { 697 alert("ìíì ì íí´ì£¼ì¸ì."); 698 return; 699 } 700 701 $j.get("/shop/product/getContents.aspx?isbn=" + isbn + "&name=" + divId + "&type=2", function (data) { 702 $j(id).html(data).show(); 703 }); 704 705 if (divId.toLowerCase() == "timeline" || divId.toLowerCase() == "timeline_rebind") { 706 $j("#btnHelpLayer").addClass("imgOpen"); 707 } 708 } 709 else { 710 $j(id).toggle(); 711 712 if (divId.toLowerCase() == "timeline" || divId.toLowerCase() == "timeline_rebind") { 713 if ($j("#btnHelpLayer").hasClass("imgOpen")) { 714 $j("#btnHelpLayer").removeClass("imgOpen"); 715 } 716 else { 717 $j("#btnHelpLayer").addClass("imgOpen"); 718 } 719 } 720 } 721} 722 723function fn_helpLayer_Toggle_V3(obj, divId) { 724 var id = "#help_" + divId; 725 if ($j(id).html().length < 1) { 726 727 var pos = $j(obj).position(); 728 //console.log("left: " + pos.left + "px, top: " + pos.top + "px"); 729 730 var isbn = $j("input[class='hd_ISBN'][type='hidden']").val(); 731 if (isbn.length < 1 || isbn == "0") { 732 alert("ìíì ì íí´ì£¼ì¸ì."); 733 return; 734 } 735 736 $j.get("/shop/product/getContents.aspx?isbn=" + isbn + "&name=" + divId + "&t
736ype=1", function (data) { 737 $j(id).css("margin-left", pos.left); 738 $j(id).html(data).show(); 739 }); 740 741 if (divId.toLowerCase() == "timeline" || divId.toLowerCase() == "timeline_rebind") { 742 $j("#btnHelpLayer").addClass("imgOpen"); 743 } 744 } else { 745 $j(id).toggle(); 746 747 if (divId.toLowerCase() == "timeline" || divId.toLowerCase() == "timeline_rebind") { 748 if ($j("#btnHelpLayer").hasClass("imgOpen")) { 749 $j("#btnHelpLayer").removeClass("imgOpen"); 750 } 751 else { 752 $j("#btnHelpLayer").addClass("imgOpen"); 753 } 754 } 755 } 756} 757 758function fn_Layer_Visible(id){ 759 var id = "#" + id; 760 $j(id).show(); 761} 762function fn_Layer_Hidden(id){ 763 var id = "#" + id; 764 $j(id).hide(); 765} 766function pop_Video(url){ 767 window.open(url,'Video','scrollbars=no,width=800,height=600'); 768} 769function fn_toggle_introduce(Type) { 770 if($j("#btn_" + Type).attr("src").match(/_more/)) { 771 $j("#btn_" + Type).attr("src",$j("#btn_" + Type).attr("src").replace("_more","_summary")); 772 fn_show_introduce(Type); 773 } 774 else { 775 $j("#btn_" + Type).attr("src",$j("#btn_" + Type).attr("src").replace("_summary","_more")); 776 fn_hide_introduce(Type); 777 } 778} 779function fn_show_introduce(Type){ 780 $j("#div_" + Type + "_All").show(); 781 $j("#div_" + Type + "_Short").hide(); 782} 783 784function fn_hide_introduce(Type){ 785 $j("#div_" + Type + "_All").hide(); 786 $j("#div_" + Type + "_Short").show(); 787} 788 789function PopUpExpandImg(img){ 790 var strImg = "/blog/mylibrary/pop/wimageview.aspx?img=" + escape(img); 791 window.open(strImg,"ExpandImg","width=1, height=1, scrollbars=yes"); 792} 793 794 795//ìííì´ì§ ì´ë²¤í¸ëê¸ 796function fn_product_eventcomment() { 797 this.ItemId = 0; 798 this.EventId = 0; 799 this.PageSize = 5; 800 this.Update = function () { 801 var o = this; 802 var comment = $j("#txt_eventComment").val(); 803 $j.ajax({ 804 url: "/ucl/shop/product/ajax/EventCommentAjax.aspx", 805 cache: false, 806 dataType: 'json', 807 data: "ItemId=" + this.ItemId + "&Comment=" + escape(comment) + "&EventId=" + this.EventId + "&action=insert&dummy=" + escape(new Date().getTime()), 808 success: function (data) { 809 if (data.Result == "true") { 810 alert("ë±ë¡ëììµëë¤."); 811 $j("#txt_eventComment").val(""); //ì½ë©í¸ ë¹ì°ê¸° 812 o.ToggleLayer(); 813 o.LoadList(); 814 return; 815 } 816 else { 817 alert(data.ErrMsg); 818 } 819 }, 820 error: function (xhr, ajaxOptions, thrownError) { 821 alert(thrownError); 822 } 823 }); 824 }; 825 826 this.Delete = function (commentId, action) { 827 if (!confirm("ì ë§ë¡ ìì íìê² ìµëê¹?")) 828 return false; 829 830 if (action == null || action == "undefined") 831 action = "delete"; 832 833 var o = this; 834 $j.ajax({ 835 url: "/ucl/shop/product/ajax/EventCommentAjax.aspx", 836 cache: false, 837 dataType: 'json', 838 data: "ItemId=" + o.ItemId + "&CommentId=" + commentId + "&action=" + action + "&dummy=" + escape(new Date().getTime()), 839 success: function (data) { 840 if (data.Result == "true") { 841 o.LoadList(); 842 return; 843 } 844 else { 845 alert(data.ErrMsg); 846 } 847 }, 848 error: function (xhr, ajaxOptions, thrownError) { 849 alert(thrownError); 850 } 851 }); 852 }; 853 854 855 this.LoadPage = function (obj) { 856 var o = this; 857 var url = $j(obj).attr('href'); 858 return o.DoLoad(url, true); 859 }; 860 861 this.LoadList = function () { 862 var o = this; 863 var url = "/ucl/shop/product/ajax/EventCommentAjax.aspx?ItemId=" + o.ItemId + "&action=list&pageSize=" + o.PageSize; 864 return o.DoLoad(url, false); 865 }; 866 867 this.DoLoad = function (url, isChangeTop) { 868 var $loadbox = $j('#np_eventcommentlist'); 869 $loadbox.load(url); 870 if (isChangeTop) { 871 var taget_top = $loadbox.offset().top - 150; //íì´íìì 100 872 $j('html, body').animate({ scrollTop: taget_top }, 500); 873 } 874 return false;
875 }; 876 877 this.ToggleLayer = function () { 878 $j('#div_product_eventcommentLayer').toggle(); 879 } 880} 881 882// v2019 using wa_common_underline 883function fn_community_more() { 884 this.communityType = ''; 885 this.contentType = ''; 886 this.itemId = 0; 887 this.pageSize = 3; 888 this.paperLength = 0; 889 this.pageObj = null; 890 this.pagerObj = null; 891 this.updatesObj = null; 892 this.rootObj = null; 893 this.page = 1; 894 this.tmpPageHtml = ''; 895 this.htmFormat = ''; 896 this.htmMoreObj = ''; 897 898 var o = this; 899 this.Update = function () { 900 $j.ajax({ 901 url: "/ucl/shop/product/ajax/GetCommunityMoreAjax.aspx", 902 cache: false, 903 dataType: 'json', 904 data: Common.format("itemid={0}&communitytype={1}&page={2}&pagesize={3}&paperlength={4}&contenttype={5}" 905 , o.itemId, o.communityType, $j(o.pageObj).val(), o.pageSize, o.paperLength, o.contentType), 906 success: function (data) { 907 $j.each(data.List, function (index, paper) { 908 if (o.communityType == "Underline") { 909 910 if (eval(paper.IsMore)) { 911 paper.Phrase = Common.format("{0}... {1}", paper.Phrase, Common.format(o.htmMoreObj, "ë보기", "img/shop/2018/icon_arrow_more.png")); 912 paper.PhraseAll = Common.format("{0} {1}", paper.PhraseAll, Common.format(o.htmMoreObj, "ì 기", "img/shop/2018/icon_arrow_fold.png")); 913 } 914 915 if (paper.PhotoImage == "") { 916 paper.Phrase = decodeURIComponent(paper.Phrase); 917 paper.PhraseAll = decodeURIComponent(paper.PhraseAll); 918 } 919 920 var htm = Common.format(o.htmFormat 921 , paper.RowNum 922 , paper.PageNo 923 , paper.Phrase 924 , paper.PhraseAll 925 , paper.btnMore 926 , paper.NickName 927 , paper.PaperLink 928 , paper.NickNameLink); 929 930 $j(o.updatesObj).append(htm); 931 } 932 }); 933 934 if (parseInt(data.Remainder) > 0) { 935 o.page = $j(o.pageObj).val(); 936 $j(o.pageObj).val(parseInt(o.page) + 1); 937 } 938 else { 939 $j(o.pagerObj).hide(); 940 } 941 942 if (data.TotalCount == 0) { 943 $j(o.rootObj).hide(); 944 } 945 }, 946 error: function (xhr, ajaxOptions, thrownError) { 947 console.log(thrownError); 948 } 949 }); 950 }; 951 952 this.ToggleLayer = function () { 953 var prefix = o.communityType + o.contentType; 954 var btn = $j(".cl_" + prefix); 955 var container = $j("#container_" + prefix); 956 var cont = $j("#" + prefix + "Updates"); 957 if (btn.hasClass("on")) { 958 btn.removeClass("on"); 959 container.hide(); 960 btn.find("div:eq(0)").removeClass().addClass("book_cb10"); 961 } else { 962 if (cont.text().length < 1) { 963 o.page = $j(o.pageObj).val(); 964 o.Update(); 965 } 966 btn.addClass("on"); 967 container.show(); 968 btn.find("div:eq(0)").removeClass().addClass("book_cb11"); 969 } 970 971 } 972} 973 974function fn_toggle_contents(el) { 975 var obj = $j("#" + el); 976 var objMore = $j("#" + el + "_more"); 977 978 if (objMore.css("display") == "none") { 979 $j(obj).hide(); 980 $j(objMore).show(); 981 } else { 982 $j(obj).show(); 983 $j(objMore).hide(); 984 } 985} 986 987function fn_ReviewPolicy_Show(sectionKey) { 988 var $box = $j("#help_ReviewPolicy_" + sectionKey); 989 if ($box.length < 1) { return false; } 990 991 var $body = $box.find(".rp-pop-body"); 992 993 if ($body.html().length < 1) { 994 $j.get("/shop/product/getContents.aspx?name=ReviewPolicy&type=2", function (data) { 995 $body.html(data); 996 $box.show(); 997 }); 998 } else { 999 $box.toggle(); 1000 } 1001 return false;
1002} 1003 1004function fn_ReviewPolicy_Hide(sectionKey) { 1005 $j("#help_ReviewPolicy_" + sectionKey).hide(); 1006 return false; 1007}
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.