Commit Graph

31 Commits

Author SHA1 Message Date
Alex Schroeder
5f019a6ce2 No more /o, modifiers sorted alphabetically 2015-08-23 21:22:12 +03:00
Alex Schroeder
40675c1665 Renamed MailCommentAdditions to MailFormAddition 2015-08-18 12:44:08 +02:00
Alex Schroeder
7ed80944fb Use @MyFormChanges in mail.pl
This also requires a change in gravatar.pl because we can no longer test
for MailNewGetCommentForm. Instead, we test @MyFormChanges as variables
are being initialized and if MailCommentAdditions is already on it, we
don't add GravatarFormAddition.
2015-08-18 12:37:18 +02:00
Alex Schroeder
0ec8dd44e6 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
4176e5d313 PrintFooter relies on @MyFooters
We already called all the subs on @MyFooters and printed the result,
but this commit moves all the code from PrintFooters into subs and
puts those subs on @MyFooters. This allows us to write modules that
can better control where exactly their output should appear. In this
case the change was required in order to allow the Google +1 module to
coexist with code that maybe prints the comment form for all pages.

For example, knowing that the Google +1 sub is the first on one the
list because of unshift(@MyFooters, \&GooglePlusPrintFooter), we can
now write the following:

splice(@MyFooters, 1, 0, \&MyCommentsInTheFooter);

sub MyCommentsInTheFooter {
  my ($id, $rev, $comment) = @_;
  if (not $GooglePlusThisPagePrintedJournal
      and (GetParam('action', 'browse') eq 'browse'
           and $id and $CommentsPrefix
	   and $id ne $RCName
      	   and $id !~ /^$CommentsPrefix(.*)/o)) {

    my $target = $CommentsPrefix . $id;
    my $page = '';
    $page = PageHtml($target) if $IndexHash{$target};
    return $q->div({-class=>'comment'},
		   $q->h2(T('Comments')),
		   $page)
	. GetCommentForm("$CommentsPrefix$id", $rev, $comment);
  }
}

The Google +1 extension was also fixed to not triger the EFF's Privacy
Badger. This is OK because we're using a two step button: The user
needs to click a button before we're loading the script from Google.
2015-08-17 13:39:34 +02:00
Alex Schroeder
0de910336d silence warnings about $q->param
$q->param in list context can be problematic. At the same time, we don't
want to depend on $q->multi_param because it was only added in CGI 4.08
(2014). That's why we're setting $CGI::LIST_CONTEXT_WARN = 0 instead.
2015-08-15 22:48:12 +02:00
Alex Schroeder
6d582698bf Getting rid of %InvisibleCookieParameters
This is no longer required because we don't print cookies nowadays.
2015-08-08 03:40:23 +03:00
Alex Schroeder
5efaf324e1 Revert "Changed EN DASH to - in copyright lines"
This reverts commit 06c7fedec0.
2015-07-28 22:44:53 +02:00
Alex Schroeder
8f3db6ebfe Changed EN DASH to - in copyright lines
The EN DASH is not really required in year ranges such as 2012–2015 when
we're talking about comments in source code that is probably being
displayed in a fixed font anyway. Changing back to an ordinary hypen
allows us to make a meaningful test for use utf8.
2015-07-28 22:14:37 +02:00
Alex Schroeder
d43112fc97 No more undefined map behaviour in scalar context (now in modules) 2015-05-02 04:11:36 +03:00
Alex Schroeder
482888cfaf No more "*Sub = *NewSub", \&NewSub used instead. (Partial progress) 2015-04-11 23:41:33 +03:00
Alex Schroeder
5d2db4b547 No more "use vars"! 2015-04-10 13:31:28 +03:00
Alex Schroeder
20bdba9eb4 mail.pl: added missing licence 2015-03-28 14:12:26 +01:00
Alex Schroeder
5137c2bf3e mail.pl: There is no reason to have module-global %h 2015-03-27 12:58:53 +02:00
Alex Schroeder
a4e0e5a9be "use strict;" in modules (some modules have problems) 2015-03-27 03:01:01 +02:00
Alex Schroeder
d7a1a5cc74 mail.pl: adapt to changes in the footer 2014-11-23 21:43:35 +01:00
Alex Schroeder
c8f606f9dc $q->endform to $q->end_form
When updating to CGI 4.06, it turns out that $q->endform
is no longer defined.
2014-10-10 16:43:01 +02:00
Alex Schroeder
e6d3ad8382 Fixed typo in AddModuleDescription sub name 2014-08-21 22:23:23 +02:00
Alex Schroeder
17bd795ef0 Automatically reformatted modules 2014-08-21 07:29:46 +03:00
Alex Schroeder
cc1e22810d Another fix for mail.pl... 2013-01-13 01:04:19 +01:00
Alex Schroeder
04e0f631fd Fix subscription migration for mail.pl 2013-01-13 00:57:58 +01:00
Alex Schroeder
429d346661 Added migration of subscriptions to mail.pl and tests. 2013-01-13 00:45:58 +01:00
Alex Schroeder
275376006e Fix encoding issues with the use of DB_File in mail.pl.
This also fixes the tests. Also get rid of wide character in print by
Test::Builder by adding the fix mentioned in the Test::More manpage.

The DB_File issue was necessary because a page name with an EN DASH
caused the script to crash, thus not printing the footer.
Unfortunately, this is solved by URL-encoding keys and values. This
means that your old mail.db is going to be invalid!
2013-01-12 23:55:08 +01:00
Alex Schroeder
c9e39a4c19 getting rid of $Id$ tags in $WikiDescription
Replaced the $Id$ tags in $WikiDescription for all the modules and wiki.pl itself with a link to the source and an appropriate wiki page, if possible. This is shown in action=version and should help users figure out what another wiki has installed.
2012-04-19 02:18:45 +02:00
Alex Schroeder
1034864867 (DraftCleanup): Delete it again. Brainfart. 2011-01-16 03:39:50 +00:00
Alex Schroeder
46b2eb1a26 (DraftCleanup): New subroutine. Add it to
@MyMaintenance.
2011-01-16 03:37:52 +00:00
Alex Schroeder
9ece0e4640 (MailNewSave): Only subscribe to a page to be
saved if that's also the page the user wants to save according to
GetId(). This is needed when saving a page X will also change
another page Y. GetId() will return X in both cases, so this code
is only triggered once.
2009-08-29 23:50:46 +00:00
Alex Schroeder
b2de79db59 (MailNewGetFooterTimestamp): Allow people to subscribe to pages even
if no email address has been set.
(DoMailSubscriptions): Provide a link to change the email address.
(DoMailSubscribe): If no mail is provided, allow to subscribe and
ask for an email address.
2009-06-07 14:09:57 +00:00
Alex Schroeder
0da5ec7394 (MailNewGetFooterTimestamp): New function to
allow people to subscribe to ordinary pages once they have their
email subscription set.
2009-06-07 13:46:52 +00:00
Alex Schroeder
453d758130 ($MailPattern): New.
(MailNewInitCookie): New.
(MailNewGetCommentForm): Added subscribe/unsubscribe link.
(MailIsSubscribed): New.
(NewMailDeletePage, MailAddSubscription): New.
(MailMenu): Added link to "All mail subscriptions".
(DoMailSubscriptions): Added unsubscription links.
(DoMailSubscriptionList): Support HTML output.
(MailLink): New.
(DoMailSubscribe, DoMailUnsubscribe): New.
(MailUnsubscribe): New.
(MailAddSubscription, MailSubscribe): Renamed to MailSubscribe.
2009-06-04 06:40:58 +00:00
Alex Schroeder
1fe2527c5f Work in progress 2009-05-17 22:43:50 +00:00