PageSourceSearch

https://www.calfish.org/Resources/Search/Search.js?cdv=285

js calfish.org collected 2026-10-02 05:59:35 UTC 2,945 bytes, 78 lines download raw bytes

1(function ($, dnn) {
2    var isDropDownVisible = false;
3    var searchSkinObject = null;
4    var toggleDropDown = function(eventElement) {
5        var choices = $get('SearchChoices');
6        if (isDropDownVisible) {
7            choices.style.display = 'none';
8            isDropDownVisible = false;
9        } else {
10            choices.style.display = 'block';
11            isDropDownVisible = true;
12
13            var clickEvent = function(e) {
14                if (isDropDownVisible && e.target.id != "SearchIcon" && e.target.id.indexOf("downArrow") == -1) {
15                    toggleDropDown();
16                    $(document).off("click", clickEvent);
17                }
18            };
19
20            $(document).on("click", clickEvent);
21        }
22    };
23
24    var selectSearch = function(eventElement) {
25        toggleDropDown(eventElement);
26        $get('SearchIcon').style.backgroundImage = dnn.getVar(eventElement.target.id + 'Url');
27
28        /* We use 'W' and 'S' to keep our code consistent with the old search skin object */
29        if (eventElement.target.id.indexOf("Web") > 0) {
30            dnn.setVar('SearchIconSelected', 'W');
31            if(searchSkinObject)
32                searchSkinObject.settings.searchType = 'W';
33        } else {
34            dnn.setVar('SearchIconSelected', 'S');
35            if (searchSkinObject)
36                searchSkinObject.settings.searchType = 'S';
37        }
38    };
39
40    var searchHilite = function(eventElement) {
41        eventElement.target.className = 'searchHilite';
42    };
43
44    var searchDefault = function(eventElement) {
45        eventElement.target.className = 'searchDefault';
46    };
47
48    var initSearch = function() {
49        var searchIcon = $get('SearchIcon');
50        if (dnn.getVar('SearchIconSelected') == 'S') {
51            searchIcon.style.backgroundImage = dnn.getVar('SearchIconSiteUrl');
52        } else {
53            searchIcon.style.backgroundImage = dnn.getVar('SearchIconWebUrl');
54        }
55        $addHandler(searchIcon, 'click', toggleDropDown);
56
57        var siteIcon = $get('SearchIconSite');
58        siteIcon.style.backgroundImage = dnn.getVar('SearchIconSiteUrl');
59        $addHandler(siteIcon, 'click', selectSearch);
60        $addHandler(siteIcon, 'mouseover', searchHilite);
61        $addHandler(siteIcon, 'mouseout', searchDefault);
62
63        var webIcon = $get('SearchIconWeb');
64        webIcon.style.backgroundImage = dnn.getVar('SearchIconWebUrl');
65        $addHandler(webIcon, 'click', selectSearch);
66        $addHandler(webIcon, 'mouseover', searchHilite);
67        $addHandler(webIcon, 'mouseout', searchDefault);
68
69        /* Set the default display style to resolve DOM bug */
70        $get('SearchChoices').style.display = 'none';
71    };
72
73    dnn.initDropdownSearch = function (skinObject) {
74        searchSkinObject = skinObject;
75        initSearch();
76    };
77
78})(jQuery, window.dnn);

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.