*** QuickCalendarPlugin.pm	Sun Oct 19 23:26:22 2003
--- QuickCalendarPlugin.pm-final	Sun May 16 11:20:33 2004
***************
*** 92,98 ****
          %This %Next %Last %Prev
      );
  
! $VERSION = '1.300';
  $pluginName = 'QuickCalendarPlugin';
  
  
--- 92,98 ----
          %This %Next %Last %Prev
      );
  
! $VERSION = '1.302-han';
  $pluginName = 'QuickCalendarPlugin';
  
  
***************
*** 118,124 ****
  
      @MonthStr = qw( . January February March April May June
              July August September October November December);
!     @DayStr = qw(Sun Mon Tue Wed Thu Fri Sat);
  
      $Static{'thisYear'} = 1900 + $NowStr[5];   # y2k compliant :-P
      $Static{'thisMonth'} = $NowStr[4] + 1;     # 1 .. 12
--- 118,124 ----
  
      @MonthStr = qw( . January February March April May June
              July August September October November December);
!     @DayStr = qw(Su Mo Tu We Th Fr Sa);
  
      $Static{'thisYear'} = 1900 + $NowStr[5];   # y2k compliant :-P
      $Static{'thisMonth'} = $NowStr[4] + 1;     # 1 .. 12
***************
*** 136,148 ****
      # Style Configuration
      $Config{'style'} = <<__STYLE__;
  <style>
!     .week   { background:#ccc; }
!     .day    { background:#eee; }
      .today  { background:yellow; }
  </style>
  __STYLE__
  
!     $Config{'tablestyle'} = qq{"width:auto; border:0px;"};
  
      # iterative state
      %Prev = %This = %Next = ();
--- 136,160 ----
      # Style Configuration
      $Config{'style'} = <<__STYLE__;
  <style>
!     .week   { background:#fff; border-right-style:solid; }
!     .day    { background:#fff; }
      .today  { background:yellow; }
+     div.qcal a      { text-decoration:none; font-weight:normal; color:blue; }
+     div.qcal a:visited { color:red; }
+     div.qcal a:hovor { background:black; color:white; }
+     div.qcal a:active  { background:black; color:white; }
  </style>
  __STYLE__
  
!     $Config{'tablestyle'} = qq{"width:auto; border:1px; font-size:14px; TEXT-ALIGN:CENTER;"};
!     $Config{'headstyle'} = qq{"font-size:20px;"};
!     $Config{'barstyle'} = qq{"font-size:16px; FONT-WEIGHT:BOLD;"};
!     $Config{'bar1style'} = qq{"border-right-style:solid; border-bottom-style:solid;"};
!     $Config{'bar2style'} = qq{"border-bottom-style:solid;"};
! 
!     # You may change the following two variables as your wishes.
!     # Set NEWTOPICBGCOLOR = white; 
!     # Set NEWTOPICFONTCOLOR = white; 
  
      # iterative state
      %Prev = %This = %Next = ();
***************
*** 196,213 ****
          $_[3]);
      my $anchor;
  
!     $anchor = '<a TARGET="_blank" href="' .  $This{'userHref'} . $y;
  
!     if ($type eq 'week') {
          # continue with "week" style anchor
!         $anchor .= 'w' . $vv . '">' . $y . 'w' . $vv;
      }
      else {
          # continue with "day" style anchor
!         $anchor .= $vv . $dd . '">' . $d;
      }
  
!     $anchor .= '</a>';
      return $anchor;
  }
  # =========================
--- 208,244 ----
          $_[3]);
      my $anchor;
  
!   # $anchor = '<a TARGET="_blank" href="' .  $This{'userHref'} . $y;
!     $anchor = '[[' . $This{'userHref'} . $y;
  
!     if ($type eq 'year') {
!         # continue with "year" style anchor
!       # $anchor .= '">' . $y;
!         $anchor .= '][' . $y;
!     }
!     elsif ($type eq 'qtr') {
!         # continue with "qtr" style anchor
!       # $anchor .= 'q' . $d . '">' . 'q' . $d;
!         $anchor .= 'q' . $d . '][' . 'q' . $d;
!     }
!     elsif ($type eq 'month') {
!         # continue with "month" style anchor
!       # $anchor .= $vv . '">' . $MonthStr[$This{'displayMonth'}];
!         $anchor .= $vv . '][' . $MonthStr[$This{'displayMonth'}];
!     }
!     elsif ($type eq 'week') {
          # continue with "week" style anchor
!       # $anchor .= 'w' . $vv . '">' . 'w' . $vv;
!         $anchor .= 'w' . $vv . '][' . 'w' . $vv;
      }
      else {
          # continue with "day" style anchor
!       # $anchor .= $vv . $dd . '">' . $d;
!         $anchor .= $vv . $dd . '][' . $d;
      }
  
!   # $anchor .= '</a>';
!     $anchor .= ']]';
      return $anchor;
  }
  # =========================
***************
*** 372,378 ****
      local $_;
  
      my $out = $preSpace .
!             "<!-- Calender rendered by TWiki Plugin: Quick Calendar -->";
  
      $out .= $Config{'style'};
  
--- 403,409 ----
      local $_;
  
      my $out = $preSpace .
!             "<!-- Calender rendered by TWiki Plugin: Quick Calendar --><div class='qcal'>";
  
      $out .= $Config{'style'};
  
***************
*** 455,468 ****
          }
      }
  
      $out .= qq{<table style=$Config{'tablestyle'}>\n} .
!             qq{<tr> <th colspan=8> } .
!             qq{$MonthStr[$This{'displayMonth'}] $This{'displayYear'} } .
!             qq{($This{'displayMonth'}/$This{'displayYear'})} .
!             qq{ </th> </tr>\n} .
!             qq{<tr> <th>Week</th> };
      for (@DayStr) { 
!         $out .= qq{<th> $_ </th> };
      }
      $out .= qq{</tr>\n};
      
--- 486,506 ----
          }
      }
  
+     # Handle Qtr argument
+     $Static{'thisQtr'} = POSIX::ceil($This{'displayMonth'} / 3); # 1 .. 4
+     $This{'displayQtr'} = $Static{'thisQtr'};
+ 
      $out .= qq{<table style=$Config{'tablestyle'}>\n} .
!             qq{<tr style=$Config{'headstyle'}> <th colspan=8> } .
!             generateAnchor('month', $This{'displayYear'}, $This{'displayMonth'}, 0 ) .
! 	    qq{ } .
!             generateAnchor('year', $This{'displayYear'}, 0, 0 ) .
!             qq{ (} .
!             generateAnchor('qtr', $This{'displayYear'}, 0, $This{'displayQtr'} ) .
!             qq{) </th> </tr>\n} .
!             qq{<tr style=$Config{'barstyle'}><th style=$Config{'bar1style'}>wk</th> };
      for (@DayStr) { 
!         $out .= qq{<th style=$Config{'bar2style'}> $_ </th> };
      }
      $out .= qq{</tr>\n};
      
***************
*** 503,509 ****
              last;   # should only get here at 5 anyway?
          }
      }
!     $out .= '</table>';
  
      return $out;
  }
--- 541,547 ----
              last;   # should only get here at 5 anyway?
          }
      }
!     $out .= '</table></div>';
  
      return $out;
  }
