PageSourceSearch

https://nsiindustries.com/wp-content/plugins/crown-blocks/blocks/c…aeae0676393c3430b9b5331713b40c56.1790862653

js nsiindustries.com collected 2026-10-01 13:51:19 UTC 5,493 bytes, 136 lines download raw bytes

1/******/ (function() { // webpackBootstrap
2var __webpack_exports__ = {};
3/*!****************************************************!*\
4  !*** ./blocks/cross-reference-index/src/public.js ***!
5  \****************************************************/
6(function ($) {
7  var crownBlockData = crownBlockCrossReferenceIndexData;
8
9  var submitForm = function (e) {
10    $(this).closest('form').trigger('submit', [e]);
11  };
12
13  $(document).on('change', '.' + crownBlockData.blockClassName + ' form.post-feed-filters input', submitForm);
14  $(document).on('change', '.' + crownBlockData.blockClassName + ' form.post-feed-filters select', submitForm);
15
16  var updateBlockPostFeed = function (block, url) {
17    if (url.match(/^\//)) url = crownBlockData.baseUrl + url;
18    var blockId = block.attr('id');
19    $('.ajax-loader', block).addClass('loading');
20    if ($('.pagination-wrapper.infinite', block).length && url.match(/\/page\/\d+\//)) $('.ajax-loader', block).addClass('loading-page');
21
22    if (history.replaceState != null) {
23      history.replaceState('', document.title, url);
24    }
25
26    if ((!$('.pagination-wrapper.infinite', block).length || !url.match(/\/page\/\d+\//)) && block.offset().top < $(window).scrollTop()) {
27      var offset = $('body').offset().top + $('#header').outerHeight();
28      window.scrollTo({
29        top: block.offset().top - offset,
30        behavior: 'smooth'
31      });
32    }
33
34    $.ajax({
35      url: url,
36      blockId: blockId,
37      dataType: 'html',
38      success: function (response) {
39        var blockId = this.blockId;
40        var block = $('#' + blockId);
41        var newBlock = $('#' + blockId, response);
42
43        if (block.length && newBlock.length) {
44          var content = $('.ajax-content', newBlock);
45
46          if (content.length) {
47            if ($('.pagination-wrapper.infinite', block).length && this.url.match(/\/page\/\d+\//)) {
48              $('.ajax-content .post-feed > .inner', block).append($('.post-feed > .inner', content).children());
49              $('.pagination-wrapper', block).remove();
50
51              if ($('.pagination-wrapper.infinite .pagination', content).length) {
52                $('.ajax-content', block).append($('.pagination-wrapper.infinite', content));
53              }
54            } else {
55              $('.ajax-content', block).html(content.html());
56            }
57          }
58
59          $('.ajax-loader', block).removeClass('loading loading-page');
60        }
61      }
62    });
63  };
64
65  $(document).on('submit', '.' + crownBlockData.blockClassName + ' form.post-feed-filters', function (e, triggeringEvent) {
66    if (!$(triggeringEvent.target).is('select, input[type=text]')) {
67      e.preventDefault();
68      var queryString = $(this).serialize();
69      var url = $(this).attr('action');
70      if (queryString != '') url += ($(this).attr('action').match(/\?/) ? '&' : '?') + queryString;
71      updateBlockPostFeed($(this).closest('.' + crownBlockData.blockClassName), url);
72    }
73  });
74  $(document).on('click', '.' + crownBlockData.blockClassName + ' form.post-feed-filters a.reset', function (e) {
75    e.preventDefault();
76    var form = $(this).closest('form');
77    $('input[type=text], select', form).val('');
78    $('input[type=checkbox], input[type=radio]', form).prop('checked', false);
79    $('.filter', form).each(function (i, el) {
80      var filter = $(el);
81      var defaultValue = filter.data('default-value');
82      var defaultValue = Array.isArray(defaultValue) ? defaultValue : JSON.parse(defaultValue);
83
84      if (defaultValue !== null) {
85        defaultValue = Array.isArray(defaultValue) ? defaultValue : [defaultValue];
86        $('input[type=text]', filter).val(defaultValue[0]);
87        $('select option', filter).filter(function (i, el2) {
88          return defaultValue.includes($(el2).val());
89        }).prop('selected', true);
90        $('input[type=checkbox], input[type=radio]', filter).filter(function (i, el2) {
91          return defaultValue.includes($(el2).val());
92        }).prop('checked', true);
93      }
94    });
95    updateBlockPostFeed($(this).closest('.' + crownBlockData.blockClassName), $(this).attr('href'));
96  });
97  $(document).on('click', '.' + crownBlockData.blockClassName + ' .pagination a', function (e) {
98    e.preventDefault();
99    updateBlockPostFeed($(this).closest('.' + crownBlockData.blockClassName), $(this).attr('href'));
100  });
101  $(document).on('click', '.' + crownBlockData.blockClassName + ' form.post-feed-filters .filter-title', function (e) {
102    e.preventDefault();
103    var filter = $(this).closest('.filter');
104    if (!filter.hasClass('expandable')) return;
105    var fieldsContainer = $('.filter-fields', filter);
106    fieldsContainer.css({
107      height: fieldsContainer.height()
108    });
109    filter.toggleClass('expanded');
110    setTimeout(function () {
111      if (!filter.hasClass('expanded')) {
112        fieldsContainer.css({
113          height: 0
114        });
115      } else {
116        fieldsContainer.css({
117          height: $('> .inner', fieldsContainer).outerHeight()
118        });
119        setTimeout(function () {
120          fieldsContainer.css({
121            height: 'auto'
122          });
123        }, 200);
124      }
125    }, 0);
126  });
127  $(document).on('click', '.' + crownBlockData.blockClassName + ' article.product > a', function (e) {
128    e.preventDefault();
129    var article = $(this).closest('article.product');
130    var postId = article.data('post-id');
131    $('#product-' + postId + '-docs-modal').modal('show');
132  });
133})(jQuery);
134/******/ })()
135;
136//# sourceMappingURL=public.js.map

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.