PageSourceSearch

http://www.nobhoshi.com/material/js/wltz.js

js nobhoshi.com collected 2026-10-08 05:44:27 UTC 3,268 bytes, 92 lines download raw bytes

1  /**
2     * 动态元素调用
3     */
4    $(document).on("click", "a", function (event) {
5        var outerURL = this.getAttribute("href");
6        checkDomain(event, outerURL, {domainUrl:["//scjgj.wuhan.gov.cn/","http://gsj.wuhan.gov.cn"], domainName: "中国·2003网站太阳集团",domainType:0});
7    });
8     /**
9     * <a>标签进行调用
10     */
11    $("a").each(function () {
12          $(this).click(function (event) {
13              var outerURL = this.getAttribute("href");
14              checkDomain(event, outerURL, {domainUrl: ["//scjgj.wuhan.gov.cn/","http://gsj.wuhan.gov.cn"], domainName: "中国·2003网站太阳集团",domainType:0});
15          });
16      });
17  /**
18     * <select>标签进行调用
19     * 给select标签添加一个class;eg:<select class="checkDomain">
20     */
21    $(".checkDomain").each(function () {
22        $(this).change(function (event) {
23            var outerURL = this.value;
24            if (outerURL) {
25                checkDomain(event, outerURL,{domainUrl: ["//scjgj.wuhan.gov.cn/","http://gsj.wuhan.gov.cn"], domainName: "中国·2003网站太阳集团",domainType:1});
26                this.selectedIndex = 0;
27            }
28        });
29    });
30  
31    function checkDomain(event, outerURL, settings) {
32        if (!arguments[0]) {
33            //alert("传入的参数格式有误!");
34            return;
35        }
36
37        if (!arguments[1]) {
38           // alert("传入的参数格式有误!");
39            return;
40        }
41
42        var defaultSetting = {
43            domainUrl: [window.location.host],
44            domainName: window.location.host,
45            domainType: 0
46        }
47
48        var extendSetting = $.extend(defaultSetting, settings);
49
50        if (/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test(outerURL)) {
51
52            if (outerURL != "" && outerURL.toLowerCase().indexOf("javascript:") == -1) {
53                var domainUrlFlag = false;
54                for (var item in extendSetting.domainUrl) {
55                    if (outerURL.toLowerCase().indexOf(extendSetting.domainUrl[item]) == -1) {
56                        domainUrlFlag = false;
57                    } else {
58                        domainUrlFlag = true;
59                        break;
60                    }
61                }
62
63                if (!domainUrlFlag) {
64                    //阻止默认事件
65                    if (event.preventDefault) {
66                        event.preventDefault();
67                    } else {
68                        event.returnValue = false;
69                    }
70                    document.getElementById("modalDomainName").innerHTML = extendSetting.domainName;
71                    document.getElementById("modalOuterURL").value = outerURL;
72 $('#myModal').removeClass("hide");
73
74 $('#myModal').modal('show');
75                    $('#myModal').modal('show');
76                } else {
77                    if (1 === parseInt(extendSetting.domainType)) {
78                        window.open(outerURL);
79                    }
80                }
81            }
82        }
83    }
84
85    /**
86     * 页面跳转
87     */
88    function toRedirect() {
89        $('#myModal').modal('hide');
90        var outerURL = document.getElementById("modalOuterURL").value;
91        window.open(outerURL);
92    }

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.