Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Calendar & Events > Reformatting Event Details
Mottie (SuperAdmin) 2/6/2009 1:27 AM EST : Reformatting Event Details
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Reformatting Event Details

GuildPortal admin site link to original post

Before
After

All this code does is moves the "Comments" and "Follow-Up" sections of the event details under the mini calendar on the right side. It was written to help make the entire window more aesthetically pleasing 

This code only effects the calendar events so you only have to add it into a free form text/HTML box on your Calendar page. There is no need to customize it.

Code

<script type="text/javascript">
$(document).ready(function() {
 $("div[id*='_pnlMainView']").each(function(){
  var temp1 = $(this);
  var temp2 = '';
  temp1.find("td:eq(0)").find(".ContentBoxTitle").each(function(){
   if ($(this).html().match("Comments")){
    temp2 += "<br><div style='text-align:left;'>";
    temp2 += $(this).parent().parent().html() + "</div>";
    $(this).parent().parent().html('');
   }
  })
  temp1.find("td").each(function(){
   if ($(this).html() == "Follow-Up") {
    temp2 += "<br><div class='ContentBox'><div style='padding:5px;font-weight:bold;' class='ContentBoxTitle'>"
    temp2 += "Follow-Up</div><table class=ContentBoxBody><tr>" + $(this).next().html() + "</tr></table></div>";
    $(this).parent().html('');
   }
   if ($(this).attr("id").match("_smallCalendarsCell")) $(this).append(temp2);
  })
 })
})
</script>
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Mottie (SuperAdmin) 4/10/2011 9:44 AM EST : RE: Reformatting Event Details
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

To move only the comments block, use this code (admin post):
<style type="text/css">
.eventComments div { font-size: 110%; }
</style>
<!-- Don't change anything below -->
<script type="text/javascript">
$(document).ready(function() {
 var temp1 = $('div[id*="_pnlMainView"]'), temp2,
  comments = temp1.find("a[id$=_lnkAddComment]").closest("td");
 if (comments.length) {
  temp2 = "<br><div style='text-align:left;'>" + comments.html() + "</div>";
  comments.empty();
  temp1.find('td[id*="_smallCalendarsCell"]')
   .append(temp2)
   .find('.ContentBoxBody')
    .addClass('eventComments')
    .removeAttr('style');
 }
});
</script>
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%