PageSourceSearch

https://www.anohana.jp/js/anohana.util.floatLoader.js

js anohana.jp collected 2026-10-02 05:39:56 UTC 16,899 bytes, 523 lines download raw bytes

1// JavaScript Document
2var FloatLoader = (function() {
3	//public static
4	FloatLoader.loadedArr		= new Array();
5	FloatLoader.loadedCount		= 0;
6	FloatLoader.scroller;
7	
8	//constructor
9	function FloatLoader() {
10		//private
11		var _myNode;
12		var _scrollTimer;
13		var _prevHeight = 0;
14		var _targetHTML		= [];
15		var _targets		= [];
16		
17		var init = function() {
18			_targetHTML.push("news/index.html");
19			_targetHTML.push("theater/index.html");
20			_targetHTML.push("tv_series/index.html");
21			_targetHTML.push("ticket/index.html");
22			_targetHTML.push("project/index.html");
23			_targetHTML.push("campaign/index.html");
24			_targetHTML.push("comment/index.html");
25			_targetHTML.push("bluray_dvd/index.html");
26			_targetHTML.push("review/index.html");
27			
28			_window.bind(Event.OPEN_FLOAT, openFloat);
29			_window.bind(Event.CLOSE_FLOAT, floatClose);
30			_window.bind(Event.MOVE_FLOAT, moveFloat);
31		}
32		
33		var openFloat = function() {
34			if (FloatLoader.loadedArr.length >= _targetHTML.length)	{
35				showFloat();
36			} else {
37				FloatLoader.loadedArr = [];
38				FloatLoader.loadedCount = 0;
39				loadFloat();
40			}
41		}
42		
43		var loadFloat = function() {
44			$.ajax({
45				scriptCharset : 'utf-8',
46				type : "GET",
47				url : _targetHTML[FloatLoader.loadedCount] + '?cache=' + new Date().getTime(),
48				dataType : 'text',
49				success : function(text) {
50					var _text = text.split('<!-- contents -->')[1].split('<!-- /contents -->')[0];
51					
52					switch(FloatLoader.loadedCount) {
53						case 0	:
54							_text = _text.split('"img').join('"news/img');
55						break;
56						case 1	:
57							_text = _text.split('"img').join('"theater/img');
58						break;
59						case 2	:
60							_text = _text.split('"img').join('"tv_series/img');
61						break;
62						case 3	:
63							_text = _text.split('"img').join('"ticket/img');
64						break;
65						case 4	:
66							_text = _text.split('"img').join('"project/img');
67						break;
68						case 5 :
69							_text = _text.split('"img').join('"campaign/img');
70						break;
71						case 6 :
72							_text = _text.split('"img').join('"comment/img');
73						break;
74						case 7 :
75							_text = _text.split('"img').join('"bluray_dvd/img');
76						break;
77						case 8 :
78							_text = _text.split('"img').join('"review/img');
79						break;
80					}
81				
82					_text = _text.split('#index').join("javascript:moveContents('#index');");
83					_text = _text.split('#intro').join("javascript:moveContents('#intro');");
84					_text = _text.split('#story').join("javascript:moveContents('#story');");
85					_text = _text.split('#staff_cast').join("javascript:moveContents('#staff_cast');");
86					_text = _text.split('#character').join("javascript:moveContents('#character');");
87					_text = _text.split('#movie').join("javascript:moveContents('#movie');");
88					_text = _text.split('#music').join("javascript:moveContents('#music');");
89					_text = _text.split('#review').join("javascript:moveContents('#review');");
90					
91					_text = _text.split('#news').join("javascript:moveFloat('news');");
92					_text = _text.split('#theater').join("javascript:moveFloat('theater');");
93					_text = _text.split('#goods').join("javascript:moveFloat('goods');");
94					_text = _text.split('#tv_series').join("javascript:moveFloat('goods');");
95					_text = _text.split('#ticket').join("javascript:moveFloat('ticket');");
96					_text = _text.split('#webradio').join("javascript:moveFloat('webradio');");
97					_text = _text.split('#project').join("javascript:moveFloat('project');");
98					_text = _text.split('#event').join("javascript:moveFloat('event');");
99					_text = _text.split('#package&blu-ray').join("javascript:moveContents('package&blu-ray');");
100					_text = _text.split('#package&secret-base').join("javascript:moveContents('package&secret-base');");
101					_text = _text.split('#package&sound-track').join("javascript:moveContents('package&sound-track');");
102					_text = _text.split('#package&theme-song').join("javascript:moveContents('package&theme-song');");
103					_text = _text.split('#package').join("javascript:moveContents('package');");
104					_text = _text.split('#campaign').join("javascript:moveContents('campaign');");
105					_text = _text.split('#comment').join("javascript:moveFloat('comment');");
106					_text = _text.split('#review').join("javascript:moveFloat('review');");
107
108					FloatLoader.loadedArr.push(_text);
109					FloatLoader.loadedCount ++;
110					
111					if (FloatLoader.loadedCount >= _targetHTML.length) {
112						showFloat();
113					} else {
114						loadFloat();
115					}
116				},
117				error : function() {
118					console.log('get_error');
119				}
120			});
121		}
122		
123		var showFloat = function() {
124			
125			var _src;
126			switch(CURRENT_FLOAT)	{
127				case AnohanaFloat.NEWS	:
128					_src = 0;
129				break;
130				case AnohanaFloat.THEATER	:
131					_src = 1;
132				break;
133				case AnohanaFloat.TV_SERIES :
134					_src = 2;
135				break;
136				case AnohanaFloat.TICKET :
137					_src = 3;
138				break;
139				case AnohanaFloat.WEB_RADIO :
140					_src = 4;
141				break;
142				case AnohanaFloat.PROJECT :
143					_src = 5;
144				break;
145				case AnohanaFloat.CAMPAIGN :
146					//_src = 6;
147					_src = 10
148				break;
149				case AnohanaFloat.SUMMER_EVENT :
150					_src = 7;
151				break;
152				case AnohanaFloat.COMMENT :
153					//_src = 8;
154					_src = 6;
155				break;
156				case AnohanaFloat.BLURAY_DVD :
157					_src = 9;
158				break;
159				case AnohanaFloat.REVIEW	 :
160					//_src = 10;
161					_src = 8;
162				break;
163			}
164	
165			var _title;
166			switch(CURRENT_FLOAT)	{
167				case AnohanaFloat.NEWS	:
168					_title = '<img src="img/lightbox/common/title_news.gif" width="46" />';
169				break;
170				case AnohanaFloat.THEATER	:
171					_title = '<img src="img/lightbox/common/title_theater.gif" width="46" />';
172				break;
173				case AnohanaFloat.TV_SERIES :
174					_title = '<img src="img/lightbox/common/title_tvseries.gif" width="46" />';
175				break;
176				case AnohanaFloat.TICKET :
177					_title = '<img src="img/lightbox/common/title_ticket.gif" width="46" />';
178				break;
179				case AnohanaFloat.WEB_RADIO :
180					_title = '<img src="img/lightbox/common/title_webradio.gif" width="46" />';
181				break;
182				case AnohanaFloat.PROJECT :
183					_title = '<img src="img/lightbox/common/title_project.gif" width="46" />';
184				break;
185				case AnohanaFloat.CAMPAIGN :
186					_title = '<img src="img/lightbox/common/title_campaign.gif" width="46" />';
187				break;
188				case AnohanaFloat.SUMMER_EVENT :
189					_title = '<img src="img/lightbox/common/title_event.gif" width="46" />';
190				break;
191				case AnohanaFloat.COMMENT :
192					_title = '<img src="img/lightbox/common/title_comment.gif" width="46" />';
193				break;
194				case AnohanaFloat.BLURAY_DVD :
195					_title = '<img src="img/lightbox/common/title_bluray.gif" width="46" />';
196				break;
197				case AnohanaFloat.REVIEW :
198					_title = '<img src="img/lightbox/common/title_review.gif" width="46" />';
199				break;
200			}
201			
202			
203			var _html = '<div id="floatContents">';
204			_html += '<p id="floatBg"></p>';
205			_html += '<div id="floatContainer">';
206			_html += '<div id="floatScroller" class="clearfix">';
207			
208		
209			// _html += FloatLoader.loadedArr[0];
210			// _html += FloatLoader.loadedArr[1];
211			// _html += FloatLoader.loadedArr[2];
212			// _html += FloatLoader.loadedArr[3];
213			
214			if (CURRENT_FLOAT == AnohanaFloat.WEB_RADIO)	{
215				_html += '<div id="webradioWrapper"><iframe src="radio/index.html" width="673" id="webradioFrame" scrolling="no" frameborder="0"></iframe></div>';
216			} else {
217				_html += '<div id="webradioWrapper"></div>';
218				_html += FloatLoader.loadedArr[_src];
219			}
220			
221			// _html += FloatLoader.loadedArr[4];
222			// _html += FloatLoader.loadedArr[5];
223			
224			if (CURRENT_FLOAT == AnohanaFloat.SUMMER_EVENT)	{
225				_html += '<div id="eventWrapper"><iframe src="event2013/event0824.html" width="673" id="eventFrame" scrolling="no" frameborder="0"></iframe></div>';
226			} else {
227				_html += '<div id="eventWrapper"></div>';
228			}
229			
230			// _html += FloatLoader.loadedArr[6];
231			// _html += FloatLoader.loadedArr[7];
232			// _html += FloatLoader.loadedArr[8];
233
234			
235			_html += '</div>';
236			_html += '<div id="floatCaptionArea">';
237			_html += '<p id="floatCaption">' + _title + '</p>';
238			_html += '<p id="floatMovieTitle"><img src="img/lightbox/common/logo.gif" width="46" height="439" alt="" /></p>';
239			_html += '</div>';
240			
241			_html += '</div>';
242			
243			_html += '<p id="btnFloatClose"><img src="img/lightbox/common/btn_close.gif" width="54" height="54" alt="close" /></p>';
244			_html += '</div>';
245			
246			_myNode = $(_html);
247
248
249
250			_myNode.css({opacity:0}).animate({opacity:1},{duration:500, easing:"easeInOutCubic"});
251			_myNode.find('#floatContainer').css({opacity:0}).animate({opacity:1},{duration:500, easing:"easeInOutCubic"});
252			_myNode.find('#btnFloatClose').animate({top:0},{duration:500, easing:"easeInOutCubic"});
253		
254			$('#exteriorWrapper').append(_myNode);
255
256			//todo
257			$('#webradioFrame').load(function(){
258				if(navigator.userAgent.indexOf("MSIE") != -1) {
259					try{
260						var AnohanaFrame = document.getElementById('webradioFrame');
261						AnohanaFrame.style.height = AnohanaFrame.contentWindow.document.body.scrollHeight + 'px';
262					} catch(e) {
263					}
264				} else {
265					//2015.07.09 add ->
266					$(this).css({"height":this.contentWindow.document.documentElement.scrollHeight});
267					//2015.07.09 add
268				}
269			});
270			$('#webradioFrame').triggerHandler('load');
271			
272			//todo2
273			$('#eventFrame').load(function(){
274				if(navigator.userAgent.indexOf("MSIE") != -1) {
275					try{
276						var AnohanaFrame = document.getElementById('eventFrame');
277						AnohanaFrame.style.height = AnohanaFrame.contentWindow.document.body.scrollHeight + 'px';
278					} catch(e) {
279					}
280				} else {
281					$(this).height(this.contentWindow.document.documentElement.scrollHeight);
282				}
283			});
284			$('#eventFrame').triggerHandler('load');
285		
286			
287			_targets = [];
288			_targets.push($('#newsWrapper'));
289			_targets.push($('#theaterWrapper'));
290			_targets.push($('#goodsWrapper'));
291			_targets.push($('#ticketWrapper'));
292			_targets.push($('#webradioWrapper'));
293			
294			_targets.push($('#projectWrapper'));
295			_targets.push($('#commentWrapper'));
296			
297			_targets.push($('#campainWrapper'));
298			_targets.push($('#reviewWrapper'));
299			_targets.push($('#eventWrapper'));
300			_targets.push($('#blurayWrapper'));
301			
302			
303			var i;
304			for (i=0; i<_targets.length; i++) {
305				if (i == _src)	{
306					_targets[i].css('display','block');
307console.log(_targets[i]);
308				} else {
309					_targets[i].css('display','none');
310				}
311			}
312			_myNode.find('#floatScroller').css({width:800});
313			_myNode.find('#btnFloatClose, #floatBg').bind('click', prepClose);
314			_scrollTimer = setInterval(setPane, 300);
315			
316			
317			if(navigator.userAgent.indexOf("MSIE") != -1) {
318				$('#projectWrapper').find('img').each(function() {
319					if($(this).attr('src').indexOf('.png') != -1) {
320						$(this).css({
321							'filter': 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' +
322							$(this).attr('src') +
323							'", sizingMethod="scale");'
324						});
325					}
326				});
327			}
328			
329			new Goods();
330			new Ticket();
331			new Project();
332			
333			if (isFromPackage) {
334				isFromPackage = false;
335				$('#tv_amenity').trigger('click');
336			}
337		}
338		
339		var prepClose = function() {
340			_window.trigger(Event.CLOSE_FLOAT);
341			//2015.07.09 add ->
342			_Hash = location.hash.split("#")[1];
343			if(_Hash === 'radio'){
344				location.assign( 'index.html')
345			}
346			//2015.07.09 add
347		}
348		
349		var moveFloat = function() {
350			
351			var _title;
352			var _src;
353			
354			switch(CURRENT_FLOAT)	{
355				case AnohanaFloat.NEWS	:
356					_src = 0;
357					_title = '<img src="img/lightbox/common/title_news.gif" width="46" />';
358				break;
359				case AnohanaFloat.THEATER	:
360					_src = 1;
361					_title = '<img src="img/lightbox/common/title_theater.gif" width="46" />';
362				break;
363				case AnohanaFloat.TV_SERIES :
364					_src = 2;
365					_title = '<img src="img/lightbox/common/title_tvseries.gif" width="46" />';
366				break;
367				case AnohanaFloat.TICKET :
368					_src = 3;
369					_title = '<img src="img/lightbox/common/title_ticket.gif" width="46" />';
370				break;
371				case AnohanaFloat.WEB_RADIO :
372					_src = 4;
373					_title = '<img src="img/lightbox/common/title_webradio.gif" width="46" />';
374					$('#webradioWrapper').empty();
375					$('#webradioWrapper').append('<iframe src="radio/index.html" width="673" id="webradioFrame" scrolling="no" frameborder="0"></iframe>');
376				break;
377				case AnohanaFloat.PROJECT :
378					_src = 5;
379					_title = '<img src="img/lightbox/common/title_project.gif" width="46" />';
380				break;
381				case AnohanaFloat.CAMPAIGN :
382					_src = 6;
383					_title = '<img src="img/lightbox/common/title_campaign.gif" width="46" />';
384				break;
385				case AnohanaFloat.SUMMER_EVENT :
386					_src = 7;
387					_title = '<img src="img/lightbox/common/title_event.gif" width="46" />';
388					$('#eventWrapper').empty();
389					$('#eventWrapper').append('<iframe src="event2013/event0824.html" width="673" id="eventFrame" scrolling="no" frameborder="0"></iframe>');
390				break;
391				case AnohanaFloat.COMMENT :
392					_src = 8;
393					_title = '<img src="img/lightbox/common/title_comment.gif" width="46" />';
394				break;
395				case AnohanaFloat.BLURAY_DVD :
396					_src = 9;
397					_title = '<img src="img/lightbox/common/title_bluray.gif" width="46" />';
398				break;
399				case AnohanaFloat.REVIEW :
400					_src = 10;
401					_title = '<img src="img/lightbox/common/title_review.gif" width="46" />';
402				break;
403			}
404			
405			var i;
406			for (i=0; i<_targets.length; i++) {
407				
408				if (i == _src)	{
409					_targets[i].css('display','block');
410				} else {
411					_targets[i].css('display','none');
412				}
413			}
414			
415			if (CURRENT_FLOAT == AnohanaFloat.WEB_RADIO)	{
416				$('#webradioFrame').load(function(){
417					if(navigator.userAgent.indexOf("MSIE") != -1) {
418						try{
419							var AnohanaFrame = document.getElementById('webradioFrame');
420							AnohanaFrame.style.height = AnohanaFrame.contentWindow.document.body.scrollHeight + 'px';
421						} catch(e) {
422						}
423					} else {
424						$(this).height(this.contentWindow.document.documentElement.scrollHeight);
425					}
426				});
427				$('#webradioFrame').triggerHandler('load');
428			}
429			
430			if (CURRENT_FLOAT == AnohanaFloat.SUMMER_EVENT)	{
431				$('#eventFrame').load(function(){
432					if(navigator.userAgent.indexOf("MSIE") != -1) {
433						try{
434							var AnohanaFrame = document.getElementById('eventFrame');
435							AnohanaFrame.style.height = AnohanaFrame.contentWindow.document.body.scrollHeight + 'px';
436						} catch(e) {
437						}
438					} else {
439						$(this).height(this.contentWindow.document.documentElement.scrollHeight);
440					}
441				});
442				$('#eventFrame').triggerHandler('load');
443			}
444			
445			$('#floatCaption').empty().append(_title);
446		}
447		
448		var floatClose = function() {
449
450			// if (bc_Player)	{
451			// 	AnxBcPlayer.stopVideo();
452			// 	AnxBcPlayer.videoDuration = 0;
453			// 	bc_TemplateLoaded = false;
454			// 	bc_Player = null;
455			// }
456			
457			_myNode.find('#btnFloatClose, #floatBg').unbind('click', prepClose);
458			_myNode.find('#btnFloatClose').animate({top:-54},{duration:500, easing:"easeInOutCubic"});
459			_myNode.find('#floatContainer').animate({opacity:0}
459,{duration:500, easing:"easeInOutCubic"});
460			_myNode.animate({opacity:0},{duration:500, easing:"easeInOutCubic", complete:removeComplete});
461		}
462		
463		var removeComplete = function() {
464			clearInterval(_scrollTimer);
465			_myNode.remove();
466			$('#webradioFrame').unbind();
467			delete _myNode;
468		}
469		
470		var setPane = function() {
471			FloatLoader.scroller = _myNode.find('#floatScroller').jScrollPane();
472			$('#webradioFrame').triggerHandler('load');
473		}
474		
475		init();
476	}
477	return FloatLoader;
478})();
479
480var moveContents = function(_target) {
481	_window.trigger(Event.CLOSE_FLOAT);
482	location.hash = _target;
483}
484
485var moveFloat = function(_target) {
486	FloatLoader.scroller
487	FloatLoader.scroller.data('jsp').scrollTo(0,0);
488//	if (bc_Player)	AnxBcPlayer.stopVideo();
489	
490	switch (_target) {
491		case "news" :
492			CURRENT_FLOAT = AnohanaFloat.NEWS;
493		break;
494		case "theater" :
495			CURRENT_FLOAT = AnohanaFloat.THEATER;
496		break;
497		case "goods" :
498			CURRENT_FLOAT = AnohanaFloat.TV_SERIES;
499		break;
500		case "ticket" :
501			CURRENT_FLOAT = AnohanaFloat.TICKET;
502		break;
503		case "webradio" :
504			CURRENT_FLOAT = AnohanaFloat.WEB_RADIO;
505		break;
506		case "project" :
507			CURRENT_FLOAT = AnohanaFloat.PROJECT;
508		break;
509		case "campaign" :
510			CURRENT_FLOAT = AnohanaFloat.CAMPAIGN;
511		break;
512		case "event" :
513			CURRENT_FLOAT = AnohanaFloat.SUMMER_EVENT;
514		break;
515		case "comment" :
516			CURRENT_FLOAT = AnohanaFloat.COMMENT;
517		break;
518		case "review" :
519			CURRENT_FLOAT = AnohanaFloat.REVIEW;
520		break;
521	}
522	_window.trigger(Event.MOVE_FLOAT);
523}

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.