PageSourceSearch

https://www.boersennews.de/js/custom.jquery.search.js?rt=1790927813

js boersennews.de collected 2026-10-02 07:59:50 UTC 4,770 bytes, 103 lines download raw bytes

1(function () {
2    $.urlParam = function (name) {
3            var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.search);
4            return (results !== null) ? results[1] || 0 : false;
5    }
6    var oldQuery = $.urlParam('bnquery');
7    if(oldQuery && oldQuery.length > 1){
8        $('#bn-search-slot').val(decodeURIComponent(oldQuery.replace( /\+/g, ' ').replace( '/\b\s$/', '')));
9    }
10    $('#bn-search-slot').on('change input', function(){
11        var query = $(this).val();
12        var queryUrl = '/search/autocomplete/'+encodeURIComponent(query.replace( /[^a-zA-Z0-9äÄüÜöÖß&+-]/g, ' ').replace( /\s+/g, ' ').replace( /\b\s$/, '').toLowerCase())+'/';
13        var queryRegex = encodeURIComponent(query.replace( /[^a-zA-Z0-9äÄüÜöÖß&+-]/g, '+').replace( /\++/g, '+').replace( /\b\+$/, '').toLowerCase());
14
15        //console.log(queryRegex);
16
17        if(query.length > 1){
18            $.getJSON(queryUrl, function(data) {
19                if (data.html !== undefined) {
20                    $('#bn-search-results').empty();
21                    $('#bn-search-results').append(data.html);
22                } else {
23                    $('#bn-search-results').empty();
24                }
25            });
26            $('#bn-search').attr('action', window.location.origin+'/suche/?bnquery='+queryRegex);
27        } else {
28            $('#bn-search').removeAttr('action');
29            $('#bn-search-results').empty();
30        }
31    });
32    $("a.show-search-slot").click(function(noHref){
33		noHref.preventDefault();
34        if($('#bn-search.nav-search-form').not(':visible')){
35            $("#smartbanner").animate({height: 0}, 150);
36            $('#bn-search.nav-search-form').removeClass('d-none').delay(150).show().addClass('show');
37			$("#bn-search-slot").focus();
38        }
39    });
40    $(':not(#bn-search):not(.nav-search-form):not(.site-search-form)').on('click touch', function(){
41        if( $('#bn-search.nav-search-form').is(':visible') && $('#bn-search.nav-search-form:hover').length === 0 && $('.nav-search-box:hover').length === 0 ){
42			$("#smartbanner").animate({height: 78}, 150);
43            $('#bn-search.nav-search-form').removeClass('show').addClass('d-none')
44			$('#bn-search.nav-search-form > #bn-search-results').html('');
45            $('#bn-search.nav-search-form')[0].reset();
46        }
47		if( $('#bn-search.site-search-form').is(':visible') && $('#bn-search.site-search-form:hover').length === 0 ){
48			$('#bn-search > #bn-search-results').html('');
49		}
50    });
51    $.fn.formNavigation = function () {
52        //var UP = 38;
53        //var DOWN = 40;
54        //var LEFT = 37;
55        //var RIGHT = 39;
56        //var TAB = 9;
57        var keyCountStop = 0;
58        var keyCount = -1;
59        $(this).each(function () {
60            
61            $(this).on('keyup', function(e) {
62                var bnResultIndex = $('.bn-result-list-item');
63                $('.bn-result-list-item-title a').removeClass('text-secondary active-result');
64                switch (e.which) {
65                    case 38:
66                        if(keyCountStop === 0 && keyCount === -1){
67                            keyCountStop++;
68                            //keyCount;
69                        } else if (keyCount < ((bnResultIndex.length-1)*-1) ){
70                            keyCount = -1;
71                        } else {
72                            keyCount--;
73                        }
74                        $('.bn-result-list-item').eq(keyCount).find('.bn-result-list-item-title a').addClass('text-secondary active-result');
75                        break;
76                    case 40:
77                        keyCount++;
78                        if (keyCount > (bnResultIndex.length-1) ){
79                            keyCount = 0;
80                        }
81                        $('.bn-result-list-item').eq(keyCount).find('.bn-result-list-item-title a').addClass('text-secondary active-result');
82                        break;
83                }
84            });
85        });
86    };
87	$('form#bn-search').formNavigation();
88	$('#bn-search-results').mousedown( function(mousebutton){
89		mousebutton.preventDefault();
90    });
91    $('#bn-search').on('submit', function(send){
92        send.preventDefault();
93        var bnSerpPath = $('.bn-result-list-item').find('.bn-result-list-item-title a.active-result').attr('href');
94        var queryRegex = $(this).attr('action');        
95        if(bnSerpPath && bnSerpPath.length !== 0){
96           window.location.href = bnSerpPath;
97        } else {
98            if(queryRegex && queryRegex.length > 1){
99                window.location.href = queryRegex;
100            }
101        }
102    });
103})();

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.