Team:NTU-Taida/Templates/Footer
From 2012.igem.org
(Difference between revisions)
(add project specific) |
|||
Line 1: | Line 1: | ||
<html> | <html> | ||
- | <footer class="footer"> | + | <footer class="footer"> |
- | + | <div class="container"> | |
- | + | <p>© This is footer</p> | |
- | + | <p>© This is footer</p> | |
- | + | <p>© This is footer</p> | |
- | + | <p>© This is footer</p> | |
- | + | </div> | |
- | + | </footer> | |
- | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> | + | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> |
- | <script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/js/bootstrap.min.js"></script> | + | <script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/js/bootstrap.min.js"></script> |
- | <script type="text/javascript"> | + | <script type="text/javascript"> |
- | $(document).ready(function() { | + | $(document).ready(function() { |
- | $("p:empty").remove(); | + | $("p:empty").remove(); |
- | $('.carousel').carousel({ | + | $('.carousel').carousel({ |
- | interval: 3000 | + | interval: 3000 |
- | + | }); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | }); | + | |
- | // | + | // table formatting |
- | $(' | + | $('table.wikitable').removeClass('wikitable').addClass('table table-bordered').css({ |
- | + | 'margin': '1em 1em 1em 0' | |
- | + | }); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | }); | + | |
- | $('h2[class!="firstHeading"]').has('span.mw-headline').wrap('<div class="page-header"></div>'); | + | //for sidebar and scroll spy |
+ | $('#toc').hide(); | ||
+ | if ("</html>{{{ActiveNavbar|Home}}}<html>" == "Project"){ | ||
+ | // project sidebar | ||
+ | console.log('Enter Project sideabr mode'); | ||
+ | }else{ | ||
+ | // all other sidebars | ||
+ | $('#toc>tbody>tr>td>ul>li.toclevel-1>a').each(function(index){ | ||
+ | //console.log($(this)); | ||
+ | $('ul.sub-navlist').append('<li><a href="'+ $(this).attr('href') +'-sec">'+$(this).children('span.toctext').text()+'</a></li>'); | ||
+ | if(index==0){ | ||
+ | $('h2[class!="firstHeading"]').has('span.mw-headline').eq(index).before('<section id="'+$(this).attr('href').slice(1)+'-sec">') | ||
+ | }else{ | ||
+ | $('h2[class!="firstHeading"]').has('span.mw-headline').eq(index).before('</section><section id="'+$(this).attr('href').slice(1)+'-sec">') | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | $('h2[class!="firstHeading"]').has('span.mw-headline').wrap('<div class="page-header"></div>'); | ||
- | $('#toc').remove(); | + | $('#toc').remove(); |
- | + | $('body').attr({ | |
- | + | 'data-spy': 'scroll', | |
- | + | 'data-target': ".my-sidebar", | |
- | + | 'data-offset': '0' | |
- | + | }); | |
- | + | $('.my-sidebar-nav').affix({ | |
- | + | offset: { | |
- | + | top: function () { return $(window).width() <= 980 ? 60 : 0}, | |
- | + | bottom: 0 | |
- | + | } | |
- | + | }); | |
- | $('[data-spy="scroll"]').each(function () { | + | $('[data-spy="scroll"]').each(function () { |
- | + | var $spy = $(this).scrollspy('refresh'); | |
- | }); | + | }); |
- | //usermenu dropdown | + | //usermenu dropdown |
- | if ($('#pt-logout').length){ | + | if ($('#pt-logout').length){ |
- | + | // login | |
- | + | $('#nav-login').text('User: ' + $('#pt-userpage').text()).append('<b class="caret"></b>'); | |
- | + | $('#nav-edit').attr('href',$('#menubar.left-menu > ul > li > a[href$="edit"]').attr('href')); | |
- | + | $('#nav-history').attr('href',$('#menubar.left-menu > ul > li > a[href$="history"]').attr('href')); | |
- | + | $('#nav-logout').attr('href',$('#pt-logout > a').attr('href')); | |
- | + | $('.dropdown-toggle').dropdown(); | |
- | }else{ | + | }else{ |
- | + | // not login | |
- | + | $('#nav-usermenu').remove(); | |
- | + | $('#nav-login').attr('href',$('#pt-login>a').attr('href')).removeAttr('data-toggle'); | |
- | } | + | } |
- | //activate wiki-menu | + | //activate wiki-menu |
- | $('#wiki-navbar.nav > li:contains("</html>{{{ActiveNavbar|Home}}}<html>")').addClass('active'); | + | $('#wiki-navbar.nav > li:contains("</html>{{{ActiveNavbar|Home}}}<html>")').addClass('active'); |
- | }); | + | }); |
- | </script> | + | </script> |
- | <p></html> | + | <p></html> |
Revision as of 14:30, 24 September 2012