Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-17 07:07:23

0001 // Make all tables striped by default.
0002 $("table").addClass("table table-striped");
0003 
0004 
0005 // Handle foldable challenges and solutions (on click and at start).
0006 $(".solution").click(function(event) {
0007     var trigger = $(event.target).has(".fold-unfold").length > 0
0008                || $(event.target).filter(".fold-unfold").length > 0;
0009     if (trigger) {
0010         $(">*:not(h2)", this).toggle(400);
0011         $(">h2>span.fold-unfold", this).toggleClass("glyphicon-collapse-down glyphicon-collapse-up");
0012         event.stopPropagation();
0013     }
0014 });
0015 $(".solution").each(function() {
0016     $(">*:not(h2)", this).toggle();
0017     var h2 = $("h2:first", this);
0018     h2.append("<span class='fold-unfold glyphicon glyphicon-collapse-down'></span>");
0019 });
0020 
0021 
0022 // Handle searches.
0023 // Relies on document having 'meta' element with name 'search-domain'.
0024 function google_search() {
0025   var query = document.getElementById("google-search").value;
0026   var domain = $("meta[name=search-domain]").attr("value");
0027   window.open("https://www.google.com/search?q=" + query + "+site:" + domain);
0028 }
0029 
0030 // function to shrink the life cycle bar when scrolling
0031 $(function(){
0032     $('#life-cycle').data('size','big');
0033 });
0034 
0035 $(window).scroll(function(){
0036     if($(document).scrollTop() > 0)
0037     {
0038         if($('#life-cycle').data('size') == 'big')
0039         {
0040             $('#life-cycle').data('size','small');
0041             $('#life-cycle').stop().animate({
0042                 padding: '5px'
0043             },100);
0044         }
0045     }
0046     else
0047     {
0048         if($('#life-cycle').data('size') == 'small')
0049         {
0050             $('#life-cycle').data('size','big');
0051             $('#life-cycle').stop().animate({
0052                 padding: '15px'
0053             },100);
0054         }
0055     }
0056 });