PageSourceSearch

https://achitechtools.com/statics/js/stui_default.js?v=2

js achitechtools.com collected 2026-10-04 16:05:45 UTC 7,013 bytes, 213 lines download raw bytes

1/*!
2 * Copyright 2016-2018 http://v.shoutu.cn
3 * Email [email protected],[email protected]
4 */
5var stui = {
6	'browser': {
7		url: document.URL,
8		domain: document.domain,
9		title: document.title,
10		language: (navigator.browserLanguage || navigator.language).toLowerCase(),
11		canvas: function() {
12			return !!document.createElement("canvas").getContext
13		}(),
14		useragent: function() {
15			var a = navigator.userAgent;
16			return {
17				mobile: !! a.match(/AppleWebKit.*Mobile.*/),
18				ios: !! a.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
19				android: -1 < a.indexOf("Android") || -1 < a.indexOf("Linux"),
20				iPhone: -1 < a.indexOf("iPhone") || -1 < a.indexOf("Mac"),
21				iPad: -1 < a.indexOf("iPad"),
22				trident: -1 < a.indexOf("Trident"),
23				presto: -1 < a.indexOf("Presto"),
24				webKit: -1 < a.indexOf("AppleWebKit"),
25				gecko: -1 < a.indexOf("Gecko") && -1 == a.indexOf("KHTML"),
26				weixin: -1 < a.indexOf("MicroMessenger")
27			}
28		}()
29	},
30	'mobile': {
31		'headroom': function() {
32			if($("#header-top").length){
33				var header = document.querySelector("#header-top");
34	            var headroom = new Headroom(header, {
35					tolerance: 5,
36					offset: 205,
37					classes: {
38						initial: "top-fixed",
39						pinned: "top-fixed-up",
40						unpinned: "top-fixed-down"
41					}
42				});
43				headroom.init();
44			}
45		},		
46		'slide': function() {
47			$(".type-slide").each(function(a) {
48				$index = $(this).find('.active').index()*1;
49				if($index > 3){
50					$index = $index-3;
51				}else{
52					$index = 0;
53				}
54				$(this).flickity({
55					cellAlign: 'left',
56					freeScroll: true,
57					contain: true,
58					prevNextButtons: false,				
59					pageDots: false,
60					initialIndex: $index
61				});
62			});
63		},
64		'mshare': function() {
65			$(".open-share").click(function() {
66				stui.browser.useragent.weixin ? $("body").append('<div class="mobile-share share-weixin"></div>') : $("body").append('<div class="mobile-share share-other"></div>');
67				$(".mobile-share").click(function() {
68					$(".mobile-share").remove();
69					$("body").removeClass("modal-open")
70				})
71			})
72		}
73	},
74	'flickity': {
75		'carousel': function() {
76			$('.carousel_center').flickity({
77			  	cellAlign: 'center',
78			  	contain: true,
79			  	wrapAround: true,
80			  	autoPlay: true,
81			  	prevNextButtons: false
82			});	
83		}
84	},	
85	'images': {
86		'lazyload': function() {
87			$(".lazyload").lazyload({
88				effect: "fadeIn",
89				threshold: 200,
90				failurelimit: 15,
91				skip_invisible: false
92			});
93		},
94		'qrcode': function() {
95			if($("#qrcode").length){
96				var qrcode = new QRCode('qrcode', {
97				  	text: stui.browser.url,
98				  	width: 150,
99				  	height: 150,
100				  	colorDark : '#000000',
101				  	colorLight : '#ffffff',
102				  	correctLevel : QRCode.CorrectLevel.H
103				});
104				$("#qrcode img").attr("class","img-responsive");
105			}
106		}
107	},
108	'common': {
109		'stylecolor': function() {
110	        var favstyle = readCookie('stylecolor');
111	        console.log(favstyle);
112	        if(favstyle){
113	            $("link[name='skin']").attr({href:favstyle});
114	        }
115	        $(".gray-color").click(function(){
116	            $("link[name='skin']").attr({href:"/statics/css/stui_color-gray.css"});
117	            createCookie('stylecolor',"/statics/css/stui_color-gray.css",365);
118	        });
119	        $(".gules-color").click(function(){
120	            $("link[name='skin']").attr({href:"/statics/css/stui_color-gules.css"});
121	            createCookie('stylecolor',"/statics/css/stui_color-gules.css",365);
122	        }); 
123	        $(".blue-color").click(function(){
124	            $("link[name='skin']").attr({href:"/statics/css/stui_color-blue.css"});
125	            createCookie('stylecolor',"/statics/css/stui_color-blue.css",365);
126	        });
127	        $(".green-color").click(function(){
128	            $("link[name='skin']").attr({href:"/statics/css/stui_color-green.css"});
129	            createCookie('stylecolor',"/statics/css/stui_color-green.css",365);
130	        }); 
131	        function createCookie(name,value,days){
132	            var expires;
133	            if (days) {
134	                expires = days;
135	            } else{
136	                expires = "";
137	            }
138	            $.cookie(name,value,{expires:expires,path:'/'});
139	        }
140	        function readCookie(name){
141	            var styles = $.cookie(name);
142	            return styles;
143	        }
144	        function delCookie(name){
145	             $.cookie(name,null)
146	        }
147		},
148		'history': function() {
149			if($.cookie("recente")){
150			    var json=eval("("+$.cookie("recente")+")");
151			    var list="";
152			    for(i=0;i<json.length;i++){
153			        list = list + "<li><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>";
154			    }
155			    $("#stui_history").append(list);
156			}
157			else
158	            $("#stui_history").append("<p style='padding: 80px 0; text-align: center'>您还没有看过影片哦</p>");
159		   
160		    $(".historyclean").on("click",function(){
161		    	$.cookie("recente",null,{expires:-1,path: '/'});
162		    })		    
163		},
164		'playlink': function() {
165			var playlist=$(".playlink");
166			playlist.each(function(i){
167				if($(this).find("li").length>30){
168					$(this).find("li").eq(29).after("<li class='more'><a href='javascript:;'><i class='iconfont icon-add'></i> 更多</a></li>");
169					var more=$(this).find("li.more");
170	                var prev=more.index();
171	                more.show();
172	                for(i=prev+1;i<$(this).find("li").length;++i)
173	                $(this).find("li").eq(i).hide();
174				}else if($(this).find("li").length<5){
175					$(this).addClass("nonum")
176				}
177			})
178			$("li.more").on("click",function(){
179	            var more=$(this).parent("ul").find("li.more");
180	            var newlist=$(this).parent("ul").find("li");
181	            var prev=more.index();
182	            for(i=0;i<newlist.length;++i)
183	                newlist.eq(i).show();
184	            more.hide();
185	       })
186		},
187		'bootstrap': function() {
188			$('a[data-toggle="tab"]').on("shown.bs.tab", function(a) {
189				var b = $(a.target).text();
190				$(a.relatedTarget).text();
191				$("span.active-tab").html(b)
192			})
193		},
194		'share': function(){
195			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='/statics/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
196		}
197	}	
198};
199$(document).ready(function() {
200	if(stui.browser.useragent.mobile){	
201		stui.mobile.slide();
202		stui.mobile.headroom();
203		stui.mobile.mshare();
204	}
205	stui.flickity.carousel();
206	stui.images.lazyload();
207	stui.images.qrcode();
208	stui.common.stylecolor();
209	stui.common.history();
210	stui.common.playlink();
211	stui.common.bootstrap();
212	stui.common.share();
213});

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.