PageSourceSearch

https://www.justsecurity.org/wp-content/plugins/accordions-pro/assets/frontend/js/scripts.js?ver=1790200728

js justsecurity.org collected 2026-09-24 08:29:03 UTC 5,783 bytes, 193 lines download raw bytes

1
2document.addEventListener("DOMContentLoaded", function (event) {
3
4    var accordions = document.querySelectorAll('[data-accordions]');
5
6
7    if (accordions != null) {
8        accordions.forEach(accordionsWrap => {
9
10
11            var accordionsData = accordionsWrap.getAttribute('data-accordions');
12
13
14            if (accordionsData == null) return;
15
16            var accordionsDataObj = JSON.parse(accordionsData);
17            var accordionsId = accordionsDataObj.id;
18            var lazyLoad = accordionsDataObj.lazyLoad;
19            var scrollTop = accordionsDataObj.scrollTop;
20            var URLHash = accordionsDataObj.URLHash;
21            var scrollTopOffset = accordionsDataObj.scrollTopOffset;
22            var stats = accordionsDataObj.stats;
23            var headerToggle = accordionsDataObj.headerToggle;
24
25
26
27            jQuery("#accordions-" + accordionsId + " .items").on("accordionactivate", function (event, ui) {
28                if (scrollTop == 'yes') {
29                    if (!jQuery.isEmptyObject(ui.newHeader.offset())) {
30                        jQuery("html:not(:animated), body:not(:animated)").animate({
31                            scrollTop: ui.newHeader.offset().top + scrollTopOffset
32                        }, "slow");
33                    }
34                }
35
36
37                // if (URLHash) {
38                //     var hashId = (ui.newHeader[0] != undefined) ? ui.newHeader[0].id : '';
39                //     if (hashId.length > 0) {
40                //         window.location.hash = hashId;
41                //     }
42                // }
43
44
45
46
47            });
48
49
50            setTimeout(() => {
51                if (typeof accordions_active != 'undefined') {
52                    for (var k in accordions_active) {
53                        var index = accordions_active[k];
54                        index.map(x => {
55                            jQuery("#accordions-" + accordionsId + " .items").accordion("option", "active", x);
56                        })
57                    }
58                }
59
60            }, 2000)
61
62
63            if (stats) {
64
65                jQuery("#accordions-" + accordionsId + " .accordions-head").click(function () {
66                    header_id = jQuery(this).attr('header_id');
67                    post_id = jQuery(this).attr('post_id');
68                    jQuery.ajax({
69                        type: 'POST',
70                        context: this,
71                        url: accordions_ajax.accordions_ajaxurl,
72                        data: {
73                            "action": "accordions_ajax_track_header",
74                            "header_id": header_id,
75                            "post_id": post_id,
76                        },
77                        success: function (data) { }
78                    });
79                });
80
81            }
82
83            if (headerToggle) {
84
85                jQuery("#accordions-" + accordionsId + " .accordions-head").click(function () {
86                    toogle_text = jQuery(this).attr('toggle-text');
87                    main_text = jQuery(this).attr('main-text');
88                    if (jQuery(this).hasClass('ui-state-active')) {
89                        if (toogle_text != null && toogle_text != '') {
90                            jQuery(this).children('.accordions-head-title').html(toogle_text);
91                        }
92                    } else {
93                        if (main_text != null && main_text != '') {
94                            jQuery(this).children('.accordions-head-title').html(main_text);
95                        }
96                    }
97                    id = jQuery(this).attr('id');
98                });
99
100            }
101
102
103
104
105            // if (URLHash) {
106            //     var hash = window.location.hash;
107            //     if (hash) {
108            //         index = jQuery("#accordions-" + accordionsId + " " + hash).attr('itemcount');
109            //         if (index) {
110            //             //index = index.replace('ui-id-','');
111            //             //header = jQuery("#accordions-" + accordionsId + " "+hash
111);
112            //             index = parseInt(index);
113            //             //jQuery("html:not(:animated), body:not(:animated)").animate({ scrollTop: header.offset().top + 800 }, "slow");
114            //             jQuery("#accordions-" + accordionsId + " .items").accordion("option", "active", index);
115            //         }
116            //     }
117
118            // }
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139        })
140    }
141
142
143
144
145    var accordionstabs = document.querySelectorAll('[data-accordionstabs]');
146
147    if (accordionstabs != null) {
148        accordionstabs.forEach(accordionsWrap => {
149
150
151            var accordionsData = accordionsWrap.getAttribute('data-accordionstabs');
152
153
154            if (accordionsData == null) return;
155
156            var accordionsDataObj = JSON.parse(accordionsData);
157            var accordionsId = accordionsDataObj.id;
158            var lazyLoad = accordionsDataObj.lazyLoad;
159            var expandedOther = accordionsDataObj.expandedOther;
160            var collapsible = accordionsDataObj.collapsible;
161            var event = accordionsDataObj.event;
162            var active = accordionsDataObj.active;
163
164            var animateStyle = accordionsDataObj.animateStyle;
165            var animateDelay = accordionsDataObj.animateDelay;
166            var navigation = accordionsDataObj.navigation;
167
168            var accordionitemsWrap = document.querySelector('#accordions-' + accordionsId + ' .tabs-content');
169            var lazyWrap = document.querySelector('#accordions-lazy-' + accordionsId);
170
171
172
173
174        })
175    }
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193});

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.