PageSourceSearch

https://fujexp.com/js/app.js

js fujexp.com collected 2026-10-04 13:15:18 UTC 5,817 bytes, 193 lines download raw bytes

1var App = function () {
2	
3	function handleMsViewport() {
4        if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
5			var msViewportStyle = document.createElement('style')
6			msViewportStyle.appendChild(
7			  document.createTextNode(
8				'@-ms-viewport{width:auto!important}'
9			  )
10			)
11			document.querySelector('head').appendChild(msViewportStyle)
12		}
13	}
14	function handleAndroidSelect() {
15		 var nua = navigator.userAgent
16		 var isAndroid = (nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1 && nua.indexOf('Chrome') === -1)
17		 if (isAndroid) {
18			 jQuery('select.form-control').removeClass('form-control').css('width', '100%')
19		 }
20	} 
21
22	function handleBootstrap() {
23		$("#owl-demo").owlCarousel(
24		{
25			singleItem : true,
26			paginationNumbers : true,
27			autoPlay:true,
28			stopOnHover:true,
29			transitionStyle : "fade"
30		});  
31		$("#owl-indexproduct").owlCarousel({
32			autoPlay: 3000, 
33			pagination: false,
34			items : 4,
35			itemsDesktop : [1199,3],
36			itemsDesktopSmall : [979,3],
37			itemsDesktopSmall : [979,3],
38			itemsTablet : [768,3],
39			itemsMobile : [479,1] 
40		});
41	}
42
43	function insertBeforePic(str,auto) 
44	{
45		var lazy = $("[" + str + "]");
46		for (var i = 0; i < lazy.length; i++) {
47			var source = lazy[i].getAttribute(str);
48			var img = new Image();
49			img.src = source;
50			img.alt = lazy[i].getAttribute("data-alt");
51			if(auto)
52			{
53			   var str=source.split('.');
54			   var str1=str[0].split('_');
55			   img.width = str1[1];
56			   img.height = str1[2];
57			}else {
58				img.width = lazy[i].getAttribute("data-width");
59				img.height = lazy[i].getAttribute("data-height");
60			}
61			lazy[i].insertBefore(img, lazy[i].firstChild)
62		}
63	}
64
65	function handleLazyResponsive()
66	{   
67		if (window.matchMedia("(max-width: 30em)").matches) {
68			var src = "data-src-480";
69		} else if (window.matchMedia("(max-width: 40em)").matches) {
70			var src = "data-src-640";
71		} else if (window.matchMedia("(max-width: 48em)").matches) {
72			var src = "data-src-768";
73		} else if (window.matchMedia("(max-width: 62em)").matches) {
74			var src = "data-src-992";
75		} else {
76			var src = "data-src-1200";
77		}
78		insertBeforePic(src,true);
79        insertBeforePic("data-src-origin",false);
80	}
81
82	function handleCaptcha()
83	{
84		if($("#captchaLink").length > 0 ) {
85			 $('#captchaLink').on('click', function(e) {
86				var radom = Math.random();
87				var urlVal = $("#captchaLink")[0].getAttribute("data-captcha");
88				if(urlVal.indexOf("?") == -1 ){
89					urlVal = urlVal+'/'+radom;
90				}else{
91					urlVal = urlVal + '&random'+radom;
92				}
93				$('#captchaImg').attr('src',urlVal);
94				e.preventDefault();
95			 });
96			 $('#captchaLink').click();
97		}    
98	}
99    
100	function handleJobValidation()
101	{
102		if($("#validation-job").length > 0 ) {
103		   $('#validation-job').validate({
104				errorElement: 'div',
105				errorClass: 'help-block',
106				focusInvalid: false,
107				rules: {  
108					resumename: {  required: true},  
109					resumetel: {  required: true},  
110					resumeemail: { required: true,  email: true}
111				},  
112				messages: {  
113					resumename: { required: "姓名不能为空ï¼?" },  
114					resumetel: { required: "联系电话不能为空ï¼?" },    
115					resumeemail: { required: "E-mail不能为空ï¼?", email: "E-mail格式错误" }
116				}, 
117				highlight: function (e) {
118					$(e).closest('.form-group').removeClass('has-info').addClass('has-error');
119				},
120				success: function (e) {
121					$(e).closest('.form-group').removeClass('has-error');//.addClass('has-info');
122					$(e).remove();
123				},
124				errorPlacement: function (error, element) {
125					error.insertAfter(element.parent());
126				}
127		   });
128		}      
129	}
130    
131	function handleMessageValidation()
132	{
133		if($("#validation-message").length > 0 ) {
134		   $('#validation-message').validate({
135				errorElement: 'div',
136				errorClass: 'help-block',
137				focusInvalid: false,
138				rules: {  
139					username: {  required: true},  
140					messagetitle: {  required: true},  
141					messagecontent: {  required: true},  
142					email: { required: true,  email: true},
143					captcha: { required: true,remote:  $('#checkCaptchaUrl').val()}
144				},  
145				messages: {  
146					username: { required: "用户名不能为空!" },  
147					messagetitle: { required: "留言标题不能为空ï¼?" },  
148					messagecontent: { required: "留言内容不能为空ï¼?" },  
149					email: { required: "邮件不能为空ï¼?", email: "格式错误" },
150					captcha:{required: '请输入字符串',remote: '输入正确的验证码'}
151				}, 
152				highlight: function (e) {
153					$(e).closest('.form-group').removeClass('has-info').addClass('has-error');
154				},
155				success: function (e) {
156					$(e).closest('.form-group').removeClass('has-error');//.addClass('has-info');
157					$(e).remove();
158				},
159				errorPlacement: function (error, element) {
160					error.insertAfter(element.parent());
161				}
162		   });
163		}      
164	}
165
166	return {
167        init: function () {
168			handleMsViewport();
169			handleAndroidSelect();
170			handleBootstrap();
171			handleLazyResponsive();
172			handleCaptcha();
173			handleMessageValidation();
174			handleJobValidation();
175        },
176		initMap: function (tip,x,y) {
177			var geocoder,map,marker = null;
178			var center = new qq.maps.LatLng(x,y);
179			map = new qq.maps.Map(document.getElementById('map'),{center: center,zoom: 17});
180			var infoWin = new qq.maps.InfoWindow({map: map});
181			infoWin.open();
182			infoWin.setContent(tip);
183			infoWin.setPosition(center);
184			geocoder = new qq.maps.Geocoder({
185				complete : function(result){
186					map.setCenter(result.detail.location);
187					var marker = new qq.maps.Marker({map:map,position: result.detail.location});
188				}
189			});
190		}
191	};
192
193}();

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.