1(function($){ 2 'use strict'; 3 $(document.body).outerWidth(false); 4 $(document).ready(function($) { 5 /* ---------------------------------------------------------------------- */ 6 /* Sliders - [Flexslider] 7 /* ---------------------------------------------------------------------- */ 8 try { 9 $('.flexslider').flexslider({ 10 animation: "fade", 11 }); 12 } catch(err) { 13 14 } 15 16 /*-------------------------------------------------*/ 17 /* = Fix for foundation when <ul> has no class 18 /*-------------------------------------------------*/ 19 $('ul:not([class])').addClass('disc'); 20 21 /*-------------------------------------------------*/ 22 /* = Input & Textarea Placeholder 23 /*-------------------------------------------------*/ 24 $('.comment-form input[type="text"], .comment-form textarea, form[role=search] input[type="text"]').focus(function(){ 25 $(this).removeClass('error'); 26 if ($(this).val().toLowerCase() == $(this).attr('data-value').toLowerCase()) 27 $(this).val(''); 28 }).blur( function(){ 29 if ($(this).val() == '') 30 $(this).val($(this).attr('data-value')); 31 }); 32 33 /*-------------------------------------------------*/ 34 /* = Dropdown Menu - Superfish 35 /*-------------------------------------------------*/ 36 try { 37 $('ul.sf-menu').superfish({ 38 delay: 400,
39 autoArrows: false, 40 speed: 'fast', 41 animation: {opacity:'show', height:'show'} 42 }); 43 } catch (err){ 44 45 } 46 47 /*-------------------------------------------------*/ 48 /* = Mobile Menu 49 /*-------------------------------------------------*/ 50 // Create the dropdown base 51 $("<select />").appendTo(".navigation"); 52 53 // Create default option "Go to..." 54 $("<option />", { 55 "selected": "selected", 56 "value" : "", 57 "text" : "Go to..." 58 }).appendTo(".navigation select"); 59 60 // Populate dropdown with menu items 61 $(".sf-menu a").each(function() { 62 var el = $(this); 63 if(el.next().is('ul.sub-menu')){ 64 $("<optgroup />", { 65 "label" : el.text() 66 }).appendTo(".navigation select"); 67 } else { 68 $("<option />", { 69 "value" : el.attr("href"), 70 "text" : el.text() 71 }).appendTo(".navigation select"); 72 } 73 }); 74 75 $(".navigation select").change(function() { 76 window.location = $(this).find("option:selected").val(); 77 }); 78 79 /*-------------------------------------------------*/ 80 /* = Fancybox Images 81 /*-------------------------------------------------*/ 82 try { 83 $('.gallery-icon a[href*=".jpg"][href*=".png"][href*=".gif"], .fancybox').colorbox({ 84 transition : 'fade', 85 scalePhotos : true, 86 maxWidth : '90%', 87 maxHeight : '90%', 88 rel : 'popup-colorbox', 89 }).attr('rel', 'popup-colorbox'); 90 } catch(err) { 91 92 } 93 /*-------------------------------------------------*/ 94 /* = Fancybox Videos 95 /*-------------------------------------------------*/ 96 try { 97 $('.video .post-image a').colorbox({ 98 iframe : true, 99 maxWidth : 800, 100 maxHeight : 600, 101 innerWidth : '75%', 102 innerHeight : '75%', 103 rel : 'nofollow', 104 closeButton : false 105 }); 106 } catch(err) { 107 108 } 109 110 /*-------------------------------------------------*/ 111 /* = Scroll to TOP 112 /*-------------------------------------------------*/ 113 $('a[href="#top"]').click(function(){ 114 $('html, body').animate({scrollTop: 0}, 'slow'); 115 return false; 116 }); 117 118 /*-------------------------------------------------*/ 119 /* = Tabs Widget - { Popular, Recent and Comments } 120 /*-------------------------------------------------*/ 121 122 $('.tabs-widget').each(function() { 123 $(this).find(".tab_content").hide(); 124 $(this).find("ul.tab-links li:first").addClass("active").show(); 125 $(this).find(".tab_content:first").show(); 126 }); 127 128 129 $("ul.tab-links li").click(function(e) { 130 $(this).parents('.tabs-widget').find("ul.tab-links li").removeClass("active"); 131 $(this).addClass("active"); 132 $(this).parents('.tabs-widget').find(".tab_content").hide(); 133 134 var activeTab = $(this).find("a").attr("href"); 135 $(this).parents('.tabs-widget').find(activeTab).fadeIn(); 136 137 e.preventDefault(); 138 }); 139 140 $("ul.tab-links li a").click(function(e) { 141 e.preventDefault(); 142 }) 143 144 /* ---------------------------------------------------------------------- */ 145 /* Comment Tree 146 /* ---------------------------------------------------------------------- */ 147 try { 148 $('#content ul.children > li, ol#comments > li').each(function(){ 149 if($(this).find(' > ul.children').length == 0){ 150 $(this).addClass('last-child'); 151 } 152 }); 153 154 $("#content ul.children").each(function() { 155 if($(this).find(' > li').length > 1) { 156 $(this).addClass('border'); 157 } 158 }); 159 160 $('ul.children.border').each(function(){ 161 $(this).append('<span class="border-left"></span>'); 162 163 var _height = 0; 164 165 for(var i = 0; i < $(this).find(' > li').length - 1; i++){ 166 _height = _height + parseInt($(this).find(' > li').eq(i).height()) + parseInt($(this).find(' > li').eq(i).css('margin-bottom')); 167 } 168 169 _height = _height + 29; 170 171 $(this).find('span.border-left').css({'height': _height + 'px'}); 172 }); 173 } catch(err) { 174 175 } 176 177 $(window).bind('resize', function(){ 178 try { 179 $('ul.children.border').each(function(){ 180 var _height = 0; 181 182 for(var i = 0; i < $(this).find(' > li').length - 1; i++){ 183 _height = _height + parseInt($(this).find(' > li').eq(i).height()) + parseInt($(this).find(' > li').eq(i).css('margin-bottom')); 184 } 185 186 _height = _height + 29; 187 188 $(this).find('span.border-left').css({'height': _height + 'px'}); 189 }); 190 } catch(err) { 191 192 } 193 }); 194 195 }); 196 197 /*-------------------------------------------------*/ 198 /* = Masonry Effect 199 /*-------------------------------------------------*/ 200 $(window).load(function(){ 201 try { 202 $('#sidebar').masonry({ 203 singleMode: true, 204 itemSelector: '.widget', 205 columnWidth: 295, 206 gutterWidth: 20 207 }); 208 } catch(err) { 209 210 } 211 }); 212})(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.