Team:TU Delft/pages/blog

From 2010.igem.org

(Difference between revisions)
 
(27 intermediate revisions not shown)
Line 1: Line 1:
-
<noinclude>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</noinclude>
 
==Blog==
==Blog==
Follow our progress day by day via our blog. Also don't forget to become a fan of our [http://tiny.cc/igemtudelft Facebook page] or [http://twitter.com/igemtudelft2010 follow us on Twitter].
Follow our progress day by day via our blog. Also don't forget to become a fan of our [http://tiny.cc/igemtudelft Facebook page] or [http://twitter.com/igemtudelft2010 follow us on Twitter].
Line 6: Line 5:
<html>
<html>
<div id="calendar_container" style="width: 300px; float: right;"></html>
<div id="calendar_container" style="width: 300px; float: right;"></html>
-
{{:Team:TU_Delft/basic_calendar}}
+
{{:Team:TU_Delft/scroll_calendar}}
<html></div>
<html></div>
Line 20: Line 19:
<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.js"></script> -->
-
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
+
-
<style>
 
-
.ui-datepicker.ui-widget-content .ui-state-default { background: none; }
 
-
.ui-widget-content .day_with_blog a.ui-state-default { background-color: #ccc; }
 
-
.ui-widget-content .day_no_blog a.ui-state-default { background-color: #eee; }
 
-
</style>
 
<script type="text/javascript">
<script type="text/javascript">
-
$(function() {
 
-
  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
+
var datePickerLoaded = false;
-
  $("#calendar_container .month").each(function() {
+
-
    var month = $.trim( $(".heading", this).text() );
+
-
    $("a", this).each(function() {  
+
function dbgout(msg) {
-
      var day = $.trim( $(this).text() );
+
  var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
-
      if ($(".day-active", this).length > 0) {
+
  if(is_chrome) console.log(msg);
-
        datemap["d"+day+month] = true;
+
}
-
      }
+
-
    });
+
-
  });
+
-
  // find the last day with a blog item
+
function blog_loadDate(date) {
-
   var c=new Date();
+
   var datestr = jQuery.datepicker.formatDate("d_MM_yy", date);
-
   while(c.getDate() > 1) {
+
   var url = "/Team:TU_Delft/"+datestr+"_content?action=render";
-
    if (datemap.hasDate(c))
+
  setActiveMonth(date.getMonth() - 2);
-
      break;
+
  dbgout('blog_loadDate: ' + date);
-
    c.setDate(c.getDate()-1);
+
-
  }
+
-
   $("#calendar_container").empty().datepicker( {
+
   $.get(url, function(response) {
-
    onSelect: dp_onSelect,
+
    $("#blog_item_container").fadeOut(200).queue(function(next) {
-
    beforeShowDay: dp_getDateInfo,
+
      $(this).html(response);
-
     defaultDate: c
+
      var refURL = "http://2010.igem.org/Team:TU_Delft#/blog?blog=" + datestr;
 +
      $("#blog_item_date").text(jQuery.datepicker.formatDate("d MM yy", date));
 +
      $("#blog_item_fbcomments").html('<fb:comments url="' + refURL + '" xid="igemblog' + datestr +'" numposts="10" width="450"></fb:comments>');
 +
      FB.XFBML.parse(document.getElementById('blog_item_fbcomments'));
 +
      next();
 +
     }).fadeIn(200);
   });
   });
 +
}
-
  function loadBlogDate(date) {
 
-
    var datestr = jQuery.datepicker.formatDate("d_MM_yy", date);
 
-
    var url = "/Team:TU_Delft/"+datestr+"_content?action=render";
 
-
    $.get(url, function(response) {
+
function blog_hashchange_cb() {
-
      $("#blog_item_container").fadeOut(200).queue(function(next) {
+
  dbgout('blog_hashchange');
-
        $(this).html(response);
+
-
        $("#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'));
+
-
        next();
+
-
      }).fadeIn(200);
+
-
    });
+
-
  }
+
-
   function dp_onSelect(dateText, inst) {
+
   hash = location.hash.substring(1);
-
    var date = $(this).datepicker("getDate");
+
   var kvmap = splitHash(hash);
-
    loadBlogDate(date);
+
-
   }
+
-
  function dp_getDateInfo(date) {
+
-
    var hasBlogItem = datemap.hasDate(date);
+
-
    return [wgUserName ? true : hasBlogItem, hasBlogItem ? 'day_with_blog' : 'day_no_blog'];
+
-
  }
+
 +
  if (kvmap.blog)
 +
    blog_loadDate($.datepicker.parseDate('d_MM_yy', kvmap.blog));
 +
}
 +
 +
function blogInit() {
 +
  dbgout('blogInit');
 +
 +
  initScrollCalendar();
 +
 +
  setCalendarLinks (function(day, mo, hasEntry) {
 +
  // console.log('Day: ' + day + '; Mo: ' + mo + '; hasentry=' + hasEntry);
 +
    return makeHash('pages/blog', { blog: day + '_' + mo + '_2010'});
 +
  });
 +
  setHash('pages/blog', { blog: $.datepicker.formatDate("d_MM_yy", new Date()) } );
 +
 +
  dbgout('bind hashupdate');
 +
  $(window).bind('hashupdate', blog_hashchange_cb);
 +
}
 +
 +
$(function() { 
 +
  loadScript('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js', function() {
 +
 +
  if (jQuery.support.boxModel) {
  // facebook initialization code
  // facebook initialization code
   window.fbAsyncInit = function() {
   window.fbAsyncInit = function() {
     FB.init({appId: '132572820109093', status: true, cookie: true, xfbml: true});
     FB.init({appId: '132572820109093', status: true, cookie: true, xfbml: true});
-
     loadBlogDate(c);
+
     blogInit();
   };
   };
Line 97: Line 87:
   e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
   e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
   document.getElementById('fb-root').appendChild(e);
   document.getElementById('fb-root').appendChild(e);
 +
  } else {
 +
    $("#blog_item_fbcomments").text("Facebook comments unsupported on this browser.");
 +
    blogInit();
 +
  }
 +
  });
});
});
 +
 +
var blogpage_close = function() {
 +
  dbgout('unbind hashupdate');
 +
  $(window).unbind('hashupdate', blog_hashchange_cb);
 +
};
 +
 +
$(window).bind('page_close', blogpage_close);
</script>
</script>
</html>
</html>

Latest revision as of 14:25, 16 September 2010

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