1 2(function ($) { 3 $module5 = $('#static-module-5'); 4 5 if ($module5.length) { 6 var $tabs, 7 slides = new Array(), 8 $slides, 9 $h3; 10 11 var enableEvents = function() { 12 $tabs = $module5.find('li.tab'); 13 $tabs.click(function() { 14 $tabs.removeClass('active'); 15 $(this).addClass('active'); 16 var tabs_re = /tab-([0-9]*)/; 17 var results = tabs_re.exec(this.className); 18 showSlide(results[1]); 19 }); 20 }; 21 22 var uiCreateSidebar = function() { 23 var $mainTitle = $module5.find('h2'); 24 var aside = '<div class="aside"><h2>' + $mainTitle.text() + '</h2><ul class="tabs">'; 25 //$mainTitle.remove(); 26 $h3 = $module5.find('h3'); 27 $h3.each(function(i) { 28 $this = $(this); 29 aside += '<li class="tab tab-' + i + (i===0 ? ' active' : '') + '"><a href="#" onclick="return false;">' + $this.text() + '</a></li>'; 30 }); 31 aside += '</ul></div>'; 32 $(aside).prependTo($module5); 33 } 34 35 var uiCreateSlides = function() { 36 $h3.each(function(i) { 37 $this = $(this); 38 slides.push(new Array()); 39 var $row = $(this).next('.row'); 40 slides[slides.length-1].push($this); 41 slides[slides.length-1].push($row); 42 43 do { 44 $row = $row.next('.row'); 45 if ($row.length) { 46 slides[slides.length-1].push($row); 47 } 48 } while ($row.length); 49 }); 50 51 $.each(slides, function(index, value) { 52 var $slide = $('<div class="slide"></div>') 53 $.each(value, function(index2, value2) { 54 value2.appendTo($slide); 55 }); 56 $slide.appendTo($module5.find('div.main-inner')); 57 if (index === 0) { 58 $slide.show(); 59 } 60 }); 61 62 $slides = $module5.find('div.slide'); 63 } 64 65 var ui = function() { 66 uiCreateSidebar(); 67 uiCreateSlides(); 68 } 69 70 var showSlide = function(index) { 71 $slides.hide(); 72 $slides.eq(index).show(); 73 } 74 75 ui(); 76 enableEvents(); 77 } 78 79})(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.