1$.fn.wingNextPage = function(option) { 2 if (!option) option = []; 3 4 let $this = this; 5 this.placeholder = $(this); // ë¶ì¬ë£ê¸° 본문 ìì¹ 6 this.file_name = option.file_name; // ì¤í¨ íì¼ ëª 7 this.module_name = option.module_name; // ì¤í¨ 모ë ëª 8 this.page = option.page || 1; // íì¬ íì´ì§ 9 this.mode = option.mode || 'append'; // ë¶ì¬ë£ê¸° 모ë append/replace/replace_all 10 this.handle = option.handle || null; // ë보기 ë²í¼ (ë§ì§ë§ íì´ì§ìì hidden) 11 this.complete = option.complete || null; // ë¶ì¬ë£ê¸° ìë£ í ì½ë°± í¨ì 12 13 if (typeof window.wing_morepages == 'undefined') { 14 window.wing_morepages = {}; 15 } 16 window.wing_morepages['module_'+this.module_name] = this; 17 18 $this.load = function(event_type) { 19 let param = { 20 'exec_file': 'skin_module/moduleloader.php', 21 'file_name': $this.file_name, 22 'module_name': $this.module_name, 23 'page': $this.page, 24 'uri': location.href, 25 'add_mode': $this.mode, 26 'event_type': event_type 27 } 28 $.get(root_url+'/main/exec.php', param, function(ret) { 29 if (ret.status == 'success') { 30 if ($this.handle) { 31 if (ret.html == '' || ret.end_page == $this.page) { 32 if ($this.handle && $this.handle.length > 0) { 33 $this.handle.hide(); 34 } 35 } else { 36 $this.handle.show(); 37 } 38 } 39 40 $this.placeholder.html(ret.html); 41 if (typeof $this.complete == 'function') { 42 $this.complete(); 43 } 44 45 if ($this.mode == 'replace' || $this.mode == 'replace_all') { 46 document.scrollingElement.scrollTop = $this.placeholder.offset().top-100; // 모ë°ì¼ 47 $(document.body).scrollTop($this.placeholder.offset().top-100); 48 } 49 } else { 50 console.log(this.message); 51 } 52 }); 53 } 54 55 $this.next = function() { 56 let url = location.href.split('#'); 57 58 // íì¬ ëª¨ëì ì ì¸í 기존 íë¼ë©í° ì ì§ 59 let param = ''; 60 for([key, val] of new URLSearchParams(url[1]).entries()) { 61 if (key == 'module_'+$this.module_name) continue; 62 if (param) param += '&'; 63 param += key+'='+val; 64 }; 65 66 // íì¬ëª¨ëì ë§í¬ ì¶ê° 67 $this.page = parseInt($this.page)+1; 68 if (param) param += '&'; 69 param += 'module_'+$this.module_name+'='+$this.page; 70 71 location.href = '#'+param; 72 } 73 74 $this.param = function(p) { 75 let url = location.href.split('#'); 76 77 // íì´ì§ ì´ê¸°í 78 $this.page = 0; 79 80 // íì¬ ëª¨ëì ì ì¸í 기존 íë¼ë©í° ì ì§ 81 let param = ''; 82 loop1:for([key, val] of new URLSearchParams(url[1]).entries()) { 83 for (k in p) { 84 if (key == k) continue loop1; 85 } 86 if (key == 'module_'+$this.module_name) val = 1; 87 if (param) param += '&'; 88 param += key+'='+val; 89 }; 90 91 for (k in p) { 92 if (param) param += '&'; 93 param += k+'='+p[k]; 94 } 95 location.href = '#'+param; 96 } 97 98 return this; 99} 100 101$(window).on('hashchange load', function(event) { 102 let url = location.href.split('#'); 103 let entries = new URLSearchParams(url[1]); 104 105 for (let key in window.wing_morepages) { 106 let module = window.wing_morepages[key]; 107 let page = entries.get(key); 108 if (page == null) page = 1; 109 module.page = page; 110 module.load(event.type); 111 } 112});
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.