PageSourceSearch

https://www.yahanet.org/Public/js/system.js?4.3.201206_imgfix0601

js yahanet.org collected 2026-10-06 07:57:37 UTC 39,732 bytes, 1,267 lines download raw bytes

1/* Version 4.2
2** QQ:271513820 
3** Up:2019.12.02*/
4var feifei = {
5//start
6'browser':{//浏览器信息
7	'url': document.URL,
8	'domain': document.domain,
9	'title': document.title,
10	'language': (navigator.browserLanguage || navigator.language).toLowerCase(),//zh-tw|zh-hk|zh-cn
11	'canvas' : function(){
12		return !!document.createElement('canvas').getContext;
13	}(),
14	'useragent' : function(){
15		var ua = navigator.userAgent;//navigator.appVersion
16		return {
17			'mobile': !!ua.match(/AppleWebKit.*Mobile.*/), //是否为移动终端 
18			'ios': !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
19			'android': ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1, //android终端或者uc浏览器 
20			'iPhone': ua.indexOf('iPhone') > -1 || ua.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器 
21			'iPad': ua.indexOf('iPad') > -1, //是否iPad
22			'trident': ua.indexOf('Trident') > -1, //IE内核
23			'presto': ua.indexOf('Presto') > -1, //opera内核
24			'webKit': ua.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
25			'gecko': ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') == -1, //火狐内核 
26			'weixin': ua.indexOf('MicroMessenger') > -1 //是否微信 ua.match(/MicroMessenger/i) == "micromessenger",			
27		};
28	}()
29},
30'cms':{//系统
31	'nav': function($id){//主导航高亮
32		$id = $('nav[data-dir]').attr('data-dir');
33		$($id).addClass("active");
34	},
35	'pre':function(){//代码高亮
36		//https://highlightjs.org/static/demo/
37		if($("pre code").length){
38			$.ajaxSetup({ 
39				cache: true 
40			});
41			$("<link>").attr({ rel: "stylesheet",type: "text/css",href: "//lib.baomitu.com/highlight.js/9.12.0/styles/googlecode.min.css"}).appendTo("head");
42			$.getScript("//lib.baomitu.com/highlight.js/9.12.0/highlight.min.js", function(){
43				$('pre code').each(function(i, block) {
44					hljs.highlightBlock(block);
45				});
46			});
47		}
48	},
49	'collapse':function(){//内容详情折叠与自适应图片
50		$('.ff-content img').addClass("img-responsive");
51		$('body').on("click", "[data-toggle=ff-collapse]", function(){
52			$this = $(this);
53			$($this.attr('data-target')).toggle();
54			$($this.attr('data-default')).toggle();
55			if($this.attr('data-html')){
56				$data_html = $this.html();
57				$this.html($this.attr('data-html'));
58				$this.attr('data-html',$data_html);
59			}
60			if($this.attr('data-val')){
61				$data_val = $this.val();
62				$this.val($this.attr('data-val'));
63				$this.attr('data-val',$data_val);
64			}
65		});
66	},
67	'pushBaidu':function(){
68		var bp = document.createElement('script');
69    var curProtocol = window.location.protocol.split(':')[0];
70    if (curProtocol === 'https') {
71        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
72    }
73    else {
74        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
75    }
76    var s = document.getElementsByTagName("script")[0];
77    s.parentNode.insertBefore(bp, s);
78	}
79},
80'mobile':{//移动端专用
81	'jump': function(){
82		if( cms.domain_m && (feifei.browser.domain != cms.domain_m) ){
83			self.location.href = feifei.browser.url.replace(feifei.browser.domain,cms.domain_m);
84		}
85	},
86	'nav': function(){
87		$("#ff-nav-btn").bind('click', function(){
88			$('#ff-nav-btn-item').toggleClass("hidden").toggleClass("d-none");
89		});
90	},
91	'goback': function(){
92		if(history.length > 0 && document.referrer){
93			$(".ff-goback").show();
94			$('.ff-goback').attr('href','javascript:history.go(-1);');
95		}else{
96			$(".ff-goback").hide();
97		}
98	},
99	'flickity':function(){//手机滑动
100		if($(".ff-gallery").length){
101			$.ajaxSetup({ 
102				cache: true 
103			});
104			$("<link>").attr({
105				rel: "stylesheet",
106				type: "text/css",
107				href: cms.root+"Public/jquery.flickity/2.1.1/flickity.min.css"
108			}).appendTo("head");
109			$.getScript(cms.root+"Public/jquery.flickity/2.1.1/flickity.pkgd.min.js", function(){
110				$(".ff-gallery").each(function(i){
111					$index = $(this).find('.gallery-active').index()*1;
112					if($index > 3){
113						$index = $index-3;
114					}else{
115						$index = 0;
116					}
117					$(this).flickity({
118						cellAlign: 'left',
119						freeScroll: true,
120						lazyLoad: true,
121						contain: true,
122						prevNextButtons: false,
123						resize: true,
124						initialIndex: $index,
125						pageDots: false
126					});
127				});
128			});
129		}
130	}
131},
132'scroll':{//滚动条
133	'fixed' : function($id, $top, $width){// 悬浮区域
134		var offset = $('#'+$id).offset();
135		if(offset){
136			if(!$top){
137				$top = 5;
138			}
139			if(!$width){
140				$width = $('#'+$id).width();
141			}			
142			$(window).bind('scroll', function(){
143				if($(this).scrollTop() > offset.top){
144					$('#'+$id).css({"position":"fixed","top":$top+"px","width":$width+"px"});
145				}else{
146					$(('#'+$id)).css({"position":"relative"});
147				}
148			});		
149		}
150	},
151	'totop':function($id, $top){ //返回顶部
152		// $id:dc-totop $top:偏移值
153		$('body').append('<a href="#" class="'+$id+'" id="'+$id+'"><i class="glyphicon glyphicon-chevron-up"></i></a>');
154		$(window).bind('scroll', function(){
155			if($(this).scrollTop() > $top){
156				$('#'+$id).fadeIn("slow");
157			}else{
158				$('#'+$id).fadeOut("slow");
159			}
160		});
161	}
162},
163'language':{//简繁转换
164	's2t':function(){
165		if(feifei.browser.language=='zh-hk' || feifei.browser.language=='zh-tw'){
166			$.getScript("//cdn.daicuo.cc/jquery.s2t/0.1.0/s2t.min.js", function(data, status, jqxhr) {
167				$(document.body).s2t();//$.s2t(data);
168			});
169		}
170	},
171	't2s':function(){
172		if(feifei.browser.language=='zh-cn'){
173			$.getScript("//cdn.daicuo.cc/jquery.s2t/0.1.0/s2t.min.js", function(data, status, jqxhr) {
174				$(document.body).t2s();//$.s2t(data);
175			});
176		}
177	}
178},
179'page': {//分页
180	'more': function(){
181		$('body').on('click', '.ff-page-more', function(){
182			$this = $(this);
183			$page = $(this).attr('data-page')*1+1;
184			$id = $this.attr('data-target');
185			$.get($(this).attr('data-url')+$page, function(data){
186				if(data){
187					$($id).append(data);
188					$this.attr("data-page",$page);
189					$($id+" .ff-img").lazyload();
190				}else{
191					$this.hide();
192					$this.unbind("click");
193				}
194			},'html');
195		});
196	},
197	'keydown': function(){
198	  var prev = $('#ff-prev').attr("href");
199	  var next = $('#ff-next').attr("href");
200	  $("body").keydown(function(event){
201		  if(event.keyCode==37 && prev!=undefined) location=prev; 
202		  if(event.keyCode==39 && next!=undefined) location=next; 
203	  });
204  },
205	'scroll': function(){
206		if( $(".ff-page-scroll").length ){
207			var $e = $(".ff-page-scroll").eq(0);
208			$(window).bind('scroll', function(){
209				$this = $(this);
210				$page = $e.attr('data-page')*1+1;
211				$id = $e.attr('data-target');
212				if( ($(this).scrollTop() + $(window).height()) >= $(document).height() ){
213					$.get($e.attr('data-url')+$page, function(data){
214						if(data){
215							$(".ff-page-scroll").eq(0).attr("data-page",$page);
216							$($id).append(data);
217							$($id+" .ff-img").lazyload();
218						}else{
219							$(".ff-page-scroll").remove();
220							$this.unbind("scroll");
221						}
222					},'html');
223				}
224			});
225		}
226	}
227},
228'alert':{//提示
229	'success':function($id, $tips){
230		$($id).html('<div class="alert alert-success"><a href="#" class="close" data-dismiss="alert">&times;</a><strong>成功!</strong>'+$tips+'</div>');
231	},
232	'warning':function($id, $tips){
233		$($id).html('<div class="alert alert-warning"><a href="#" class="close" data-dismiss="alert">&times;</a><strong>警告!</strong>'+$tips+'</div>');
234	}
235},
236'image': {//图片
237	'ensureSrc': function(){// immediately fill missing src from lazyload attribute
238		$('img[data-original]').each(function(){
239			var $img = $(this);
240			if(!$img.attr('src') && $img.attr('data-original')){
241				$img.attr('src', $img.attr('data-original'));
242			}
243		});
244	},
245	'lazyload': function(){//延迟加载
246		$.ajaxSetup({
247			cache: true
248		});
249		$.getScript(cms.root+"Public/jquery.lazyload/1.9.7/jquery.lazyload.min.js", function(response, status) {
250			$("img.ff-img").lazyload({
251				placeholder : cms.root+"Public/images/poster-fallback.svg",
252				effect : "fadeIn",
253				failurelimit: 15
254				//threshold : 400
255				//skip_invisible : false
256				//container: $(".carousel-inner"),
257			}); 
258		});
259	},
260	'qrcode': function(){//生成二维码
261		//$("[data-toggle='popover']").popover({html: true});
262		$(".glyphicon-phone").popover({
263				html: true
264		});
265		$(".glyphicon-phone").on('show.bs.popover', function () {
266			$(".glyphicon-phone").attr('data-content','<img class="ff-qrcode" src="//cdn.feifeicms.co/qrcode/1.0/?w=150&h=150&url='+encodeURIComponent(feifei.browser.url)+'"/>');
267		})
268	},
269	'vcode':function(){//安全码
270		return '<label><img class="ff-vcode-img" src="'+cms.root+'index.php?s=Vcode-Index"></label>';
271	},
272	'slide':function(){//轮播幻灯
273		$('.ff-slide').carousel({interval: $('.ff-slide').attr('data-interval')*1});
274	},
275	'fallback':function(){// image fallback
276		$('body').on('error', 'img', function(){
277			var $img = $(this);
278			if($img.attr('data-fallback-loaded')){
279				return;
280			}
281			$img.attr('data-fallback-loaded', '1');
282			$img.attr('src', cms.root+'Public/images/poster-fallback.svg');
283		});
284	}
285},
286'ads': {// ad lazy-load after scroll > 300px
287	'loaded': false,
288	'load': function(){
289		if(feifei.ads.loaded){
290			return;
291		}
292		var $ads = $('.ff-ads-lazy[data-ads-src]');
293		if(!$ads.length){
294			feifei.ads.loaded = true;
295			return;
296		}
297		feifei.ads.loaded = true;
298		$ads.each(function(){
299			var $this = $(this);
300			var src = $this.attr('data-ads-src');
301			if(!src){
302				return;
303			}
304			var script = document.createElement('script');
305			script.type = 'text/javascript';
306			script.async = true;
307			script.src = src;
308			var charset = $this.attr('data-ads-charset');
309			if(charset){
310				script.charset = charset;
311			}
312			$this.replaceWith(script);
313		});
314	},
315	'bind': function(){
316		if(!$('.ff-ads-lazy[data-ads-src]').length){
317			return;
318		}
319		var onScroll = function(){
320			if($(window).scrollTop() > 300){
321				feifei.ads.load();
322				$(window).off('scroll.ffads', onScroll);
323			}
324		};
325		$(window).on('scroll.ffads', onScroll);
326		setTimeout(onScroll, 60);
327	}
328},
329'vcode': {//验证码
330	'load': function(){
331		feifei.vcode.focus();
332		feifei.vcode.click();
333	},
334	'focus': function(){//验证码框焦点
335		$('body').on("focus", ".ff-vcode", function(){
336			$(this).removeClass('ff-vcode').parent().after(feifei.image.vcode());
337			$(this).unbind();
338		});
339	},
340	'click': function(){//点击刷新
341		$('body').on('click', 'img.ff-vcode-img', function(){
342			$(this).attr('src', cms.root+'index.php?s=Vcode-Index');
343		});
344	}
345},
346'search': {//搜索
347	'keydown': function(){//回车 4.1update
348		$(".ff-search input").keyup(function(event){
349			if(event.keyCode == 13){
350				$form = $(this).parents('form');
351				$wd = $form.find('.ff-wd').val();
352				$action = $form.attr('data-action');
353				if(!$wd){
354					$form.find('.ff-wd').focus();
355					$form.find('.ff-wd').attr('data-toggle','tooltip').attr('data-placement','bottom').attr('title','请输入关键字').tooltip('show');
356					return false;
357				}
358				if($action){
359					location.href = $action.replace('FFWD',encodeURIComponent($wd));
360					return false;
361				}
362			}
363		});
364	},
365	'dropdown': function(){//下拉菜单
366		$(".ff-search .dropdown-menu li a").on("click", function(){
367			$form = $(this).parents('form');
368			if($(this).attr('data-action')){
369				$form.attr('data-sid','');
370				$form.attr('data-action', $(this).attr('data-action'));
371				$form.find('.dropdown-toggle .title').html($(this).html());
372			}
373		});
374	},
375	'submit': function(){//搜索表单 4.1update
376		$(".ff-search").on("submit", function(){
377			$wd = $(this).find('.ff-wd').val();
378			$action = $(this).attr('data-action');
379			if(!$wd){
380				$(this).find('.ff-wd').focus();
381				$(this).find('.ff-wd').attr('data-toggle','tooltip').attr('data-placement','bottom').attr('title','请输入关键字').tooltip('show');
382				return false;
383			}
384			if($action){
385				location.href = $action.replace('FFWD',encodeURIComponent($wd));
386				return false;
387			}
388		});
389	},
390	'autocomplete': function(){//3.5增加搜索结果控制 4.1update
391		var $limit = $('.ff-search').eq(0).attr('data-limit')*1;
392		var $sid = $('.ff-search').eq(0).attr('data-sid')*1;
393		if( $limit > 0){
394			$.ajaxSetup({
395				cache: true
396			});
397			$.getScript(cms.root+"Public/jquery.devbridge-autocomplete/1.4.7/jquery.autocomplete.min.js", function(response, status) {
398				$('.ff-wd').autocomplete({
399					serviceUrl : cms.root+'index.php?g=home&m=search&a=api&sid='+$sid,
400					params: {'limit': $limit},
401					paramName: 'wd',
402					maxHeight: 400,
403					transformResult: function(response) {
404						var obj = $.parseJSON(response);
405						return {
406							suggestions: $.map(obj.data, function(dataItem) {
407								return { value: dataItem.name, data: dataItem.link };
408							})
409						};
410					},
411					onSelect: function (suggestion) {
412						location.href = suggestion.data;
413						//alert('You selected: ' + suggestion.value + ', ' + suggestion.data);
414					}
415				});
416			});
417		}
418	},
419	'hot':function(){
420		$(".ff-search [data-toggle='tooltip']").tooltip();
421		$("#ff-site-hot").load(cms.root+"index.php?s=ajax-site_hot");
422	}
423},
424'record': {//云记录
425	'load': function(){
426		feifei.record.get();
427		feifei.record.set();
428		feifei.record.del();
429	},
430	'get':function(){
431		//后端获取记录
432		if($(".ff-record-get").eq(0).length){
433			$.get(cms.root+'index.php?g=home&m=record&a=vod&sid=1', function(data){
434				if(data == ''){
435					data = '<strong>暂无观看记录</strong>';
436				}
437				$(".ff-record-get").attr('data-content',data);
438			});
439		}
440		//弹出事件
441		$(".ff-record-get").popover().on("mouseenter", function () {
442			var _this = this;
443			$(this).popover("show");
444			$(".popover").on("mouseleave", function () {
445				$(_this).popover('hide');
446			});
447		}).on("mouseleave", function () {
448			var _this = this;
449			setTimeout(function () {
450				if (!$(".popover:hover").length) {
451					$(_this).popover("hide");
452				}
453			}, 300);
454		});
455	},
456	'set':function(){//用户互动记录
457		//自动写入观看或浏览记录
458		if($(".ff-record-set[data-type=1]").eq(0).attr('data-sid')){
459			$this = $(".ff-record-set[data-type=1]").eq(0);
460			$.get(cms.root+'index.php?g=home&m=record&a=post&sid='+$this.attr("data-sid")+'&did='+$this.attr("data-id")+'&type=1&did_sid='+$this.attr("data-id-sid")+'&did_pid='+$this.attr("data-id-pid"));
461		}
462		//喜欢 想看 在看 看过 写入记录
463		$('body').on('click', 'a.ff-record-set', function(e){
464			//是否需要验证登录
465			if(cms.userforum == 1 && cms.userid < 1){
466				feifei.user.login();
467				return false;
468			}
469			var $this = $(this);
470			if($(this).attr("data-id")){
471				$.ajax({
472					url: cms.root+'index.php?g=home&m=record&a=post&sid='+$(this).attr("data-sid")+'&did='+$(this).attr("data-id")+'&type='+$(this).attr("data-type"),
473					cache: false,
474					dataType: 'json',
475					success: function(json){
476						if(json.status == 200){
477							$this.addClass('disabled');
478						}else{
479							$this.attr('title', json.info);
480							$this.tooltip('show');
481						}
482					}
483				});
484			}
485		});
486	},
487	'del':function(){//删除记录
488		$('body').on('click', 'a.ff-record-delete', function(e){
489			var $this = $(this);
490			if($(this).attr("data-id")){
491				$.ajax({
492					url: cms.root+'index.php?g=home&m=record&a=delete&id='+$(this).attr("data-id"),
493					cache: false,
494					dataType: 'json',
495					success: function(json){
496						if(json.status == 200){
497							location.reload();
498						}else{
499							$this.attr('title', json.info).tooltip('show');
500						}
501					}
502				});
503			}
504		});
505	}
506},
507'score': {//评分
508	'raty': function(){
509		if( $('.ff-score').length ){
510			$.ajaxSetup({ 
511				cache: true 
512			});
513			$("<link>").attr({ rel: "stylesheet",type: "text/css",href: "//lib.baomitu.com/raty/2.7.1/jquery.raty.min.css"}).appendTo("head");
514			//
515			$.getScript("//lib.baomitu.com/raty/2.7.1/jquery.raty.min.js", function(response, status) {
516				$(".ff-score").each(function(i){
517					$(".ff-score").eq(i).find('.ff-score-raty').raty({ 
518						starType: 'i',
519						number: 5,
520						numberMax : 5,
521						half: true,
522						score : function(){
523							return $(this).attr('data-score');
524						},
525						click: function(score, evt) {
526							$this = $(this);
527							$.ajax({
528								type: 'get',
529								url: cms.root+'index.php?s=gold-'+$(this).attr('data-module')+'-id-'+$(this).attr('data-id')+'-score-'+(score*2),
530								timeout: 5000,
531								dataType:'json',
532								error: function(){
533									$this.attr('title', '网络异常!').tooltip('show');
534								},
535								success: function(json){
536									if(json.status == 1){
537										$this.parent().find('.ff-score-val').html(json.data.gold);
538									}else{
539										$this.attr('title', json.info).tooltip('show');
540									}
541								}
542							});
543						}
544					});					
545				});
546			});
547		}
548	}
549},
550'updown':{//顶踩
551	'click': function(){
552		$('body').on('click', 'a.ff-updown-set', function(e){
553			var $this = $(this);
554			if($(this).attr("data-id")){
555				$.ajax({
556					url: cms.root+'index.php?s=updown-'+$(this).attr("data-module")+'-id-'+$(this).attr("data-id")+'-type-'+$(this).attr("data-type"),
557					cache: false,
558					dataType: 'json',
559					success: function(json){
560						$this.addClass('disabled');
561						if(json.status == 1){
562							if($this.attr("data-type")=='up'){
563								$this.find('.ff-updown-val').html(json.data.up);
564							}else{
565								$this.find('.ff-updown-val').html(json.data.down);
566							}
567						}else{
568							$this.attr('title', json.info);
569							$this.tooltip('show');
570						}
571					}
572				});
573			}
574		});
575	}
576},
577'hits':{//人气
578	'load': function(){
579		$(".ff-hits").each(function(i){
580			var $this = $(".ff-hits").eq(i);
581			$.ajax({
582				url: cms.root+'index.php?s=hits-show-id-'+$this.attr("data-id")+'-sid-'+$this.attr("data-sid")+'-type-'+$this.attr("data-type"),
583				cache: true,
584				dataType: 'json',
585				success: function(json){
586					$type = $this.attr('data-type');
587					if($type != 'insert'){
588						$this.html(eval('(json.' + $type + ')'));
589					}
590				}
591			});
592	 });
593	}
594},
595'share':{//分享
596	'baidu': function(){
597		if($(".ff-share").length ){
598			$size = $(".ff-share").attr('data-size');
599			if(!$size){$size = 16;}
600			if( $(".ff-share dd").length ){
601				$id = $(".ff-share dd");
602			}else{
603				$id = $(".ff-share");
604			}
605			$($id).html('<div class="bdsharebuttonbox"><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_bdysc" data-cmd="bdysc" title="分享到百度云收藏"></a><a href="#" class="bds_copy" data-cmd="copy" title="分享到复制网址"></a></div>');
606			window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":""+$size+""},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='//bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
607		}
608	}
609},
610'forum': {//讨论模块功能
611	'load':function(){
612		if($('.ff-forum[data-type=feifei]').length){
613			this.system();
614		}
615		if($('.ff-forum[data-type=changyan]').length){
616			this.changyan();
617		}
618	},
619	'system': function(){
620		//初始加载
621		if($('.ff-forum[data-type=feifei]').attr('data-sid')){
622			feifei.forum.ajax('.ff-forum', $('.ff-forum[data-type=feifei]').attr('data-sid'), $('.ff-forum[data-type=feifei]').attr('data-id'),$('.ff-forum[data-type=feifei]').attr('data-pid'), 0, 1);
623		}
624		//登录验证
625		$(".ff-forum").on("focus", 'textarea[name=forum_content]', function(){ //表单提交
626			if(cms.userforum == 1 && cms.userid < 1){
627				feifei.user.login();
628			}
629		});
630		//回复评论
631		$('body').on('click', 'a.forum-reply-set', function(){
632			var $pid = $(this).attr("data-id");
633			var $reply = $(this).parents('.media-body').find('.forum-reply');
634			var $form = $($(".ff-forum-post").eq(0).prop("outerHTML"));
635			if($pid){
636				$form.find('.ff-alert').html('');
637				$form.find("button[type='submit']").removeClass('disabled')
638				$form.find("input[name='forum_pid']").val($pid);
639				$form.show();
640				$($reply).html($form);
641				$($reply).collapse('toggle');
642			}
643		});
644		//举报评论
645		$('body').on('mouseenter', '.ff-forum-item .media-body', function(){
646			$(this).find('.forum-report').fadeIn();
647		});
648		$('body').on('mouseleave', '.ff-forum-item .media-body', function(){
649			$(this).find('.forum-report').fadeOut();
650		});
651		$('body').on('click', 'a.forum-report', function(){
652			$(this).remove();//移除按钮
653			var $id = $(this).attr("data-id");
654			if($id){
655				$.ajax({
656					type: 'get',
657					url: cms.root+'index.php?s=forum-report-id-'+$id,
658					timeout: 3000,
659					dataType:'json',
660					success:function(json){
661						feifei.alert.success($('.form-forum').eq(0).find('.ff-alert'), json.info);
662					}
663				});
664			}
665		});
666		//删除评论
667		$('body').on('click', 'a.forum-delete', function(){
668			var $this = $(this);
669			var $id = $(this).attr("data-id");
670			if($id){
671				$.ajax({
672					type: 'get',
673					url: cms.root+'index.php?s=forum-delete-id-'+$id,
674					timeout: 3000,
675					dataType:'json',
676					success:function(json){
677						if(json.status == 200){
678							location.reload();
679						}else{
680							$this.attr('title', json.info).tooltip('show');
681						}
682					}
683				});
684			}
685		});
686		//发表评论
687		$("body").on("submit", '.ff-forum-post', function(){
688			var $this = $(this);
689			var $sid = $(this).find('input[name=forum_sid]').val();
690			$.post($this.attr('action'), $this.serialize(), function(json){
691				if(json.status == 200){//不需要审核留言
692					feifei.alert.success($this.find('.ff-alert'), json.info);//发布成功提示
693					$this.find("button[type='submit']").addClass('disabled');//禁止再次提交
694					//主题、回复贴处理
695					if(json.data.forum_pid){//回复贴
696						feifei.forum.reply(json.data.forum_pid);//更新回复数及显示回复链接按钮
697						setTimeout(function(){$('.forum-reply[data-id='+json.data.forum_pid+']').fadeOut('slow')}, 2000);//移除回复表单容器
698					}else{//主题贴
699						setTimeout(function(){feifei.forum.ajax('.ff-forum-item', json.data.forum_sid, json.data.forum_cid, 0, 1, 1)}, 2000);
700						setTimeout(function(){$this.hide()}, 3000);
701					}
702					//发表评论后是否需要刷新网页
703					if($('.ff-forum-reload').length){
704						location.reload();
705					}
706				}else if(json.status > 200){//需要审核
707					feifei.alert.success($this.find('.ff-alert'), json.info);//发布成功提示
708					$this.find("button[type='submit']").addClass('disabled');//禁止再次提交
709				}else{
710					feifei.alert.warning($this.find('.ff-alert'), json.info);
711				}
712			 },'json');
713			return false;
714		});
715	},
716	'ajax': function($target, $sid, $cid, $pid, $ismore, $page){//AJAX加载系统评论
717		$.ajax({
718			type: 'get',
719			url: cms.root+'index.php?s=forum-ajax-sid-'+$sid+'-cid-'+$cid+'-pid-'+$pid+'-ismore-'+$ismore+'-p-'+$page,
720			timeout: 3000,
721			error: function(){
722				$($target).html('评论加载失败,请刷新...');
723			},
724			success:function($html){
725				$($target).html($html);
726			}
727		});
728	},
729	'reply': function($id){//更新回复数及显示回复链接
730		$.ajax({
731			type: 'get',
732			url: cms.root+'index.php?s=forum-reply-id-'+$id,
733			timeout: 3000,
734			dataType:'json',
735			success:function(json){
736				if(json.status==200){
737					$('.forum-reply-set[data-id='+$id+']').find('.forum-reply-val').html(json.data);
738					$('.forum-reply-get[data-id='+$id+']').fadeIn();
739				}
740			}
741		});
742	},
743	'changyan': function(){
744		$appid = $('.ff-forum[data-type=changyan]').attr('data-cy-id');
745		$conf = $('.ff-forum[data-type=changyan]').attr('data-cy-conf');
746		$sourceid = $('.ff-forum[data-type=changyan]').attr('data-sid')+'-'+$('.ff-forum[data-type=changyan]').attr('data-id');
747		var width = window.innerWidth || document.documentElement.clientWidth;
748		if (width < 768) { 
749			$(".ff-forum").html('<div id="SOHUCS" sid="'+$sourceid+'"></div><script charset="utf-8" id="changyan_mobile_js" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id='+$appid+'&conf=prod_'+$conf+'"><\/script>');
750		}else{
751			$(".ff-forum").html('<div id="SOHUCS" sid="'+$sourceid+'"></div>');
752			$.getScript("https://changyan.sohu.com/upload/changyan.js",function(){
753				window.changyan.api.config({
754					appid: $appid,
755					conf: 'prod_'+$conf
756				});
757			});
758		}
759	}
760},
761'scenario': {//分集剧情
762	'load':function(){
763		var $max = $(".ff-scenario-pill").attr('data-max')*1;
764		var $count = $(".ff-scenario-content dl").length;
765		var $li = 0;
766		var $list = '';
767		if($count > 0 && $max>0){
768			for($i=0; $i<$count; $i++){
769				if(($i+$max) > $count){
770					$max_ji = $count;
771				}else{
772					$max_ji = $i+$max;
773				}
774				if($i % $max == 0){
775					$li++;
776					$list+='<li><a href="javascript:;" data-target=".ff-scenario-'+$li+'" data-toggle="pill">第'+($i+1)+'-'+$max_ji+'集</a></li>';
777				}
778				$(".ff-scenario-content dl").eq($i).addClass('ff-scenario-'+$li);
779			}
780			$('.ff-scenario-pill').html($list);
781			$('.ff-scenario-pill a:first').tab('show');
782		}
783	}
784},
785'playurl': {//播放地址
786	'tongji': function(){
787		if($("#cms_player").length){
788			$.getScript("//cdn.feifeicms.co/tongji/4.3/?"+~(-new Date()/36e5));
789		}
790	},
791	'active':function(){
792		$('.ff-playurl li[data-id="'+$('.ff-playurl[data-active]').attr('data-active')+'"]').addClass("active");
793		$('.ff-playurl-tab a[data-target="'+$('.ff-playurl-tab[data-active]').attr('data-active')+'"]').tab('show');
794		$('.ff-playurl-dropdown a[data-target="'+$('.ff-playurl-dropdown[data-active]').attr('data-active')+'"]').tab('show');
795	},	
796	'dropdown':function(){
797		$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
798			$(this).parents('.btn-group').find('.dropdown-toggle span:eq(0)').html($(e.target).text());
799			$(this).parents('.dropdown-menu').find('li').removeClass('active');
800			$(this).parent().addClass('active');
801		});
802	},
803	'error':function(){//报错
804		$('.ff-playurl-error').on('click',function(){
805			$id = $(this).attr('data-id');
806			$sid = $(this).attr('data-sid');
807			$pid = $(this).attr('data-pid');
808			$content = $(this).attr('data-content')+' 第'+$sid+'组 第'+$pid+'集';
809			$.ajax({
810				type: 'POST',
811				url: cms.root+'index.php?s=forum-update',
812				timeout: 3000,
813				dataType:'json',
814				data: "forum_sid=24&forum_pid="+$sid+"&forum_cid="+$id+"&forum_cid_ep="+$pid+"&forum_content="+$content,
815				error: function(){
816					alert('网络异常');
817				},
818				success: function(json){
819					alert('提交成功');
820				}
821			});
822		});
823	},
824	'more':function(){//...效果
825		$('.ff-playurl').each(function(i){
826			$this = $(this);
827			$config = $this.attr('data-more')*1;
828			$max = $this.find('li a').length;
829			if(($config+2) < $max && $config>0){
830				$max_html = $($this.find('li:last').prop("outerHTML")).find('a').attr('href','#all').html('全部...');
831				$max_html = '<li class="'+$this.find('li').attr('class')+'">'+$max_html.prop("outerHTML")+'</li>';
832				$this.find('li').each(function(n){
833					if(n+1 > $config){
834						$(this).hide();
835					}
836				});
837				$this.find('li').eq($config).after($max_html);
838				$this.find('li:last').show();
839			}
840	 	});
841		//more点击
842		$('.ff-playurl').on('click', 'a', function(e){
843			if($(this).attr('href') == '#all'){
844				$(this).parent().parent().find('li').show();
845				$(this).parent().remove();
846				return false;
847			}
848		});
849	},
850	//vip播放器回调
851	'vip_callback':function($vod_id, $vod_sid, $vod_pid, $status, $trysee, $tips){
852		if($status != 200){
853			if($trysee > 0){
854				window.setTimeout(function(){
855					$.get(cms.root+'index.php?s=vod-vip-action-trysee-id-'+$vod_id+'-sid-'+$vod_sid+'-pid-'+$vod_pid, function(html){
856						$('#cms_player').html(html).removeClass("embed-responsive-4by3").removeClass("embed-responsive-16by9").css({"height":"auto"});
857					},'html');
858				},1000*60*$trysee);
859			}else{
860				$('#cms-player-vip .cms-player-box').html($tips);
861				$('#cms-player-vip .cms-player-iframe').hide();
862				$('#cms_player').removeClass("embed-responsive-4by3").removeClass("embed-responsive-16by9").css({"height":"auto"});
863			}
864			//支付影币按钮
865			$('#cms_player').on("click",".vod-price",function(){
866				$(this).html('Loading...');
867				$.get(cms.root+'index.php?s=vod-vip-action-ispay-id-'+$vod_id+'-sid-'+$vod_sid+'-pid-'+$vod_pid, function(json){
868					if(json.status == 200){
869						location.reload();
870					}else if(json.status == 500 || json.status == 501){
871						feifei.user.login();
872					}else{
873						$('#cms_player').html(json.info);
874					}
875				},'json');
876			});
877		}else{
878			//拥有VIP观看权限
879		}
880	},
881	'xunlei':function(){//迅雷下载
882		if($(".ff-playurl-down").length){
883			$.getScript("//open.thunderurl.com/thunder-link.js",function(){
884				//单个下载
885				jQuery(".thunder-link").unbind("click").bind("click",function(){
886					thunderLink.newTask({
887						downloadDir: '',
888						tasks: [{
889							name: jQuery(this).attr("data-name"),
890							url: jQuery(this).attr("data-url")
891						}]
892					});
893					return false;
894				});
895				//批量下载任务
896				jQuery(".thunder-link-all").unbind("click").bind("click",function(){
897					var index=jQuery(this).attr("data-sid");
898					var tasks=[];
899					jQuery("input[name='thunder-link-all-"+index+"']:checked").each(function(i){
900						tasks.push({"name":jQuery(this).attr("data-name"),"url":jQuery(this).val()});
901					});
902					thunderLink.newTask({
903						downloadDir: '',
904						installFile: '',
905						taskGroupName: '',
906						tasks: tasks
907					});
908				});
909				//3.4增加鼠标点击去掉文件名标题
910				$(".ff-playurl-down input[type=text]").focus(function(){
911					$(this).val($(this).parent().find('input[type=checkbox]').val());
912				});
913				//3.8增加失去焦点事件
914				$(".ff-playurl-down input[type=text]").blur(function(){
915					$(this).val($(this).parent().find('input[type=checkbox]').attr('data-name')+' '+$(this).parent().find('input[type=checkbox]').val());
916				});
917			});
918		}
919	}
920},
921'user':{
922	//基础功能
923	'load':function(){
924		//不同模式下处理用户基础信息
925		feifei.user.islogin();
926		//模态框登录事件
927		$("body").on("click",".user-login-modal",function(){
928			feifei.user.login();
929			return false;
930		});
931		//积分在线充值事件
932		$("body").on("click",".user-score-payment",function(){
933			feifei.user.ScorePayment();
934			return false;
935		});
936		//积分卡密充值事件
937		$("body").on("click",".user-score-card",function(){
938			feifei.user.ScoreCard();
939			return false;
940		});
941		//积分升级VIP事件
942		$("body").on("click",".user-score-upvip",function(){
943			feifei.user.ScoreUpvip();
944			return false;
945		});
946		//用户中心修改邮箱
947		$("body").on("click",".user-change-email", function(){
948			feifei.user.ChangeEmail();
949			return false;
950		});
951		//用户中心修改密码
952		$("body").on("click",".user-change-pwd", function(){
953			feifei.user.ChangePwd();
954			return false;
955		});
956	},
957	//静态模式加载用户ID
958	'islogin':function(){
959		if($('.ff-user').length && (cms.urlhtml == 1)){
960			$.ajax({
961				type: 'get',
962				url: cms.root+'index.php?s=user-info',
963				timeout: 3000,
964				dataType:'json',
965				success:function(json){
966					if(json.status==200){
967						cms.userid = json.data.user_id;
968						cms.username = json.data.user_name;
969						$('.ff-user').removeClass("user-login-modal");
970						$('.ff-user[data-href]').attr('href',$('.ff-user[data-href]').attr('data-href'));
971						$('.ff-user[data-name]').html('<a href="'+$('.ff-user').attr('data-href')+'">'+cms.username+'</a>');
972					}
973				}
974			});
975		}
976	},
977	//AJAX模态框登录
978	'login':function(){
979		$('.ff-modal').remove();
980		$.ajax({
981			type: 'get',
982			cache: false,
983			url: cms.root+'index.php?s=user-ajax_login',
984			timeout: 3000,
985			success:function($html){
986				$('body').append($html);
987				$('.ff-modal').modal('show');
988				$(".form-user-login").on('submit',function(e){
989					$.ajax({
990						url: $(this).attr('action'),
991						type: 'POST',
992						dataType: 'json',
993						timeout: 3000,
994						data: $(this).serialize(),
995						beforeSend: function(xhr){
996							$('.user-login-alert').html('正在登录...');
997						},
998						error : function(){
999							$('.user-login-alert').html('请求失败,请刷新网页。');
1000						},
1001						success: function(json){
1002							if(json.status == 200){
1003								location.reload();
1004							}else{
1005								$('#user-submit').html('登录');
1006								feifei.alert.warning('.user-login-alert',json.info);
1007							}
1008						},
1009						complete: function(xhr){
1010						}
1011					});
1012					return false;
1013				});
1014			}
1015		});
1016	},
1017	//积分在线充值
1018	'ScorePayment':function(){
1019		feifei.order.payment();
1020	},
1021	//积分卡密充值
1022	'ScoreCard':function(){
1023		feifei.order.card();
1024	},
1025	//升级VIP
1026	'ScoreUpvip':function(){
1027		$('.ff-modal').remove();
1028		$('.modal-backdrop').hide();
1029		$.ajax({
1030			type: 'get',
1031			url: cms.root+'index.php?s=user-ajax_upvip',
1032			timeout: 3000,
1033			success:function($html){
1034				$('body').append($html);
1035				$('.ff-modal').modal('show');
1036				$(".user-upvip-form").on('submit',function(e){
1037					$data_url = $(this).attr('data-url');//卡密充值地址
1038					$.ajax({
1039						url: $(this).attr('action'),
1040						type: 'POST',
1041						dataType: 'json',
1042						timeout: 3000,
1043						data: $(this).serialize(),
1044						beforeSend: function(xhr){
1045							$('.user-upvip-alert').html('Loading...');
1046						},
1047						error : function(){
1048							$('.user-upvip-alert').html('请求失败,请刷新网页。');
1049						},
1050						success: function(json){
1051							if(json.status == 200){
1052								feifei.alert.success('.user-upvip-alert', '升级完成,谢谢支持。');
1053								setTimeout(function(){location.reload();}, 2000);
1054							}else if(json.status == 404){
1055								feifei.alert.success('.user-upvip-alert', '请先登录。');
1056								setTimeout(function(){$(".ff-modal").modal('hide');$('.modal-backdrop').hide();feifei.user.login();}, 2000);
1057							}else if(json.status == 501){
1058								feifei.alert.warning('.user-upvip-alert', '影币不足,共需要'+json.info+'个影币,请先冲值!');
1059								//有卡密售卖的时候
1060								if($data_url && $('.user-upvip-btn').length){
1061									$('.user-upvip-btn').removeClass('hidden').removeClass('d-none').show();
1062								}else{
1063									setTimeout(function(){$(".ff-modal").modal('hide');$('.modal-backdrop').hide();feifei.order.payment();}, 2000);
1064								}
1065							}else{
1066								feifei.alert.warning('.user-upvip-alert', json.info);
1067							}
1068						},
1069						complete: function(xhr){
1070						}
1071					});
1072					return false;
1073				});
1074			}
1075		});
1076	},
1077	//修改邮箱
1078	'ChangeEmail':function(){
1079		$('.ff-modal').remove();
1080		$('.modal-backdrop').hide();
1081		$.ajax({
1082			type: 'get',
1083			url: cms.root+'index.php?s=user-ajax_email',
1084			timeout: 3000,
1085			success:function($html){
1086				$('body').append($html);
1087				$('.ff-modal').modal('show');
1088				$(".user-email-form").on('submit',function(e){
1089					$.ajax({
1090						url: $(this).attr('action'),
1091						type: 'POST',
1092						dataType: 'json',
1093						timeout: 3000,
1094						data: $(this).serialize(),
1095						beforeSend: function(xhr){
1096							$('.user-email-alert').html('Loading...');
1097						},
1098						error : function(){
1099							$('.user-email-alert').html('请求失败,请刷新网页。');
1100						},
1101						success: function(json){
1102							if(json.status == 200){
1103								feifei.alert.success('.user-email-alert', '邮箱修改完成。');
1104								setTimeout(function(){location.reload();}, 2000);
1105							}else if(json.status == 404){
1106								feifei.alert.success('.user-email-alert', '请先登录。');
1107								setTimeout(function(){$(".ff-modal").modal('hide');$('.modal-backdrop').hide();feifei.user.login();}, 2000);
1108							}else{
1109								feifei.alert.warning('.user-email-alert', json.info);
1110							}
1111						},
1112						complete: function(xhr){
1113						}
1114					});
1115					return false;
1116				});
1117			}
1118		});
1119	},
1120	//修改密码
1121	'ChangePwd':function(){
1122		$('.ff-modal').remove();
1123		$.ajax({
1124			type: 'get',
1125			url: cms.root+'index.php?s=user-ajax_repwd',
1126			timeout: 3000,
1127			success:function($html){
1128				$('body').append($html);
1129				$('.ff-modal').modal('show');
1130				$(".user-repwd-form").on('submit',function(e){
1131					$.ajax({
1132						url: $(this).attr('action'),
1133						type: 'POST',
1134						dataType: 'json',
1135						timeout: 3000,
1136						data: $(this).serialize(),
1137						beforeSend: function(xhr){
1138							$('.user-repwd-alert').html('Loading...');
1139						},
1140						error : function(){
1141							$('.user-repwd-alert').html('请求失败,请刷新网页。');
1142						},
1143						success: function(json){
1144							if(json.status == 200){
1145								feifei.alert.success('.user-repwd-alert', '密码修改完成。');
1146								setTimeout(function(){location.reload();}, 2000);
1147							}else if(json.status == 404){
1148								feifei.alert.success('.user-repwd-alert', '请先登录。');
1149								setTimeout(function(){$(".ff-modal").modal('hide');$('.modal-backdrop').hide();feifei.user.login();}, 2000);
1150							}else{
1151								feifei.alert.warning('.user-repwd-alert', json.info);
1152							}
1153						},
1154						complete: function(xhr){
1155						}
1156					});
1157					return false;
1158				});
1159			}
1160		});
1161	}
1162},
1163'order':{//影币订单模块
1164	'payment':function(){//在线充值付款界面
1165		$('.ff-modal').remove();
1166		$('.modal-backdrop').hide();
1167		$.ajax({
1168			type: 'get',
1169			url: cms.root+'index.php?s=payment-index',
1170			timeout: 3000,
1171			success:function($html){
1172				$('body').append($html);
1173				$('.ff-modal').modal('show');
1174				$(".forum-payment").on('submit',function(e){
1175					if($(".forum-payment input[name=score_ext]").val() < $(".forum-payment").attr('data-small')){
1176						feifei.alert.warning('.user-pay-alert', '每次至少充值<strong>'+$(".forum-payment").attr('data-small')+'</strong>元');
1177						return false;
1178					}
1179					setTimeout(function(){$(".ff-modal").modal('hide');$('.modal-backdrop').hide();}, 5000);
1180				});
1181			}
1182		});
1183	},
1184	'card':function(){//卡密充值付款界面
1185		$('.ff-modal').remove();
1186		$('.modal-backdrop').hide();
1187		$.ajax({
1188			type: 'get',
1189			url: cms.root+'index.php?s=payment-card',
1190			timeout: 3000,
1191			success:function($html){
1192				$('body').append($html);
1193				$('.ff-modal').modal('show');
1194				$(".forum-card").on('submit',function(e){
1195					$.ajax({
1196						url: $(this).attr('action'),
1197						type: 'POST',
1198						dataType: 'json',
1199						timeout: 3000,
1200						data: $(this).serialize(),
1201						beforeSend: function(xhr){
1202							$('.alert-card').html('Loading...');
1203						},
1204						error : function(){
1205							$('.alert-card').html('请求失败,请刷新网页。');
1206						},
1207						success: function(json){
1208							if(json.status == 200){
1209								feifei.alert.success('.alert-card', '充值成功,谢谢支持。');
1210								setTimeout(function(){location.reload();}, 2000);
1211							}else{
1212								feifei.alert.warning('.alert-card', json.info);
1213							}
1214						},
1215						complete: function(xhr){
1216						}
1217					});
1218					return false;
1219				});
1220			}
1221		});
1222	}
1223}
1224//end
1225};
1226/*.ff-search #wd #ff-goback .ff-gallery .ff-raty .ff-img .ff-share .ff-safecode .ff-reply*/
1227$(document).ready(function(){
1228	if(feifei.browser.useragent.mobile){
1229		feifei.mobile.jump();
1230		feifei.mobile.nav();
1231		feifei.mobile.goback();
1232		feifei.mobile.flickity();
1233	}
1234	feifei.user.load();
1235	feifei.cms.nav();//
1236	feifei.cms.collapse();
1237	feifei.cms.pushBaidu();
1238	feifei.search.dropdown();
1239	feifei.search.autocomplete();
1240	feifei.search.hot();//
1241	feifei.search.submit();//
1242	feifei.search.keydown();//
1243	feifei.image.ensureSrc();
1244	feifei.image.lazyload();
1245	feifei.image.slide();
1246	feifei.image.fallback();
1247	feifei.image.qrcode();//
1248	feifei.ads.bind();
1249	feifei.playurl.tongji();
1250	feifei.playurl.more();
1251	feifei.playurl.error();
1252	feifei.playurl.dropdown();
1253	feifei.playurl.active();
1254	feifei.playurl.xunlei();
1255	feifei.page.more();
1256	feifei.page.keydown();//
1257	feifei.page.scroll();
1258	feifei.updown.click();
1259	feifei.score.raty();
1260	feifei.scenario.load();
1261	feifei.forum.load();
1262	feifei.vcode.load();
1263	feifei.scroll.totop('ff-totop',10);
1264	feifei.record.load();//
1265	feifei.hits.load();
1266	feifei.share.baidu();
1267});

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.