1
# See bottom of file for license and copyright information
3
# See Plugin topic for history and plugin information
5
package Foswiki::Plugins::CommentPlugin;
10
require Foswiki::Plugins;
12
use vars qw( $VERSION $RELEASE $SHORTDESCRIPTION $NO_PREFS_IN_TOPIC );
14
our $VERSION = '$Rev: 4263 (2009-06-21) $';
15
our $RELEASE = '04 Jun 2009';
16
our $SHORTDESCRIPTION =
17
'Quickly post comments to a page without an edit/preview/save cycle';
18
our $NO_PREFS_IN_TOPIC = 1;
21
#my ( $topic, $web, $user, $installWeb ) = @_;
25
sub commonTagsHandler {
26
my ( $text, $topic, $web, $meta ) = @_;
28
require Foswiki::Plugins::CommentPlugin::Comment;
30
my $query = Foswiki::Func::getCgiQuery();
31
return unless( defined( $query ) );
33
return unless $_[0] =~ m/%COMMENT({.*?})?%/o;
35
# SMELL: Nasty, tacky way to find out where we were invoked from
36
my $scriptname = $ENV{'SCRIPT_NAME'} || '';
39
my $previewing = ( $scriptname =~ /\/(preview|gnusave|rdiff|compare)/ );
40
Foswiki::Plugins::CommentPlugin::Comment::prompt( $previewing,
41
$_[0], $web, $topic );
44
sub beforeSaveHandler {
45
#my ( $text, $topic, $web ) = @_;
47
require Foswiki::Plugins::CommentPlugin::Comment;
49
my $query = Foswiki::Func::getCgiQuery();
52
my $action = $query->param('comment_action');
54
return unless( defined( $action ) && $action eq 'save' );
55
Foswiki::Plugins::CommentPlugin::Comment::save( @_ );
60
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
62
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
63
# Foswiki Contributors are listed in the AUTHORS file in the root
64
# of this distribution. NOTE: Please extend that file, not this notice.
66
# Additional copyrights apply to some or all of the code in this
69
# Copyright (C) 2001-2006 TWiki Contributors. All Rights Reserved.
70
# TWiki Contributors are listed in the AUTHORS file in the root
71
# of this distribution. NOTE: Please extend that file, not this notice.
72
# Copyright (C) 2004-2008 Crawford Currie
74
# This program is free software; you can redistribute it and/or
75
# modify it under the terms of the GNU General Public License
76
# as published by the Free Software Foundation; either version 2
77
# of the License, or (at your option) any later version. For
78
# more details read LICENSE in the root of this distribution.
80
# This program is distributed in the hope that it will be useful,
81
# but WITHOUT ANY WARRANTY; without even the implied warranty of
82
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.