1/* 2 * Responsee JS - v4 - 2016-06-30 3 * https://www.myresponsee.com 4 * Copyright 2016, Vision Design - graphic zoo 5 * Free to use under the MIT license. 6*/ 7jQuery(document).ready(function($) { 8 //Responsee tabs 9 $('.tabs').each(function(intex, element) { 10 current_tabs = $(this); 11 $(this).prepend('<div class="tab-nav line"></div>'); 12 var tab_buttons = $(element).find('.tab-label'); 13 $(this).children('.tab-nav').prepend(tab_buttons); 14 $(this).children('.tab-item').each(function(i) { 15 $(this).attr("id", "tab-" + (i + 1)); 16 }); 17 $(".tab-nav").each(function() { 18 $(this).children().each(function(i) { 19 $(this).attr("href", "#tab-" + (i + 1)); 20 }); 21 }); 22 $(this).find(".tab-nav a").click(function(event) { 23 $(this).parent().children().removeClass("active-btn"); 24 $(this).addClass("active-btn"); 25 var tab = $(this).attr("href"); 26 $(this).parent().parent().find(".tab-item").not(tab).css("display", "none"); 27 $(this).parent().parent().find(tab).fadeIn(); 28 return false; 29 }); 30 }); 31 //Responsee eside nav 32 $('.aside-nav > ul > li ul').each(function(index, element) { 33 var count = $(element).find('li').length; 34 var content = '<span class="count-number"> ' + count + '</span>'; 35 $(element).closest('li').children('a').append(content); 36 }); 37 $('.aside-nav > ul > li:has(ul)').addClass('aside-submenu'); 38 $('.aside-nav > ul ul > li:has(ul)').addClass('aside-sub-submenu'); 39 $('.aside-nav > ul > li.aside-submenu > a').attr('aria-haspopup', 'true').click(function() { 40 //Close other open sub menus 41 $('.aside-nav ul li.aside-submenu > ul').removeClass('show-aside-ul', 'slow'); 42 $('.aside-nav ul li.aside-submenu:hover > ul').toggleClass('show-aside-ul', 'slow'); 43 }); 44 $('.aside-nav > ul ul > li.aside-sub-submenu > a').attr('aria-haspopup', 'true').click(function() { 45 //Close other open sub menus 46 $('.aside-nav ul ul li > ul').removeClass('show-aside-ul', 'slow'); 47 $('.aside-nav ul ul li:hover > ul').toggleClass('show-aside-ul', 'slow'); 48 }); 49 //Mobile aside navigation 50 $('.aside-nav-text').each(function(index, element) { 51 $(element).click(function() { 52 $('.aside-nav > ul').toggleClass('show-menu', 'slow'); 53 }); 54 }); 55 //Responsee nav 56 $('.top-nav > ul > li ul').each(function(index, element) { 57 var count = $(element).find('li').length; 58 var content = '<span class="count-number"> ' + count + '</span>'; 59 $(element).closest('li').children('a').append(content); 60 }); 61 $('.top-nav > ul li:has(ul)').addClass('submenu'); 62 $('.top-nav > ul ul li:has(ul)').addClass('sub-submenu').removeClass('submenu'); 63 $('.top-nav > ul li.submenu > a').attr('aria-haspopup', 'true').click(function() { 64 //Close other open sub menus 65 $('.top-nav > ul li.submenu > ul').removeClass('show-ul', 'slow'); 66 $('.top-nav > ul li.submenu:hover > ul').toggleClass('show-ul', 'slow'); 67 }); 68 $('.top-nav > ul ul > li.sub-submenu > a').attr('aria-haspopup', 'true').click(function() { 69 //Close other open sub menus 70 $('.top-nav ul ul li > ul').removeClass('show-ul', 'slow'); 71 $('.top-nav ul ul li:hover > ul').toggleClass('show-ul', 'slow'); 72 }); 73 //Mobile aside navigation 74 $('.nav-text').click(function() { 75 $('.top-nav > ul').toggleClass('show-menu', 'slow'); 76 }); 77 //Custom forms 78 $(function() { 79 var input = document.createElement("input"); 80 if (('placeholder' in input) == false) { 81 $('[placeholder]').focus(function() { 82 var i = $(this); 83 if (i.val() == i.attr('placeholder')) { 84 i.val('').removeClass('placeholder'); 85 if (i.hasClass('password')) { 86 i.removeClass('password'); 87 this.type = 'password'; 88 } 89 } 90 }).blur(function() { 91 var i = $(this); 92 if (i.val() == '' || i.val() == i.attr('placeholder')) { 93 if (this.type == 'password') { 94 i.addClass('password'); 95 this.type = 'text'; 96 } 97 i.addClass('placeholder').val(i.attr('placeholder')); 98 } 99 }).blur().parents('form').submit(function() { 100 $(this).find('[placeholder]').each(function() { 101 var i = $(this); 102 if (i.val() == i.attr('placeholder')) i.val(''); 103 }) 104 }); 105 } 106 }); 107 //Tooltip 108 $(".tooltip-container").each(function () { 109 $(this).hover(function(){ 110 var pos = $(this).position(); 111 var container = $(this); 112 var pos = container.offset(); 113 tip = $(this).find('.tooltip-content'); 114 tip_top = $(this).find('.tooltip-content.tooltip-top'); 115 tip_bottom = $(this).find('.tooltip-content.tooltip-bottom'); 116 117 var height = tip.height(); 118 tip.fadeIn("fast"); //Show tooltip 119 tip_top.css({ 120 top: pos.top - height, 121 left: pos.left + (container.width() /2) - (tip.outerWidth(true)/2) 122 }) 123 tip_bottom.css({ 124 top: pos.top, 125 left: pos.left + (container.width() /2) - (tip.outerWidth(true)/2) 126 }) 127 }, function() { 128 tip.fadeOut("fast"); //Hide tooltip 129 }); 130 }); 131 //Active item 132 var url = window.location.href; 133 $('a').filter(function() { 134 return this.href == url; 135 }).parent('li').addClass('active-item'); 136 var url = window.location.href; 137 $('.aside-nav a').filter(function() { 138 return this.href == url; 139 }).parent('li').parent('ul').addClass('active-aside-item'); 140 var url = window.location.href; 141 $('.aside-nav a').filter(function() { 142 return this.href == url; 143 }).parent('li').parent('ul').parent('li').parent('ul').addClass('active-aside-item'); 144 var url = window.location.href; 145 $('.aside-nav a').filter(function() { 146 return this.href == url; 147 }).parent('li').parent('ul').parent('li').parent('ul').parent('li').parent('ul').addClass('active-aside-item'); 148});
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.