Skip to content

Commit

Permalink
Item14887: add rev parameter
Browse files Browse the repository at this point in the history
- add "delete all", "mark all", "approve all" feature moderating comments in bunches
- better Solr integration
- many js fixes
- more modular templates
  • Loading branch information
MichaelDaum committed Nov 26, 2019
1 parent f08386f commit b32a68e
Show file tree
Hide file tree
Showing 6 changed files with 424 additions and 262 deletions.
11 changes: 8 additions & 3 deletions data/System/MetaCommentPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1425048174" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1574759516" format="1.1" version="1"}%
---+!! MetaCommentPlugin
%FORMFIELD{"Description"}%

Expand Down Expand Up @@ -182,6 +182,7 @@ Parameters:
* skip: number of comments to skip in the list, useful for pagination
* limit: maximum number of comments to list, useful for pagination
* singular: title used when only one comment is present, defaults to =One comment=
* rev, revision: specify the version of the topic to render its comments, defaults to most recent revision
* plural: title when there are more than one comment, defaults to ="$count comments=
* mindate: minimum date of a comment to be displayed
* maxdate: maximum date of a comment to be displayed
Expand Down Expand Up @@ -263,6 +264,10 @@ The parameters =THEWEB=, =WHERE= and =LIMIT= are optional where
%$DEPENDENCIES%

---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
| 26 Nov 2019: | 5.10 - added rev parameter to display comments of previous revisions of a topic; \
added "delete all", "approve all", "mark all" features to moderate comments in bunches; \
improved [[Foswiki:Extensions/SolrPlugin][SolrPlugin]] integration |
| 28 May 2018: | 5.03 - depend on new [[Foswiki:Extensions/TopicTitlePlugin][TopicTitlePlugin]] |
| 05 Mar 2018: | 5.01 - cleaned up templates |
| 16 Jan 2017: | 5.00 - implemented a registerCommentHandler() api to let other plugins interact with comment changes |
Expand Down Expand Up @@ -311,10 +316,10 @@ The parameters =THEWEB=, =WHERE= and =LIMIT= are optional where
fixed recoding of received data to the site's own charset; \
improved the way photos are gathered |

%META:FILEATTACHMENT{name="MetaCommentSnap1.jpeg" attachment="MetaCommentSnap1.jpeg" attr="h" comment="" date="1425048174" path="MetaCommentSnap1.jpeg" size="51144" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="MetaCommentSnap1.jpeg" attachment="MetaCommentSnap1.jpeg" attr="h" comment="" date="1574759516" path="MetaCommentSnap1.jpeg" size="51144" user="ProjectContributor" version="1"}%
%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Foswiki:Main/MichaelDaum"}%
%META:FIELD{name="Copyright" title="Copyright" value="2009-2017, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Copyright" title="Copyright" value="2009-2019, Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Home" title="Home" value="https://foswiki.org/Extensions/MetaCommentPlugin"}%
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
Expand Down
18 changes: 15 additions & 3 deletions lib/Foswiki/Plugins/MetaCommentPlugin.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2009-2018 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2009-2019 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -19,8 +19,8 @@ use Foswiki::Func ();
use Foswiki::Plugins ();
use Foswiki::Contrib::JsonRpcContrib ();

our $VERSION = '5.03';
our $RELEASE = '28 May 2018';
our $VERSION = '5.10';
our $RELEASE = '26 Nov 2019';
our $SHORTDESCRIPTION = 'An easy to use comment system';
our $NO_PREFS_IN_TOPIC = 1;
our $core;
Expand Down Expand Up @@ -55,6 +55,18 @@ sub initPlugin {
return getCore(shift)->jsonRpcDeleteComment(@_);
});

Foswiki::Contrib::JsonRpcContrib::registerMethod("MetaCommentPlugin", "deleteAllComments", sub {
return getCore(shift)->jsonRpcDeleteAllComments(@_);
});

Foswiki::Contrib::JsonRpcContrib::registerMethod("MetaCommentPlugin", "approveAllComments", sub {
return getCore(shift)->jsonRpcApproveAllComments(@_);
});

Foswiki::Contrib::JsonRpcContrib::registerMethod("MetaCommentPlugin", "markAllComments", sub {
return getCore(shift)->jsonRpcMarkAllComments(@_);
});

Foswiki::Contrib::JsonRpcContrib::registerMethod("MetaCommentPlugin", "markComment", sub {
return getCore(shift)->jsonRpcMarkComment(@_);
});
Expand Down

0 comments on commit b32a68e

Please sign in to comment.