Team:TU Delft/pages/blogtest
From 2010.igem.org
(Difference between revisions)
Line 43: | Line 43: | ||
}); | }); | ||
}); | }); | ||
+ | |||
+ | // 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: dp_onSelect, | onSelect: dp_onSelect, | ||
- | beforeShowDay: dp_getDateInfo | + | beforeShowDay: dp_getDateInfo, |
+ | defaultDate: c | ||
}); | }); | ||
+ | loadBlogDate(c); | ||
- | function | + | function loadBlogDate(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 61: | Line 70: | ||
}).fadeIn(200); | }).fadeIn(200); | ||
}); | }); | ||
+ | } | ||
+ | |||
+ | function dp_onSelect(dateText, inst) { | ||
+ | var date = $(this).datepicker("getDate"); | ||
+ | loadBlogDate(date); | ||
} | } | ||
function dp_getDateInfo(date) { | function dp_getDateInfo(date) { | ||
var hasBlogItem = datemap.hasDate(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> | </script> | ||
</html> | </html> |
Revision as of 14:10, 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 [http://tiny.cc/igemtudelft Facebook page] or [http://twitter.com/igemtudelft2010 follow us on Twitter].
Today's post
Calendar
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|