Team:TU Delft/pages/blog

From 2010.igem.org

(Difference between revisions)
Line 4: Line 4:
==Calendar==
==Calendar==
-
<html><div id="calendar_container" style="width: auto;"></html>
+
<html>
 +
<div id="calendar_container" style="width: 300px; float: right;"></html>
{{:Team:TU_Delft/basic_calendar}}
{{:Team:TU_Delft/basic_calendar}}
<html></div>
<html></div>
 +
<div style="width: 450px;">
 +
<h2><span class="mv-headline" id="blog_item_date">Today's post</span></h2>
 +
<div id="blog_item_container"></div>
 +
<div style="display:none;" id="blog_item_next"></div>
 +
<div style="clear:both;"></div>
 +
</div>
 +
<div id="fb-root"></div>
 +
<div id="blog_item_fbcomments"></div>
 +
</html>
 +
 +
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
Line 16: Line 28:
.ui-widget-content .day_no_blog a.ui-state-default { background-color: #eee; }
.ui-widget-content .day_no_blog a.ui-state-default { background-color: #eee; }
</style>
</style>
-
 
<script type="text/javascript">
<script type="text/javascript">
$(function() {
$(function() {
-
   var datemap = {};
+
   var datemap = {
 +
    hasDate: function(d) {
 +
      var fmt = $.datepicker.formatDate("dMM", d);
 +
      return this["d" + fmt];
 +
    }
 +
  };
   // use the old calendar to find which days have a blog entry
   // use the old calendar to find which days have a blog entry
Line 32: Line 48:
     });
     });
   });
   });
 +
 +
  // find the last day with a blog item
 +
  var c=new Date();
 +
  while(c.getDate() > 1) {
 +
    if (datemap.hasDate(c))
 +
      break;
 +
    c.setDate(c.getDate()-1);
 +
  }
   $("#calendar_container").empty().datepicker( {
   $("#calendar_container").empty().datepicker( {
-
      onSelect: function(dateText, inst) {
+
    onSelect: dp_onSelect,
-
        var date = $(this).datepicker("getDate");
+
    beforeShowDay: dp_getDateInfo,
-
        var datestr = jQuery.datepicker.formatDate("d_MM_yy", date);
+
    defaultDate: c
-
        var url = "/Team:TU_Delft/"+datestr+"_content?action=render";
+
  });
-
        $.get(url, function(response) {
+
  function loadBlogDate(date) {
-
          $("#blog_item_container").fadeOut(200).queue(function(next) {
+
    var datestr = jQuery.datepicker.formatDate("d_MM_yy", date);
-
            $(this).html(response);
+
    var url = "/Team:TU_Delft/"+datestr+"_content?action=render";
-
            $("#blog_item_date").text(jQuery.datepicker.formatDate("d MM yy", date));
+
 
-
            next();
+
    $.get(url, function(response) {
-
          }).fadeIn(200).queue(function(next) {
+
      $("#blog_item_container").fadeOut(200).queue(function(next) {
-
            updatePageMaskHeight(); // function in main page code
+
        $(this).html(response);
-
            next();
+
        $("#blog_item_date").text(jQuery.datepicker.formatDate("d MM yy", date));
-
          });
+
//      <fb:comments xid="igemblogpost"></fb:comments>
-
        });
+
        $("#blog_item_fbcomments").html('<fb:comments xid="igemblog' + datestr +'" numposts="10" width="450"></fb:comments>');
-
      },
+
        FB.XFBML.parse(document.getElementById('blog_item_fbcomments'));
-
      beforeShowDay: getDateInfo
+
        next();
 +
      }).fadeIn(200);
     });
     });
 +
  }
-
   function getDateInfo(date) {
+
   function dp_onSelect(dateText, inst) {
-
     var fmt = $.datepicker.formatDate("dMM", date);
+
     var date = $(this).datepicker("getDate");
-
     var hasBlogItem = datemap["d" + fmt];
+
    loadBlogDate(date);
 +
  }
 +
  function dp_getDateInfo(date) {
 +
     var hasBlogItem = datemap.hasDate(date);
     return [wgUserName ? true : hasBlogItem, hasBlogItem ? 'day_with_blog' : 'day_no_blog'];
     return [wgUserName ? true : hasBlogItem, hasBlogItem ? 'day_with_blog' : 'day_no_blog'];
   }
   }
-
});
 
-
</script>
+
// facebook initialization code
-
</html>
+
  window.fbAsyncInit = function() {
 +
    FB.init({appId: '132572820109093', status: true, cookie: true, xfbml: true});
 +
    loadBlogDate(c);
 +
  };
-
<html>
+
  var e = document.createElement('script'); e.async = true;
-
<h2><span class="mv-headline" id="blog_item_date">Today's post</span></h2>
+
  e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
-
<div id="blog_item_container"></html>
+
  document.getElementById('fb-root').appendChild(e);
-
{{:Team:TU_Delft/{{CURRENTDAY}}_{{CURRENTMONTHNAME}}_{{CURRENTYEAR}}_content}}
+
});
-
<html></div>
+
</script>
-
<div style="display:none;" id="blog_item_next"></div>
+
-
<div style="clear:both;"></div>
+
</html>
</html>

Revision as of 14:53, 5 July 2010

For some reason, there needs to be an empty line at the start otherwise the wiki markup is not working correctly on the main page

Blog

Follow our progress day by day via our blog. Also don't forget to become a fan of our Facebook page or follow us on Twitter.

Calendar

March
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

April
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30

May
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

June
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

July
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

August
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

September
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

October
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

November
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

Today's post