Team:NTU-Taida/Templates/Footer

From 2012.igem.org

(Difference between revisions)
 
(58 intermediate revisions not shown)
Line 1: Line 1:
<html>
<html>
-
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
+
<footer class="footer">
-
<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/js/bootstrap.min.js"></script>
+
<div class="container" height='50px'>
 +
</div>
 +
</footer>
 +
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
 +
<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
 +
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></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
});
});
-
  //for scroll spy
+
 
-
$('#toc').hide();
+
    // table formatting
-
$('#toc>tbody>tr>td>ul>li.toclevel-1>a').each(function(index){
+
    $('table.wikitable').removeClass('wikitable').addClass('table table-bordered').css({
-
$('ul.sub-navlist').append('<li><a href="'+ $(this).attr('href') +'-sec">'+$(this).children('span.toctext').text()+'</a></li>');
+
      'margin': '1em 1em 1em 0'
-
if(index==0){
+
      });
-
$('h1[class!="firstHeading"]').eq(index).before('<section id="'+$(this).attr('href').slice(1)+'"-sec>')
+
 
-
}else{
+
    //for sidebar and scroll spy
-
$('h1[class!="firstHeading"]').eq(index).before('</section><section id="'+$(this).attr('href').slice(1)+'"-sec>')
+
    $('.toc').hide();
 +
    var activeItem = "</html>{{{ActiveNavbar|Home}}}<html>";
 +
    /*if (activeItem.split(',')[0] == "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){
 +
      $('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{
 +
      $('h2[class!="firstHeading"]').has('span.mw-headline').eq(index).before('</section><section id="'+$(this).attr('href').slice(1)+'-sec">')
 +
      }
 +
      });
 +
  // }
 +
    $('.toc').remove();
 +
 
 +
function abbrSubnavText(displayText){
 +
  if (displayText.length >= 23){
 +
    var arrayAbbrText = displayText.split(' ');
 +
    var newDisplayText="";
 +
    var nextDisplayText="";
 +
    var i = -1;
 +
    var state = false;
 +
    do{
 +
      i++;
 +
      newDisplayText = nextDisplayText;
 +
      nextDisplayText = nextDisplayText + ' ' + arrayAbbrText[i];
 +
      if (i < arrayAbbrText.length){
 +
        if (nextDisplayText.length < 20){
 +
          state = true; 
 +
        }
 +
        else{
 +
          state = false;
 +
        }
 +
      }else{
 +
        state = false;
 +
      }
 +
    }while (state)
 +
      return newDisplayText + ' …';
 +
  }else{
 +
    return displayText;
 +
  }
}
}
-
$('#toc').remove();
+
$('h2[class!="firstHeading"]').has('span.mw-headline').wrap('<div class="page-header"></div>');
-
});
+
-
  $('body').attr({
+
//$('#toc').remove();
 +
 
 +
$('body').attr({
     'data-spy': 'scroll',
     'data-spy': 'scroll',
     'data-target': ".my-sidebar",
     'data-target': ".my-sidebar",
-
     'data-offset': '0'
+
     'data-offset': '60'
-
  });
+
    });
-
  $('.my-sidebar-nav').affix({
+
$('.my-sidebar-nav').affix({
-
    offset: {
+
  offset: {
-
      top: function () { return $(window).width() <= 980 ? 60 : 0},
+
    top: function () { return $(window).width() <= 980 ? 60 : 0},
-
      bottom: 40
+
    bottom: 0
-
    }
+
   }
-
   });
+
-
$('[data-spy="scroll"]').each(function () {
+
-
  var $spy = $(this).scrollspy('refresh');
+
});
});
 +
$('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
//usermenu dropdown
Line 51: Line 112:
}
}
-
//activate wiki-menu
+
reactiveNavbar();
-
$('#wiki-navbar.nav > li:contains("</html>{{{ActiveNavbar|Home}}}<html>")').addClass('active');
+
});
});
 +
 +
</script>
</script>
<p></html>
<p></html>

Latest revision as of 17:50, 25 October 2012