1(function($) { 2 "use strict"; 3 4 function headRoomInit(){ 5 var headroom = $("#site-header.site-header-headroom").headroom({ 6 onUnpin : function() { 7 $( 'body' ).toggleClass( 'site-header-unpin' ); 8 }, 9 onPin : function() { 10 $( 'body' ).toggleClass( 'site-header-unpin' ); 11 } 12 }); 13 } 14 15 /** 16 * Remove overlay div 17 * 18 * @since 1.0.0 19 */ 20 function removeOverlayDiv(){ 21 if( $( window ).width() > 1200 ){ 22 $( 'body' ) 23 .removeClass( 'sidebar-secondary-active' ) 24 .find( '.body-overlay' ) 25 .remove(); 26 } 27 } 28 29 /** 30 * Remove the mobile search form 31 * 32 * @since 1.0.0 33 */ 34 function removeMobileSearchForm(){ 35 if( $( window ).width() > 992 ){ 36 $( '#site-header .col-center' ).removeClass( 'show-search' ); 37 } 38 } 39 40 function setMobileBootstrapMenu(){ 41 if( $( window ).width() < 992 ){ 42 $( '.main-menu .dropdown-menu' ).click( function( event ){ 43 event.stopPropagation(); 44 } ); 45 } 46 } 47 48 /** 49 * Window Resize event 50 * 51 * @since 1.0.0 52 */ 53 $( window ).resize(function(){ 54 55 removeMobileSearchForm(); 56 57 removeOverlayDiv(); 58 59 setMobileBootstrapMenu(); 60 61 }); 62 63 $( document ).ready(function() { 64 65 try { 66 if ($('body').hasClass('has-preloader')) { 67 $('#preloader').fadeOut('slow'); 68 } 69 } catch (error) { 70 console.error(error); 71 } 72 73 headRoomInit(); 74 75 setMobileBootstrapMenu(); 76 77 $( '.dropdown-menu2' ).click(function(e){ 78 e.stopPropagation(); 79 }); 80 81 $( '.advanced-search-filter' ).on( 'show.bs.dropdown', function(e){ 82 $( '#site-search' ) 83 .addClass( 'show' ) 84 .prev( '.toggle-search' ) 85 .addClass( 'show' ) 86 .attr( 'aria-expanded', 'true' ); 87 } ); 88 89 $( '.advanced-search-filter' ).on( 'hide.bs.dropdown', function(e){ 90 $( '#site-search' ) 91 .addClass( 'show' ) 92 .prev( '.toggle-search' ) 93 .addClass( 'show' ) 94 .attr( 'aria-expanded', 'true' ); 95 } ); 96 97 $( '.main-menu .dropdown-menu .dropdown-toggle' ).click( function( event ){ 98 $(this).toggleClass( 'show' ).next().toggleClass( 'show' ); 99 } ); 100 101 $( '#btn-menu-collap' ).click( function( event ){ 102 $(this).parent().toggleClass( 'sidebar-collapse' ); 103 $( document.body ).trigger( 'sidebar_secondary_collapse' ); 104 } ); 105 106 /** 107 * 108 * BS tooltip render 109 * 110 */ 111 $('body').tooltip({selector: '[data-bs-toggle="tooltip"]'}); 112 113 $( 'select' ).addClass( 'form-select' ); 114 115 /** 116 * 117 * The float sidebar toggler 118 * 119 * @since 1.0.0 120 */ 121 $( '#toggle-nav' ).on( 'click', function( event ){ 122 $( 'body' ).toggleClass( 'sidebar-secondary-active' ); 123 124 if( $( '.body-overlay' ).length == 0 ){ 125 $( 'body' ).append( '<div class="body-overlay"></div>' ); 126 } 127 else{ 128 $( '.body-overlay' ).remove(); 129 } 130 131 } ); 132 133 $( document ).on( 'click', '.body-overlay', function( event ){ 134 $( 'body' ) 135 .removeClass( 'sidebar-secondary-active' ) 136 .find( '.body-overlay' ) 137 .remove(); 138 }); 139 140 /** 141 * Mobile search toggler 142 * @since 1.0.0 143 */ 144 $( '.toggle-search' ).on( 'click', function( event ){ 145 $( '#site-search' ) 146 .closest( '.col-center' ) 147 .toggleClass( 'show-search' ); 148 149 150 $( '#site-search' ) 151 .removeClass( 'show' )
152 .find( 'input[name=s]' ) 153 .focus(); 154 } ); 155 156 $( document ).on( 'click', '.btn-lock-pass', function( event ){ 157 var button = $(this); 158 159 var textField = button.prev(); 160 161 if( textField.attr( 'type' ) == 'password' ){ 162 textField.attr( 'type', 'text' ); 163 }else{ 164 textField.attr( 'type', 'password' ); 165 } 166 167 button.toggleClass( 'show-password' ); 168 }); 169 170 /** 171 * 172 * The post content JS read more handler 173 * 174 * @since 1.0.0 175 * 176 */ 177 if( $( '.js-read' ).height() > 60 ){ 178 $( '.js-read' ) 179 .addClass( 'js-more' ) 180 .next().removeClass( 'd-none' ); 181 } 182 183 /** 184 * 185 * The post content JS read more link toggler handler 186 * 187 * @since 1.0.0 188 * 189 */ 190 $( '.js-read-toggler' ).on( 'click', function( event ){ 191 $(this).toggleClass( 'js-read-less' ).prev().toggleClass( 'js-more' ); 192 } ); 193 194 /** 195 * 196 * 197 * Comment JS read more handler 198 * 199 * @since 1.0.0 200 * 201 */ 202 203 $( document ).on( 'click', '.comment-show-more', function( event ){ 204 event.preventDefault(); 205 206 $(this).parent().toggleClass( 'show-less' ); 207 } ); 208 209 /** 210 * 211 * 212 * Comment JS read less handler 213 * 214 * @since 1.0.0 215 * 216 */ 217 218 $( document ).on( 'click', '.comment-show-less', function( event ){ 219 event.preventDefault(); 220 221 $(this).parent().toggleClass( 'show-less' ); 222 }); 223 224 225 /** 226 * 227 * The replies link click event handler 228 * 229 * @since 1.0.0 230 */ 231 $( document ).on( 'click', '.toggle-replies-link', function( event ){ 232 233 event.preventDefault(); 234 235 //$( this ).toggleClass( 'active' ).closest( '.comment-body' ).next().toggleClass( 'd-block' ); 236 237 var children = $( this ).toggleClass( 'active' ).closest( '.comment-body' ).next(); 238 239 if( children.hasClass( 'expanded' ) ){ 240 children.removeClass( 'expanded' ).slideUp(); 241 } 242 else{ 243 children.addClass( 'expanded' ).slideDown(); 244 } 245 } ); 246 247 $( '.search-type-select' ).on( 'change', function( event ){ 248 var searchType = $(this).val(); 249 var action = ''; 250 if( searchType == 'topics' ){ 251 action = 'bbp-search-request'; 252 } 253 else{ 254 action = 'search-' + searchType; 255 } 256 257 $(this).closest( 'form' ).find( 'input[name=action]' ).val( action ); 258 } ); 259 260 261 }); 262 263 $( '#sidebar-secondary .dropdown' ).on( 'show.bs.dropdown', function () { 264 265 if( $( '#sidebar-secondary' ).hasClass( 'sidebar-collapse' ) ){ 266 $( '#sidebar-secondary' ).removeClass( 'sidebar-collapse' ); 267 } 268 269 if( $( window ).width() <= 1300 || $( '#sidebar-secondary' ).hasClass( 'sidebar-collapse' ) ){ 270 271 $( 'body' ).addClass( 'sidebar-secondary-active' ); 272 273 if( $( '.body-overlay' ).length == 0 ){ 274 $( 'body' ).append( '<div class="body-overlay"></div>' ); 275 } 276 } 277 278 $( document.body ).trigger( 'sidebar_secondary_collapse' ); 279 }); 280 281})(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.