Team:NTU-Taida/Templates/Footer

From 2012.igem.org

(Difference between revisions)
m
 
(30 intermediate revisions not shown)
Line 1: Line 1:
<html>
<html>
-
  <footer class="footer">
+
<footer class="footer">
-
    <div class="container">
+
<div class="container" height='50px'>
-
      <p>&copy; This is footer</p>
+
</div>
-
      <p>&copy; This is footer</p>
+
</footer>
-
      <p>&copy; This is footer</p>
+
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
-
      <p>&copy; This is footer</p>
+
<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
-
    </div>
+
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
-
  </footer>
+
<script type="text/javascript">
-
  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
+
$(document).ready(function() {
-
  <script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/js/bootstrap.min.js"></script>
+
    $("p:empty").remove();
-
  <script type="text/javascript">
+
    $('.carousel').carousel({
-
    $(document).ready(function() {
+
interval: 3000
-
      $("p:empty").remove();
+
});
-
      $('.carousel').carousel({
+
-
        interval: 3000
+
-
      });
+
-
      // table formatting
+
    // table formatting
-
      $('table.wikitable').removeClass('wikitable').addClass('table table-bordered').css({
+
    $('table.wikitable').removeClass('wikitable').addClass('table table-bordered').css({
-
        'margin': '1em 1em 1em 0'
+
      'margin': '1em 1em 1em 0'
       });
       });
-
      //for sidebar and scroll spy
+
    //for sidebar and scroll spy
-
      $('#toc').hide();
+
    $('.toc').hide();
-
      if ("</html>{{{ActiveNavbar|Home}}}<html>" == "Project"){
+
    var activeItem = "</html>{{{ActiveNavbar|Home}}}<html>";
-
        // project sidebar
+
    /*if (activeItem.split(',')[0] == "Project"){
-
        console.log('Enter Project sideabr mode');
+
    // project sidebar
 +
    console.log('Enter Project sideabr mode');
 +
    }else{*/
 +
    // all other sidebars
 +
    $('#toc>tbody>tr>td>ul>li.toclevel-1>a').each(function(index){
 +
      $('ul.sub-navlist').append('<li><a href="'+ $(this).attr('href') +'-sec">'+ $(this).children('span.toctext').text()+'</a></li>');
 +
      // abbrSubnavText();
 +
      if(index==0){
 +
      $('h2[class!="firstHeading"]').has('span.mw-headline').eq(index).before('<section id="'+$(this).attr('href').slice(1)+'-sec">')
       }else{
       }else{
-
        // all other sidebars
+
      $('h2[class!="firstHeading"]').has('span.mw-headline').eq(index).before('</section><section id="'+$(this).attr('href').slice(1)+'-sec">')
-
        $('#toc>tbody>tr>td>ul>li.toclevel-1>a').each(function(index){
+
-
          $('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();
 
-
 
-
      $('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 () {
 
-
        var $spy = $(this).scrollspy('refresh');
 
       });
       });
 +
  // }
 +
    $('.toc').remove();
-
 
+
function abbrSubnavText(displayText){
-
      //usermenu dropdown
+
  if (displayText.length >= 23){
-
      if ($('#pt-logout').length){
+
    var arrayAbbrText = displayText.split(' ');
-
        // login
+
    var newDisplayText="";
-
        $('#nav-login').text('User: ' + $('#pt-userpage').text()).append('<b class="caret"></b>');
+
    var nextDisplayText="";
-
        $('#nav-edit').attr('href',$('#menubar.left-menu > ul > li > a[href$="edit"]').attr('href'));
+
    var i = -1;
-
        $('#nav-history').attr('href',$('#menubar.left-menu > ul > li > a[href$="history"]').attr('href'));
+
    var state = false;
-
        $('#nav-logout').attr('href',$('#pt-logout > a').attr('href'));
+
    do{
-
         $('.dropdown-toggle').dropdown();
+
      i++;
 +
      newDisplayText = nextDisplayText;
 +
      nextDisplayText = nextDisplayText + ' ' + arrayAbbrText[i];
 +
      if (i < arrayAbbrText.length){
 +
         if (nextDisplayText.length < 20){
 +
          state = true;
 +
        }
 +
        else{
 +
          state = false;
 +
        }
       }else{
       }else{
-
         // not login
+
         state = false;
-
        $('#nav-usermenu').remove();
+
-
        $('#nav-login').attr('href',$('#pt-login>a').attr('href')).removeAttr('data-toggle');
+
       }
       }
 +
    }while (state)
 +
      return newDisplayText + ' …';
 +
  }else{
 +
    return displayText;
 +
  }
 +
}
-
      //activate wiki-menu
+
$('h2[class!="firstHeading"]').has('span.mw-headline').wrap('<div class="page-header"></div>');
-
      $('#wiki-navbar.nav > li:contains("</html>{{{ActiveNavbar|Home}}}<html>")').addClass('active');
+
 
 +
//$('#toc').remove();
 +
 
 +
$('body').attr({
 +
    'data-spy': 'scroll',
 +
    'data-target': ".my-sidebar",
 +
    'data-offset': '60'
     });
     });
 +
$('.my-sidebar-nav').affix({
 +
  offset: {
 +
    top: function () { return $(window).width() <= 980 ? 60 : 0},
 +
    bottom: 0
 +
  }
 +
});
 +
$('body[data-spy="scroll"]').scrollspy('refresh').on('activate', reactiveNavbar);
 +
 +
/*jQuery('ul.nav li.dropdown').hover(function() {
 +
  jQuery(this).closest('.dropdown-menu').stop(true, true).show();
 +
  jQuery(this).addClass('open');
 +
}, function() {
 +
  jQuery(this).closest('.dropdown-menu').stop(true, true).hide();
 +
  jQuery(this).removeClass('open');
 +
});*/
 +
 +
function reactiveNavbar(){
 +
  //activate wiki-menu
 +
  //$('#wiki-navbar.nav > li:contains("</html>{{{ActiveNavbar|Home}}}<html>")').addClass('active');   
 +
  $('#nav-</html>{{{ActiveNavbar|Home}}}<html>').addClass('active');
 +
}
 +
 +
//usermenu dropdown
 +
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{
 +
  // not login
 +
  $('#nav-usermenu').remove();
 +
  $('#nav-login').attr('href',$('#pt-login>a').attr('href')).removeAttr('data-toggle');
 +
}
 +
 +
reactiveNavbar();
 +
});
-
  </script>
+
</script>
-
  <p></html>
+
<p></html>

Latest revision as of 17:50, 25 October 2012