PageSourceSearch

https://www.jcqzw.com/xtwj/js/common.js?v=20260624

js jcqzw.com collected 2026-10-08 19:04:22 UTC 5,392 bytes, 161 lines download raw bytes

1// @ts-nocheck
2$(document).ready(function () {
3  // 移动端菜单
4  $(".menu-btn,.mask").click(function () {
5    $(".menu, .menu-btn, .mask").toggleClass("on");
6  });
7  $('.menu .menu_list_more > a').click(function (e) {
8    e.preventDefault();
9    $(this).siblings('ul').slideToggle()
10    $(this).parent('.menu_list_more').siblings().find('ul').slideUp()
11  });
12
13  //返回顶部
14  function initBackToTop(options) {
15    if ($('#backtop').length) return;
16    $('body').append('<div id="backtop" class="backtop" title="返回顶部"></div>');
17    const settings = $.extend({
18      selector: '#backtop',
19      offset: 400,
20      speed: 400,
21    }, options);
22    const $btn = $(settings.selector);
23    if (!$btn.length) return;
24
25    $(window).scroll(function () {
26      $(this).scrollTop() > settings.offset
27        ? $btn.fadeIn(300)
28        : $btn.fadeOut(300);
29    });
30
31    $btn.off('click.backtop').on('click.backtop', function () {
32      $('html, body').stop(true).animate({
33        scrollTop: 0
34      }, settings.speed);
35    });
36  }
37  // initBackToTop();
38
39  // 检测外链跳转
40  function getSiteName() {
41    // 从页面标题提取
42    var pageTitle = document.title;
43    var siteName = '';
44
45    // 常见分割符提取站点名
46    if (pageTitle) {
47      // 尝试从标题中提取站点名称(常见格式:"页面名称 - 站点名称")
48      var titleParts = pageTitle.split(/\s*[-|]\s*/);
49      if (titleParts.length > 1) {
50        siteName = titleParts[titleParts.length - 1]; // 取最后一个部分
51      } else {
52        siteName = pageTitle;
53      }
54
55      // 移除可能的尾缀
56      siteName = siteName.replace(/首页|官网|网站|门户|首页$/, '').trim();
57    }
58
59    return siteName || '当前网站';
60  }
61  var currentSiteName = getSiteName();
62  // $('a[href^="http"]').each(function () {
63  //   var href = $(this).attr('href');
64  //   if (href.indexOf('183.95.190.187') == -1) {
65  //     $(this).click(function (e) {
66  //       e.preventDefault();
67  //       layui.layer.open({
68  //         title: false,
69  //         type: 0,
70  //         offset: '100px',
71  //         id: 'wltz',
72  //         content: '<div style="padding: 16px;font-size: 18px;">您访问的链接即将离开"' + currentSiteName + '门户网站" 是否继续?</div>', area: 'auto',
73  //         shade: 0.8,
74  //         skin: 'layer-wltz',
75  //         move: false,
76  //         resize: false,
77  //         btn: ['继续访问', '放弃'],
78  //         btn1: function (index, layero, that) {
79  //           window.open(href)
80  //           layui.layer.close(index);
81  //         },
82  //         btn2: function (index, layero, that) {
83  //           layui.layer.close(index);
84  //         },
85  //       });
86  //     });
87  //   }
88  // });
89
90  // tab切换-click
91  $('.tab_pane_click .tab li:not(.nohover)').click(function () {
92    $(this).addClass('cur').siblings().removeClass('cur')
93    $(this).parents('.tab_pane').find('.pane').children('div,ul').hide().eq($(this).index()).show()
94    var url = $(this).find('a').attr('href');
95    $(this).parents('.tab_box').find('.more').attr('href', url)
96  })
97  // tab切换-hover
98  $('.tab_pane_hover .tab li:not(.nohover)').mouseover(function () {
99    $(this).addClass('cur').siblings().removeClass('cur')
100    $(this).parents('.tab_pane').find('.pane').children('div,ul').hide().eq($(this).index()).show()
101    var url = $(this).find('a').attr('href');
102    $(this).parents('.tab_box').find('.more').attr('href', url)
103  })
104  // 处理移动端加载更多
105  function handleMobileLinks() {
106    var isMobileView = $(window).width() < 992;
107    $('.tab_pane_mobile .mobile_nolink').off('click').on('click', function (e) {
108      if (isMobileView) {
109        e.preventDefault();
110      }
111    });
112  }
113  handleMobileLinks();
114  $(window).resize(handleMobileLinks);
115
116  // 侧边栏
117  $('.sidebar_menu li').each(function () {
118    const $menu = $(this);
119    const $subMenu = $menu.find('> .sub_menu');
120    if ($subMenu.length) {
121      if ($subMenu.find('li').length === 0) {
122        $subMenu.remove();
123        $menu.find('> a i').remove();
124      } else {
125        $menu.addClass('has_child');
126      }
127      if ($menu.hasClass('cur') || $menu.find('.cur').length > 0) {
128        $menu.addClass('toggled');
129      }
130    }
131  });
132  $('.sidebar_menu .has_child > a').click(function (e) {
133    e.preventDefault();
134    const $menu = $(this).parent();
135    $menu.toggleClass('toggled')
136      .siblings('.has_child').removeClass('toggled');
137  });
138
139  // 详情页
140  // 操作条固定
141  function optionFixed() {
142    var st = $(document).scrollTop()
143    var gt = $('.article .article_content').offset().top;
144    st > gt ? $('.article .option').addClass('fixed') : $('.article .option').removeClass('fixed');
145    $('.article .article_title2').text($('.article .article_title').text());
146  }
147  // 如果条数少于1,则隐藏
148  function hideLessThanOne(father) {
149    var links = $(father + ' li').length;
150    if (links < 1) {
151      $(father).hide();
152    }
153  }
154  if ($('.article').length > 0) {
155    $(window).bind('load scroll resize', optionFixed);
156    hideLessThanOne('.article_appendix')
157    hideLessThanOne('.article_zhengce')
158    hideLessThanOne('.article_jiedu')
159    hideLessThanOne('.article_links')
160  }
161});

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.