PageSourceSearch

https://www.grantforward.com/public/js/result.js?v=284

js grantforward.com collected 2026-09-24 18:37:10 UTC 2,412 bytes, 75 lines download raw bytes

1/** namespace for result section */
2var GrantResult = GrantResult || function(){
3
4    /**
5     * contains all handlers for section
6     * @type {Object}
7     */
8    var eventHandlers = {
9        onExtraInfoTabClick: function(e){
10            var elm = $(e.currentTarget);
11            var tabItem = elm.attr('js-tab');
12
13            //change active tab
14            elm.siblings().removeClass('active');
15            elm.addClass('active');
16
17            //change content
18            var contentElm = elm.parent('ul').siblings('.js-tab-content');
19            contentElm.find('.js-tab-content-item').addClass('hidden');
20            contentElm.find('[js-content=' + tabItem + ']').removeClass('hidden');
21        },
22        onSeeMoreClick: function(e){
23            var elm = $(e.currentTarget);
24            var parentElm = elm.parent('.annotated-keywords');
25            $(parentElm).find(".annotated-keyword-rest").each(function(){
26                $(this).removeClass("hidden");
27            });
28
29            elm.addClass("hidden");
30            $(parentElm).find(".annotated-keywords-see-less").removeClass("hidden").focus();
31        },
32        onSeeLessClick: function(e){
33            var elm = $(e.currentTarget);
34            var parentElm = elm.parent('.annotated-keywords');
35            $(parentElm).find(".annotated-keyword-rest").each(function(){
36                $(this).addClass("hidden");
37            });
38
39            elm.addClass("hidden");
40            $(parentElm).find(".annotated-keywords-see-more").removeClass("hidden").focus();
41        },
42    };
43
44    /**
45     * binds event to section elements
46     * @return {None}
47     */
48    var bindEvents = function(){
49        //click on extra info tab
50        $(document).on('click', '.js-result-extra-nav', eventHandlers.onExtraInfoTabClick);
51        //extra accessibility
52        //the focused tab will show content right away
53        //$(document).on('focus', '.js-result-extra-nav', eventHandlers.onExtraInfoTabClick);
54        $(document).on('click', '.annotated-keywords-see-more', eventHandlers.onSeeMoreClick);
55        $(document).on('click', '.annotated-keywords-see-less', eventHandlers.onSeeLessClick);
56    };
57
58    /**
59     * initialize function
60     * @return {None}
61     */
62    var init = function(){
63        bindEvents();
64    };
65
66    init();
67
68};
69
70/** trigger on DOM ready */
71$(document).ready(function(){
72
73    var grantResultView = new GrantResult();
74
75});

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.