PageSourceSearch

https://dongmanmanhua.cn/js/dailySchedule.js

js dongmanmanhua.cn collected 2026-10-02 03:06:35 UTC 5,905 bytes, 203 lines download raw bytes

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.