1/** 2 * 3 */ 4jindo.$Fn(function() { 5 var welSelectedWeekday = jindo.$Element('dailyList').query('div.on'); 6 if (welSelectedWeekday == null) { 7 changeSelect(getCurrentWeekdayName()); 8 } 9}).attach(document, 'domready'); 10 11jindo.$Fn(function() { 12 /* sorting */ 13 jindo.$Fn(function() { 14 jindo.$ElementList('.sort_box').show(); 15 }).attach(jindo.$("_sortLink"), 'click'); 16 new jindo.LayerManager(jindo.$$.getSingle('.sort_box')).link(jindo.$("_sortLink")); 17 18 jindo.$Fn(onClickSorting).attach(jindo.$$(".sort_box a"), 'click'); 19 20 // ìì¼ ì í ì´ë²¤í¸ ì²ë¦¬ 21 jindo.$Element('dailyList').attach({ 22 'click@._weekdaySelect' : function(oEvent) { 23 oEvent.stopDefault(); 24 changeSelect(jindo.$Element(oEvent.element).data('weekday')); 25 } 26 }); 27 28}).attach(window, 'load'); 29 30 31var WebtoonTypeSelector = jindo.$Class({ 32 $autoBind : true, 33 34 $init : function(options) { 35 this.welWrap = jindo.$Element(jindo.$$.getSingle(options.selectorWrap)); 36 this.hasCompleteWebtoon = options.hasCompleteWebtoon; 37 this.webtoonCompleteType = options.webtoonCompleteType; 38 39 /* fixed type selector */ 40 jindo.$Fn(this._checkTypeSelector, this).attach(window, 'scroll'); 41 42 if(this.hasCompleteWebtoon) { 43 // type selector click event 44 jindo.$Fn(this._onClickType).attach(jindo.$$("._type_selector li"), 'click'); 45 if(this.webtoonCompleteType) { 46 var position = this._getTypePosition(this.webtoonCompleteType); 47 this._moveScrollTo(position, this.webtoonCompleteType); 48 } 49 } 50 }, 51 52 _onClickType : function(event) { 53 event.stopBubble(); 54 event.stopDefault(); 55 56 var type = jindo.$Element(event.currentElement).data('type'); 57 var position = this._getTypePosition(type); 58 this._moveScrollTo(position, type); 59 }, 60 61 _getTypePosition : function(type) { 62 var _TOP_MARGIN = 70; 63 var position = jindo.$$.getSingle("._type_title[data-type=" + type + "]").offsetTop - _TOP_MARGIN; 64 return position; 65 }, 66 67 _checkTypeSelector : function(event) { 68 this._setTypeSelectorPosition(); 69 70 if(this.hasCompleteWebtoon) { 71 this._changeTypeMark(); 72 } 73 }, 74 75 _setTypeSelectorPosition : function(){ 76 if(jindo.$Document().scrollPosition().top > 100) { 77 this.welWrap.css({ 78 position : 'fixed', 79 top : '0px', 80 }); 81 } 82 else { 83 this.welWrap.css({ 84 position : 'absolute', 85 top : '' 86 }); 87 } 88 }, 89 90 // íì¬ ìì¹ì ë°ë¼ type ë§í¬ ë³ê²½ 91 _changeTypeMark : function() { 92 var typeTitles = jindo.$$("._type_title"); 93 for(var i=0; i < typeTitles.length; i++) { 94 if(typeTitles[i].offsetTop+120 > jindo.$Document().scrollPosition().top && typeTitles[i].offsetTop+120 < jindo.$Document().scrollPosition().top + jindo.$Document().clientSize().height/2) { 95 var type = jindo.$Element(typeTitles[i]).data("type"); 96 jindo.$ElementList(jindo.$$("._type_selector li.on")).removeClass("on"); 97 jindo.$Element(jindo.$$.getSingle("._type_selector li[data-type=" + type + "]")).addClass("on"); 98 return; 99 } 100 } 101 }, 102 103 // ì¤í¬ë¡¤ì ë¶ëë½ê² ì´ë 104 _moveScrollTo : function(position, type) { 105 var currentPosition = jindo.$Document().scrollPosition().top; 106 new jindo.Morph() 107 .pushAnimate(500, [ 108 document.body, { 109 "scrollTop" : jindo.Effect.sinusoidal(currentPosition, position) 110 }, 111 document.documentElement, { 112 "scrollTop" : jindo.Effect.sinusoidal(currentPosition, position) 113 } 114 ]) 115 .pushCall(jindo.$Fn(function() { 116 // íì¬ íê³¼ ì§ì ë íì´ ì¼ì¹íì§ ìë ê²½ì°, ì§ì ë íì¼ë¡ ë³ê²½ 117 if(type != undefined) { 118 if(this._getCurrentType() != type) { 119 jindo.$ElementList(jindo.$$("._type_selector li.on")).removeClass("on"); 120 jindo.$Element(jindo.$$.getSingle("._type_selector li[data-type=" + type + "]")).addClass("on"); 121 } 122 } 123 }, this).bind()) 124 .play(); 125 }, 126 127 // íì¬ ì íë íì ì ê°ì ¸ì¨ë¤ 128 _getCurrentType : function() { 129 var selectedTypeEl = jindo.$$.getSingle("._type_selector li.on"); 130 if(selectedTypeEl == null) { 131 return null; 132 } 133 return jindo.$Element(selectedTypeEl).data('type'); 134 }, 135}); 136 137 138 139 140 141 142/** 143 * ìì¼ ì í ë³ê²½ ì²ë¦¬ 144 * 145 * @param sWeekdayName {String} ë³ê²½í ìì¼ ì´ë¦ 146 */ 147function changeSelect(sWeekdayName) { 148 // 기존 ì í í´ì 149 var welSelectedList = jindo.$Element('dailyList').query('.on'); 150 if (welSelectedList) { 151 var morph = new jindo.Morph({ 152 bUseTransition: true, 153 fEffect : jindo.Effect.linear 154 }); 155 156 157 morph.pushAnimate(1000, [ 158 document.body, { 159 '@backgroundColor' : jindo.Effect.cubicEaseIn('#f00') 160 } 161 ]); 162 163 welSelectedList.removeClass('on'); 164 } 165 166 // ìë¡ ì í 167 var wel = jindo.$Element('dailyList').query('._list_' + sWeekdayName); 168 wel.addClass('on'); 169} 170 171function onClickSorting(event) { 172 var sWeekday = jindo.$Element('dailyList').query('.daily_section.on a._weekdaySelect').data('weekday'); 173 var sSortOrder = jindo.$Element(event.currentElement).data('sort'); 174 var welSelectedTab = jindo.$Element(jindo.$$.getSingle('._type_selector li.on')); 175 var webtoonCompleteType = "ONGOING"; 176 if (welSelectedTab != null) { 177 webtoonCompleteType = welSelectedTab.data('type'); 178 } 179 180 var sClickCode = ''; 181 if (sSortOrder == 'UPDATE') { 182 sClickCode = 'sortdate'; 183 } else if (sSortOrder == 'LIKEIT') { 184 sClickCode = 'sortrate'; 185 } else if (sSortOrder == 'READ_COUNT') { 186 sClickCode = 'sortview'; 187 } 188 //clickcr(this, 'dsd.' + sClickCode, '', '', event, sNclkLanguageCode); 189
190 location.href = '/dailySchedule?weekday=' + sWeekday + '&sortOrder=' + sSortOrder + '&webtoonCompleteType=' + webtoonCompleteType; 191} 192 193/** 194 * ì¤ë ìì¼ ì´ë¦ ê°ì ¸ì¤ê¸° 195 * 196 * @return {String} a tagì data-weekdayê° 197 */ 198function getCurrentWeekdayName() { 199 var oDate = jindo.$Date(); 200 var nDay = oDate.day() - 1 < 0 ? 6 : oDate.day() - 1; // ììì¼ì´ 맨 ìì ëìì 201 // ì¶ê° ì²ë¦¬ 202 return jindo.$Element('dailyList').queryAll('a._weekdaySelect')[nDay].data('weekday'); 203}
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.