*** lib/TWiki/Form.pm.orig Thu Jan 6 17:53:08 2005
--- lib/TWiki/Form.pm Thu Jan 6 19:02:49 2005
***************
*** 407,418 ****
$val =~ s/\n<\/tr>
$//;
$value = "$val\n
\n";
} elsif ( $type eq "date" ) { # calendar.js
$value =~ s/"/"/go; # Make sure double quote don't kill us
$value =~ s/&/&\;/go;
$value =~ s/<\;/go;
$value =~ s/>/>\;/go;
! $value = "";
! $query->{'jscalendar'} = 1;
} elsif( $type eq "radio" ) {
my $val = "";
my $matched = "";
--- 407,426 ----
$val =~ s/\n<\/tr>
$//;
$value = "$val\n
\n";
} elsif ( $type eq "date" ) { # calendar.js
+ my $ifFormat = "@fieldInfo";
+ $ifFormat = $ifFormat ||
+ TWiki::Prefs::getPreferencesValue("JSCALENDARDATEFORMAT", "$web");
+ my $ifOptions = TWiki::Prefs::getPreferencesValue("JSCALENDAROPTIONS", "$web");
+ $size = 10 if $size < 1;
$value =~ s/"/"/go; # Make sure double quote don't kill us
$value =~ s/&/&\;/go;
$value =~ s/<\;/go;
$value =~ s/>/>\;/go;
! $value = "";
! $value .= "";
! $value .= "";
! $query->{'jscalendar'} = 1;
} elsif( $type eq "radio" ) {
my $val = "";
my $matched = "";
*** lib/TWiki/UI/Edit.pm.orig Thu Jan 6 17:53:08 2005
--- lib/TWiki/UI/Edit.pm Thu Jan 6 18:53:23 2005
***************
*** 75,80 ****
--- 75,81 ----
my $meta = "";
my $extra = "";
my $topicExists = &TWiki::Store::topicExists( $webName, $topic );
+ $query->{'jscalendar'} = 0;
# Prevent editing existing topic?
if( $onlyNewTopic && $topicExists ) {
***************
*** 263,268 ****
--- 264,280 ----
$tmpl =~ s/%FORMTEMPLATE%//go; # Clear if not being used
$tmpl =~ s/%TEXT%/$text/go;
$tmpl =~ s/( ?) *<\/?(nop|noautolink)\/?>\n?/$1/gois; # remove and tags
+
+ if ($query->{'jscalendar'}) {
+ # add header data for jscalendar if used. Use header in jscalendar.tmpl
+ my $dir = "$TWiki::pubUrlPath/$TWiki::twikiWebname/JSCalendarContrib";
+ my $calhead = "\n";
+ $calhead .= "\n";
+ $calhead .= "\n";
+ $calhead .= "\n";
+ $tmpl =~ s/<\/head>/$calhead<\/head>/i;
+ }
TWiki::writeHeaderFull ( $query, 'edit', $cgiAppType, length($tmpl) );