PageSourceSearch

https://strahovoy-urist.ru/strahovoy-urist/functions/js/shortcodes.js

js strahovoy-urist.ru collected 2026-10-08 23:23:06 UTC 3,425 bytes, 124 lines download raw bytes

1/*-----------------------------------------------------------------------------------
2
3FILE INFORMATION
4
5Description: JavaScript used on WooFramework shortcodes.
6Date Created: 2011-01-24.
7Author: Matty.
8Since: 3.5.0
9
10
11TABLE OF CONTENTS
12
13- Tabs shortcode
14- Toggle shortcode
15
16-----------------------------------------------------------------------------------*/
17
18jQuery(function($) {
19	
20/*-----------------------------------------------------------------------------------
21  Tabs shortcode
22-----------------------------------------------------------------------------------*/
23	
24	if ( jQuery( '.shortcode-tabs').length ) {	
25		
26		jQuery( '.shortcode-tabs').each( function () {
27		
28			var tabCount = 1;
29		
30			jQuery(this).children( '.tab').each( function ( index, element ) {
31			
32				var idValue = jQuery(this).parents( '.shortcode-tabs').attr( 'id' );
33			
34				var newId = idValue + '-tab-' + tabCount;
35			
36				jQuery(this).attr( 'id', newId );
37				
38				jQuery(this).parents( '.shortcode-tabs').find( 'ul.tab_titles').children( 'li').eq(index).find( 'a').attr( 'href', '#' + newId );
39				
40				tabCount++;
41			
42			});
43		
44			var thisID = jQuery(this).attr( 'id' );
45		
46			jQuery(this).tabs( { fx: { opacity: 'toggle', duration: 200 } } );
47		
48		});
49
50
51	} // End IF Statement
52	
53/*-----------------------------------------------------------------------------------
54  Toggle shortcode
55-----------------------------------------------------------------------------------*/
56	
57	if ( jQuery( '.shortcode-toggle').length ) {	
58		
59		jQuery( '.shortcode-toggle').each( function () {
60			
61			var toggleObj = jQuery(this);
62			
63			toggleObj.closedText = toggleObj.find( 'input[name="title_closed"]').attr( 'value' );
64			toggleObj.openText = toggleObj.find( 'input[name="title_open"]').attr( 'value' );
65			
66			// Add logic for the optional excerpt text.
67			if ( toggleObj.find( 'a.more-link.read-more' ).length ) {
68				toggleObj.readMoreText = toggleObj.find( 'a.more-link.read-more' ).text();
69				toggleObj.readLessText = toggleObj.find( 'a.more-link.read-more' ).attr('readless');
70				toggleObj.find( 'a.more-link.read-more' ).removeAttr('readless');
71				
72				toggleObj.find( 'a.more-link' ).click( function () {
73					
74					var moreTextObj = jQuery( this ).next( '.more-text' );
75					
76					moreTextObj.animate({ opacity: 'toggle', height: 'toggle' }, 300).css( 'display', 'block' );
77					moreTextObj.toggleClass( 'open' ).toggleClass( 'closed' );
78					
79					if ( moreTextObj.hasClass( 'open') ) {
80					
81						jQuery(this).text(toggleObj.readLessText);
82					
83					} // End IF Statement
84					
85					if ( moreTextObj.hasClass( 'closed') ) {
86					
87						jQuery(this).text(toggleObj.readMoreText);
88					
89					} // End IF Statement
90					
91					return false;
92				});
93			}
94			
95			toggleObj.find( 'input[name="title_closed"]').remove();
96			toggleObj.find( 'input[name="title_open"]').remove();
97			
98			toggleObj.find( 'h4.toggle-trigger a').click( function () {
99			
100				toggleObj.find( '.toggle-content').animate({ opacity: 'toggle', height: 'toggle' }, 300);
101				toggleObj.toggleClass( 'open' ).toggleClass( 'closed' );
102				
103				if ( toggleObj.hasClass( 'open') ) {
104				
105					jQuery(this).text(toggleObj.openText);
106				
107				} // End IF Statement
108				
109				if ( toggleObj.hasClass( 'closed') ) {
110				
111					jQuery(this).text(toggleObj.closedText);
112				
113				} // End IF Statement
114				
115				return false;
116			
117			});
118					
119		});
120
121
122	} // End IF Statement
123	
124}); // jQuery()

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.