Team:TU Delft/pages/blog
From 2010.igem.org
(Difference between revisions)
Line 8: | Line 8: | ||
<html></div> | <html></div> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
<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 23: | Line 16: | ||
.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 = {}; |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
// 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 43: | Line 32: | ||
}); | }); | ||
}); | }); | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
$("#calendar_container").empty().datepicker( { | $("#calendar_container").empty().datepicker( { | ||
- | + | onSelect: function(dateText, inst) { | |
- | + | var date = $(this).datepicker("getDate"); | |
- | + | var datestr = jQuery.datepicker.formatDate("d_MM_yy", date); | |
- | + | var url = "/Team:TU_Delft/"+datestr+"_content?action=render"; | |
- | + | ||
- | + | $.get(url, function(response) { | |
- | + | $("#blog_item_container").fadeOut(200).queue(function(next) { | |
- | + | $(this).html(response); | |
- | + | $("#blog_item_date").text(jQuery.datepicker.formatDate("d MM yy", date)); | |
- | + | next(); | |
- | + | }).fadeIn(200).queue(function(next) { | |
- | + | updatePageMaskHeight(); // function in main page code | |
- | + | next(); | |
- | + | }); | |
- | + | }); | |
- | + | }, | |
- | + | beforeShowDay: getDateInfo | |
- | + | ||
}); | }); | ||
- | |||
- | function | + | function getDateInfo(date) { |
- | var | + | var fmt = $.datepicker.formatDate("dMM", date); |
- | + | var hasBlogItem = datemap["d" + fmt]; | |
- | + | ||
- | + | ||
- | var hasBlogItem = datemap | + | |
return [wgUserName ? true : hasBlogItem, hasBlogItem ? 'day_with_blog' : 'day_no_blog']; | return [wgUserName ? true : hasBlogItem, hasBlogItem ? 'day_with_blog' : 'day_no_blog']; | ||
} | } | ||
+ | }); | ||
- | + | </script> | |
- | + | </html> | |
- | + | ||
- | + | ||
- | + | <html> | |
- | + | <h2><span class="mv-headline" id="blog_item_date">Today's post</span></h2> | |
- | + | <div id="blog_item_container"></html> | |
- | + | {{:Team:TU_Delft/{{CURRENTDAY}}_{{CURRENTMONTHNAME}}_{{CURRENTYEAR}}_content}} | |
- | </ | + | <html></div> |
+ | <div style="display:none;" id="blog_item_next"></div> | ||
+ | <div style="clear:both;"></div> | ||
</html> | </html> |
Revision as of 14:33, 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].
Calendar
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|