PageSourceSearch

https://www.erzbistumberlin.de/templates/public/js/etagen_documentcenter-custom.js?1790255991

js erzbistumberlin.de collected 2026-09-24 20:53:37 UTC 5,631 bytes, 156 lines download raw bytes

1$(document).ready(function () {
2
3    var categoryId = sessionStorage.getItem('categoryId');
4    var subcategoriesHtml = sessionStorage.getItem('subcategories');
5
6	// Manchmal werden die Unterkategorien nicht geladen. Die sollen dann nachgeladen werden.
7	// Aber nicht, wenn man den Pager benutzt hat, weil man sonst wieder auf seite 1 springt.
8	if ($('.subcategoryFormOption').length == 1 && window.location.href.indexOf("currentPage") == -1)
9	{
10		$('.categoryFormOption').trigger('change');
11	}
12
13    if ($('.categoryFormOption').val() != "" && $('.subcategoryFormOption').val() == null) {
14        if ($('.subcategoryFormOption').length && $('.subcategoryFormOption').val() == null) {
15            $('.subcategoryDiv').show();
16            $('.subcategoryFormOption').html(subcategoriesHtml);
17            $('.subcategoryFormOption').val(categoryId);
18
19            if ($('.subcategoryFormOption').val() != "") {
20                $('.subcategoryFormOption').trigger('change');
21            }
22        }
23    }
24});
25
26function refineUrl() {
27    window.history.replaceState({}, document.title, window.location.pathname + window.location.search.split("&")[0]);
28}
29
30$(document).on('change', '.categoryFormOption', function () {
31    refineUrl();
32    var form = $('#category-search-form');
33    var resultContainer = $('.ajaxCallResult');
34    var parentId = $(this).val();
35    var pagetype = 'id=' + $('#pageId').val(),
36        controller = 'tx_documentcenter_list[controller]=Download',
37        action = 'tx_documentcenter_list[action]=ajaxCall',
38        search = 'tx_documentcenter_list[parentId]=' + parentId;
39
40    var searchTerm = $('#searchword').val() ||'';
41    if (searchTerm != "") {
42        search += '&tx_documentcenter_list[searchTerm]=' + searchTerm;
43    }
44
45    $.ajax({
46        url: '/index.php?' + pagetype + '&' + controller + '&' + action + '&' + search,
47        cache: false,
48        dataType: 'json',
49        beforeSend: function () {
50            $('.subcategoryDiv').fadeOut('fast');
51        },
52
53        success: function (data) {
54            var html = '';
55
56            if (data.subcategories.length > 0) {
57                html = '<option value="">All</option>';
58                $('.subcategoryDiv').fadeIn('fast');
59                $.each(data.subcategories, function (i, obj) {
60                    html += '<option value="' + obj.id + '">' + obj.title + '</option>';
61                });
62            }
63            sessionStorage.setItem('subcategories', html);
64            $('.subcategoryFormOption').html(html).trigger('change');
65        },
66        error: function (jqXHR, textStatus, errorThrow) {
67            resultContainer.html('Ajax request - ' + textStatus + ': ' + errorThrow).fadeIn('fast');
68        }
69
70    });
71
72});
73
74$(document).on('change', '.subcategoryFormOption', function () {
75    refineUrl();
76    var form = $('#category-search-form');
77    var resultContainer = $('.ajaxCallResult');
78    var categoryId = $(this).val();
79    if (categoryId == -1) {
80        return false;
81    }
82
83    var pagetype = 'id=' + $('#pageId').val(),
84        controller = 'tx_documentcenter_list[controller]=Download',
85        action = 'tx_documentcenter_list[action]=list',
86        search = 'tx_documentcenter_list[parentId]=' + $('.categoryFormOption').val();
87
88    if (categoryId != "" && categoryId != null) {
89        search += '&tx_documentcenter_list[categoryId]=' + categoryId;
90    }
91
92    var searchTerm = $('#searchword').val() ||'';
93    if (searchTerm != "") {
94        search += '&tx_documentcenter_list[searchTerm]=' + searchTerm;
95    }
96
97    sessionStorage.setItem('categoryId', categoryId);
98
99    $.ajax({
100        url: '/index.php?' + pagetype + '&' + controller + '&' + action + '&' + search,
101        dataType: 'html',
102        success: function (result) {
103            var section = $(result).find('.ajaxCallResult');
104            resultContainer.html(section).fadeIn('fast');
105        },
106        error: function (jqXHR, textStatus, errorThrow) {
107            resultContainer.html('Ajax request - ' + textStatus + ': ' + errorThrow).fadeIn('fast');
108        }
109
110    });
111});
112
113$(document).on('keyup', '#searchword', function (event) {
114
115    if (event.which == 13 || event.keyCode == 13) {
116        $('#searchButton').trigger('click');
117        return false;
118    }
119    return true;
120});
121
122$(document).on('click', '#searchButton', function () {
123    var form = $('#category-search-form');
124    var resultContainer = $('.ajaxCallResult');
125    var parentId = $('.categoryFormOption').val();
126    var categoryId = $('.subcategoryFormOption').val();
127    var searchTerm = $('#searchword').val() ||'';
128    var pagetype = 'id=' + $('#pageId').val(),
129        controller = 'tx_documentcenter_list[controller]=Download',
130        action = 'tx_documentcenter_list[action]=list',
131        search = 'tx_documentcenter_list[parentId]=' + parentId;
132
133    if (categoryId != "" && categoryId != null) {
134        search += '&tx_documentcenter_list[categoryId]=' + categoryId;
135    }
136
137    if (searchTerm != "") {
138        search += '&tx_documentcenter_list[searchTerm]=' + searchTerm;
139    }
140
141    $.ajax({
142        url: '/index.php?' + pagetype + '&' + controller + '&' + action + '&' + search,
143        dataType: 'html',
144        success: function (result) {
145            var section = $(result).find('.ajaxCallResult');
146            if (!section.length) {
147                section = $('<div>No records found</div>');
148            }
149            resultContainer.html(section).fadeIn('fast');
150        },
151
152        error: function (jqXHR, textStatus, errorThrow) {
153            resultContainer.html('Ajax request - ' + textStatus + ': ' + errorThrow).fadeIn('fast');
154        }
155    });
156});

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.