Team:TU Delft/pages/blogtest

From 2010.igem.org

(Difference between revisions)
Line 5: 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 37: Line 37:
function blog_loadDate(date) {
function blog_loadDate(date) {
-
  var datestr = jQuery.datepicker.formatDate("d_MM_yy", date);
+
//  var datestr = jQuery.datepicker.formatDate("d_MM_yy", date);
   var url = "/Team:TU_Delft/"+datestr+"_content?action=render";
   var url = "/Team:TU_Delft/"+datestr+"_content?action=render";
Line 73: Line 73:
   dbgout('blogInit');
   dbgout('blogInit');
   
   
-
  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
 
-
  $("#calendar_container .month").each(function() {
 
-
    var month = $.trim( $(".heading", this).text() );
 
-
 
-
    $("a", this).each(function() {
 
-
      var day = $.trim( $(this).text() );
 
-
      if ($(".day-active", this).length > 0) {
 
-
        datemap["d"+day+month] = true;
 
-
      }
 
-
    });
 
-
  });
 
-
 
-
  // find the last day with a blog item
 
-
  var c=new Date();
 
-
 
-
  var kvmap = splitHash(location.hash.substring(1));
 
-
  if (kvmap.blog) {
 
-
    c = $.datepicker.parseDate('d_MM_yy', kvmap.blog);
 
-
  } else while(c.getDate() > 1) {
 
-
    if (datemap.hasDate(c))
 
-
      break;
 
-
    c.setDate(c.getDate()-1);
 
-
  }
 
-
 
-
  $("#calendar_container").empty().datepicker( {
 
-
    onSelect: dp_onSelect,
 
-
    beforeShowDay: dp_getDateInfo,
 
-
    defaultDate: c
 
-
  });
 
-
 
-
  dbgout('sethash: ' + $.datepicker.formatDate("d_MM_yy", c));
 
   setHash('pages/blogtest',  { blog: $.datepicker.formatDate("d_MM_yy", c) } );
   setHash('pages/blogtest',  { blog: $.datepicker.formatDate("d_MM_yy", c) } );
   blog_loadDate(c);
   blog_loadDate(c);
Line 116: Line 78:
   dbgout('bind hashupdate');
   dbgout('bind hashupdate');
   $(window).bind('hashupdate', blog_hashchange_cb);
   $(window).bind('hashupdate', blog_hashchange_cb);
-
 
-
 
-
  function dp_onSelect(dateText, inst) {
 
-
    var date = $(this).datepicker("getDate");
 
-
//alert("selected: " +dateText);
 
-
    setHash('pages/blogtest', { blog: $.datepicker.formatDate("d_MM_yy", date) } );
 
-
  }
 
-
 
-
  function dp_getDateInfo(date) {
 
-
    var hasBlogItem = datemap.hasDate(date);
 
-
    return [wgUserName ? true : hasBlogItem, hasBlogItem ? 'day_with_blog' : 'day_no_blog'];
 
-
  }
 
   return c;
   return c;

Revision as of 15:36, 15 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