PageSourceSearch

https://www.marqueetheatreaz.com/wp-content/plugins/event-discovery/js/tw-plugin-search.js?ver=1.3.4

js marqueetheatreaz.com collected 2026-09-29 21:18:31 UTC 3,678 bytes, 97 lines download raw bytes

1jQuery(function ($) {
2    let timer;
3    options = {
4        lookup: function (query, done) {
5            var cleanQuery = query.trim();
6            if (cleanQuery.length < 3) {
7                done({ suggestions: [] });
8                $('.autocomplete-suggestions').hide(); 
9                return;
10            }
11            // Do Ajax call or lookup locally, when done,
12            // call the callback and pass your results:
13            clearTimeout(timer);
14            timer = setTimeout(() => {
15                $.ajax({
16                    type: 'post',
17                    dataType: 'json',
18                    url: my_ajax_object.ajax_url,
19                    data: {
20                        query: cleanQuery,
21                        action: 'get_search_view_data',
22                        nonce: my_ajax_object.nonce,
23                    },
24                    async: true,
25                    success: function (response) {
26                        done({ suggestions: response });
27                    }
28                });
29            }, 500);
30        },
31        autoSelectFirst: false,
32        formatResult: function (suggestion, currentValue) {
33            var strpos = suggestion.value.toLowerCase().indexOf(currentValue.toLowerCase());
34            var firstpart = suggestion.display.substring(0, strpos);
35            var secondpart = suggestion.display.substring(strpos, currentValue.length + strpos);
36            var thirdpart = suggestion.display.substring(currentValue.length + strpos);
37            return firstpart + '<strong>' + secondpart + '</strong>' + thirdpart;
38        },
39        beforeRender: function (container, suggestions) {
40            $.each(suggestions, function (index, suggestion) {
41                $('.autocomplete-suggestion').eq(index).addClass('tw-autocomplete-suggestion');
42                $('.autocomplete-suggestion').eq(index).addClass(suggestion.data.type);
43            });
44        },
45        onSelect: function (suggestion) {
46            if(suggestion.data.url !== '') {
47                window.location.href = suggestion.data.url;
48            }
49            return false;
50        },
51        minChars: 3,
52        maxHeight: 500,
53        preventBadQueries: true,
54        showNoSuggestionNotice: true,
55        noSuggestionNotice: '<span class="tw-autocomplete-suggestion">No result found</span>',
56        tabDisabled: true,
57        noCache : false,
58    }
59
60    $('.tw-search-input-nav').devbridgeAutocomplete(options);
61
62    // Search view javascript ends here.
63
64    /**
65     * Break event from recurring series
66     */
67    $(
68        'ul#wp-admin-bar-root-default li#wp-admin-bar-edit ul#wp-admin-bar-edit-default li#wp-admin-bar-break-series a',
69        '#wpadminbar'
70    ).click(function () {
71        var dataHtml = "You are about to break this event out of it's series. \r\n";
72        dataHtml += 'You will be able to edit it independently of the original series.\r\n';
73        dataHtml += 'This action cannot be undone.\r\n';
74        var status = confirm(dataHtml);
75        if (status) {
76            var edit_url = $(this).attr('href');
77            $.ajax({
78                type: 'post',
79                dataType: 'json',
80                url: my_ajax_object.ajax_url,
81                data: {
82                    edit_url: edit_url,
83                    action: 'break_event_series'
84                },
85                success: function (response) {
86                    if (response.status) {
87                        //return true;
88                        window.location.href = edit_url;
89                    }
90                }
91            });
92            return false;
93        } else {
94            return false;
95        }
96    });
97});

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.