PageSourceSearch

http://dzkx.org/style/web/js/cn/tpl5/main.js

js dzkx.org collected 2026-10-02 10:07:16 UTC 3,702 bytes, 125 lines download raw bytes

1$(function(){
2		var tempYear= new Date().getFullYear();
3		var tempDay = new Date().getDate();
4		
5//	datechange = dateTemp
6//var dateArr=datechange.split("-");
7	if($("#language").val() == "cn" || $("#language").val() == "zh"){
8		var tempMonth = new Date().getMonth()+1;
9		var datechange =tempYear+"年"+tempMonth+"月"+tempDay+"日\xa0"
10		
11		var wee = new Array("日", "一", "二", "三", "四", "五", "六");  
12		var weekto = new Date().getDay();  
13		var weekstr = wee[weekto];
14		$(".dateCon ").text(datechange+'星期'+weekstr);
15		//$(".weekcon").text(weekstr);
16	}	
17	if($("#language").val() == "en"){
18		var tempMonth = new Date().getMonth();
19		var tempMonEng =["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug","Sept.","Oct.","Nov.","Dec."]
20         var datechange =tempMonEng[tempMonth]+" "+tempDay+", "+tempYear
21 		$(".dateCon ").text(datechange);
22	}
23
24	
25	if($('#searchSign').length>0){
26		$('.banner-bg .tgbtn,.banner-bg .j-searchBg').hide();
27	}
28	
29	// 中文文章详情页右侧PDF的大小,从kb转为Mb
30	if($('.mind-pdf #pdfSize').length > 0){
31		var temp = Number($('.mind-pdf #pdfSize').html());
32		if(!isNaN(temp)){
33			var curHtml = "(" + kb2Mb(temp) + "MB)";
34			$('.mind-pdf #pdfSize').html(curHtml);
35		}
36		
37	}
38})
39
40function kb2Mb(value) {
41    var n = 1;
42    if (typeof value === 'number' && !isNaN(value) && value != 0) {
43        return Math.round(value / 1024 * Math.pow(10, n)) / Math.pow(10, n);
44    } else {
45        return 0;
46    }
47}	
48
49
50
51function loadPluginsMetric(articles){
52	//if($('.cited-show').length > 0){
53		var idArray = [];
54		for(var i = 0;i<articles.length;i++){
55			idArray.push(articles[i].id);
56		}
57		
58    if (idArray.length > 0) {
59    var ids = idArray.toString();	
60		$.ajax({
61	        url: local_host + '/article/getArticleMetric',
62			async:false,
63	        data: { 'articleIds': ids },
64	        success: function (data) {
65	        	if(data.result == "success"){
66		        	$.each(data.data,function(i,e){
67			//htmlViewCount //pdfDownCount //viewCount
68		        		for(var j = 0;j<articles.length;j++){
69		        			if(e.articleId == articles[j].id){
70		        				var visitArticleCount = 0;
71			        			if(!isNull(e.visitArticleCount) && e.visitArticleCount != 0){
72			        				visitArticleCount = e.visitArticleCount;
73				        		}
74								articles[j].visitArticleCount = visitArticleCount;
75								var pdfDownloadCount = 0;
76			        			if(!isNull(e.pdfDownloadCount) && e.pdfDownloadCount != 0){
77			        				pdfDownloadCount = e.pdfDownloadCount;
78				        		}	
79								articles[j].pdfDownloadCount = 	pdfDownloadCount;					
80		        				
81		        			}
82	        			}
83		    		})
84	        	}else{
85	        		console.log(data.message);
86	        	}
87	        }
88		})
89	}
90}
91
92
93$(function(){
94	if($('#articleId').length){
95		if($('.visitArticleNum').length){
96			var id = $('#articleId').val();
97			setTimeout(function(){
98				$.ajax({
99			        url: local_host + '/article/getArticleMetric',
100			        data: { 'articleIds': id },
101			        success: function (data) {
102			        	if(data.result == "success"){
103				        	$.each(data.data,function(i,e){
104								if(e.articleId == id){
105									$('.visitArticleNum').html(e.visitArticleCount);
106									if(!e.visitArticleCount) $('.visitArticleNum').parent().hide();
107									if($('.pdfArticleNum').length){
108										$('.pdfArticleNum').html(e.pdfDownloadCount);
109										if(!e.pdfDownloadCount) $('.pdfArticleNum').parent().hide();
110									}
111								}
112				    		})
113			        	}else{
114			        		console.log(data.message);
115			        	}
116			        }
117				})				
118			},100)		
119		}
120	}
121
122})
123
124
125

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.