PageSourceSearch

http://www.liannan.gov.cn/global/power-link-tip.js

js liannan.gov.cn collected 2026-10-02 20:59:10 UTC 3,771 bytes, 109 lines download raw bytes

1//非政府网站跳转提示
2String.prototype.startWith=function(str){
3  if(str==null||str==""||this.length==0||str.length>this.length)
4   return false;
5  if(this.substr(0,str.length)==str)
6     return true;
7  else
8     return false;
9  return true;
10 }
11
12/**
13 * 点击外链询问离开
14 * @param {this对象} _this this对象。
15 * @param {string} type 类型"aLink"为a链接,"select"为select下拉。
16 */
17function isExcelLink(_this, type) {
18	var o = $(_this);
19	var linkEcrypted = false;
20	var thisSrc = "";
21	var target = "";
22	if (type == "aLink") {
23		thisSrc = o.attr('href');
24	} else if (type == "select" && !!$('option:selected', o).attr('value')) {
25		thisSrc = o.val();
26	} else {
27		return false;
28	}
29	//判断是否加载 layer.js 库,没有的话加载!
30	if (typeof layer === 'undefined') {
31		$('body').prepend('<link href="/global/layer.css" rel="stylesheet" type="text/css">');
32		$('body').prepend('<script src="/global/layer.js"></script>');
33	}
34	//加入不需要外链提示的链接
35	if(thisSrc!=null&&thisSrc.indexOf(document.domain)<0&&!thisSrc.startWith('/')&&!thisSrc.startWith('..') && thisSrc.split("?")[0].indexOf("gov.cn")<0){
36		if(thisSrc.startWith('www.') || thisSrc.startWith('http')){
37			o.removeAttr('href');
38			var jx = true;
39			var w = '480px';
40			var h = 'auto';
41			if(window.screen.width < 768) { w = '90%'; h = 'auto';}
42			var cf = layer.confirm('<div style="margin-top:15px; font-size:18px;">您即将访问非政府网站链接,是否继续?</div>', {
43//			var cf = layer.confirm('<div style="margin-top:20px; font-size:16px;">您访问的链接即将离开“'+document.querySelector("title").innerText+'” 是否继续?</div>', {
44				btn:[ '继续访问', '放弃' ],
45				title: false,
46				shade: 0.7,
47				area: [w, h],
48				shadeClose: true,
49				cancel: function(index){ o.attr('href',thisSrc); }
50			}, function() {
51				o.attr('href',thisSrc);
52				layer.close(cf);
53				window.open(thisSrc);
54			}, function() {
55				o.attr('href',thisSrc);
56			});
57		}
58	}
59	else if (type == "select") {
60        window.open(thisSrc);
61	}
62	else if (type == "aLink" && linkEcrypted) {
63		window.open(thisSrc);
64	}
65}
66
67$(document).on('click', 'a:not("[data-power-noExcelLinks] a,[data-power-noExcelLink]")', function () {
68	isExcelLink(this, "aLink");
69});
70$(document).on('change','[data-power-select-ExcelLink]',function () {
71	isExcelLink(this, "select");
72});
73
74/*
75//点击外链询问离开
76$(document).on('click','a',function(){
77	var o = $(this);
78	var thisSrc = o.attr('href');
79	//判断是否加载 layer.js 库,没有的话加载!
80	if (typeof layer === 'undefined') {
81		$('body').prepend('<link href="/global/layer.css" rel="stylesheet" type="text/css">');
82		$('body').prepend('<script src="/global/layer.js"></script>');
83	}
84	//加入不需要外链提示的链接
85	if(thisSrc!=null&&thisSrc.indexOf(document.domain)<0&&!thisSrc.startWith('/')&&!thisSrc.startWith('..') && thisSrc.split("?")[0].indexOf("gov.cn")<0){
86		if(thisSrc.startWith('www.') || thisSrc.startWith('http')){
87			o.removeAttr('href');
88			var jx = true;
89			var w = '480px';
90			var h = 'auto';
91			if(window.screen.width < 768) { w = '90%'; h = 'auto';}
92			var cf = layer.confirm('<div style="margin-top:20px; font-size:16px;">您访问的链接即将离开“'+document.querySelector("title").innerText+'”门户网站 是否继续?</div>', {
93				btn:[ '继续访问', '放弃' ],
94				title: false,
95				shade: 0.7,
96				area: [w, h],
97				shadeClose: true,
98				cancel: function(index){ o.attr('href',thisSrc); }
99			}, function() {
100				o.attr('href',thisSrc);
101				layer.close(cf);
102				window.open(thisSrc);
103			}, function() {
104				o.attr('href',thisSrc);
105			});
106		}
107	}
108});
109*/

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.