1// JustWrite Scripts 2;( function( $, window, document, undefined ) { 3 4 'use strict'; 5 6 // Selectors 7 var $window = $( window ), 8 $body = $( 'body' ), 9 $document = $( document ), 10 $html_body = $( 'html, body' ), 11 ac_activated = 'activated', 12 ac_selected = 'selected', 13 ac_opened = 'opened', 14 ac_visible = 'visible'; 15 16 17 18 // Menu Drop-Down 19 var ac_menu_args = { 20 delay: 300, 21 speed: 'fast', 22 animation: {opacity:'show',height:'show'}, 23 dropShadows: false, 24 cssArrows: false, 25 autoArrows: true 26 } 27 $('.superfish').superfish(ac_menu_args); 28 29 $document.on( 'customize-preview-menu-refreshed', function( e, params, ac_menu_args ) { 30 if ( params.oldContainer.hasClass( 'superfish' ) ) { 31 params.newContainer.superfish( ac_menu_args ); 32 } 33 }); 34 35 36 37 // Mobile menus 38 var ac_mobileMenuBtn = '.mobile-menu-button', 39 ac_mobileMenuBtn2 = '.mobile-menu-button-2', 40 ac_menuMain = $('.menu-main'), 41 ac_mobileMenu = $('.mobile-menu'), 42 ac_mobileMenu2 = $('.mobile-menu-2'), 43 ac_menuVisible = 'menu-visible', 44 ac_mobileDropDown = 'mobile-drop-down', 45 ac_mobileSubArrow = 'fa fa-angle-right', 46 ac_mobileOnOff = 'fa-navicon fa-times'; 47 48 $document.on('click', ac_mobileMenuBtn, function(e) { 49 $(ac_mobileMenuBtn).toggleClass(ac_activated).find('i').toggleClass(ac_mobileOnOff); 50 ac_menuMain.toggleClass(ac_menuVisible); 51 ac_mobileMenu.find('li.'+ac_mobileDropDown).removeClass(ac_mobileDropDown); 52 ac_mobileMenu.find('i').removeAttr('class').addClass(ac_mobileSubArrow); 53 ac_close_mini_sidebar(); 54 ac_close_search_box(); 55 56 e.preventDefault(); 57 }); 58 59 $document.on('click', '.mobile-menu .sf-sub-indicator', function(e) { 60 $(this).parent().parent().toggleClass(ac_mobileDropDown) 61 .children().find('.'+ac_mobileDropDown) 62 .removeClass(ac_mobileDropDown) 63 .find('i').toggleClass('fa-angle-down fa-angle-right'); 64 65 $(this).find('i').toggleClass('fa-angle-right fa-angle-down') 66 67 e.preventDefault(); 68 }); 69 70 $document.on('click', ac_mobileMenuBtn2, function(e) { 71 $(ac_mobileMenuBtn2).toggleClass(ac_activated).find('i').toggleClass(ac_mobileOnOff); 72 $('.second-menu').toggleClass('menu-visible-2'); 73 ac_mobileMenu2.find('li.'+ac_mobileDropDown).removeClass(ac_mobileDropDown); 74 ac_mobileMenu2.find('i').removeAttr('class').addClass(ac_mobileSubArrow); 75 ac_close_mini_sidebar(); 76 ac_close_search_box(); 77 ac_close_mobile_menu(); 78 79 e.preventDefault(); 80 }); 81 82 $document.on('click', '.mobile-menu-2 .sf-sub-indicator', function(e) { 83 $(this).parent().parent().toggleClass(ac_mobileDropDown) 84 .children().find('.'+ac_mobileDropDown) 85 .removeClass(ac_mobileDropDown) 86 .find('i').toggleClass('fa-angle-down fa-angle-right'); 87 88 $(this).find('i').toggleClass('fa-angle-right fa-angle-down') 89 90 e.preventDefault(); 91 }); 92 93 var ac_close_mobile_menu = function() { 94 $(ac_mobileMenuBtn).removeClass(ac_activated).find('i').removeClass().addClass('fa fa-navicon'); 95 ac_menuMain.removeClass(ac_menuVisible); 96 ac_mobileMenu.find('li.'+ac_mobileDropDown).removeClass(ac_mobileDropDown); 97 ac_mobileMenu.find('i').removeAttr('class').addClass(ac_mobileSubArrow); 98 } 99 100 101 102 // Search Button 103 var ac_searchBtn = '.search-button', 104 ac_searchBtnSel = $(ac_searchBtn), 105 ac_searchVisible = 'search-visible', 106 ac_searchWrap = $('.search-wrap'), 107 ac_searchField = $('#header-search .search-field'); 108 109 $document.on('click', ac_searchBtn + ', .try-a-search', function(e) { 110 ac_searchBtnSel.toggleClass(ac_activated).find('i').toggleClass('fa-search fa-times'); 111 ac_searchWrap.toggleClass(ac_searchVisible); 112 ac_searchField.val('').focus(); 113 ac_close_mini_sidebar(); 114 ac_close_mobile_menu(); 115 e.preventDefault(); 116 }); 117 118 var ac_close_search_box = function() { 119 ac_searchBtnSel.removeClass(ac_activated); 120 ac_searchBtnSel.find('i').removeClass().addClass('fa fa-search'); 121 ac_searchWrap.removeClass(ac_searchVisible); 122 ac_searchField.blur(); 123 } 124 125 126 127 // Browse 128 var ac_browseID = '#browse-more', 129 ac_browseSel = $(ac_browseID), 130 ac_miniSidebar = $('.mini-sidebar'), 131 ac_browseOpened = 'browse-window-opened'; 132 133 $document.on('click', ac_browseID, function(e) { 134 var cwp = $('.container.main-section').position(); 135 var cwp_total = cwp.top - parseInt(ac_miniSidebar.css('padding-top')) + parseInt($('.container.main-section').css('border-top-width')) + 1; 136 $(this).toggleClass(ac_activated); 137 ac_miniSidebar.toggleClass(ac_browseOpened); 138 ac_miniSidebar.css({ 139 'display': 'block', 140 'position': 'absolute' 141 }); 142 if (ac_miniSidebar.hasClass(ac_browseOpened)) { 143 $html_body.animate({scrollTop: cwp_total}, 300); 144 } else { 145 ac_miniSidebar.removeAttr('style'); 146 } 147 ac_close_search_box(); 148 ac_close_mobile_menu(); 149 e.preventDefault(); 150 }); 151 152 var ac_close_mini_sidebar = function() { 153 ac_miniSidebar.removeClass(ac_browseOpened); 154 ac_browseSel.removeClass(ac_activated); 155 ac_miniSidebar.removeAttr('style'); 156 } 157 158 $document.on('click', '.close-browse-by', function(e) { 159 ac_close_mini_sidebar(); 160 ac_close_mobile_menu(); 161 e.preventDefault(); 162 }); 163 164 165 166 // Responsive Videos
167 $('.single-content, .sidebar').fitVids(); 168 169 170 171 // Back To Top 172 $('.back-to-top').click(function() { 173 $html_body.animate({scrollTop: 0}, 600); 174 }); 175 176 177 178 // Remove Tag Style (widget) 179 $('.tagcloud a').removeAttr('style'); 180 181 182 183 // Tabs Widget 184 var ac_tabsContainer = '.ac-tabs-init', 185 ac_tabsBtn = ac_tabsContainer + ' a', 186 ac_tabsTab = '.tabs-widget-tab'; 187 188 var ac_init_tabs = function() { 189 var tabs = $( ac_tabsContainer + '-wrap'); 190 if( ! tabs.length ) return; 191 tabs.each( function( index, element ) { 192 var tab_id = $( '#' + element.id ); 193 tab_id.find(ac_tabsBtn).parent('li').first().addClass(ac_selected); 194 tab_id.find(ac_tabsTab).first().css('display', 'block'); 195 }); 196 } 197 ac_init_tabs(); 198 199 $(ac_tabsBtn).click(function(e) { 200 e.preventDefault(); 201 var $this = $(this), 202 tabs_id = '#' + $this.parents(ac_tabsContainer + '-wrap').attr('id'), 203 get_tab_id = $this.attr('href'); 204 205 $(tabs_id + ' ' + ac_tabsBtn).parent().addClass(ac_selected); 206 $this.parent().siblings().removeClass(ac_selected); 207 $(tabs_id + ' ' + ac_tabsTab).not(get_tab_id).css('display', 'none'); 208 $(get_tab_id).fadeIn(); 209 }); 210 211 212 213 // Posts - Template 1 - Share Article 214 $document.on('click', '.post-share-temp1', function(e) { 215 var share_id = $(this).attr('id'), 216 share_wrap_width = $('.post-template-1 .details').width() - 50; 217 218 $(this).css('display', 'none'); 219 $('#' + share_id + '-rm').css('margin-right', 48); 220 $('#' + share_id + '-wrap').addClass(ac_opened).css('height', 50).animate({ 221 'width': '92%' 222 }, 500, function() { 223 $('#' + share_id + '-wrap .contents').css('display','block').animate({ 224 'opacity': 1, 225 }, 300); 226 }); 227 e.preventDefault(); 228 }); 229 230 $document.on('click', '.close-this-temp1', function(e) { 231 var share_href = $(this).attr('href'), 232 share_href_wrap = $(this).attr('href') + '-wrap'; 233 234 $(share_href_wrap + ' .contents').animate({ 235 'opacity': 0 236 }, 300, function(){ 237 $(this).css('display','none') 238 $(share_href_wrap).animate({ 239 'width': 48, 240 'height': 'auto' 241 }, 300, function(){ 242 $(share_href_wrap).removeClass(ac_opened) 243 $(share_href + '-rm').css('margin-right', 0); 244 $(share_href).css('display', 'block'); 245 }); 246 }); 247 e.preventDefault(); 248 }); 249 250 251 252 // Sticky Menu 253 var ac_sticky_menu = function() { 254 var nav = $('.menu-wrap'), 255 nav_scrolled = false, 256 spo_scrooled = false, 257 header_social = $('.header-social-icons'); 258 259 if( !nav.hasClass('sticky-disabled') ) { 260 if( $window.width() > 1140 ) { 261 $window.scroll(function() { 262 if (220 <= $window.scrollTop() && !nav_scrolled && $window.width() > 1140) { 263 if( $body.hasClass('admin-bar') ) { 264 nav.removeAttr('style').addClass(ac_visible).css('top', 28); 265 } else { 266 nav.removeAttr('style').addClass(ac_visible) 267 } 268 nav_scrolled = true; 269 } 270 if (220 >= $window.scrollTop() && nav_scrolled) { 271 if( $body.hasClass('admin-bar') ) { 272 nav.removeClass(ac_visible).css('top', 0); 273 } else { 274 nav.removeClass(ac_visible); 275 } 276 nav_scrolled = false; 277 } 278 if (320 <= $window.scrollTop() && !spo_scrooled) { 279 if( ! header_social.hasClass('show') ) { 280 header_social.css('display', 'block').animate({'marginRight': 0}, 100); 281 } 282 spo_scrooled = true; 283 } 284 if (320 >= $window.scrollTop() && spo_scrooled) { 285 if( ! header_social.hasClass('show') ) { 286 header_social.animate({ 287 'marginRight': 20 288 }, 100, function() { 289 header_social.hide().css({ 290 'marginRight': 0 291 }); 292 }).show(); 293 } 294 spo_scrooled = false; 295 } 296 }); 297 } else { 298 nav.removeClass(ac_visible), 299 nav_scrolled = false, 300 header_social.removeAttr('style'), 301 spo_scrooled = false; 302 } 303 } 304 305 306 } 307 ac_sticky_menu(); 308 309 if( $body.hasClass('admin-bar') ) { $('.menu-wrap' + ac_visible).css('top', 100); } 310 311 312 313 // On Window Resize 314 $window.resize(function() { 315 if( $window.width() >= 1600 ) { 316 ac_miniSidebar.removeClass(ac_browseOpened); 317 $(ac_browseID).removeClass(ac_activated); 318 ac_miniSidebar.removeAttr('style'); 319 } 320 ac_sticky_menu(); 321 }); 322 323 324 325 // On Window Load 326 $window.load(function(){ 327 $('#ac-preloader').fadeOut('slow',function(){$(this).remove();}); 328 }); 329 330 331 332})( jQuery, window, document );
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.