1/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */ 2 3(function($){ 4 5 $(document).ready(function() { 6 7 var config = $('html').data('config') || {}; 8 9 // Social buttons 10 $('article[data-permalink]').socialButtons(config); 11 12 // Accordion menu 13 $('.menu-sidebar').accordionMenu({ 14 mode:'slide', 15 transition: "easeOutQuad", 16 duration: 500, 17 display: 'show' 18 }); 19 20 // Dropdown menu 21 $('#menu').dropdownMenu({ 22 mode: 'height', 23 dropdownSelector: 'div.dropdown', 24 transition:"easeOutExpo", 25 duration:500 26 }); 27 28 // add icon to menu 29 $('.menu-dropdown li a.level1, .menu-dropdown li a.level2').each(function() { 30 var drop_m = $(this); 31 var all = drop_m.attr('class').split(' '); 32 for (var i = 0; i < all.length; ++i) { 33 var cls = all[i]; 34 if (cls.indexOf('icon-') == 0) { 35 drop_m.prepend('<i class="uk-' + cls + '"></i>'); 36 drop_m.removeClass(cls).addClass('has-icon'); 37 } 38 } 39 }); 40 41 // Smoothscroller 42 $('a[href="#page"]').smoothScroller({ duration: 500 }); 43 44 //show-title 45 $('div.show-title').css({opacity: 0.1, 'visibility': 'visible'}); 46 47 // article meta-data 48 $('.email span.icon-envelope').removeClass('icon-envelope').addClass('uk-icon-envelope-o'); 49 $('.print span.icon-print').removeClass('icon-print').addClass('uk-icon-print'); 50 51 // style the zoo blog buttons 52 $('p.links').each(function() { 53 var $this = $(this); 54 $this.children().eq(0).addClass("button-color"); 55 $this.children().eq(1).addClass("button"); 56 }); 57 58 //modules styling 59 $('.mod-color').closest('section').addClass('at-mod-color'); 60 $('.mod-dark').closest('section').addClass('at-mod-dark'); 61 $('.mod-overlay').closest('.at-parent').addClass('overlay-margin'); 62 $('.mod-color').parents('.uk-modal-dialog').addClass('mod-color'); 63 $('.mod-dark').parents('.uk-modal-dialog').addClass('mod-dark'); 64 65 // toggles 66 if ($('.showhide li').length > 0) { 67 var showhide = $('.showhide li'); 68 showhide.each(function () { 69 var q = $(this); 70 71 if (q.children('div').css('display') === 'block') { 72 q.children('h4').prev().addClass('uk-icon-minus-circle'); 73 } else if (q.children('div').css('display') === 'none') { 74 q.children('h4').prev().addClass('uk-icon-plus-circle');; 75 } 76 77 q.children('h4').click(function () { 78 q.children('div').slideToggle(300, 'easeOutQuad', function () { 79 if (q.children('div').css('display') === 'block') { 80 q.children('h4').prev().addClass('uk-icon-minus-circle').removeClass('uk-icon-plus-circle'); 81 } else if (q.children('div').css('display') === 'none') { 82 q.children('h4').prev().addClass('uk-icon-plus-circle').removeClass('uk-icon-minus-circle'); 83 } 84 }); 85 }); 86 }); 87 }; 88 89 // add styling to images 90 $('.element-image img, .zoo-item-list img, .zoo-comments-list img, .itemAuthorBlock > .gkAvatar > img, .k2Avatar img, .gkAvatar > img, .kwho-admin img, .kprofilebox-left img, .kwho-user img').each(function() { 91 var $this = $(this); 92 $this.addClass("pic3d"); 93 }); 94 95 // add style button 96 $('.sprocket-lists a.readon, .sprocket-features-desc a.readon, .sprocket-tabs a.readon').each(function() { 97 var $this = $(this); 98 $this.addClass("button-color"); 99 }); 100 101 // blog tags 102 $('.element-itemtag a, .zoo-tagcloud a, .itemTags a, .k2TagCloudBlock a, .moduleItemTags a, p.taxonomy a').each(function(i, elem) { 103 var $this = $(this); 104 var html = $(elem).html(); 105 var final = '<span class="tag">' + html + '</span>'; 106 $(this).html(final ); 107 $this.addClass("tag-body"); 108 }); 109 110 //block-number 111 $('.block-number').each(function(i, elem){ 112 var html = $(elem).html(); 113 var final = '<span class="digit">' + html + '</span><span class="bottom"></span>'; 114 $(this).html(final ); 115 }); 116 117 118 //event date/time block 119 $('.uk-event-time').each(function(i, elem){ 120 var html = $(elem).html(); 121 var dt = html.split(":"); 122 var final = '<span class="uk-event-date">' + dt[0] + '</span><span class="uk-event-month">' + dt[1] + '</span>'; 123 $(this).html(final ); 124 $(this).parent().addClass('uk-event'); 125 }); 126 127 //back to top 128 if ($("#totop-scroller").length) { 129 $().UItoTop({scrollSpeed: 500, easingType: 'easeOutExpo' }); 130 } 131 132 // titles 133 $('#contact-form, form.submission').prev().addClass('module-title'); 134 135 //li span 136 $('.sheet-body ul.style li').each(function(i, elem){ 137 var html = $(elem).html(); 138 var final = '<span>' + html + '</span>'; 139 $(this).html(final ); 140 }); 141 142 // remove empty p tags 143 $('p').each(function() { 144 var $this = $(this); 145 if($this.html().replace(/\s| /g, '').length === 0) 146 $this.remove(); 147 }); 148 149 // add icon to widgetkit spotlight 150 $('a[data-spotlight] img').each(function(i, elem){ 151 $(this).load(function() { 152 $(this).next('.overlay-default').addClass('uk-icon-search').css("line-height", $(this).height() + "px"); 153 }); 154 }); 155 156 // apply modal-box sizes
157 $('.module.modal-small').each(function() { 158 $(this).closest('.uk-modal-dialog').addClass('md-small'); 159 }); 160 $('.module.modal-large').each(function() { 161 $(this).closest('.uk-modal-dialog').addClass('md-large'); 162 }); 163 164 //yoo vertical menu fix 165 $('.mod-box.colored li.level2.active').closest('div').addClass('open-menu'); 166 $('.mod-box .menu-sidebar a.level1 > span, .mod-box .menu-sidebar span.level1 > span').append('<i class="uk-float-right uk-icon-chevron-right"></i>'); 167 168 // badges 169 $('.badge.badge-new').parent().addClass('badge-new'); 170 $('.badge.badge-hot').parent().addClass('badge-hot'); 171 $('.badge.badge-free').parent().addClass('badge-free'); 172 $('.badge.badge-top').parent().addClass('badge-top'); 173 174 }); 175 176 $.onMediaQuery('(min-width: 960px)', { 177 init: function() { 178 if (!this.supported) this.matches = true; 179 }, 180 valid: function() { 181 $.matchWidth('grid-block', '.grid-block', '.grid-h').match(); 182 $.matchHeight('main', '#maininner, #sidebar-a, #sidebar-b').match(); 183 $.matchHeight('top-a', '#top-a .grid-h', '.deepest').match(); 184 $.matchHeight('top-b', '#top-b .grid-h', '.deepest').match(); 185 $.matchHeight('bottom-a', '#bottom-a .grid-h', '.deepest').match(); 186 $.matchHeight('bottom-b', '#bottom-b .grid-h', '.deepest').match(); 187 $.matchHeight('bottom-c', '#bottom-c .grid-h', '.deepest').match(); 188 $.matchHeight('innertop', '#innertop .grid-h', '.deepest').match(); 189 $.matchHeight('innerbottom', '#innerbottom .grid-h', '.deepest').match(); 190 }, 191 invalid: function() { 192 $.matchWidth('grid-block').remove(); 193 $.matchHeight('main').remove(); 194 $.matchHeight('top-a').remove(); 195 $.matchHeight('top-b').remove(); 196 $.matchHeight('bottom-a').remove(); 197 $.matchHeight('bottom-b').remove(); 198 $.matchHeight('bottom-c').remove(); 199 $.matchHeight('innertop').remove(); 200 $.matchHeight('innerbottom').remove(); 201 } 202 }); 203 204 var pairs = []; 205 206 $.onMediaQuery('(min-width: 480px) and (max-width: 959px)', { 207 valid: function() { 208 $.matchHeight('sidebars', '.sidebars-2 #sidebar-a, .sidebars-2 #sidebar-b').match(); 209 pairs = []; 210 $.each(['.sidebars-1 #sidebar-a > .grid-box', '.sidebars-1 #sidebar-b > .grid-box', '#top-a .grid-h', '#top-b .grid-h', '#bottom-a .grid-h', '#bottom-b .grid-h', '#innertop .grid-h', '#innerbottom .grid-h'], function(i, selector) { 211 for (var i = 0, elms = $(selector), len = parseInt(elms.length / 2); i < len; i++) { 212 var id = 'pair-' + pairs.length; 213 $.matchHeight(id, [elms.get(i * 2), elms.get(i * 2 + 1)], '.deepest').match(); 214 pairs.push(id); 215 } 216 }); 217 }, 218 invalid: function() { 219 $.matchHeight('sidebars').remove(); 220 $.each(pairs, function() { $.matchHeight(this).remove(); }); 221 } 222 }); 223 224 $.onMediaQuery('(max-width: 767px)', { 225 valid: function() { 226 var header = $('#header-responsive'); 227 if (!header.length) { 228 header = $('<div id="header-responsive"/>').prependTo('#header'); 229 $('#logo').clone().removeAttr('id').addClass('logo').appendTo(header); 230 $('.searchbox').first().clone().removeAttr('id').appendTo(header); 231 $('#menu').responsiveMenu().next().addClass('menu-responsive').appendTo(header); 232 } 233 } 234 }); 235 236})(jQuery); 237 238// css helper 239(function($) { 240var data = [ 241 {str:navigator.userAgent,sub:'Chrome',ver:'Chrome',name:'chrome'}, 242 {str:navigator.vendor,sub:'Apple',ver:'Version',name:'safari'}, 243 {prop:window.opera,ver:'Opera',name:'opera'}, 244 {str:navigator.userAgent,sub:'Firefox',ver:'Firefox',name:'firefox'}, 245 {str:navigator.userAgent,sub:'MSIE',ver:'MSIE',name:'ie'}]; 246for (var n=0;n<data.length;n++) { 247 if ((data[n].str && (data[n].str.indexOf(data[n].sub) != -1)) || data[n].prop) { 248 var v = function(s){var i=s.indexOf(data[n].ver);return (i!=-1)?parseInt(s.substring(i+data[n].ver.length+1)):'';}; 249 $('html').addClass(data[n].name+' '+data[n].name+v(navigator.userAgent) || v(navigator.appVersion)); break; 250 } 251} 252})(jQuery); 253 254 255/*UITop jquery*/ 256(function(a){a.fn.UItoTop=function(b){var c={text:"",min:200,inDelay:600,outDelay:400,containerID:"toTop",containerHoverID:"toTopHover",scrollSpeed:1e3,easingType:"linear"};var d=a.extend(c,b);var e="#"+d.containerID;var f="#"+d.containerHoverID;a("body").append('<a href="#" class="uk-icon-chevron-up" title="" id="'+d.containerID+'">'+d.text+"</a>");a(e).hide().click(function(){a("html, body").animate({scrollTop:0},d.scrollSpeed,d.easingType);a("#"+d.containerHoverID,this).stop().animate({opacity:0}
256,d.inDelay,d.easingType);return false}).prepend('<span id="'+d.containerHoverID+'"></span>').hover(function(){a(f,this).stop().animate({opacity:1},600,"linear")},function(){a(f,this).stop().animate({opacity:0},700,"linear")});a(window).scroll(function(){var b=a(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){a(e).css({position:"absolute",top:a(window).scrollTop()+a(window).height()-50})}if(b>d.min)a(e).fadeIn(d.inDelay);else a(e).fadeOut(d.Outdelay)})}})(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.