Team:TU Delft/Notebook/blog
From 2010.igem.org
(Difference between revisions)
Line 61: | Line 61: | ||
var datePickerLoaded = false; | var datePickerLoaded = false; | ||
+ | var bloggedDays = {}; | ||
function dbgout(msg) { | function dbgout(msg) { | ||
Line 79: | Line 80: | ||
Cufon.replace('h3'); // Works without a selector engine | Cufon.replace('h3'); // Works without a selector engine | ||
Cufon.replace('#sub1'); // Requires a selector engine for IE 6-7, see above | Cufon.replace('#sub1'); // Requires a selector engine for IE 6-7, see above | ||
- | var refURL = "https://2010.igem.org/Team:TU_Delft | + | var refURL = "https://2010.igem.org/Team:TU_Delft" + makeHash('Notebook/blog', { blog: datestr}); |
$("#blog_item_date").text(jQuery.datepicker.formatDate("d MM yy", date)); | $("#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=" | + | $("#blog_item_fbcomments").html('<fb:comments url="' + refURL + '" xid="igemblog' + datestr +'" numposts="10" width="550"></fb:comments>'); |
FB.XFBML.parse(document.getElementById('blog_item_fbcomments')); | FB.XFBML.parse(document.getElementById('blog_item_fbcomments')); | ||
next(); | next(); | ||
Line 95: | Line 96: | ||
var kvmap = splitHash(hash); | var kvmap = splitHash(hash); | ||
- | if (kvmap.blog) | + | if (kvmap.blog) { |
blog_loadDate($.datepicker.parseDate('d_MM_yy', kvmap.blog)); | blog_loadDate($.datepicker.parseDate('d_MM_yy', kvmap.blog)); | ||
+ | return true; | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | |||
+ | function getLastBlogDate() { | ||
+ | var cur = new Date(); | ||
+ | // find the last day with a blog item | ||
+ | var max = 1000; | ||
+ | while ( !bloggedDays['d' + $.datepicker.formatDate("d_MM", cur)] && max-- > 0) | ||
+ | cur.setDate(cur.getDate()-1); | ||
+ | return cur; | ||
} | } | ||
function blogInit() { | function blogInit() { | ||
dbgout('blogInit'); | dbgout('blogInit'); | ||
- | |||
initScrollCalendar(); | initScrollCalendar(); | ||
setCalendarLinks (function(day, mo, hasEntry) { | setCalendarLinks (function(day, mo, hasEntry) { | ||
// console.log('Day: ' + day + '; Mo: ' + mo + '; hasentry=' + hasEntry); | // console.log('Day: ' + day + '; Mo: ' + mo + '; hasentry=' + hasEntry); | ||
+ | bloggedDays['d' + day + '_' + mo] = hasEntry; | ||
+ | |||
return makeHash('Notebook/blog', { blog: day + '_' + mo + '_2010'}); | return makeHash('Notebook/blog', { blog: day + '_' + mo + '_2010'}); | ||
}); | }); | ||
- | setHash('Notebook/blog', { blog: $.datepicker.formatDate("d_MM_yy", | + | |
+ | if (!blog_hashchange_cb()) { | ||
+ | var last = getLastBlogDate(); | ||
+ | setHash('Notebook/blog', { blog: $.datepicker.formatDate("d_MM_yy", last) } ); | ||
+ | } | ||
dbgout('bind hashupdate'); | dbgout('bind hashupdate'); |
Revision as of 13:46, 15 October 2010
|
|
|
|
|
|
|
|
|
Team Blog
During the competition we updated our blog daily. Read about our every move in and outside the lab. Instead of browsing through the calendar on the right, you can also get a quick overview of the highlights on our timeline page. Also don't forget to become a fan of our [http://tiny.cc/igemtudelft Facebook page] or to [http://twitter.com/igemtudelft2010 follow us on Twitter].
Blog Post
Comment on this post