PageSourceSearch

https://mytysoft.com/template/zmb/statics/js/stui_block.js

js mytysoft.com collected 2026-10-04 18:29:44 UTC 10,260 bytes, 303 lines download raw bytes

1var playerhigh = "1"; 
2//是否开启播放器高度自适应,0关闭1开启(开启后将播放器设置100%关闭填写固定高度)
3
4var lazyswitch = "1";
5//是否开启图片懒加载,0关闭1开启(关闭后会通过js直接加载图片,速度较慢)
6
7var playcolumn = "8"; 
8//是否开启有序播放列表,0关闭,3、6、8、10、12开启并指定列数,数字代表每行列数,手机强制4列
9
10var qrcode1 = "1";
11//右侧悬浮二维码,1自动生成(当前页面二维码),填写路径将加载指定图片(建议尺寸150*150px)例:/statics/img/wxcode.png
12
13var qrcode2 = "1";
14//内容页二维码,1自动生成(当前页面二维码),填写路径将加载指定图片(建议尺寸160*160px)例:/statics/img/wxcode.png
15
16var copyshort = "0";
17//是否开启自动生成短链接,0关闭1开启(开启后点击分享按钮将会复制短链否则复制默认链接)
18
19var baidushare = "0";
20//是否开启百度分享,0关闭,启用本地分享填写/statics/api/js/share.js,启用官网分享填写http://bdimg.share.baidu.com/static/api/js/share.js(不支持https)
21
22var stui = {
23	'browser': {//浏览器
24		url: document.URL,
25		domain: document.domain,
26		title: document.title,
27		language: (navigator.browserLanguage || navigator.language).toLowerCase(),
28		canvas: function() {
29			return !!document.createElement("canvas").getContext
30		}(),
31		useragent: function() {
32			var a = navigator.userAgent;
33			return {
34				mobile: !! a.match(/AppleWebKit.*Mobile.*/),
35				ios: !! a.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
36				android: -1 < a.indexOf("Android") || -1 < a.indexOf("Linux"),
37				iPhone: -1 < a.indexOf("iPhone") || -1 < a.indexOf("Mac"),
38				iPad: -1 < a.indexOf("iPad"),
39				trident: -1 < a.indexOf("Trident"),
40				presto: -1 < a.indexOf("Presto"),
41				webKit: -1 < a.indexOf("AppleWebKit"),
42				gecko: -1 < a.indexOf("Gecko") && -1 == a.indexOf("KHTML"),
43				weixin: -1 < a.indexOf("MicroMessenger")
44			}
45		}()
46	},
47	'mobile': {//移动端
48		'popup': function() {
49			$popblock = $(".popup");
50			$(".open-popup").click(function() {
51				$popblock.addClass("popup-visible");
52				$("body").append('<div class="mask"></div>');
53				$(".close-popup").click(function() {
54					$popblock.removeClass("popup-visible");
55					$(".mask").remove();
56					$("body").removeClass("modal-open");
57				});
58				$(".mask").click(function() {
59					$popblock.removeClass("popup-visible");
60					$(this).remove();
61					$("body").removeClass("modal-open");
62				});
63			})
64		},
65		'slide': function() {
66			$(".type-slide").each(function(a) {
67				$index = $(this).find('.active').index()*1;
68				if($index > 3){
69					$index = $index-3;
70				}else{
71					$index = 0;
72				}
73				$(this).flickity({
74					cellAlign: 'left',
75					freeScroll: true,
76					contain: true,
77					prevNextButtons: false,				
78					pageDots: false,
79					initialIndex: $index
80				});
81			});
82		},
83		'mshare': function() {
84			$(".open-share").click(function() {
85				stui.browser.useragent.weixin ? $("body").append('<div class="mobile-share share-weixin"></div>') : $("body").append('<div class="mobile-share share-other"></div>');
86				$(".mobile-share").click(function() {
87					$(".mobile-share").remove();
88					$("body").removeClass("modal-open");
89				});
90			});
91		}
92	},
93	'images': {//图片处理
94		'lazyload': function() {
95			if(lazyswitch==1){
96				$(".lazyload").lazyload({
97					effect: "fadeIn",
98					threshold: 200,
99					failurelimit: 15,
100					skip_invisible: false
101				});
102			}else{				
103				$(".lazyload").each(function(){
104					var original = $(this).attr("data-original");
105			        $(this).css("background-image","url("+original+")");
106			        $(this).attr("data-original","");
107			        if($(this).attr("src")!= undefined){
108			        	$(this).attr("src",original);
109			        }	        
110			    });
111			}			
112		},
113		'carousel': function() {
114			$('.carousel_default').flickity({
115			  	cellAlign: 'left',
116			  	contain: true,
117			  	wrapAround: true,
118			  	autoPlay: true,
119			  	prevNextButtons: false
120			});					
121			$('.carousel_wide').flickity({
122			  	cellAlign: 'center',
123			  	contain: true,
124			  	wrapAround: true,
125			  	autoPlay: true
126			});
127			$('.carousel_center').flickity({
128			  	cellAlign: 'center',
129			  	contain: true,
130			  	wrapAround: true,
131			  	autoPlay: true,
132			  	prevNextButtons: false
133			});			
134			$('.carousel_right').flickity({
135			  	cellAlign: 'left',
136			  	wrapAround: true,
137			  	contain: true,
138			  	pageDots: false
139			});
140		},
141		'qrcode': function() {
142			if(qrcode1==1){
143				if($("#qrcode").length){
144					var qrcode = new QRCode('qrcode', {
145					  	text: stui.browser.url,
146					  	width: 150,
147					  	height: 150,
148					  	colorDark : '#000000',
149					  	colorLight : '#ffffff',
150					  	correctLevel : QRCode.CorrectLevel.H
151					});
152					$("#qrcode img").attr("class","img-responsive");
153				}
154			} else {
155				if($("#qrcode").length){
156					$("#qrcode").append("<img class='img-responsive' src='"+qrcode1+"' width='150' height='150' />");
157				}
158			}
159			if(qrcode2==1){
160				if($("#qrcode2").length){
161					var qrcode = new QRCode('qrcode2', {
162					  	text: stui.browser.url,
163					  	width: 160,
164					  	height: 160,
165					  	colorDark : '#000000',
166					  	colorLight : '#ffffff',
167					  	correctLevel : QRCode.CorrectLevel.H
168					});
169					$("#qrcode2 img").attr("class","img-responsive").css({"padding":"10px","background-color":"#fff"});
170				}
171			} else {
172				if($("#qrcode2").length){
173					$("#qrcode2").append("<img class='img-responsive' src='"+qrcode2+"' width='160' height='160' />");
174				}
175			}
176		}
177	},
178	'common': {//公共基础
179		'bootstrap': function() {
180			$('a[data-toggle="tab"]').on("shown.bs.tab", function(a) {
181				var b = $(a.target).text();
182				$(a.relatedTarget).text();
183				$("span.active-tab").html(b);
184			});
185		},
186		'headroom': function() {
187			if($("#header-top").length){
188				var header = document.querySelector("#header-top");
189	            var headroom = new Headroom(header, {
190					tolerance: 5,
191					offset: 205,
192					classes: {
193						initial: "top-fixed",
194						pinned: "top-fixed-up",
195						unpinned: "top-fixed-down"
196					}
197				});
198				headroom.init();
199			}
200		},
201		'history': function() {
202			if($("#stui_history").length){
203				if($.cookie("recente")){
204				    var json=eval("("+$.cookie("recente")+")");
205				    var list="";
206				    for(i=0;i<json.length;i++){
207				        list = list + "<li class='top-line'><a href='"+json[i].vod_url+"' title='"+json[i].vod_name+"'><span class='pull-right text-red'>"+json[i].vod_part+"</span>"+json[i].vod_name+"</a></li>";
208				    }
209				    $("#stui_history").append(list);
210				}
211				else
212		            $("#stui_history").append("<p style='padding: 80px 0; text-align: center'>您还没有看过影片哦</p>");
213			   
214			    $(".historyclean").on("click",function(){
215			    	$.cookie("recente",null,{expires:-1,path: '/'});
216			    });
217			}
218		},
219		'collapse': function() {
220			if($(".detail").length){
221				$(".detail").find("a.detail-more").on("click",function(){
222					$(this).parent().find(".detail-sketch").addClass("hide");
223					$(this).parent().find(".detail-content").css("display","");
224					$(this).remove();
225				});
226			}
227		},
228		'scrolltop': function() {
229			var a = $(window);
230			$scrollTopLink = $("a.backtop");
231			a.scroll(function() {
232				500 < $(this).scrollTop() ? $scrollTopLink.css("display", "") : $scrollTopLink.css("display", "none");
233			});
234			$scrollTopLink.on("click", function() {
235				$("html, body").animate({
236					scrollTop: 0
237				}, 400);
238				return !1
239			});
240		},
241		'copylink': function(){
242			if(copyshort==1){
243				if($(".copylink").length){
244					$.ajax({ 
245						type : 'GET',  
246				        url : 'https://api.weibo.com/2/short_url/shorten.json?source=2849184197&url_long='+encodeURIComponent(stui.browser.url),
247				        dataType : 'JSONP',   
248				        success : function(r) {
249				        	url_short = r.data.urls[0].url_short;	
250				        	var clipboard = new Clipboard('.copylink', {
251								text: function() {									
252									return url_short;
253								}
254							});
255							clipboard.on('success', function(e) {
256								alert("地址复制成功,赶快分享给小伙伴吧!");
257							});
258			        	} 		        	
259				    });
260				}
261			} else {
262				if($(".copylink").length){
263					var url_short = stui.browser.url;	
264					var clipboard = new Clipboard('.copylink', {
265						text: function() {									
266							return url_short;
267						}
268					});
269					clipboard.on('success', function(e) {
270						alert("地址复制成功,赶快分享给小伙伴吧!");
271					});
272				}
273			}
274			
275		},
276		'share': function(){
277			if(baidushare!=0){
278				$(".share").html('<span class="bds_shere"></span><a class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a><a class="bds_bdhome" data-cmd="bdhome" title="分享到百度新首页"></a><a class="bds_tqf" data-cmd="tqf" title="分享到腾讯朋友"></a><a class="bds_youdao" data-cmd="youdao" title="分享到有道云笔记"></a><a class="bds_more" data-cmd="more" title="更多"></a>');
279				window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName("head")[0]||body).appendChild(createElement('script')).src=''+baidushare+'?cdnversion='+~(-new Date()/36e5)];
280			}			
281		}	
282	}	
283};
284
285
286
287$(document).ready(function() {	
288	if(stui.browser.useragent.mobile){
289		stui.mobile.slide();
290		stui.mobile.popup();
291		stui.mobile.mshare();
292	}
293	stui.images.lazyload();
294	stui.images.carousel();
295	stui.images.qrcode();
296	stui.common.bootstrap();
297	stui.common.headroom();
298	stui.common.history();
299	stui.common.collapse();
300	stui.common.scrolltop();
301	stui.common.copylink();
302	stui.common.share();
303});

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.