PageSourceSearch

https://www.bahai.us/wp-content/plugins/show-hidecollapse-expand/assets/js/bg-show-hide.js?ver=7.0.5

js bahai.us collected 2026-09-24 09:15:11 UTC 2,914 bytes, 101 lines download raw bytes

1if ('undefined' === typeof BG_SHCE_USE_EFFECTS) {
2	BG_SHCE_USE_EFFECTS = '0';
3} 
4if ('undefined' === typeof BG_SHCE_TOGGLE_SPEED) {
5	BG_SHCE_TOGGLE_SPEED = '0';
6} 
7if ('undefined' === typeof BG_SHCE_TOGGLE_OPTIONS) {
8	BG_SHCE_TOGGLE_OPTIONS = 'swing';
9}
10if ('undefined' === typeof BG_SHCE_TOGGLE_EFFECT) {
11	BG_SHCE_TOGGLE_EFFECT = '';
12}
13
14
15function bgExpandCollapsedContent() {
16	var bgCollapseExpandItems = document.querySelectorAll('input[bg_collapse_expand]');
17	
18	for ( i=0; i<bgCollapseExpandItems.length; i++) {
19		
20		var showHideButton = document.getElementById('bg-showmore-action-'+bgCollapseExpandItems[i].value);	
21		var hiddenContent = document.getElementById('bg-showmore-hidden-'+bgCollapseExpandItems[i].value);
22		
23		if (showHideButton && hiddenContent) {
24			if (window.addEventListener) {
25				showHideButton.addEventListener('click', function(event) {bgExpandCollapsedContentAction(event, this);} );
26			}
27			else {
28				window.attachEvent("onclick", function(event) {bgExpandCollapsedContentAction(event, this);} );
29			}					
30		}
31		
32		if (jQuery( showHideButton ).parent().prop("tagName") === 'LI' && 
33			jQuery( showHideButton ).parent().parent().prop("tagName") === 'UL') {
34			jQuery( showHideButton ).parent().parent().css('margin-bottom',0);
35		}
36		
37	}
38
39}
40
41/* FE */
42function bgExpandCollapsedContentAction(event, thisObj) {
43	event.preventDefault();
44	
45	var bgUniqId = thisObj.id.replace('bg-showmore-action-', '');
46		
47	var showHideButton = document.getElementById('bg-showmore-action-'+bgUniqId);	
48	var hiddenContent = document.getElementById('bg-showmore-hidden-'+bgUniqId);
49	
50	var showLessText = document.getElementById('bg-show-less-text-'+bgUniqId).value;
51	var showMoreText = document.getElementById('bg-show-more-text-'+bgUniqId).value;
52	
53	var text = jQuery(showHideButton).text();
54	if (BG_SHCE_USE_EFFECTS === '1') {
55		jQuery( hiddenContent ).toggle(BG_SHCE_TOGGLE_EFFECT, BG_SHCE_TOGGLE_OPTIONS, parseInt(BG_SHCE_TOGGLE_SPEED)+1);
56	}
57	else {
58		jQuery( hiddenContent ).toggle(parseInt(BG_SHCE_TOGGLE_SPEED));
59	}
60	
61	if (showLessText === '') {
62		jQuery( showHideButton ).toggle();
63		
64		if (jQuery( showHideButton ).parent().prop("tagName") === 'LI') {
65			jQuery( showHideButton ).parent().toggle();
66		}
67	}
68	else {
69		 jQuery(showHideButton).text(
70			 text == showMoreText ? showLessText : showMoreText
71		 );
72		  jQuery(showHideButton).toggleClass("bg-close");
73	}
74	
75	if ('undefined' !== typeof gmspAllMaps) {
76		gmspResizeMaps('recenterHidden');
77	}
78}
79
80/* BE */
81function bgSelectedEffect() {
82	var effectOpts = jQuery('#bg_shce_effect > option');
83	if (effectOpts.length > 0) {
84		var i = 0;
85		while ( i < effectOpts.length ) {
86			if (effectOpts[i].value === BG_SHCE_TOGGLE_EFFECT) {
87				effectOpts[i].selected = true;
88			}
89			i++;
90		}
91	}
92	
93	if (BG_SHCE_USE_EFFECTS === '1') {
94		jQuery('.bg-effects').show();
95	} 
96}
97
98jQuery(document).ready(function() {
99	bgExpandCollapsedContent();
100	bgSelectedEffect();
101});

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.