Compare commits

...

229 Commits

Author SHA1 Message Date
Aleks-Daniel Jakimenko-Aleksejev
ac69cc6612 Unicode icons
$UnicodeIcons option and a couple of initial icons.
2015-11-01 06:57:39 +02:00
Alex Schroeder
c64095fd95 scripts: renamed two scripts 2015-10-31 15:15:36 +01:00
Aleks-Daniel Jakimenko-Aleksejev
542f552002 nosearch.pl: code style
It seems like oddtrans does not pick up the strings with double quotes?
It's weird, but it does not matter anyway, because we will switch to gettext
sooner or later.
2015-10-31 02:58:00 +02:00
Aleks-Daniel Jakimenko-Aleksejev
22017a24f2 Updates to Russian translation (70% → 85%) 2015-10-31 02:56:39 +02:00
Alex Schroeder
6ac7093e9f word-count.pl: new 2015-10-30 23:39:52 +01:00
Aleks-Daniel Jakimenko-Aleksejev
89a23a6ac5 Full support for arrayref in $StyleSheet 2015-10-26 01:03:42 +02:00
Aleks-Daniel Jakimenko-Aleksejev
ed17476aeb Fix the number of tests in css.t 2015-10-26 00:34:57 +02:00
Aleks-Daniel Jakimenko-Aleksejev
1b951c66f1 Allow multiple stylesheet files in $StyleSheet
Since $StyleSheet is a scalar, you can't pass multiple values, but you can
now set it to one array ref. For example:

$StyleSheet = ['http://example.org/test.css', 'http://example.org/another.css'];
2015-10-26 00:27:14 +02:00
Aleks-Daniel Jakimenko-Aleksejev
878d99a84c New script translations-stats
Basically copied from the README file. Now you can use it instead of pasting
very long lines into your terminal.
2015-10-23 00:55:21 +03:00
Aleks-Daniel Jakimenko-Aleksejev
c5ec3d782c oddtrans: print # on the last line
Otherwise we will get odd number of elements if the last string has no
translation (it seems like perl trims last empty lines).

Also: strictures and formatting
2015-10-23 00:25:38 +03:00
Aleks-Daniel Jakimenko-Aleksejev
a28276b868 More fixes for Spanish translation 2015-10-21 16:57:27 +03:00
Aleks-Daniel Jakimenko-Aleksejev
a8920bfec1 Some fixes for Spanish translation 2015-10-21 16:06:13 +03:00
Aleks-Daniel Jakimenko-Aleksejev
0e5f338b40 Prioritize slow tests
By using 「--state=slow,save」 we can probably crunch all tests faster (better
wallclock time). Some tests are taking a lot of time simply because of the
delays (sleeping), so it makes sense to start these tests earlier.
2015-10-21 13:15:34 +03:00
Aleks-Daniel Jakimenko-Aleksejev
4a7e50e83e Fix tests ($ShowAll)
$ShowAll was not added to 「our」.
2015-10-21 12:15:25 +03:00
Aleks-Daniel Jakimenko-Aleksejev
608440553b Alexine repo is different now 2015-10-21 06:00:57 +03:00
Aleks-Daniel Jakimenko-Aleksejev
e493652e96 Alexine updates according to the new directory structure
Also, use 8 threads for 「make test」
2015-10-21 05:39:05 +03:00
Aleks-Daniel Jakimenko-Aleksejev
d286267d52 translations/README deleted
This file has to be regenerated periodically, Alexine will do that.
Also, these long one-liners have to be separated into scripts.
I am deleting this file because I'm not willing to update it.
2015-10-21 05:19:56 +03:00
Alex Schroeder
27c5c5fa79 Translation: fix 'non existent' for Spanish, too 2015-10-20 17:31:42 +02:00
Alex Schroeder
9f7cd0bfc7 Translation: 'non existant' to 'nonexisting' 2015-10-20 17:19:02 +02:00
Matias A. Fonzo
6a45d51189 Updates to Spanish translation
This is a general revision of the current file, and a massive upgrade
from the last date (2002).  Some sentences have been formalized and
have been clarified, including corrections, completing the total of the
translation.
2015-10-20 16:51:28 +02:00
Aleks-Daniel Jakimenko-Aleksejev
5d99cb5874 Typo in German translation (liefert repeated twice) 2015-10-19 23:21:44 +03:00
Aleks-Daniel Jakimenko-Aleksejev
7f0f8164bd Biscecting -> Bisection (typo) 2015-10-19 23:17:39 +03:00
Aleks-Daniel Jakimenko-Aleksejev
236e6a4c85 Updates to Russian translation 2015-10-19 23:12:58 +03:00
Aleks-Daniel Jakimenko-Aleksejev
669043e7a9 More fixes for $ShowAll
Some modules had to be fixed too!
'showedit' and 'rollback' are not used in modules, so there's nothing to fix.
2015-10-18 03:14:57 +03:00
Aleks-Daniel Jakimenko-Aleksejev
e57372692e “link blow” → “link below” 2015-10-18 02:48:06 +03:00
Aleks-Daniel Jakimenko-Aleksejev
512afd75a0 Fixed $ShowAll and $ShowEdits, added $ShowRollbacks
It seems like $ShowEdits feature was half broken (not all occurances were
actually defaulted to its value). In the last commit I did the same mistake
with $ShowAll. This is now fixed.
Also, for completeness, I decided to add $ShowRollbacks as well.
2015-10-18 01:21:07 +03:00
Aleks-Daniel Jakimenko-Aleksejev
b5c51d19ba New $ShowAll variable
Sometimes you might want to “List all changes” and “Include minor
changes” by default. We can already change the default value of the
latter by using $ShowEdits variable, but another one was unsettable from
the config file. Now we have $ShowAll variable.
2015-10-18 00:49:57 +03:00
Alex Schroeder
0955dcbc97 make translations
This adds the subheaders to all the translation files.

for f in modules/translations/*-utf8.pl; do
  perl -e "sub AddModuleDescription { print shift, ' ' };
           do '$f';
	   \$i = 0;
	   map { \$_ || \$i++} values %Translate;
	   printf(qq{%d/%d translations missing\n}, \$i, scalar keys %Translate);";
done

brazilian-portuguese-utf8.pl 237/672 translations missing
bulgarian-utf8.pl 496/672 translations missing
catalan-utf8.pl 259/672 translations missing
chinese-utf8.pl 254/672 translations missing
chinese_cn-utf8.pl 199/672 translations missing
dutch-utf8.pl 459/672 translations missing
finnish-utf8.pl 436/672 translations missing
french-utf8.pl 177/672 translations missing
german-utf8.pl 13/672 translations missing
greek-utf8.pl 242/672 translations missing
hebrew-utf8.pl 555/672 translations missing
italian-utf8.pl 425/672 translations missing
japanese-utf8.pl 5/237 translations missing
korean-utf8.pl 393/672 translations missing
fixme-utf8.pl 672/672 translations missing
polish-utf8.pl 239/672 translations missing
portuguese-utf8.pl 389/672 translations missing
romanian-utf8.pl 514/672 translations missing
russian-utf8.pl 297/672 translations missing
serbian-utf8.pl 526/672 translations missing
spanish-utf8.pl 246/672 translations missing
swedish-utf8.pl 372/672 translations missing
ukrainian-utf8.pl 347/672 translations missing
2015-10-17 23:00:26 +02:00
Alex Schroeder
5ee3adf13f Switched to Palatino
On a phone with little RAM, downloading Noticia takes too much time.
2015-10-16 08:44:17 +02:00
Alex Schroeder
5a237d05f7 Translation: "为 %s 建立锁定 。\t"
Removed trailing tab.
2015-10-15 20:12:19 +02:00
Alex Schroeder
bd5d419472 Translation: " . . . . "
Removed trailing whitespace.
2015-10-15 20:05:23 +02:00
Alex Schroeder
cdb66e1ed4 Translation: " ... " is no longer translatable 2015-10-15 19:35:08 +02:00
Alex Schroeder
d5cd6cbd65 Translations: removed trailing whitespace
Various translation files still had translated strings with trailing
whitespace where the English original did not have any. This has been
removed.
2015-10-15 19:32:12 +02:00
Alex Schroeder
e85ddcc9b9 Translation: "Comments on " and "Comment on"
Removed trailing whitespace.
2015-10-15 19:29:35 +02:00
Alex Schroeder
ac4948ca5d Translations: removed trailing whitespace
Various translation files still had translated strings with trailing
whitespace where the English original did not have any. This has been
removed.
2015-10-15 19:23:42 +02:00
Alex Schroeder
6bffdc8149 Trans.: "Consider banning the IP number as well: "
Remove trailing whitespace. In the German translation, I also replaced a
few instances of "sie" with "Sie".
2015-10-15 19:18:55 +02:00
Alex Schroeder
db814c627a Transl.: "Module count (only testable modules): "
Remove trailing whitespace.
2015-10-15 19:15:18 +02:00
Alex Schroeder
b156e08d85 Translation: "Summary of your changes: "
Remove trailing whitespace.
2015-10-15 19:13:13 +02:00
Alex Schroeder
cad08ee17c Translation: "Define external redirect: "
Removed trailing whitespace.
2015-10-15 19:10:59 +02:00
Alex Schroeder
7c04ee83e5 Translation: "Internal Page: "
This string was not used correctly. T('Internal Page: ' . $resolved)
means that the string is concatenated with $resolved and then it will be
translated. This means that the translation will never be found. The
correct usage is as follows: Ts('Internal Page: %s', $resolved). The
translation string has therefore been changed to 'Internal Page: %s' and
the translation files have been fixed accordingly.
2015-10-15 19:07:51 +02:00
Alex Schroeder
844d984526 Translation: ", see "
Removed trailing whitespace.
2015-10-15 15:01:51 +02:00
Alex Schroeder
e91797fcba Translation: "Name: " and "URL: "
Removed trailing whitespace.
2015-10-15 14:55:54 +02:00
Alex Schroeder
8ad1c60817 Translation: remove trailing whitespace
The German translation contained a stray trailing whitespace.
2015-10-15 14:47:49 +02:00
Alex Schroeder
e24f853bef Translation: "Email: "
Removed trailing whitespace.
2015-10-15 14:41:55 +02:00
Alex Schroeder
cfceb84cc6 Translation: "Trail: "
Removed trailing whitespace.
2015-10-15 14:36:51 +02:00
Alex Schroeder
e81234d81f Translation: "Translated page: "
Removed trailing whitespace.
2015-10-15 14:34:28 +02:00
Alex Schroeder
5a647e6042 Translation: "This page is a translation of %s. "
Removed trailing whitespace.
2015-10-15 14:27:17 +02:00
Alex Schroeder
a53f3e390f Translation: "Title: "
Removed trailing whitespace.
2015-10-15 14:24:08 +02:00
Alex Schroeder
d9d213b6b3 Translation: "Trags: "
Removed trailing whitespace.
2015-10-15 14:19:16 +02:00
Alex Schroeder
09c5351a11 Translation: fix Return to
This used to be string with a trailing whitespace, but actual use was
wrong: T('Return to ' . NormalToFree($id)) – this concatenates the page
name and then attempts to translate the result, which never works. The
correct usage is Ts('Return to %s', NormalToFree($id)).
2015-10-14 12:39:55 +02:00
Alex Schroeder
f0fc2f2f29 Translation: File to upload: without trailing SPC 2015-10-14 12:35:23 +02:00
Alex Schroeder
7d6138107f Translation: not deleted: without trailing space 2015-10-14 12:32:25 +02:00
Alex Schroeder
446f587a49 Translation: Cookie: no longer required
With or without trailing space, this text is no longer required.
2015-10-14 12:28:22 +02:00
Alex Schroeder
0872ee501e Translation: %s: without trailing space
We can still translate %s: to %s : for the French.
2015-10-14 12:24:31 +02:00
Alex Schroeder
e4f7500340 month-names, national-days: delete cruft
An error in the Makefile treated all *.pl files in the translations
directory as translation files -- including these other files which are
not regular translation files.
2015-10-14 12:23:18 +02:00
Alex Schroeder
a429bb6a4b alex-2015.css: switched fonts
Removed the @font-face rules that downloaded Noticia Text and Symbola
from the net. This was slowing down access from old mobile phones.
Instead, I'm now using a font-family of "Palatino Linotype", "Book
Antiqua", Palatino, serif.
2015-10-14 10:29:45 +02:00
Aleks-Daniel Jakimenko
ce2a39d8f1 Allow custom setting for --jobs in make test 2015-10-13 03:21:11 +03:00
Aleks-Daniel Jakimenko
81a4dbcdcd Alexine: more comfortable default paths 2015-10-13 02:26:00 +03:00
Alex Schroeder
33a3f515a3 big-brother.t: more rebust under heavy load
The previous fix was no good. Now attempting a different fix.
2015-10-12 15:45:09 +02:00
Alex Schroeder
6372907c4b Parallelize tests
Using random numbers to generate new test-directories for every test
file. Use t/setup.pl to reset.
2015-10-12 15:13:22 +02:00
Alex Schroeder
a8b7b67efe Use warnings
search.t: Using braces without escaping them in regular expressions
trigges a warning. wiki.pl will now quotemeta the replacement string
when highlighting changes.

upgrade-files.t: Only remove the old UseMod directory if it actually
exists in order to fix some warnings.

wiki.pl: only reading the log file when open actually succeeded in order
to fix some warnings.
2015-10-12 15:12:20 +02:00
Alex Schroeder
b0f9722857 recaptcha.t: use Captcha::reCAPTCHA always
This module is no longer optional. The test will not skip.
2015-10-12 15:09:15 +02:00
Alex Schroeder
d5fda299b0 Some tests now more rebust under heavy load
When running tests with four jobs on a laptop with just two cores, load
is heavy and some tests may fail. Trying to make them more robust...

- big-brother.t
- captcha.t
2015-10-12 15:08:08 +02:00
Alex Schroeder
725e121731 meta.t: perl -c only takes one file 2015-10-12 14:48:51 +02:00
Alex Schroeder
ad299b6b1d server.pl: instructions for the plugin to use
I've submitted some patches for Mojolicious::Plugin::CGI and the
comments now point to a fork.
2015-10-11 20:02:37 +02:00
Aleks-Daniel Jakimenko
8439566b01 aawrapperdiv.pl deleted 2015-10-11 12:19:29 +03:00
Alex Schroeder
ef4263cf03 Adding wiki.log to .gitignore 2015-10-09 00:48:07 +02:00
Alex Schroeder
464a6e9af1 server.pl is a Mojolicious server for Oddmuse 2015-10-09 00:47:31 +02:00
Aleks-Daniel Jakimenko
7152fa0a54 WikiConfigFile and WikiModuleDir ENV variables
Currently the config file and modules are supposed to be in $DataDir,
which does make any sense from security point of view. Files with code
should not be in directories that are writable by www-data.

Previously you had to use a wrapper script to work around that. Now we
provide special variables.

Please note that oddmuse will sometimes cache data by using Storable.
Such cache is saved to the disk and then read back when required. This,
however, is an insecure operation given that there is a risk that the
file will be manipulated from www-data in a malicious way.
2015-10-06 04:53:21 +03:00
Alex Schroeder
da5c5a8275 New make target: new-utf8.pl
Changes to oddtrans make sure that lines starting with # are comments
and will be stripped when the translation file is read. When writing new
translation files, comments are added to indicate which files are being
processed right now. This will help translators figure out where the
texts originated from. Note that every key appears only once, so
translations will be missing in the section for later files if they
appeared in earlier sections.

Recreated new-utf8.pl in order to illustrate the new format.
2015-09-30 17:35:02 +02:00
Aleks-Daniel Jakimenko
ee52a25ebf ban.t: fix number of tests 2015-09-30 16:27:40 +03:00
Aleks-Daniel Jakimenko
e831c10cd3 ban.t: removing more strange-spam tests 2015-09-30 16:00:30 +03:00
Aleks-Daniel Jakimenko
9a6da39aaf strange-spam.pl module was deleted, deleting tests as well 2015-09-28 11:24:58 +03:00
Aleks-Daniel Jakimenko
99b819dd68 strange-spam.pl: Module deleted
The wiki says that this module is obsolete. If it is, then there is no need to
keep it in our repo.
2015-09-28 11:21:18 +03:00
Aleks-Daniel Jakimenko
0b42ed0508 private-wiki.pl: missing our 2015-09-23 21:30:54 +03:00
Aleks-Daniel Jakimenko
3b6d891dc7 Stop leaving locks behind
Previously if some user cancelled his request (simply by pressing Stop button
in his browser), then the script will receive a TERM signal or the like.

This means that some locks could be left behind, which required someone
to unlock the wiki manually (by using Unlock Wiki action).

Now we remove these locks automatically!

However, some tasks might want to handle such situations gracefully. That's why
%LockCleaners hash was added. Use lock name as the key and put a coderef as a
value. If SIGTERM (or a bunch of other signals) is received, then it will run
this code, which, supposedly, cleans all of the stuff after it. Private Wiki
Extension was changed according to that, so you can see it in action.

Also, tests added!
2015-09-23 21:07:02 +03:00
Alex Schroeder
e77abbc09f big-brother.pl: Make sure restricted URL is used 2015-09-21 17:56:02 +02:00
Alex Schroeder
61a2238d9a Rollback fixes for $KeepDays = 0
RollbackPossible needs to handle the situation where $KeepDays == 0.
DoRollback used to examine all the pages where rollback was
possible (using $KeepDays) but in order to avoid the special case where
$KeepDays == 0, we can also examine all the pages changed after the
target timestamp $to.
2015-09-21 09:58:38 +02:00
Alex Schroeder
0322deaf82 maintain.t: Fix for $KeepDays = 0 2015-09-21 09:42:30 +02:00
Alex Schroeder
044a6ad835 preview.pl: remove trailing whitespace 2015-09-21 09:41:00 +02:00
Alex Schroeder
86fe0193b7 preview.pl: fix typo
'$id' is not interpolated...
2015-09-21 09:39:40 +02:00
Alex Schroeder
2517928c1e conflict.t: typo 2015-09-21 09:34:00 +02:00
Alex Schroeder
971f4b1579 history.t: Fix for $KeepDays = 0 2015-09-21 09:27:48 +02:00
Alex Schroeder
c0f0b970a6 preview.pl: Add admin menu 2015-09-21 09:24:53 +02:00
Alex Schroeder
fa493d7360 preview.pl: New module to report changes in HTML 2015-09-21 09:12:32 +02:00
Alex Schroeder
831de74800 Print cache even if just have a single clean block
Once again, bitten by Perl. We used to print a cache "if ($Page{blocks}
and $Page{flags} and GetParam('cache', $UseCache) > 0)" -- but if we
have exactly one clean block, then flags will be "0" which is false. So
now we're testing for defined $Page{flags}.
2015-09-21 09:09:14 +02:00
Alex Schroeder
755010f619 rollback.t: Fix tests given $KeepDays default
As $KeepDays now defaults to 0, more changes are required to make these
tests work again.
2015-09-20 14:03:18 +02:00
Alex Schroeder
44c7102dd5 rollback.t: fix many tests
This is done by appending "$KeepDays = 14" to the config file whenever
it gets written. This restores the old behaviour and thus "fixes" the
tests.
2015-09-20 11:44:37 +02:00
Aleks-Daniel Jakimenko
e731c16214 Fix crossbar.t after 858ff72
It seems like the test needs any empty page (not exactly HomePage,
which now returns "Welcome!").
2015-09-19 23:02:29 +03:00
Aleks-Daniel Jakimenko
b3b6eeb2bd Explanation for $KeepDays = 0 (0 means forever) 2015-09-19 22:40:12 +03:00
Aleks-Daniel Jakimenko
fc8c0e66a7 Let's have a working page history (no more ForgiveAndForget by default)
There was a huge discussion with a lot of tension:
https://oddmuse.org/wiki/Revolutionary_Changes#ForgiveAndForget
And also the comments:
https://oddmuse.org/wiki/Comments_on_Revolutionary_Changes#ForgiveAndForget

But in the end, it is safer to have a history which is not broken.
Don't get it wrong, ForgiveAndForget is still a good thing, it's just not what
we should do *by default*.

If your wiki does benefit from ForgiveAndForget, then add this to your config:
$KeepDays = 14;

Although this change solves a couple of important problems, it does not address
new ones that arise because of no ForgiveAndForget. Namely it does not
resolve the problem of deleting stuff when you *really* have to do it. For
example, [[DMCA Extension]] (or similarly named extension with the same
purpose) should be developed. These problems existed for a long time, because
people were using “$KeepDays = 0” a lot. It is just that we started to accept
wikis with no ForgiveAndForget more thoroughly.

In other words, this commit is just part of the bigger change.

Why don't we set it to 5 years? Because then it will be a time bomb that will
be triggered unexpectedly. We should have a more predictable default value.
2015-09-19 22:18:15 +03:00
Alex Schroeder
6207434f19 Make sure the "Welcome!" message is shown 2015-09-19 18:30:51 +02:00
Aleks-Daniel Jakimenko
9ecfe306cb load-lang.pl: missing translations, meta test 2015-09-19 08:28:05 +03:00
Aleks-Daniel Jakimenko
a4dd2b8b0a load-lang.pl: Use $ModuleDir/translations by default
Modules are not loaded recursively, so we are free to use any directory inside
$ModuleDir. It is also where translations are located in the git repo.

Also, %library was renamed to %TranslationsLibrary (which is now "our"). This
is required for tests and for custom configuration.
2015-09-19 07:57:33 +03:00
Aleks-Daniel Jakimenko
0868f3a98e Workaround for utf8::decode bug (sometimes utf8 chars were not decoded)
Remember the problem with toc.pl when the whole page was *sometimes* not
utf8-decoded? There were some thoughts that it might be associated with
memory files, and it is correct. Although I was not able to narrow it down
last time, now I did (simply because this problem appeared elsewhere).

If you look at $output variable after utf8::decode with Devel::Peek, you
will see two variants of flags. This one looks good:
   FLAGS = (PADMY,POK,pPOK,UTF8)
And this one is wrong:
   FLAGS = (PADMY,POK,pPOK)
This problem is weird because it works inconsistently. Most of the time
you will get correct output, but sometimes it will be broken.

Someone has to golf it down to something short in order to submit perl
bug report. This, however, does not look like a simple task.

Current workaround is as stupid as it looks like, but it works.
Somehow assigning it to another variable solves the problem (which, by the
way, is similar to solving other perl string-related problems).
2015-09-16 04:13:02 +03:00
Aleks-Daniel Jakimenko
316471b145 server.pl: just whitespace 2015-09-15 04:13:24 +03:00
Alex Schroeder
586972c71d atom.t: Use our own server for this test
We no longer require an existing webserver running a wiki at
http://localhost/cgi-bin/wiki.pl. Instead, we're running our own
stuff/server.pl on a random port and use it for testing -- and we kill
it when we're done.
2015-09-14 13:01:22 +02:00
Alex Schroeder
f6954c4a2e server.pl simplified and with license 2015-09-14 12:40:09 +02:00
Alex Schroeder
3b0d8c9bd6 server.pl: a stand-alone Oddmuse wiki server 2015-09-13 22:40:05 +02:00
Alex Schroeder
3e60aa8e1b atom.pl: use PUTDATA 2015-09-12 19:06:59 +02:00
Alex Schroeder
b3f865a4ab Make Atom tests mandatory
You must have a wiki running at http://localhost/cgi-bin/wiki.pl and it
must have the Atom Extension installed.
2015-09-12 19:06:09 +02:00
Alex Schroeder
64568025c9 Don't skip the tests if XML::Atom is missing 2015-09-12 18:42:27 +02:00
Alex Schroeder
9472a279ea Lots of tests for preview pagination 2015-09-12 00:05:30 +02:00
Alex Schroeder
e0fdeffc94 Link license 2015-09-11 22:18:38 +02:00
Aleks-Daniel Jakimenko
d1d70be583 No more trailing whitespace (again!), meta test added 2015-09-11 18:07:52 +03:00
Alex Schroeder
6260033669 Add pagination to search and replace preview 2015-09-11 15:15:00 +02:00
Alex Schroeder
57a4132512 Fix test for malformed regular expression search 2015-09-11 15:14:34 +02:00
Alex Schroeder
3e16b45dbb Fix ReplaceAndDiff calling convention
ReplaceAndDiff calls Replace, which loops over all pages. That's why we
don't need to call it from SearchTitleAndBody -- that makes our code
runs way too often.
2015-09-11 14:34:01 +02:00
Alex Schroeder
21392f2f1b Fix issue with malformed regular expressions
If the regular expression cannot be compiled using eval { qr/$re/ } we
just use quotemeta($re) instead.
2015-09-11 14:12:29 +02:00
Alex Schroeder
0fd86ee60d Preview button for search and replace
Also, more use of $func->() instead of &$func() syntax.
2015-09-11 14:05:35 +02:00
Aleks-Daniel Jakimenko
fd42ebf9c3 With /x, # has a special meaning (escape it!) 2015-09-11 02:55:18 +03:00
Aleks-Daniel Jakimenko
3180e5b02a smarttitles.pl: allow patterns in #SUBURL
(with a colon) to get interlinks interpreted, but now any link pattern will
be parsed in regular #SUBURL.
2015-09-11 00:41:15 +03:00
Alex Schroeder
26d3852f30 campaignwiki.org uses HTTPS 2015-09-10 08:36:29 +02:00
Alex Schroeder
ad54fda317 light.css: validator says some stuff is invalid 2015-09-07 10:42:05 +02:00
Aleks-Daniel Jakimenko
dca0c75e34 AGPL for Alexine scripts 2015-09-07 05:00:20 +03:00
Aleks-Daniel Jakimenko
ca0f12697b askpage.pl: forgot to add some variables to our (...) 2015-09-07 03:47:23 +03:00
Aleks-Daniel Jakimenko
b8ae7e0817 askpage.pl: changed according to recent oddmuse changes 2015-09-07 03:42:32 +03:00
Aleks-Daniel Jakimenko
3e91bdc75e Do not tell people to write a comment if they're doing it
“There are no comments, yet. Be the first to leave a comment!” – that's what
you will see when you preview your comment on an empty page.

Since the user is already doing it, there is no need to tell that. Also, it
may look like it is part of the preview.

We no longer do that (after this commit). In other words, the preview should
look exactly like the resulting page.
2015-09-07 03:32:55 +03:00
Alex Schroeder
e25a621e6e Big changes to how diffs are generated
The original issue was that looking at all changes (action=rc all=1) the
resulting diff didn't always make sense if you clicked on the diff link.
It showed the difference between that revision and the current revision.
The PrintHtmlDiff sub was changed significantly to make it easier to
understand and to help fix this issue.

The drawback is that it now requires a new key in page and keep files:
lastmajorsummary. It goes with lastmajor and diff-major and records the
summary for that particular edit. As new changes will start recording
this new key, the change will slowly propagate in existing wikis.
Whenever you look at minor diffs, however, the existing summary key is
chosen. Plus, whenever you want to look at differences between
particular revisions, this is equivalent to looking at minor diffs. So
the only situation that is problematic is an edit history like the
following:

A - major change
B - major change (major diff, major summary, last major revision)
C - minor change

When looking at this page with diff=2, we want to show major diff, major
summary, last major revision. If B happened before this commit was
installed, the summary will be missing.
2015-09-06 14:32:36 +02:00
Alex Schroeder
de6a3f1d0c Add comment label back
Commit:8d4c15e removed our ”Write your comment here:” label. This
commit adds it back.
2015-09-06 08:27:43 +02:00
Alex Schroeder
bf00a9ea04 Merge remote-tracking branch 'origin/return-objects' 2015-09-06 08:10:46 +02:00
Aleks-Daniel Jakimenko
f8ac7a2818 aawrapperdiv.pl: wrap PrintFooter correctly 2015-09-06 02:55:36 +03:00
Aleks-Daniel Jakimenko
1cd33b691c Fix for issue #1 on github
Changing everything to return objects is a worthy goal, but for now we have
taken enough destructive steps towards it. Therefore, this commit fixes the
problem in backwards compatible way (by adding one more parameter to the
signatures).

Note that this additional parameter is NOT a timestamp, it is a whole page
object. Which means that we are still moving towards our goal of using page
objects everywhere, this commit is just doing it in a backwards-compatible
way.
2015-09-06 01:10:29 +03:00
Aleks-Daniel Jakimenko
9d7e5b43c0 Test for Issue #1 on github 2015-09-05 23:54:43 +03:00
Alex Schroeder
ceca41d85c google-plus-one.pl: fix plusone action
Privacy Badger is acting up and I think we're better off creating the
buttons dynamically.
2015-09-04 14:00:44 +02:00
Aleks-Daniel Jakimenko
1c4e082755 Return objects where it begs for it
sub ParseData is fully backwards compatible. If some module runs it in list
context, then it will get listified hash like previously. New code should
always run it in scalar context though (everything in our code base
was changed according to that).

sub GetTextRevision is not backwards compatible (don't let “wantarray” usage
to confuse you). Most modules do not touch that subroutine, so we are probably
fine (modules from our git repo that do use were changed accordingly).

“EncodePage(%$page)” looks wrong. It seems like we should change it to accept
hash ref.
2015-09-04 04:55:48 +03:00
Alex Schroeder
aec340b401 rollback.t: add another 1s sleep
Trying to solve an issue: sometimes the test fails on Alex Daniel's
test server but never on Alex Schroeder's laptop. The output of Recent
Changes being tested has no rollback button for one of the page links.
Actually, the last six edits have no rollback button:

12:34 UTC (diff) MinorPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC (minor)
12:34 UTC (diff) AnotherEvilPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC (minor)
12:34 UTC (diff) OtherPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC
12:34 UTC (diff) NicePage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC
12:34 UTC (diff) EvilPage . . . . 127.0.0.1 – Rollback to 2015-09-01 12:34 UTC
12:34 UTC (diff) MinorPage . . . . 127.0.0.1 – testerror (minor)

Note that this includes the "testerror" minor edit which is about to
be rolled back. Perhaps that's because this should hold in
RollbackPossible and it does not: $ts != $LastUpdate. $ts would be the
timestamp of the testerror edit and $LastUpdate would be the timestamp
of the rollback. I've added another 1s sleep between these two.
2015-09-02 13:41:12 +02:00
Alex Schroeder
3ea87c007d The parameter days must be numeric 2015-08-31 11:04:22 +02:00
Alex Schroeder
4d8b028e2d test for wiping comments with "0" and fix 2015-08-29 11:57:29 +02:00
Aleks-Daniel Jakimenko
31c02d6e95 oddmuse-quickstart: some progress 2015-08-26 07:05:44 +03:00
Aleks-Daniel Jakimenko
26bf8a3043 oddmuse-quickstart: progress (still not ready) 2015-08-25 07:09:37 +03:00
Aleks-Daniel Jakimenko
ac21a8e6a4 Group pages with comment pages in page index 2015-08-25 04:14:16 +03:00
Aleks-Daniel Jakimenko
a000937768 https links in README 2015-08-24 03:00:56 +03:00
Aleks-Daniel Jakimenko
4eef4d2d76 No more /o, modifiers sorted alphabetically 2015-08-23 21:22:12 +03:00
Alex Schroeder
92410a1f5c add-link.pl: Fix footer 2015-08-23 13:32:41 +02:00
Aleks-Daniel Jakimenko
aa89d08e08 atom.pl: use XML::Atom explicitly
So that it is easier to find the required dependency
2015-08-20 14:59:00 +03:00
Aleks-Daniel Jakimenko
244ddb5157 run-tests: fixed wrong git path 2015-08-20 07:19:06 +03:00
Aleks-Daniel Jakimenko
9c3456c963 run-tests: do push as well 2015-08-20 06:54:41 +03:00
Aleks-Daniel Jakimenko
ad9afbf5ba GPL license for Alexine scripts 2015-08-20 06:47:53 +03:00
Aleks-Daniel Jakimenko
bc079133f7 New script new-release (autoupdate source links) 2015-08-20 06:45:32 +03:00
Aleks-Daniel Jakimenko
69a0f3ed23 Alexine image 2015-08-19 11:28:30 +03:00
Aleks-Daniel Jakimenko
1fc3600329 run-tests: print only 7 characters of a commit 2015-08-19 11:19:31 +03:00
Aleks-Daniel Jakimenko
c1141cd610 run-tests: another repository link
This repository will not only hold test data, but it
will also have some other files associated with Alexine bot.
2015-08-19 11:12:36 +03:00
Aleks-Daniel Jakimenko
300d86b2cd run-tests: fixed newlines 2015-08-19 11:10:48 +03:00
Aleks-Daniel Jakimenko
d609a857c0 run-tests: fixed typo, OK status edits are now minor 2015-08-19 10:57:31 +03:00
Aleks-Daniel Jakimenko
8e98298777 run-tests: fix wikiput path 2015-08-19 10:47:49 +03:00
Aleks-Daniel Jakimenko
0642fad8f8 Afterfix for 5462b21 (disallow minor comments)
Test added as well
2015-08-19 10:17:49 +03:00
Aleks-Daniel Jakimenko
d10d76c475 run-tests: secret key specified 2015-08-19 10:05:45 +03:00
Aleks-Daniel Jakimenko
8aa2f04995 New run-tests script (part of Alexine) 2015-08-19 08:53:21 +03:00
Alex Schroeder
b3a1f199c1 Renamed MailCommentAdditions to MailFormAddition 2015-08-18 12:44:08 +02:00
Alex Schroeder
9fbf8a6f39 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
c96b9bb71c static-copy.pl: do not mess with GetCommentForm
This used to be necessary because we used PrintFooter. As static-copy.pl
no longer uses PrintFooter, this futzing is unnecessary and was removed.
2015-08-18 12:35:31 +02:00
Alex Schroeder
71ff0f7de3 askpage.t: new 2015-08-18 11:23:55 +02:00
Alex Schroeder
89fa22d1c9 Introducing @MyFormChanges
GetEditForm and GetCommentForm will now call all the subs in
@FormChanges in order to let them change the generated HTML. This is
used by all the modules that used to hook into either of these two
functions.

A typical change from questionasker.pl:

push(@MyFormChanges, \&QuestionAddTo);

sub QuestionAddTo {
  my ($form, $type, $upload) = @_;
  if (not $upload
      and not QuestionaskerException(GetId())
      and not $QuestionaskerRememberAnswer && GetParam($QuestionaskerSecretKey, 0)
      and not UserIsEditor()) {
    my $question = QuestionaskerGetQuestion();
    $form =~ s/(.*)<p>(.*?)<label for="username">/$1$question<p>$2<label for="username">/;
  }
  return $form;
}

This commit als moves from &$foo to $foo->() based on a recommendation
in Modern Perl by Conway.
2015-08-18 11:11:13 +02:00
Alex Schroeder
7582aaaba1 askpage.pl: don't hook into GetCommentForm
When GetCommentForm is part of @MyFooters, changing it turns into a
problem. We're hooking into GetTextArea instead.
2015-08-18 11:07:51 +02:00
Alex Schroeder
58e9a1e240 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
bd39fe5d38 recaptcha.pl: same fix as questionasker.pl
We need to replace the old reference in @MyFooters with the new code
reference.
2015-08-18 09:44:43 +02:00
Alex Schroeder
1c776e1080 Undo the commit of version numbers 2015-08-17 16:54:07 +02:00
Alex Schroeder
d088887337 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-17 14:22:15 +02:00
Alex Schroeder
0ba76bafb2 oddmuse-2.2.6.pl: use $q->end_form
This silences the errors about $q->endform not existing in newer CGI
versions.
2015-08-17 14:20:25 +02:00
Aleks-Daniel Jakimenko
c7756a8861 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-17 15:12:20 +03:00
Aleks-Daniel Jakimenko
5462b215be Disallow minor comments when $EditAllowed is 3
Otherwise people can sneak some comments in
2015-08-17 15:11:18 +03:00
Alex Schroeder
f98374df9b 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
4614990e04 upgrade-files.t: wipe /tmp/mywikidb
If you're running this test on a system that did not get /tmp wiped in
a 30 days (as happens after a reboot on some systems), then this test
used to fail. The files from the last run will not be changed and
therefore they will not show up in Recent Changes. This commit wipes
$UseModWiki::DataDir before running the test.
2015-08-17 13:35:27 +02:00
Alex Schroeder
6658886b72 alex-2015.css: fix CSS errors 2015-08-17 11:17:04 +02:00
Alex Schroeder
5130a92f9c upgrade_files.pl: Get rid of a warning
Using $q->param in list context...
2015-08-16 09:55:36 +02:00
Alex Schroeder
a602bc0678 search.t: test grouping of search terms 2015-08-16 09:23:33 +02:00
Alex Schroeder
09efd911e6 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
958c118649 upgrade-files.t: upgrade-files.pl was moved 2015-08-15 21:54:06 +02:00
Alex Schroeder
c031898184 summary.t: XSS in summaries was fixed
Similar to the previous commit: there was a test that basically ensured
that XSS attacks were possible.
2015-08-15 21:45:17 +02:00
Alex Schroeder
d32ebaddc8 rss.t: XSS in summaries was fixed
Thus it is revealed that the old version of the test was making sure
that XSS was possible via the edit summary. Oh dear.
2015-08-15 21:22:05 +02:00
Alex Schroeder
9c90bba602 SearchHighlight unless raw
The recent reorganization of the search code always calls
SearchHighlight, even if the raw parameter is set. This causes a test in
namespace.t to fail.
2015-08-15 21:17:02 +02:00
Alex Schroeder
93cc1578d0 encoding.t: fix test
When we decided to no longer show changes to the cookie, we knew that we
would have to change some of the tests. This commit does that for
encoding.t. The tests that looked at the HTML document now look at the
footer of an edit.
2015-08-15 21:03:26 +02:00
Alex Schroeder
79610f7490 cookie.t: fix tests
When we decided to no longer show changes to the cookie, we knew that we
would have to change some of the tests. This commit does that for
cookie.t. All the tests that looked at the HTML document now look at the
HTTP response headers.
2015-08-15 16:05:16 +02:00
Alex Schroeder
be2b87635c big-brother.t: increase $VisitorTime to 10
We had decreased $VisitorTime to 5 back in commit 6bc9531...
"big-brother.t: reduce $VisitorTime to 5". As it turns out, under
certain circumstances, this time window is too short for my laptop, so
I'm increasing it again.
2015-08-15 15:55:12 +02:00
Alex Schroeder
8e38179b66 our $q
The recent change to $q->remote_addr() necessitated the addition of our
$q to a few modules.
2015-08-15 10:32:11 +02:00
Alex Schroeder
1300cfad52 Reintroducing Filtered
When the GrepFiltered sub was removed, we didn't check our modules. As
it turns out, tags.pl and mac.pl hooked into this sub to do their job. A
simple no-op Filtered sub was reintroduced for those modules.

Also, all instances of $UseGrep were removed.
2015-08-15 10:02:14 +02:00
Alex Schroeder
bc6ae67a9a xss.t: testing search & replace 2015-08-10 17:50:29 +02:00
Alex Schroeder
c989bdab1d Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-10 14:23:18 +02:00
Alex Schroeder
3d339a2bf5 Fix HTML escaping of search terms
The existing code basically used HTML quoted regular expressions on HTML
quoted pages. This meant that you could not search and replace HTML
tags, for example. This commit tries to fix it.
2015-08-10 14:18:22 +02:00
Alex Schroeder
ac7d68d134 search.t: do not test without $PATH
There is no need to test a fallback when grep is unavailable because we
got rid of $UseGrep.
2015-08-10 10:30:58 +02:00
Aleks-Daniel Jakimenko
a50c2da042 New quickstart script to help creating a new wiki 2015-08-08 05:08:22 +03:00
Aleks-Daniel Jakimenko
6ccf5b7c14 Getting rid of %InvisibleCookieParameters
This is no longer required because we don't print cookies nowadays.
2015-08-08 03:40:23 +03:00
Aleks-Daniel Jakimenko
7a54eff9b1 No more visible cookies
Displaying the cookie is dangerous. If someone finds a way to perform XSS
attack, then he could steal the cookies just by looking at the page contents.

Please note that otherwise cookie contents are not visible from javascript
due to httponly flag.

This feature was not really useful anyway.
2015-08-08 03:22:56 +03:00
Aleks-Daniel Jakimenko
3c2ff5577b cart.pl: use strict and AddModuleDescription 2015-08-07 02:43:46 +03:00
Aleks-Daniel Jakimenko
d721704a1f cart.pl: whitespace issues 2015-08-07 02:36:35 +03:00
Aleks-Daniel Jakimenko
2ba67e1d8b Just “cart”, no bfc 2015-08-07 02:32:37 +03:00
Aleks-Daniel Jakimenko
eb0a4b6416 Found a newer version of Cart Extension 2015-08-07 02:32:07 +03:00
Aleks-Daniel Jakimenko
7f9b23a704 cart-bfc.pl module stolen from http://bfc.sfsu.edu/source/cart-bfc.pl 2015-08-07 02:26:10 +03:00
Aleks-Daniel Jakimenko
1576c80c9f flashbox.pl deleted because nobody likes Flash 2015-08-07 01:59:19 +03:00
Aleks-Daniel Jakimenko
894748b6b8 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-06 02:44:19 +03:00
Aleks-Daniel Jakimenko
a70618c3be Moving a whole bunch of files 2015-08-06 02:43:57 +03:00
Alex Schroeder
7e92227414 wiki.pl: HTML changes to search form
The search form used to nest delete checkbox and its label, now it uses
the -for attribute instead (and a title attribute with a little help
text).
2015-08-05 16:52:05 +02:00
Alex Schroeder
57788b375a pdf.pl: deleted 2015-08-05 12:25:03 +02:00
Alex Schroeder
b363cb535f wiki.css: code with white-space: pre-wrap; 2015-08-04 13:49:52 +02:00
Alex Schroeder
e31662cda6 wiki.css: padding-top: none changed to 0 2015-08-04 13:43:00 +02:00
Alex Schroeder
ec84200a0b wiki.css: fix typo: no ';' after a block 2015-08-04 13:42:21 +02:00
Alex Schroeder
6f5a4f974c Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-04 13:35:29 +02:00
Alex Schroeder
7d7383de7f wiki.css: code gets grey background
Just code, not pre.
2015-08-04 13:34:51 +02:00
Alex Schroeder
892d462e53 Get rid of $UseGrep
With a wiki having 5934 pages:

alex@kallobombus:~/alexschroeder.ch$ for f in $(seq 10); do (time perl wiki.pl search=kabelbinder grep=0) 2>&1 1>/dev/null|grep user; done
user	0m5.816s
user	0m5.954s
user	0m5.878s
user	0m6.100s
user	0m6.043s
user	0m5.971s
user	0m5.900s
user	0m6.003s
user	0m6.065s
user	0m6.098s
alex@kallobombus:~/alexschroeder.ch$ for f in $(seq 10); do (time perl wiki.pl search=kabelbinder grep=1) 2>&1 1>/dev/null|grep user; done
user	0m6.126s
user	0m6.105s
user	0m6.109s
user	0m6.167s
user	0m6.205s
user	0m5.980s
user	0m6.107s
user	0m6.047s
user	0m6.200s
user	0m6.133s
2015-08-04 11:31:00 +02:00
Alex Schroeder
4e26f0ea37 wiki.css: code gets grey background 2015-08-04 09:57:11 +02:00
Alex Schroeder
ca0a429027 xss.t: verify alt attributes are ok 2015-08-03 09:33:19 +02:00
Aleks-Daniel Jakimenko
d72ee44c3d Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-02 23:44:48 +03:00
Alex Schroeder
5b8caecee9 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-02 22:19:02 +02:00
Ingo Belka
9e58992459 “title” attribute for uploaded images
Uploaded images had no tooltips in Firefox because there was
no “title” attribute.

This change has a positive impact on creole.pl because
Creole Extension is using GetDownloadLink core subroutine.
2015-08-02 23:18:30 +03:00
Alex Schroeder
408df36c0b Fix XSS attack in RSS feeds
If the page content is not printed, then the page summary is plain text.
In other words, it needs to be HTML-quoted.
2015-08-02 22:18:02 +02:00
Aleks-Daniel Jakimenko
46183d0246 Now we will always use httponly cookie flag
If XSS ever comes through, we don't want it to read passwords or do wiki
actions (like editing pages).

Although it does not protect against MitM attacks (all data sent through
HTTP is sent as plaintext, therefore it is easy to get the cookies),
still it gives a protection against script-kiddies. Use HTTPS to get
it completely secure.

This is a prerequisite for anti-CSRF Double Submit Cookies.
2015-08-02 16:14:34 +03:00
Alex Schroeder
3e6de210f8 xss.t: new 2015-07-31 18:03:17 +02:00
Aleks-Daniel Jakimenko
f50b617b76 Fix XSS in diffs 2015-07-31 18:44:22 +03:00
Alex Schroeder
2c4df27922 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-07-31 15:38:10 +02:00
Alex Schroeder
823f518615 Replace GetRemoteHost with $q->remote_addr() 2015-07-31 09:35:51 +02:00
Alex Schroeder
2a2987ac79 undo-double-quotes.pl
The conversion of : at the beginning of a line into [quote] bbCode had sometimes left me with consecutive quotes:

: a
: b

Turned into:

[quote]
a
[/quote]

[quote]
b
[/quote]

And this script turns that back into:

[quote]
a

b
[/quote]
2015-07-29 15:52:29 +02:00
Alex Schroeder
dfd97d4958 undo-local-names.pl and undo-usemod.pl
When I decided to drop Wiki Wirds, uninstall the Local Names Extension
and uninstall the Usemod Markup Extension from my homepage, I had a
lot of markup that would no longer work. These are the files I used to
migrate my data directory.
2015-07-29 15:38:30 +02:00
Alex Schroeder
826d1cd6ef Fix test for good regular expression 2015-07-29 10:34:14 +02:00
Alex Schroeder
642cec5e7d Fix utf8 encoding and enable meta test
We now check POD and code with two separate checks. One checks for use
utf8, the other checks for =encoding utf8.
2015-07-28 23:02:23 +02:00
Alex Schroeder
dfa71cb2e3 Revert "Changed EN DASH to - in copyright lines"
This reverts commit 06c7fedec0.
2015-07-28 22:44:53 +02:00
Alex Schroeder
5ed32a6d3f meta.t: enable use utf8 test 2015-07-28 22:16:02 +02:00
Alex Schroeder
06c7fedec0 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
b29ce6c44d agree-disagree.pl: fix leading whitespace 2015-07-28 21:59:47 +02:00
Alex Schroeder
ef6d9172f5 agree-disagree.pl: fix issues 2015-07-28 21:58:15 +02:00
Alex Schroeder
eaf4433505 meta.t: 404handler.pl is not a real module 2015-07-28 21:52:41 +02:00
Alex Schroeder
259dc5c27d meta.t: test for AddModuleDescription 2015-07-28 11:15:28 +02:00
Alex Schroeder
e606016ece 404handler.pl: use our for variables 2015-07-28 10:55:13 +02:00
Alex Schroeder
c7692fad5b upload.pl: fix missing my 2015-07-28 10:49:42 +02:00
Alex Schroeder
3206947b6b Remove trailing whitespace
I love those meta tests.
2015-07-28 10:47:21 +02:00
Alex Schroeder
1eb5bb06a5 oddmuse-curl.el: help users see reload command 2015-07-28 10:44:04 +02:00
Aleks-Daniel Jakimenko
0b4007ff5a meta.t: nice suggestion in "perl -c" test 2015-07-28 06:20:54 +03:00
Aleks-Daniel Jakimenko
92c64bbba9 Tests for our Refactoring efforts (some tests are failing)
Some tests are failing because of the actual problems.
We should fix those.
2015-07-28 06:10:38 +03:00
Aleks-Daniel Jakimenko
f7d5430451 New old module agree-disagree.pl (copied from wiki) 2015-07-28 03:35:33 +03:00
333 changed files with 12504 additions and 9539 deletions

4
.gitignore vendored
View File

@@ -1,8 +1,10 @@
*~
/build/
\#*\#
/test-data
/test-data*
/Mac/pkg/
*.dmg
*.pkg
.DS_Store
wiki.log
.prove

View File

@@ -3,7 +3,7 @@
# subdirectory.
VERSION_NO=$(shell git describe --tags)
TRANSLATIONS=$(wildcard modules/translations/[a-z]*.pl$)
TRANSLATIONS=$(wildcard modules/translations/[a-z]*-utf8.pl$)
MODULES=$(wildcard modules/*.pl)
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
@@ -38,11 +38,21 @@ build/month-names-%.pl: modules/translations/month-names-%.pl
build/%.pl: modules/%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
modules/translations/new-utf8.pl: wiki.pl $(MODULES)
cp $@ $@-old
perl stuff/oddtrans -l $@-old wiki.pl $(MODULES) > $@
rm -f $@-old
translations: $(TRANSLATIONS)
for f in $^; do \
echo updating $$f...; \
perl oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
perl stuff/oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
done
# Running four jobs in parallel, but clean up data directories without
# race conditions!
jobs ?= 4
test:
prove t
prove t/setup.pl
prove --jobs=$(jobs) --state=slow,save t

View File

@@ -1,5 +1,5 @@
This is the README file distributed together with the
[[http://oddmuse.org/|Oddmuse]] script.
[[https://oddmuse.org/|Oddmuse]] script.
== Installing Oddmuse on a Debian System running Apache
@@ -82,7 +82,7 @@ putting their names in {{{[[double square brackets]]}}}.
Enjoy your wiki experience.
Visit http://www.oddmuse.org/ to learn more about the translation
Visit https://www.oddmuse.org/ to learn more about the translation
files and modules that are part of this package.
== Apache
@@ -136,7 +136,7 @@ simply restart it all:
sudo service apache2 graceful
}}}
----------------------------------------------------------------------
== License
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -153,5 +153,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Both the GNU Free Documentation License, and the GNU General Public
License are distributed together with this script. See the files FDL
and GPL, respectively.
License are distributed together with this script. See the files
[[https://github.com/kensanata/oddmuse/blob/master/FDL|FDL]] and
[[https://github.com/kensanata/oddmuse/blob/master/GPL|GPL]],
respectively.

View File

@@ -1,4 +1,4 @@
The files in this directory are used to run http://campaignwiki.org/
The files in this directory are used to run https://campaignwiki.org/
add-link.pl
===========
@@ -8,7 +8,7 @@ bookmark site: A few pages make up a big unordered list of links in
wiki format. add-link is a tool to help users contribute new links to
the list.
http://campaignwiki.org/wiki/LinksToWisdom/HomePage
https://campaignwiki.org/wiki/LinksToWisdom/HomePage
copy.pl
=======
@@ -17,7 +17,7 @@ This is used to copy the text from a web page to a wiki page. The idea
was to keep archive copies of cool pages somewhere. The Blog Archive
never got used, though.
http://campaignwiki.org/wiki/BlogArchive/HomePage
https://campaignwiki.org/wiki/BlogArchive/HomePage
monster-tag.pl
==============
@@ -25,7 +25,7 @@ monster-tag.pl
This is used to quickly tag many pages in the Monsters wiki. The
Monsters wiki hasn't been used in a long time, though.
http://campaignwiki.org/wiki/Monsters/HomePage
https://campaignwiki.org/wiki/Monsters/HomePage
submit.pl
=========
@@ -34,4 +34,4 @@ This used to be used to add sites to the Old School RPG Planet. The
aggregator was configured via a wiki page on the Planet wiki. It's now
abandoned.
http://campaignwiki.org/wiki/Planet/HomePage
https://campaignwiki.org/wiki/Planet/HomePage

View File

@@ -292,6 +292,7 @@ sub main {
Init(); # read config file (no modules!)
$ScriptName = $site; # undo setting in the config file
$FullUrl = $site; #
InitPageVariables(); # call again: $ScriptName was wrong
binmode(STDOUT,':utf8');
$q->charset('utf8');
if ($q->path_info eq '/source') {

View File

@@ -602,7 +602,7 @@ This command is used to reflect new pages to `oddmuse-pages-hash'."
("{{{.*?}}}"
0 '(face shadow
help-echo "Creole code"))
("^{{{\n\\(.*\n\\)+?}}}\n"
("^{{{\\(.*\n\\)+?}}}\n"
0 '(face shadow
help-echo "Creole multiline code")))
"Implement markup rules for the Creole markup extension.
@@ -841,7 +841,9 @@ WIKI is the name of the wiki as defined in `oddmuse-wikis',
PAGENAME is the pagename of the page you want to edit. If the
page is already in a buffer, pop to that buffer instead of
loading the page Use a prefix argument to force a reload of the
page."
page. Use \\[oddmuse-reload] to reload the list of pages
available if you changed the URL in `oddmuse-wikis' or if other
people have been editing the wiki in the mean time."
(interactive (oddmuse-pagename))
(make-directory (concat oddmuse-directory "/" wiki) t)
(let ((name (concat wiki ":" pagename)))

114
contrib/undo-double-quotes.pl Executable file
View File

@@ -0,0 +1,114 @@
#! /usr/bin/perl -w
# Copyright (C) 2015 Alex Schroeder <alex@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use utf8;
use strict;
use warnings;
undef $/; # slurp
my %index = ();
my $verbose = '';
sub write_file {
my ($file, $data) = @_;
return unless $data;
open(my $fh, '>:utf8', $file) or die "Cannot write $file: $!";
print $fh $data;
close($fh);
}
sub replacement_block {
my ($block, $pos, @no_go) = @_;
while (@no_go) {
my $first = shift @no_go;
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
return $block if $pos >= $first->[0] and $pos <= $first->[1];
}
return "";
}
sub translate_file {
my ($data) = @_;
my @no_go = ();
while ($data =~ /( <nowiki>.*?<\/nowiki>
| <code>.*?<\/code>
| ^ <pre> (.*\n)+ <\/pre>
| ^ {{{ (.*\n)+ }}} )/gmx) {
push @no_go, [pos($data) - length $1, pos($data)];
print "no go from " . $no_go[-1]->[0] . ".." . $no_go[-1]->[1] . " for $1\n" if $verbose;
}
# The problem is that these replacements don't adjust @no_go! Perhaps it is good enough?
my $subs = '';
$subs = $subs || $data =~ s/ ( \[\/quote\] \n \n \[quote\] ) /replacement_block($1, pos($data), @no_go)/gex;
return $data if $subs;
}
sub read_file {
my $file = shift;
open(my $fh, '<:utf8', $file) or die "Cannot read $file: $!";
my $data = <$fh>;
close($fh);
return $data;
}
sub main {
my ($dir) = @_;
mkdir($dir . '-new') or die "Cannot create $dir-new: $!";
print "Indexing files\n";
foreach my $file (glob("$dir/.* $dir/*")) {
next unless $file =~ /$dir\/(.+)/;
my $id = $1;
next if $id eq ".";
next if $id eq "..";
$index{$id} = 1;
}
print "Converting files\n";
foreach my $id (sort keys %index) {
# this is where you debug a particular page
# $verbose = $id eq '2014-12-18_Emacs_Wiki_Migration';
write_file("$dir-new/$id", translate_file(read_file("$dir/$id")));
}
}
use Getopt::Long;
my $dir = 'raw';
my $help = '';
GetOptions ("dir=s" => \$dir,
"help" => \$help);
if ($help) {
print qq{
Usage: $0 [--dir=DIR]
You need to use the raw.pl script to create a directory full of raw
wiki text files.
--dir=DIR is where the raw wiki text files are. Default: raw. The
converted files will be stored in DIR-new, ie. in raw-new by
default.
Example: $0 --dir=~/alexschroeder/raw
}
} else {
main ($dir);
}

170
contrib/undo-local-names.pl Executable file
View File

@@ -0,0 +1,170 @@
#! /usr/bin/perl -w
# Copyright (C) 2015 Alex Schroeder <alex@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use utf8;
use strict;
use warnings;
undef $/; # slurp
my %index = ();
my $verbose = '';
my $LinkPattern = '(\p{Uppercase}+\p{Lowercase}+\p{Uppercase}\p{Alphabetic}*)';
my $FreeLinkPattern = "([-,.()'%&?;<> _1-9A-Za-z\x{0080}-\x{fffd}]|[-,.()'%&?;<> _0-9A-Za-z\x{0080}-\x{fffd}][-,.()'%&?;<> _0-9A-Za-z\x{0080}-\x{fffd}]+)";
my $UrlProtocols = 'http|https|ftp|afs|news|nntp|mid|cid|mailto|wais|prospero|telnet|gopher|irc|feed';
my $UrlChars = '[-a-zA-Z0-9/@=+$_~*.,;:?!\'"()&#%]'; # see RFC 2396
my $FullUrlPattern="((?:$UrlProtocols):$UrlChars+)"; # when used in square brackets
# either a single letter, or a string that begins with a single letter and ends with a non-space
my $words = '([A-Za-z\x{0080}-\x{fffd}](?:[-%.,:;\'"!?0-9 A-Za-z\x{0080}-\x{fffd}]*?[-%.,:;\'"!?0-9A-Za-z\x{0080}-\x{fffd}])?)';
# zero-width assertion to prevent km/h from counting
my $nowordstart = '(?:(?<=[^-0-9A-Za-z\x{0080}-\x{fffd}])|^)';
# zero-width look-ahead assertion to prevent km/h from counting
my $nowordend = '(?=[^-0-9A-Za-z\x{0080}-\x{fffd}]|$)';
my $IrcNickRegexp = qr{[]a-zA-Z^[;\\`_{}|][]^[;\\`_{}|a-zA-Z0-9-]*};
sub FreeToNormal { # trim all spaces and convert them to underlines
my $id = shift;
return '' unless $id;
$id =~ s/ /_/g;
$id =~ s/__+/_/g;
$id =~ s/^_//;
$id =~ s/_$//;
return $id;
}
sub parse_local_names {
my $filename = shift;
print "Reading $filename\n";
open(my $fh, '<:utf8', $filename) or die "Cannot read $filename: $!";
my $data = <$fh>;
close($fh);
print "Parsing $filename\n";
my %names = ();
while ($data =~ m/\[$FullUrlPattern\s+([^\]]+?)\]/g) {
my ($page, $url) = ($2, $1);
my $id = FreeToNormal($page);
$names{$id} = $url;
}
return \%names;
}
sub write_file {
my ($file, $data) = @_;
return unless $data;
open(my $fh, '>:utf8', $file) or die "Cannot write $file: $!";
print $fh $data;
close($fh);
}
sub replacement {
my ($names, $id, $pos, @no_go) = @_;
while (@no_go) {
my $first = shift @no_go;
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
return $id if $pos >= $first->[0] and $pos <= $first->[1];
}
return "[[$id]]" if exists $index{$id}; # local page exists
return $id unless $names->{$id};
return '[' . $names->{$id} . ' ' . $id . ']';
}
sub translate_file {
my ($names, $data) = @_;
my @no_go = ();
while ($data =~ /( <nowiki>.*?<\/nowiki>
| <code>.*?<\/code>
| ^ <pre> (.*\n)+ <\/pre>
| ^ {{{ (.*\n)+ }}}
| ${nowordstart} \* ${words} \* ${nowordend}
| ${nowordstart} \/ ${words} \/ ${nowordend}
| ${nowordstart} \_ ${words} \_ ${nowordend}
| ${nowordstart} \! ${words} \! ${nowordend}
| \[\[ $FreeLinkPattern .*? \]\]
| \[ $FullUrlPattern \s+ [^\]]+? \]
| ^( \h+.+\n )+
| ^(?: \[? \d\d?:\d\d (?:am|pm)? \]? )? \s* < $IrcNickRegexp > )/gmx) {
push @no_go, [pos($data) - length $1, pos($data)];
print "no go from " . $no_go[-1]->[0] . ".." . $no_go[-1]->[1] . " for $1\n" if $verbose;
}
my $subs = $data =~ s/(?<![:![])\b$LinkPattern(?![:])/replacement($names, $1, pos($data), @no_go)/ge;
return $data if $subs;
}
sub read_file {
my $file = shift;
open(my $fh, '<:utf8', $file) or die "Cannot read $file: $!";
my $data = <$fh>;
close($fh);
return $data;
}
sub main {
my ($dir, $local_names) = @_;
mkdir($dir . '-new') or die "Cannot create $dir-new: $!";
my $names = parse_local_names("$dir/$local_names");
print "Indexing files\n";
foreach my $file (glob("$dir/.* $dir/*")) {
next unless $file =~ /$dir\/(.+)/;
my $id = $1;
next if $id eq ".";
next if $id eq "..";
next if $id eq "$local_names";
$index{$id} = 1;
}
print "Converting files\n";
foreach my $id (sort keys %index) {
# this is where you debug a particular page
# $verbose = $id eq '2014-12-18_Emacs_Wiki_Migration';
write_file("$dir-new/$id", translate_file($names, read_file("$dir/$id")));
}
}
use Getopt::Long;
my $names = 'LocalNames';
my $dir = 'raw';
my $help = '';
GetOptions ("names=s" => \$names,
"dir=s" => \$dir,
"help" => \$help);
if ($help) {
print qq{
Usage: $0 [--dir=DIR] [--names=LocalNames]
You need to use the raw.pl script to create a directory full of raw
wiki text files.
--dir=DIR is where the raw wiki text files are. Default: raw. The
converted files will be stored in DIR-new, ie. in raw-new by
default.
--names=LocalNames is the page name with all the local names on
it. Default: LocalNames
Example: $0 --dir=~/alexschroeder/raw --names=Names
}
} else {
main ($dir, $names);
}

128
contrib/undo-usemod.pl Executable file
View File

@@ -0,0 +1,128 @@
#! /usr/bin/perl -w
# Copyright (C) 2015 Alex Schroeder <alex@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use utf8;
use strict;
use warnings;
undef $/; # slurp
my %index = ();
my $verbose = '';
sub write_file {
my ($file, $data) = @_;
return unless $data;
open(my $fh, '>:utf8', $file) or die "Cannot write $file: $!";
print $fh $data;
close($fh);
}
sub replacement_block {
my ($block, $pos, @no_go) = @_;
while (@no_go) {
my $first = shift @no_go;
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
return $block if $pos >= $first->[0] and $pos <= $first->[1];
}
return "[quote]\n" . join("\n", split(/ \n :+ \h? /x, $block)) . "[/quote]\n";
}
sub replacement {
my ($block, $tag, $pos, @no_go) = @_;
while (@no_go) {
my $first = shift @no_go;
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
return $block if $pos >= $first->[0] and $pos <= $first->[1];
}
return $tag . $block . $tag;
}
sub translate_file {
my ($data) = @_;
my @no_go = ();
while ($data =~ /( <nowiki>.*?<\/nowiki>
| <code>.*?<\/code>
| ^ <pre> (.*\n)+ <\/pre>
| ^ {{{ (.*\n)+ }}} )/gmx) {
push @no_go, [pos($data) - length $1, pos($data)];
print "no go from " . $no_go[-1]->[0] . ".." . $no_go[-1]->[1] . " for $1\n" if $verbose;
}
# The problem is that these replacements don't adjust @no_go! Perhaps it is good enough?
my $subs = '';
$subs = $subs || $data =~ s/ ''' (.*?) ''' /replacement($1, '**', pos($data), @no_go)/gxe;
$subs = $subs || $data =~ s/ '' (.*?) '' /replacement($1, '\/\/', pos($data), @no_go)/gxe;
$subs = $data =~ s/ ^ :+ \h? ( .* \n (?: .+ \n ) * ) /replacement_block($1, pos($data), @no_go)/gmxe;
return $data if $subs;
}
sub read_file {
my $file = shift;
open(my $fh, '<:utf8', $file) or die "Cannot read $file: $!";
my $data = <$fh>;
close($fh);
return $data;
}
sub main {
my ($dir) = @_;
mkdir($dir . '-new') or die "Cannot create $dir-new: $!";
print "Indexing files\n";
foreach my $file (glob("$dir/.* $dir/*")) {
next unless $file =~ /$dir\/(.+)/;
my $id = $1;
next if $id eq ".";
next if $id eq "..";
$index{$id} = 1;
}
print "Converting files\n";
foreach my $id (sort keys %index) {
# this is where you debug a particular page
# $verbose = $id eq '2014-12-18_Emacs_Wiki_Migration';
write_file("$dir-new/$id", translate_file(read_file("$dir/$id")));
}
}
use Getopt::Long;
my $dir = 'raw';
my $help = '';
GetOptions ("dir=s" => \$dir,
"help" => \$help);
if ($help) {
print qq{
Usage: $0 [--dir=DIR]
You need to use the raw.pl script to create a directory full of raw
wiki text files.
--dir=DIR is where the raw wiki text files are. Default: raw. The
converted files will be stored in DIR-new, ie. in raw-new by
default.
Example: $0 --dir=~/alexschroeder/raw
}
} else {
main ($dir);
}

View File

@@ -1,110 +1,7 @@
/* This file is in the public domain. */
/* @import url(https://fonts.googleapis.com/css?family=Noticia+Text:400,400italic,700italic,700&subset=latin,latin-ext); */
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
font-family: 'Symbola';
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff') url('/fonts/Symbola.ttf') format('truetype');
}
body, rss {
font-family: "Noticia Text", Symbola, serif;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-style: normal;
font-size: 14pt;
margin: 1em 3em;
@@ -271,7 +168,7 @@ label[for="searchlang"], #searchlang, .header input[type="submit"] {
visibility: hidden; position: absolute;
}
/* wrap on the iphone */
@media media only screen and (max-device-width: 480px) {
@media only screen and (max-device-width: 480px) {
}
.header input {

View File

@@ -8,110 +8,8 @@
@import url(https://fonts.googleapis.com/css?family=Noticia+Text:400,400italic,700italic,700&subset=latin,latin-ext); */
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
font-family: 'Symbola';
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff');
}
body {
font-family: "Noticia Text", Symbola, serif;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 14pt;
color: #000;
background-color: #eed;
@@ -119,13 +17,13 @@ body {
}
textarea, pre, code, tt {
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
font-size: 80%;
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
font-size: 80%;
}
@media print {
body {
background-color: white;
background-color: white;
font-family: Times, serif;
font-size:10pt;
}
@@ -175,9 +73,9 @@ input#mail, input#homepage, input#username {
/* titles */
h1 {
font-weight: bold;
font-size: 150%;
padding: 1em 0;
font-weight: bold;
font-size: 150%;
padding: 1em 0;
}
h1 a:link, h1 a:visited {
color: inherit;
@@ -217,7 +115,7 @@ a:active {
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset,
0px 1px 3px black;
0px 1px 3px black;
}
.button a {
text-decoration: none;
@@ -231,10 +129,6 @@ a:active {
font-weight: normal;
}
a.edit, div.footer, form, span.gotobar, a.number span { display:none; }
a[class="url number"]:after, a[class="inter number"]:after {
content:"[" attr(href) "]";
}
a[class="local number"]:after { content:"[" attr(title) "]"; }
img[smiley] { line-height: inherit; }
}
@@ -243,15 +137,15 @@ a.pencil { display: none; }
/* table of contents */
.toc {
font-size: smaller;
border-left: 1em solid #886;
font-size: smaller;
border-left: 1em solid #886;
}
.toc ol {
list-style-type: none;
padding-left: 1em;
list-style-type: none;
padding-left: 1em;
}
.toc a {
font-weight: normal;
font-weight: normal;
}
/* images with links, captions, etc */
@@ -314,19 +208,19 @@ div.rc li { padding-bottom: 0.5em; }
/* Tables */
table.user {
margin: 1em 0;
padding: 0 1em;
border-top: 1px solid black;
border-bottom: 1px solid black;
margin: 1em 0;
padding: 0 1em;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
div.aside table.user {
margin: 1em 0;
padding: 0;
margin: 1em 0;
padding: 0;
}
table.user td, table.user th {
border-style: none;
padding:5px 10px;
vertical-align: top;
border-style: none;
padding:5px 10px;
vertical-align: top;
}
table.user th { font-weight:bold; }
table.user td.r { text-align:right; }
@@ -337,7 +231,7 @@ table.user td.mark { background-color:yellow; }
tr:empty { display: block; height: 0.5em; }
@media print {
table {
font-size: 9pt;
font-size: 9pt;
margin: 0;
}
table.user td, table.user th {

View File

@@ -188,7 +188,7 @@ div.footer hr {
div.content > div.comment {
border-top: none;
padding-top: none;
padding-top: 0;
border-left: 1ex solid #bbb;
padding-left: 1ex;
}
@@ -213,7 +213,12 @@ pre {
tt, pre, code {
font-size: 80%;
};
}
code {
background: #eee;
white-space: pre-wrap;
}
@font-face {
font-family: 'Gentium Basic';

View File

@@ -27,7 +27,7 @@ my @path = split(/\//, $ENV{REDIRECT_URL});
my $file = $path[$#path];
# for dynamic pages
use vars qw($NotFoundHandlerExceptionsPage);
our ($NotFoundHandlerExceptionsPage);
$NotFoundHandlerExceptionsPage = 'NoCachePages';
$RunCGI = 0;
do $script;

View File

@@ -1,42 +0,0 @@
# Copyright (C) 2004, 2005 Fletcher T. Penney <fletcher@freeshell.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('aawrapperdiv.pl', 'WrapperDiv Module');
our ($q);
*OldGetHeader = \&GetHeader;
*GetHeader = \&WrapperGetHeader;
sub WrapperGetHeader {
my ($id, $title, $oldId, $nocache, $status) = @_;
my $result = OldGetHeader ($id, $title, $oldId, $nocache, $status);
$result .= $q->start_div({-class=>'wrapper'});
}
*OldPrintFooter = \&PrintFooter;
*PrintFooter = \&WrapperPrintFooter;
sub WrapperPrintFooter {
my ($id, $rev, $comment) = @_;
print $q->start_div({-class=>'wrapper close'});
print $q->end_div(), $q->end_div();
OldPrintFooter($id, $rev, $comment);
}

View File

@@ -14,6 +14,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('accesskeys.pl', 'Links With AccessKeys Extension');
@@ -21,7 +22,7 @@ our (@MyRules, $FreeLinkPattern);
push(@MyRules, \&LinksWithAccessKeys);
sub LinksWithAccessKeys {
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cog) {
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cg) {
my ($id, $key) = ($2, $3);
Dirty($1);
$id = FreeToNormal($id);

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
our ($q, %Page, %Action, $IndexFile, $PageDir, $KeepDir, @MyAdminCode, $RefererDir);
@@ -35,11 +36,11 @@ sub AdminPowerDelete {
OpenPage($id);
my $status = DeletePage($id);
if ($status) {
print $q->p(GetPageLink($id) . ' ' . T('not deleted: ')) . $status;
print $q->p(GetPageLink($id) . ' ' . T('not deleted:') . ' ' . $status);
} else {
print $q->p(GetPageLink($id) . ' ' . T('deleted'));
WriteRcLog($id, Ts('Deleted %s', $id), 0, $Page{revision},
GetParam('username', ''), GetRemoteHost(), $Page{languages},
GetParam('username', ''), $q->remote_addr(), $Page{languages},
GetCluster($Page{text}));
}
# Regenerate index on next request
@@ -88,10 +89,10 @@ sub AdminPowerRename {
# RecentChanges
OpenPage($new);
WriteRcLog($id, Ts('Renamed to %s', $new), 0, $Page{revision},
GetParam('username', ''), GetRemoteHost(), $Page{languages},
GetParam('username', ''), $q->remote_addr(), $Page{languages},
GetCluster($Page{text}));
WriteRcLog($new, Ts('Renamed from %s', $id), 0, $Page{revision},
GetParam('username', ''), GetRemoteHost(), $Page{languages},
GetParam('username', ''), $q->remote_addr(), $Page{languages},
GetCluster($Page{text}));
print $q->p(Tss('Renamed %1 to %2.', GetPageLink($id), GetPageLink($new)));
ReleaseLock();

View File

@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('adsense.pl', 'AdSense Module');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('advanced-uploads.pl', 'Advanced File Upload Extension');

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('age.pl', 'Age Indication Extension');

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('aggregate.pl', 'Front Page Extension');
@@ -25,7 +26,7 @@ our ($q, $bol, %Action, %Page, $OpenPageName, $UseDiff, $UsePathInfo, $RssStyleS
push(@MyRules, \&AggregateRule);
sub AggregateRule {
if ($bol && m/\G(&lt;aggregate\s+((("[^\"&]+",?\s*)+)|(sort\s+)?search\s+(.+?))&gt;)/gc) {
if ($bol && m/\G(&lt;aggregate\s+((("[^\"&]+",?\s*)+)|(sort\s+)?search\s+(.+?))&gt;)/cg) {
Clean(CloseHtmlEnvironments());
Dirty($1);
my ($oldpos, $old_, $str, $sort, $search) = ((pos), $_, $3, $5, $6);
@@ -125,8 +126,8 @@ sub DoAggregate {
}
}
foreach my $id (@pages) {
my %data = ParseData(ReadFileOrDie(GetPageFile(FreeToNormal($id))));
my $page = $data{text};
my $data = ParseData(ReadFileOrDie(GetPageFile(FreeToNormal($id))));
my $page = $data->{text};
my $size = length($page);
my $i = index($page, "\n=");
my $j = index($page, "\n----");
@@ -135,13 +136,13 @@ sub DoAggregate {
$page =~ s/^=.*\n//; # if it starts with a header
my $name = $id;
$name =~ s/_/ /g;
my $date = TimeToRFC822($data{ts});
my $host = $data{host};
my $username = $data{username};
my $date = TimeToRFC822($data->{ts});
my $host = $data->{host};
my $username = $data->{username};
$username = QuoteHtml($username);
$username = $host unless $username;
my $minor = $data{minor};
my $revision = $data{revision};
my $minor = $data->{minor};
my $revision = $data->{revision};
my $cluster = GetCluster($page);
my $description = ToString(sub { ApplyRules(QuoteHtml($page), 1, 0, undef, 'p') });
$description .= $q->p(GetPageLink($id, T('Learn more...')))

119
modules/agree-disagree.pl Normal file
View File

@@ -0,0 +1,119 @@
# Copyright (C) 2005 Bayle Shanks http://purl.net/net/bshanks
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
our ($Now, @MyMacros, @MyRules, $DefaultStyleSheet, $q, $bol);
AddModuleDescription('agree-disagree.pl', 'AgreeDisagreePlugin');
push(@MyRules, \&AgreeDisagreeSupportRule);
push(@MyMacros, sub{ s/\[\+\]/"[+:" . GetParam('username', T('Anonymous'))
. ':' . TimeToText($Now) . "]"/eg });
push(@MyMacros, sub{ s/\[\+(:[^]:]+)\]/"[+$1:" . TimeToText($Now) . "]"/eg });
push(@MyMacros, sub{ s/\[\-\]/"[-:" . GetParam('username', T('Anonymous'))
. ':' . TimeToText($Now) . "]"/eg });
push(@MyMacros, sub{ s/\[\-(:[^]:]+)\]/"[-$1:" . TimeToText($Now) . "]"/eg });
$DefaultStyleSheet .= <<'EOT' unless $DefaultStyleSheet =~ /div\.agree/; # mod_perl?
div.agreeCount {
float: left;
clear: left;
background-color: Green;
padding-left: .5em;
padding-right: .5em;
padding-top: .5em;
padding-bottom: .5em;
}
div.disagreeCount {
float: left;
clear: right;
background-color: Red;
padding-left: .5em;
padding-right: .5em;
padding-top: .5em;
padding-bottom: .5em;
}
div.agreeNames {
float: left;
background-color: Green;
font-size: xx-small;
display: none;
}
div.disagreeNames {
float: left;
background-color: Red;
font-size: xx-small;
display: none;
}
EOT
my %AgreePortraits = ();
sub AgreeDisagreeSupportRule {
if ($bol) {
if ($bol && m/(\G(\s*\[\+(.*?)\]|\s*\[-(.*?)\])+)/cgs) {
my $votes = $1;
my @ayes = ();
my @nayes = ();
while ($votes =~ m/\G.*?\[\+(.*?)\]/cgs) {
my ($ignore, $name, $time) = split(/:/, $1, 3);
push(@ayes, $name);
}
my $votes2 = $votes;
while ($votes2 =~ m/\G.*?\[-(.*?)\]/cgs) {
my ($ignore, $name, $time) = split(/:/, $1, 3);
push(@nayes, $name);
}
my $html = CloseHtmlEnvironments() ;
$html .= $q->div({-class=>'agreeCount'}) . ($#ayes+1) . ' ' . '</div>' ;
$html .= $q->div({-class=>'agreeNames'}) . printNames(@ayes) . '</div>' ;
$html .= $q->div({-class=>'disagreeCount'}) . ' ' . ($#nayes+1) . '</div>' ;
$html .= $q->div({-class=>'disagreeNames'}) . printNames(@nayes) . '</div>' ;
return $html;
}
}
return undef;
}
sub printNames {
my @names = @_;
my $html = '';
foreach my $name (@names) {
$html .= "$name<br>";
}
return $html;
}

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('all.pl', 'All Action');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('anchors.pl', 'Local Anchor Extension');
@@ -20,13 +21,13 @@ our ($q, %Page, $FootnoteNumber, $FreeLinkPattern, @MyRules, $BracketWiki);
push(@MyRules, \&AnchorsRule);
sub AnchorsRule {
if (m/\G\[\[\#$FreeLinkPattern\]\]/gc) {
if (m/\G\[\[\#$FreeLinkPattern\]\]/cg) {
return $q->a({-href=>'#' . FreeToNormal($1), -class=>'local anchor'}, $1);
} elsif ($BracketWiki && m/\G\[\[\#$FreeLinkPattern\|([^\]]+)\]\]/gc) {
} elsif ($BracketWiki && m/\G\[\[\#$FreeLinkPattern\|([^\]]+)\]\]/cg) {
return $q->a({-href=>'#' . FreeToNormal($1), -class=>'local anchor'}, $2);
} elsif ($BracketWiki && m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\|([^\]]+)\]\])/cog
or m/\G(\[\[\[$FreeLinkPattern\#$FreeLinkPattern\]\]\])/cog
or m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\]\])/cog) {
} elsif ($BracketWiki && m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\|([^\]]+)\]\])/cg
or m/\G(\[\[\[$FreeLinkPattern\#$FreeLinkPattern\]\]\])/cg
or m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\]\])/cg) {
# This one is not a dirty rule because the output is always a page
# link, never an edit link (unlike normal free links).
my $bracket = (substr($1, 0, 3) eq '[[[');
@@ -46,7 +47,7 @@ sub AnchorsRule {
$text = $id unless $text;
$text =~ s/_/ /g;
return ScriptLink(UrlEncode($id), $text, $class, undef, $title);
} elsif (m/\G\[\:$FreeLinkPattern\]/gc) {
} elsif (m/\G\[\:$FreeLinkPattern\]/cg) {
return $q->a({-name=>FreeToNormal($1), -class=>'anchor'}, '');
}
return;

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('antispam.pl', 'Antispam Module');
@@ -33,7 +34,7 @@ push(@MyRules, \&MaskEmailRule);
sub MaskEmailRule {
# Allow [email@foo.bar Email Me] links
if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/igc) {
if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/cgi) {
my $chunk = $1;
$chunk =~ s/($EmailRegExp)//i;
my $email = $1;
@@ -50,7 +51,7 @@ sub MaskEmailRule {
return "<a href=\"mailto:$email\">$chunk</a>";
}
if (m/\G($EmailRegExp)/igc) {
if (m/\G($EmailRegExp)/cgi) {
my $email = $1;
if ($DoMaskEmail) {
my $masked="";

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('archive.pl', 'Archive Extension');

View File

@@ -14,12 +14,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('askpage.pl', 'Ask Page Extension');
use Fcntl qw(:DEFAULT :flock);
our ($DataDir);
our ($DataDir, %Translate, @MyFooters);
our ($AskPage, $QuestionPage, $NewQuestion);
# Don't forget to set your $CommentsPattern to include both $AskPage and $QuestionPage
$AskPage = 'Ask';
@@ -38,8 +39,8 @@ sub IncrementInFile {
return $num;
}
*OldAskPageDoPost=\&DoPost;
*DoPost=\&NewAskPageDoPost;
*OldAskPageDoPost = \&DoPost;
*DoPost = \&NewAskPageDoPost;
sub NewAskPageDoPost {
my $id = FreeToNormal(shift);
if ($id eq $AskPage and not GetParam('text', undef)) { # comment, not a regular edit
@@ -50,16 +51,18 @@ sub NewAskPageDoPost {
OldAskPageDoPost($id, @_); # keep original functionality for regular edits
}
*OldAskPageGetCommentForm=\&GetCommentForm;
*GetCommentForm=\&NewAskPageGetCommentForm;
*OldAskPageGetCommentForm = \&GetCommentForm;
*GetCommentForm = \&NewAskPageGetCommentForm;
@MyFooters = map { $_ == \&OldAskPageGetCommentForm ? \&NewAskPageGetCommentForm : $_ } @MyFooters;
sub NewAskPageGetCommentForm {
my ($id, $rev, $comment) = @_;
$comment = $NewQuestion if not $comment and $id eq $AskPage;
my ($id) = @_;
$Translate{'Add your comment here:'} = $NewQuestion if $id eq $AskPage;
OldAskPageGetCommentForm(@_);
}
*OldAskPageJournalSort=\&JournalSort;
*JournalSort=\&NewAskPageJournalSort;
*OldAskPageJournalSort = \&JournalSort;
*JournalSort = \&NewAskPageJournalSort;
sub NewAskPageJournalSort {
return OldAskPageJournalSort() unless $a =~ m/^$QuestionPage\d+$/ and $b =~ m/^$QuestionPage\d+$/;
($b =~ m/$QuestionPage(\d+)/)[0] <=> ($a =~ m/$QuestionPage(\d+)/)[0];

View File

@@ -14,7 +14,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
use XML::Atom;
use XML::Atom::Entry;
use XML::Atom::Link;
use XML::Atom::Person;
@@ -148,7 +150,7 @@ sub GetRcAtom {
# Based on DoPost
sub DoAtomSave {
my ($type, $oldid) = @_;
my $entry = AtomEntry();
my $entry = AtomEntry($type);
my $title = $entry->title();
my $author = $entry->author();
SetParam('username', $author->name) if $author; # Used in Save()
@@ -229,15 +231,8 @@ sub DoAtomGet {
}
sub AtomEntry {
my $data = $q->param('POSTDATA');
if (not $data) {
# CGI provides POSTDATA for POST requests, not for PUT requests.
# The following code is based on the CGI->init code.
my $content_length = defined($ENV{'CONTENT_LENGTH'}) ? $ENV{'CONTENT_LENGTH'} : 0;
if ($content_length > 0 and $content_length < $MaxPost) {
$q->read_from_client(\$data, $content_length, 0);
}
}
my $type = shift || 'POST';
my $data = $q->param($type . 'DATA'); # PUTDATA or POSTDATA
my $entry = XML::Atom::Entry->new(\$data);
return $entry;
}

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ autolock.pl ]====================
@@ -174,7 +175,7 @@ sub UserCanEditAutoLockFix {
return 0 if $LockOnCreation{$id} and not -f GetPageFile($id); # new page
return 0 if !$EditAllowed or -f $NoEditFile;
return 0 if $editing and UserIsBanned(); # this call is more expensive
return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/o);
return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/);
return 1 if $EditAllowed >= 3 and ($comment or (GetParam('aftertext', '') and not GetParam('text', '')));
return 0 if $EditAllowed >= 3;
return 1;

View File

@@ -20,6 +20,7 @@
# ie: http://search.cpan.org/CPAN/authors/id/C/CH/CHAMAS/MLDBM-2.01.tar.gz
use strict;
use v5.10;
use Fcntl;
use MLDBM qw( DB_File Storable );
@@ -116,7 +117,7 @@ sub GetBackLink {
foreach my $backlink (@backlinks) {
my ($class, $resolved, $title, $exists) = ResolveId($backlink);
if (($resolved ne $id) && ($resolved !~ /^($BacklinkBanned)$/)) {
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, T('Internal Page: ' . $resolved)));
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, Ts('Internal Page: %s', $resolved)));
}
}

View File

@@ -11,6 +11,7 @@
# http://www.oddmuse.org/cgi-bin/oddmuse/Backlinks_Extension
use strict;
use v5.10;
AddModuleDescription('backlinks.pl', 'Backlinks Extension');

View File

@@ -25,6 +25,7 @@ the IP or hostname will be added to the C<BannedHosts> page for you.
=cut
use strict;
use v5.10;
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
@@ -123,10 +124,10 @@ sub NewBanContributorsWriteRcLog {
and $OpenPageName eq $id and UserIsAdmin()) {
# we currently have the clean page loaded, so we need to reload
# the spammed revision (there is a possible race condition here)
my ($old) = GetTextRevision($Page{revision}-1, 1);
my %urls = map {$_ => 1 } $old =~ /$UrlPattern/og;
my $old = GetTextRevision($Page{revision} - 1, 1)->{text};
my %urls = map {$_ => 1 } $old =~ /$UrlPattern/g;
# we open the file again to force a load of the despammed page
foreach my $url ($Page{text} =~ /$UrlPattern/og) {
foreach my $url ($Page{text} =~ /$UrlPattern/g) {
delete($urls{$url});
}
# we also remove any candidates that are already banned
@@ -152,7 +153,7 @@ sub NewBanContributorsWriteRcLog {
$q->submit(T('Ban!'))),
$q->end_form();
};
print $q->p(T("Consider banning the IP number as well: "),
print $q->p(T("Consider banning the IP number as well:"), ' ',
ScriptLink('action=ban;id=' . UrlEncode($id), T('Ban contributors')));
};
return OldBanContributorsWriteRcLog(@_);

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2013 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20132015 Alex Schroeder <alex@gnu.org>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
@@ -16,10 +16,11 @@
# editors will be logged.
use strict;
use v5.10;
AddModuleDescription('ban-quick-editors.pl', 'Banning Quick Editors');
our ($Now, %RecentVisitors, $SurgeProtection);
our ($q, $Now, %RecentVisitors, $SurgeProtection);
*BanQuickOldUserIsBanned = \&UserIsBanned;
*UserIsBanned = \&BanQuickNewUserIsBanned;
@@ -29,7 +30,7 @@ sub BanQuickNewUserIsBanned {
if (not $rule
and $SurgeProtection # need surge protection
and GetParam('title')) {
my $name = GetParam('username', GetRemoteHost());
my $name = GetParam('username', $q->remote_addr());
my @entries = @{$RecentVisitors{$name}};
# $entry[0] is $Now after AddRecentVisitor
my $ts = $entries[1];

View File

@@ -13,14 +13,17 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('banned-regexps.pl', 'Banning Regular Expressions');
=h1 Compatibility
=encoding utf8
=head1 Compatibility
This extension works with logbannedcontent.pl.
=h1 Example content for the BannedRegexps page:
=head1 Example content for the BannedRegexps page:
# This page lists regular expressions that prevent the saving of a page.
# The regexps are matched against any page or comment submitted.

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('bbcode.pl', 'bbCode Extension');
@@ -60,12 +61,12 @@ sub bbCodeRule {
return AddHtmlEnvironment('strong', qq{class="highlight"}); }
elsif ($tag eq 'url') {
if ($option) {
$option =~ /^($UrlProtocols)/o;
$option =~ /^($UrlProtocols)/;
my $class = "url $1";
return AddHtmlEnvironment('a', qq{href="$option" class="$class"}); }
elsif (/\G$FullUrlPattern\s*\[\/url\]/cogi) {
elsif (/\G$FullUrlPattern\s*\[\/url\]/cgi) {
return GetUrl($1); }}
elsif ($tag eq 'img' and /\G$FullUrlPattern\s*\[\/img\]/cogi) {
elsif ($tag eq 'img' and /\G$FullUrlPattern\s*\[\/img\]/cgi) {
return GetUrl($1, undef, undef, 1); } # force image
elsif ($tag eq 'quote') {
my $html = CloseHtmlEnvironments();

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('big-brother.pl', 'Big Brother Extension');
@@ -59,7 +60,6 @@ sub AddRecentVisitor {
my $url = ScriptUrl(join(';', "action=$action;id=" . UrlEncode($id),
map { $_ . '=' . UrlEncode(GetParam($_)) }
keys %params));
my $url = $q->url(-path_info=>1,-query=>1);
my $download = GetParam('action', 'browse') eq 'download'
|| GetParam('download', 0)
|| $q->path_info() =~ m/\/download\//;

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('blockquote.pl', 'Comments on Text Formatting Rules');
@@ -27,10 +28,10 @@ push(@MyRules, \&BlockQuoteRule);
sub BlockQuoteRule {
# indented text using : with the option of spanning multiple text
# paragraphs (but not lists etc).
if (InElement('blockquote') && m/\G(\s*\n)+:[ \t]*/cog) {
if (InElement('blockquote') && m/\G(\s*\n)+:[ \t]*/cg) {
return CloseHtmlEnvironmentUntil('blockquote')
. AddHtmlEnvironment('p');
} elsif ($bol && m/\G(\s*\n)*:[ \t]*/cog) {
} elsif ($bol && m/\G(\s*\n)*:[ \t]*/cg) {
return CloseHtmlEnvironments()
. AddHtmlEnvironment('blockquote')
. AddHtmlEnvironment('p');

View File

@@ -18,6 +18,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('calendar.pl', 'Calendar Extension');
@@ -73,7 +74,7 @@ sub Cal {
$link .= ScriptLink('action=collect;match=' . UrlEncode($re), $day, 'local collection' . $class);
}
$link;
}}ge;
}}eg;
$cal =~ s{(\S+) (\d\d\d\d)}{{
my ($month_text, $year_text) = ($1, $2);
my $date = sprintf("%d-%02d", $year, $mon);
@@ -117,22 +118,22 @@ sub DoCollect {
push(@MyRules, \&CalendarRule);
sub CalendarRule {
if (/\G(calendar:(\d\d\d\d))/gc) {
if (/\G(calendar:(\d\d\d\d))/cg) {
my $oldpos = pos;
Clean(CloseHtmlEnvironments());
Dirty($1);
PrintYearCalendar($2);
pos = $oldpos;
return AddHtmlEnvironment('p');
} elsif (/\G(month:(\d\d\d\d)-(\d\d))/gc) {
} elsif (/\G(month:(\d\d\d\d)-(\d\d))/cg) {
my $oldpos = pos;
Clean(CloseHtmlEnvironments());
Dirty($1);
print Cal($2, $3);
pos = $oldpos;
return AddHtmlEnvironment('p');
} elsif (/\G(month:([+-]\d\d?))/gc
or /\G(\[\[month:([+-]\d\d?) $FreeLinkPattern\]\])/gc) {
} elsif (/\G(month:([+-]\d\d?))/cg
or /\G(\[\[month:([+-]\d\d?) $FreeLinkPattern\]\])/cg) {
my $oldpos = pos;
Clean(CloseHtmlEnvironments());
Dirty($1);

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('canonical.pl', 'Canonical Names');

180
modules/cart.pl Normal file
View File

@@ -0,0 +1,180 @@
# Copyright (C) 2008 Eric Hsu <apricotan@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
use utf8;
AddModuleDescription('cart.pl', 'Cart Extension');
our ($q, %Action, $UserGotoBar, $CookieName);
our ($CartPic, $CartName, %Cart, $ShowCart, @CartOrdered);
my $LOADED_CART_JS;
# ============
# = cart-bfc =
# ============
# This is a simple shopping cart for pages!
# Requires searchpaged-bfc.pl.
# We make a checkbox that onChange, uses Yahoo! UI Cookie 2.6 (note we need 2.6!) routines to set a subcookie.
# We have the cookie "$CartName" (by default $Cookiename . "Cart")
# which holds the actual cart and is managed almost entirely
# in client-side javascript. That means the checkboxes directly control the cookie.
# If you want a little picture of a cart, you can set the URL at $CartPic.
# InitCart loads the cookie values into %Cart. $Cart->{$pagename}=1 if it's in the cart.
# In theory cookies are capped at 4K. Our page names are capped around 90ish chars. That leaves room for 40 maximal names in the cart. Probably enough.
# We'll need the cookie values for
# action=cart;subaction=show; along with other future subactions (download in latex, bibtex)
# we'll feed this display to a variant of search display.
# I'll have to check oddmuse.pl.
# load Yahoo UI code bit to manage subcookies.
$Action{cart} = \&DoCart;
sub DoCart {
# foreach $key (keys %Cart) {
# push @cart, $key if ($Cart{"$key"});
# }
DoSearch(\@CartOrdered);
}
$UserGotoBar .= '<a href="?action=cart;cache=0">View Cart</a>';
# Manage Cart Routines
#push @MyPrintSearchResultsPrefix, \&PrintCheckboxTableStart;
#push @MyPrintSearchResultsSuffix, \&PrintCheckboxTableEnd;
# I can't hack into Init, so let's tap into InitCookie.
# We also tap into Cookie() to arrange writing out our cleaned up Cart.
*OldInitCookie = *InitCookie;
*InitCookie = *InitCookieAndCart;
# To get a checkbox in the titles of pages, we patch GetHeader.
*OldGetHeader = *GetHeader;
*GetHeader = *GetHeaderAndCart;
sub InitCookieAndCart {
OldInitCookie();
InitCart();
}
sub GetHeaderAndCart {
my ($id, $title, $oldId, $nocache, $status) = @_;
my $result = OldGetHeader(@_);
return ($result) unless ($id);
my $checkbox = MakeCheckbox($id);
$checkbox = qq(<span class="cart-checkbox" style="float:right">$checkbox</span>);
$result =~ s/(<\/h1>)/$checkbox$1/;
return ($result);
}
# We load the contents of our Cart cookie into the global %Cart and @CartOrdered
sub InitCart {
$CartName = $CookieName . "Cart" unless (defined ($CartName) );
my @pairs;
%Cart = ();
@CartOrdered = ();
if ($q->cookie($CartName)) {
# @pairs = split(/&/, $q->cookie($CartName));
@pairs = $q->cookie($CartName);
foreach my $pair (@pairs) {
# my $encodedequals = UrlEncode("=");
my ($name, $val)= split(/\=/, $pair);
$Cart{"$name"}=$val;
push @CartOrdered, $name;
}
}
}
sub PrintCheckboxTableStart {
my ($name, $regex, $text, $type) = @_;
my $html;
$html .= "<table><tr>";
my $checkbox = MakeCheckbox(@_);
$html .= qq(<td valign=top>$checkbox</td>);
$html .= "<td valign=top>";
print $html;
}
sub PrintCheckboxTableEnd {
my ($name, $regex, $text, $type) = @_;
my $html;
$html .= "</td>";
$html .= "</tr></table>";
print $html;
}
sub MakeCheckbox {
my ($name, $regex, $text, $type) = @_;
my $html;
return unless ($ShowCart);
unless ($LOADED_CART_JS) {
$html .= '<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.7.0/build/yahoo/yahoo-min.js&2.7.0/build/cookie/cookie-min.js&2.7.0/build/event/event-min.js"></script>';
$LOADED_CART_JS=1;
}
my $selected = qq(checked="yes") if ($Cart{"$name"});
$html .=<<HTMLEND;
$CartPic<input type="checkbox" value="cart" id="$name-set" title="Add To Cart" $selected/> <br>
<script type="text/javascript">
(function(){
YAHOO.util.Event.on("$name-set", "change", function(){
var value = YAHOO.util.Cookie.getSub("$CartName", "$name");
if (value == 1 ) { YAHOO.util.Cookie.removeSub("$CartName", "$name"); }
else { YAHOO.util.Cookie.setSub("$CartName", "$name", 1 ); }
});
})();
</script>
HTMLEND
return $html unless ($q->param('action') eq 'edit' || $q->param('Preview'));
# no checkboxes for edit pages.
return;
}
__END__
=
(0.7) Load JS libraries on first checkbox (so won't load if we are editing).
(0.6) Changed the JS source to be Yahoo's CDN.
(0.51) Use CSS class cart-checkbox for the cart checkbox! That way, we can remove them for printouts, for instance.
(0.5) Our hack of cookies was not working cross-platform. We have a mismatch because our attempts to send out a cookie from oddmuse were getting the contents encoded and unreadable for the YUI routines. Instead,we will use removeSub to avoid ever having to send the cookie back from our server!
(0.4) Now every page title has a checkbox floated to the right, which controls the cart status.
(0.3) Allow cart editing from cart display. Currently, doesn't seem to affect the cart.
(0.2) Cart now displays.
(0.1) Cart is now persistent and is edited by the checkboxes.

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('checkbox.pl', 'Checklist Extension');
@@ -76,7 +77,7 @@ sub DoCheckBox{
$summary{$3} = 0 if $2 eq 'x' or $2 eq 'X';
"${1}[[ :${3}]]";
}
}eig;
}egi;
SetParam('text', $text);
SetParam('summary', join(', ', map {
if ($summary{$_}) {

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('clustermap.pl', 'ClusterMap Module');
@@ -61,7 +62,7 @@ foreach (@ClusterMapAdminPages){
}
sub ClusterMapRule {
if (/\G^([\n\r]*\<\s*clustermap\s*\>\s*)$/mgc) {
if (/\G^([\n\r]*\<\s*clustermap\s*\>\s*)$/cgm) {
Dirty($1);
my $oldpos = pos;
my $oldstr = $_;

View File

@@ -14,6 +14,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('comment-div-wrapper.pl', 'Comment Div Wrapper Extension');
@@ -29,7 +30,7 @@ sub CommentDivWrapper {
return $q->start_div({-class=>'userComment'});
}
}
if ($OpenPageName =~ /$CommentsPattern/o) {
if ($OpenPageName =~ /$CommentsPattern/) {
if ($bol and m/\G(\s*\n)*----+[ \t]*\n?/cg) {
my $html = CloseHtmlEnvironments()
. ($CommentDiv++ > 0 ? $q->end_div() : $q->h2({-class=>'commentsHeading'}, T('Comments:'))) . $q->start_div({-class=>'userComment'})

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('commentcount.pl', 'Comment Count Extension');
@@ -51,15 +52,15 @@ sub NewCommentcountScriptLink {
if ($CommentsPrefix && $action =~ /^$CommentsPrefix(.*)/) { # TODO use $CommentsPattern ?
# Add the number of comments here
my $id = $action;
$id =~ s/%([0-9a-f][0-9a-f])/chr(hex($1))/ge; # undo urlencode
$id =~ s/%([0-9a-f][0-9a-f])/chr(hex($1))/eg; # undo urlencode
my $comments = GetPageContent($id);
my $num = 0;
if($comments =~ /=== (\d+) Comments?\. ===/) {
$num = $1;
}
# Fix plurals
my $plural = T('Comments on ');
my $singular = T('Comment on ');
my $plural = T('Comments on');
my $singular = T('Comment on');
$text =~ s/$plural/$singular/ if($num == 1);
$text = $num . ' ' . $text;
}

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('compilation.pl', 'Compilation Extension');

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('context.pl', 'Calendar Extension');

View File

@@ -24,6 +24,7 @@
# Of course, you can customize this to store more information
use strict;
use v5.10;
AddModuleDescription('creationdate.pl', 'CreationDate Module');

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ creole.pl ]====================
@@ -217,7 +218,7 @@ sub CreoleRule {
}
# escape next char (and prevent // in URLs from enabling italics)
# ~
elsif (m/\G(~($FullUrlPattern|\S))/cgo) {
elsif (m/\G(~($FullUrlPattern|\S))/cg) {
return
($CreoleTildeAlternative and
index( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -233,12 +234,12 @@ sub CreoleRule {
# {{{preformatted code}}}
elsif (m/\G\{\{\{(.*?}*)\}\}\}/cg) { return $q->code($1); }
# download: {{pic}} and {{pic|text}}
elsif (m/\G(\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\})/cgos) {
elsif (m/\G(\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\})/cgs) {
my $text = $4 || $2;
return GetCreoleLinkHtml($1, GetDownloadLink(FreeToNormal($2), 1, undef, $text), $text);
}
# image link: {{url}} and {{url|text}}
elsif (m/\G\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}/cgos) {
elsif (m/\G\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}/cgs) {
return GetCreoleImageHtml(
$q->a({-href=> UnquoteHtml($1),
-class=> 'image outside'},
@@ -249,7 +250,7 @@ sub CreoleRule {
}
# image link: [[link|{{pic}}]] and [[link|{{pic|text}}]]
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) {
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) {
my $text = $5 || $2;
return GetCreoleLinkHtml($1, GetCreoleImageHtml(
ScriptLink(UrlEncode(FreeToNormal($2)),
@@ -260,7 +261,7 @@ sub CreoleRule {
}
# image link: [[link|{{url}}]] and [[link|{{url|text}}]]
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) {
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) {
my $text = $5 || $2;
return GetCreoleLinkHtml($1, GetCreoleImageHtml(
ScriptLink(UrlEncode(FreeToNormal($2)),
@@ -271,7 +272,7 @@ sub CreoleRule {
}
# image link: [[url|{{pic}}]] and [[url|{{pic|text}}]]
elsif (m/\G(\[\[$FullUrlPattern$CreoleLinkPipePattern
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) {
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) {
my $text = $5 || $2;
return GetCreoleLinkHtml($1, GetCreoleImageHtml(
$q->a({-href=> UnquoteHtml($2), -class=> 'image outside'},
@@ -282,7 +283,7 @@ sub CreoleRule {
}
# image link: [[url|{{url}}]] and [[url|{{url|text}}]]
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkPipePattern
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\]/cgosx) {
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\]/cgsx) {
return GetCreoleImageHtml(
$q->a({-href=> UnquoteHtml($1), -class=> 'image outside'},
$q->img({-src=> UnquoteHtml($2),
@@ -291,7 +292,7 @@ sub CreoleRule {
-class=> 'url outside'})));
}
# link: [[url]] and [[url|text]]
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkTextPattern\]\]/cgos) {
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkTextPattern\]\]/cgs) {
# Permit embedding of Creole syntax within link text. (Rather complicated,
# but it does the job remarkably.)
my $link_url = $1;
@@ -304,7 +305,7 @@ sub CreoleRule {
return GetUrl($link_url, $link_text, 1);
}
# link: [[page]] and [[page|text]]
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkTextPattern\]\])/cgos) {
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkTextPattern\]\])/cgs) {
my $markup = $1;
my $page_name = $2;
my $link_text = $4 ? CreoleRuleRecursive($4, @_) : $page_name;
@@ -314,7 +315,7 @@ sub CreoleRule {
}
# interlink: [[Wiki:page]] and [[Wiki:page|text]]
elsif ($is_interlinking and
m/\G(\[\[$FreeInterLinkPattern$CreoleLinkTextPattern\]\])/cgos) {
m/\G(\[\[$FreeInterLinkPattern$CreoleLinkTextPattern\]\])/cgs) {
my $markup = $1;
my $interlink = $2;
my $interlink_text = $4;

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ creoleaddition.pl ]====================

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ crossbar.pl ]====================

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('crumbs.pl', 'List Parent Pages Extension');
@@ -27,8 +28,8 @@ $RuleOrder{\&CrumbsRule} = -10; # run before default rules!
sub CrumbsRule {
if (not (pos) # first!
and (($WikiLinks && /\G($LinkPattern\n)/cgo)
or ($FreeLinks && /\G(\[\[$FreeLinkPattern\]\]\n)/cgo))) {
and (($WikiLinks && /\G($LinkPattern\n)/cg)
or ($FreeLinks && /\G(\[\[$FreeLinkPattern\]\]\n)/cg))) {
my $oldpos = pos; # will be trashed below
my $cluster = FreeToNormal($2);
my %seen = ($cluster => 1);

View File

@@ -1,4 +1,5 @@
use strict;
use v5.10;
=head1 NAME

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('csv.pl', 'Comments on Long Table Markup Extension');

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('dates.pl', 'Dates Extension');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('delete-all.pl');

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
our ($q, $Now, %IndexHash, %Action, %Page, $OpenPageName, $FS, $BannedContent, $RcFile, $RcDefault, @MyAdminCode, $FullUrlPattern, $DeletedPage, $StrangeBannedContent);
@@ -132,14 +133,14 @@ sub DespamPage {
# from DoHistory()
my @revisions = sort {$b <=> $a} map { m|/([0-9]+).kp$|; $1; } GetKeepFiles($OpenPageName);
foreach my $revision (@revisions) {
my ($text, $rev) = GetTextRevision($revision, 1); # quiet
my ($revisionPage, $rev) = GetTextRevision($revision, 1); # quiet
if (not $rev) {
print ': ' . Ts('Cannot find revision %s.', $revision);
return;
} elsif (not DespamBannedContent($text)) {
} elsif (not DespamBannedContent($revisionPage->{text})) {
my $summary = Tss('Revert to revision %1: %2', $revision, $rule);
print ': ' . $summary;
Save($OpenPageName, $text, $summary) unless GetParam('debug', 0);
Save($OpenPageName, $revisionPage->{text}, $summary) unless GetParam('debug', 0);
return;
}
}

View File

@@ -14,6 +14,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('diff.pl', 'Diff Action Extension');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('div-foo.pl', 'Div Foo Extension');

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('dojo.pl', 'Using Dojo Instead Of Wiki Markup');
@@ -29,7 +30,7 @@ $DojoTheme = 'tundra';
push (@MyRules, \&WysiwygRule);
sub WysiwygRule {
if (m/\G(&lt;.*?&gt;)/gc) {
if (m/\G(&lt;.*?&gt;)/cg) {
return $1 if substr($1,5,6) eq 'script'
or substr($1,4,6) eq 'script';
return UnquoteHtml($1);

View File

@@ -22,6 +22,7 @@
# JavaScript enabled for this to work.
use strict;
use v5.10;
AddModuleDescription('doubleclick.pl', 'Doubleclick Extension');

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('download.pl', 'Download Extension');
@@ -27,8 +28,8 @@ push( @MyRules, \&DownloadSupportRule );
# [[download:page name|alternate title]]
sub DownloadSupportRule {
if (m/\G(\[\[download:$FreeLinkPattern\|([^\]]+)\]\])/cog
or m!\G(\[\[download:$FreeLinkPattern\]\])!cog) {
if (m/\G(\[\[download:$FreeLinkPattern\|([^\]]+)\]\])/cg
or m!\G(\[\[download:$FreeLinkPattern\]\])!cg) {
Dirty($1);
print GetDownloadLink($2, undef, undef, $3);
return '';

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
use File::Glob ':glob';
our ($DraftDir);
@@ -28,7 +29,7 @@ push(@MyInitVariables, \&DraftInit);
sub DraftInit {
if (GetParam('Draft', '')) {
SetParam('action', 'draft') ; # Draft button used
} elsif (-f "$DraftDir/" . GetParam('username', GetRemoteHost()) # draft exists
} elsif (-f "$DraftDir/" . GetParam('username', $q->remote_addr()) # draft exists
and $FooterNote !~ /action=draft/) { # take care of mod_perl persistence
$FooterNote = $q->p(ScriptLink('action=draft', T('Recover Draft'))) . $FooterNote;
}
@@ -38,7 +39,7 @@ $Action{draft} = \&DoDraft;
sub DoDraft {
my $id = shift;
my $draft = $DraftDir . '/' . GetParam('username', GetRemoteHost());
my $draft = $DraftDir . '/' . GetParam('username', $q->remote_addr());
if ($id) {
my $text = GetParam('text', '');
ReportError(T('No text to save'), '400 BAD REQUEST') unless $text;
@@ -47,10 +48,10 @@ sub DoDraft {
SetParam('msg', T('Draft saved')); # invalidate cache
print GetHttpHeader('', T('Draft saved'), '204 NO CONTENT');
} elsif (-f $draft) {
my %data = ParseData(ReadFileOrDie($draft));
my $data = ParseData(ReadFileOrDie($draft));
unlink ($draft);
$Message .= $q->p(T('Draft recovered'));
DoEdit($data{id}, $data{text}, 1);
DoEdit($data->{id}, $data->{text}, 1);
} else {
ReportError(T('No draft available to recover'), '404 NOT FOUND');
}

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('duckduckgo-search.pl', 'Use DuckDuckGo For Searches');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('dynamic-comments.pl', 'Dynamic Comments Extension');

View File

@@ -28,6 +28,7 @@
#
use strict;
use v5.10;
AddModuleDescription('dynlogo.pl', 'Dynamic Logo');

View File

@@ -15,6 +15,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('edit-assist.pl', 'Edit Assist Extension');

View File

@@ -14,10 +14,11 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('edit-cluster.pl', 'Edit Cluster Extension');
our ($q, $FS, $RcDefault, @RcDays, $RecentTop, $LastUpdate);
our ($q, $FS, $RcDefault, @RcDays, $RecentTop, $LastUpdate, $ShowAll);
our $EditCluster = 'EditCluster';
@@ -33,7 +34,7 @@ sub GetRc {
$changetime{$pagename} = $ts;
}
my $date = '';
my $all = GetParam('all', 0);
my $all = GetParam('all', $ShowAll);
my ($idOnly, $userOnly, $hostOnly, $clusterOnly, $filterOnly, $match, $lang) =
map { GetParam($_, ''); }
('rcidonly', 'rcuseronly', 'rchostonly', 'rcclusteronly',
@@ -127,7 +128,7 @@ sub EditClusterNewRcHeader {
$action = "action=rc$action";
}
my $days = GetParam('days', $RcDefault);
my $all = GetParam('all', 0);
my $all = GetParam('all', $ShowAll);
my @menu;
if ($all) {
push(@menu, ScriptLink("$action;days=$days;all=0",

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('edit-paragraphs.pl', 'Edit Paragraphs Extension');

View File

@@ -11,6 +11,7 @@
# http://www.oddmuse.org/cgi-bin/oddmuse/Email_Quote_Extension
use strict;
use v5.10;
AddModuleDescription('emailquote.pl', 'Email Quote Extension');
@@ -20,14 +21,14 @@ push(@MyRules, \&EmailQuoteRule);
sub EmailQuoteRule {
# > on a line of its own should work
if ($bol && m/\G(\s*\n)*((\&gt;))+\n/cog) {
if ($bol && m/\G(\s*\n)*((\&gt;))+\n/cg) {
return $q->p();
}
# > hi, you mentioned that:
# >> I don't like Oddmuse.
# > in last letter.
elsif ($bol && m/\G(\s*\n)*((\&gt;)+)[ \t]/cog
or InElement('dd') && m/\G(\s*\n)+((\&gt;)+)[ \t]/cog) {
elsif ($bol && m/\G(\s*\n)*((\&gt;)+)[ \t]/cg
or InElement('dd') && m/\G(\s*\n)+((\&gt;)+)[ \t]/cg) {
my $leng = length($2) / 4;
return CloseHtmlEnvironmentUntil('dd') . OpenHtmlEnvironment('dl',$leng, 'quote')
. $q->dt() . AddHtmlEnvironment('dd');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('emoji.pl', 'Smilies');

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('enclosure.pl', 'Podcasting');
@@ -27,7 +28,7 @@ push(@MyRules, \&EnclosureRule);
# [[enclosure:url|size in bytes|mime type]]
sub EnclosureRule {
if (m!\G\[\[enclosure:\s*$FreeLinkPattern(\|([^\]]+))?\]\]!ogci) {
if (m!\G\[\[enclosure:\s*$FreeLinkPattern(\|([^\]]+))?\]\]!cgi) {
my $id = FreeToNormal($1);
# Make sure we don't add duplicates; we will add non-existing
# enclosures as well. We test for existence only when the RSS feed
@@ -55,8 +56,8 @@ sub NewEnclosureRssItem {
my $id = shift;
my $rss = OldEnclosureRssItem($id, @_);
require MIME::Base64;
my %data = ParseData(ReadFileOrDie(GetPageFile($id)));
my @enclosures = split(' ', $data{enclosures});
my $data = ParseData(ReadFileOrDie(GetPageFile($id)));
my @enclosures = split(' ', $data->{enclosures});
my $enclosures = '';
foreach my $enclosure (@enclosures) {
# Don't add the enclosure if the page has been deleted in the mean

View File

@@ -24,6 +24,7 @@
# the css classes div.question and div.answer.
use strict;
use v5.10;
AddModuleDescription('faq.pl', 'FAQ Extension');
@@ -37,10 +38,10 @@ $FaqAnswerText = "Answer: " unless $FaqAnswerText;
push(@MyRules, \&FaqRule);
sub FaqRule {
if ($bol && m/\GQ: (.+)/gc) {
if ($bol && m/\GQ: (.+)/cg) {
return $q->a({name=>'FAQ_' . UrlEncode($1)},'')
. $q->div({class=>'question'}, $FaqQuestionText . $1);
} elsif ($bol && m/\GA:[ \t]*/gc) {
} elsif ($bol && m/\GA:[ \t]*/cg) {
return CloseHtmlEnvironments()
. AddHtmlEnvironment('div', "class='answer'") . $FaqAnswerText;
}

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA,
use strict;
use v5.10;
AddModuleDescription('fckeditor.pl', 'Using FCKeditor In Addition To Wiki Markup');
@@ -28,7 +29,7 @@ $FCKeditorHeight = 400; # Pixel
push (@MyRules, \&WysiwygRule);
sub WysiwygRule {
if (m/\G(&lt;.*?&gt;)/gc) {
if (m/\G(&lt;.*?&gt;)/cg) {
return $1 if substr($1,5,6) eq 'script'
or substr($1,4,6) eq 'script';
return UnquoteHtml($1);

View File

@@ -11,6 +11,7 @@
# http://www.oddmuse.org/cgi-bin/oddmuse/Field_List_Extension
use strict;
use v5.10;
AddModuleDescription('fieldlist.pl', 'Field List Extension');

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('find.pl', 'Find Extension');

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('fix-encoding.pl', 'Fix Encoding');

View File

@@ -1,257 +0,0 @@
#!/usr/bin/env perl
use strict;
# ====================[ flashbox.pl ]====================
=head1 NAME
flashbox - An Oddmuse module for embedding offsite-hosted Flash videos within
an Oddmuse Wiki page - especially those hosted by Google Videos,
YouTube, and SlideShare.
=head1 INSTALLATION
flashbox is easily installable: move this file into the B<wiki/modules/>
directory of your Oddmuse Wiki.
=cut
AddModuleDescription('flashbox.pl', 'Flashbox Extension');
our ($bol, @MyRules, %RuleOrder);
# ....................{ CONFIGURATION }....................
=head1 CONFIGURATION
flashbox is easily configurable: set these variables in the B<wiki/config.pl>
file for your Oddmuse Wiki.
=cut
our ($FlashboxWidth,
$FlashboxHeight);
=head2 $FlashboxWidth
The width of the HTML object "frame" for Flash videos, in pixels.
The default value for this variable is (usually) fine.
=cut
$FlashboxWidth = 420;
=head2 $FlashboxHeight
The height of the HTML object "frame" for Flash videos, in pixels. For any
specific width, a height roughly 83.33% of that width tends to provide a
respectable frame for viewing Flash videos.
The default value for this variable is (usually) fine.
=cut
$FlashboxHeight = 350;
# ....................{ MARKUP }....................
=head1 MARKUP
flashbox provides a few new markup rules. These are:
=over
=item [[GoogleVideo:${GoogleVideoID}]]
=over
=item Embeds the Google Video uniquely identified by ${GoogleVideoID} into the
Oddmuse Wiki page, where ${GoogleVideoID} is the signed integer
following the "docID" parameter in the Google Video URL for that video;
for example, [[GoogleVideo:8649250863235826256]] embeds Derrick Jensen's
"Endgame: Part I" Google Video into the Oddmuse Wiki page.
=back
=item [[YouTube:${YouTubeVideoID}]]
=over
=item Embeds the YouTube video uniquely identified by ${YouTubeVideoID} into the
Oddmuse Wiki page, where ${YouTubeVideoID} is the string following the
"watch?v" parameter in the YouTube URL for that video; for example,
[[YouTube:Q1ZeXnmDZMQ]] embeds James Howard Kunstler's "The Tragedy of
Suburbia TED Talk" YouTube video into the Oddmuse Wiki page.
=back
=item [[SlideShare:${SlideSharePresentationID}]]
=over
=item Embeds the SlideShare presentation uniquely identified by
${SlideSharePresentationID} into the Oddmuse Wiki page, where
${SlideSharePresentationID} is a string composed of the title for that
presentation and an arbitrary signed integer. Unfortunately, this string
is more difficult to obtain than for Google Video and YouTube; for any
given presentation, see the small "Embed" box on that presentation's
SlideShare page and the string following the "doc" parameter in that
box. For example,
[[SlideShare:the-tyranny-of-human-civilization-13479]] embeds
huer1278ft's "The Tyranny of Human Civilization" SlideShare presentation
into the Oddmuse Wiki page.
=back
=back
=cut
push(@MyRules, \&FlashboxRule);
# "FlashboxRule" conflicts with "CreoleRule"-style interpretation of "[[...]]"
# syntax; and must, thus, be applied before that rule.
$RuleOrder{\&FlashboxRule} = -11;
sub FlashboxRule {
if (/\G\[\[googlevideo:([0-9-]+)\]\]/cgi) {
return FlashboxHtml('googlevideo',
"http://video.google.com/googleplayer.swf?docId=${1}&hl=en");
}
elsif (/\G\[\[slideshare:([a-z0-9-]+)\]\]/cgi) {
return FlashboxHtml('slideshare',
"http://static.slideshare.net/swf/ssplayer2.swf?doc=${1}");
}
elsif (/\G\[\[youtube:([a-z0-9-_]{11})\]\]/cgi) {
return FlashboxHtml('youtube',
"http://www.youtube.com/v/${1}");
}
return;
}
sub FlashboxHtml {
my ($paragraph_class, $flashbox_url) = @_;
return
($bol
? CloseHtmlEnvironments().AddHtmlEnvironment('p', qq~class="flashbox ${paragraph_class}"~)
: '').qq~
<object width="${FlashboxWidth}" height="${FlashboxHeight}">
<param name="movie" value="${flashbox_url}"/>
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer"/>
<param name="quality" value="high"/>
<param name="wmode" value="transparent"/>
<param name="allowFullScreen" value="true"/>
<param name="allowScriptAccess" value="always"/>
<embed type="application/x-shockwave-flash"
width="${FlashboxWidth}" height="${FlashboxHeight}"
src="${flashbox_url}"
wmode="transparent"
allowscriptaccess="always" allowfullscreen="true"/>
</object>~;
}
=head1 CSS
flashbox also provides a few new HTML classes for CSS-stylizing the HTML emitted
by these markup rules. Of necessity, flashbox embeds Flash videos in an
"<object>...</object>" HTML tag-set; technically, therefore, you can stylize
such videos with a CSS selector resembling:
# This CSS selector selects all HTML-embedded objects (e.g., Flash videos).
object {
# These CSS properties are supposed to horizontally center such objects;
# however, they do not.
margin: 1.500em auto;
padding: 1.500em 0.000em 0.500em 0.000em;
text-align: center;
text-indent: 0.000em;
}
Unfortunately, most browsers ignore most CSS properties on the CSS "object"
selector (including those in the example, above).
To circumvent this, flashbox enwraps all block-level, flashbox-specific markup
(i.e., flashbox-specific markup preceded by at least two newlines) within an
HTML paragraph having two unique classes. This HTML paragraph, unlike the
"<object>...</object>" HTML tag-set, is styleable by all browsers via CSS
selection of these classes:
=over
=item "flashbox"; and
=item "googlevideo", "youtube", or "slideshare" - according to which offsite host
a Flash video is embedded from.
=back
Let's illustrate with a crude example. Suppose some Oddmuse Wiki page contains
this text markup:
In this compelling reading of his, perhaps, most well-read poetry, Carl Sagan
thunders the truth, Vangelis supplies the angels harp and music, and YouTube
plies the photo-montage seas of "this pale, blue dot": our Earth, from afar.
[[YouTube:p86BPM1GV8M]]
Then, flashbox transmutes that text markup into HTML markup resembling:
<p>
In this compelling reading of his, perhaps, most well-read poetry, Carl Sagan
thunders the truth, Vangelis supplies the angels harp and music, and YouTube
plies the photo-montage seas of "this pale, blue dot": our Earth, from afar.
</p>
<p class="flashbox youtube">
<object width="420" height="350">
<param name="movie" value="http://www.youtube.com/v/p86BPM1GV8M"/>
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer"/>
<embed type="application/x-shockwave-flash"
width="420" height="350"
src="http://www.youtube.com/v/p86BPM1GV8M"/>
</object>
</p>
Then, your CSS stylesheet can style this HTML markup with CSS resembling:
# This CSS selector selects flashbox-embedded Flash videos.
p.flashbox {
# These CSS properties horizontally center such videos.
margin: 1.500em auto;
padding: 1.500em 0.000em 0.500em 0.000em;
text-align: center;
text-indent: 0.000em;
}
# This CSS selector selects flashbox-embedded, YouTube-specific Flash videos.
p.youtube {
# These CSS properties background and border such videos.
background: #334466;
border: #112255 0.125em solid;
}
Wew! There; that wasn't so gruesomely detailed, was it?
=head1 SEE ALSO
The oddmuse.org "YouTube" page off which this Oddmuse extension was founded, at:
L<http://www.oddmuse.org/cgi-bin/oddmuse/YouTube>
=head1 COPYRIGHT AND LICENSE
The information below applies to everything in this distribution,
except where noted.
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this file; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
=cut

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('flickrgallery.pl', 'FlickrGallery Module');
@@ -65,7 +66,7 @@ $RuleOrder{\&FlickrGalleryRule} = -10;
sub FlickrGalleryRule {
# This code is used when Markdown is not available
if (/\G^([\n\r]*\&lt;\s*FlickrSet:\s*(\d+)\s*\&gt;\s*)$/mgci) {
if (/\G^([\n\r]*\&lt;\s*FlickrSet:\s*(\d+)\s*\&gt;\s*)$/cgim) {
my $oldpos = pos;
my $oldstr = $_;
@@ -78,7 +79,7 @@ sub FlickrGalleryRule {
return '';
}
if (/\G^([\n\r]*\&lt;\s*FlickrPhoto:\s*(\d+)\s*([a-z0-9]*?)\s*($size)?\s*\&gt;\s*)$/mgci) {
if (/\G^([\n\r]*\&lt;\s*FlickrPhoto:\s*(\d+)\s*([a-z0-9]*?)\s*($size)?\s*\&gt;\s*)$/cgim) {
my $oldpos = pos;
my $oldstr = $_;
@@ -102,13 +103,13 @@ sub MarkdownFlickrGalleryRule {
^&lt;FlickrSet:\s*(\d+)\s*\>
}{
FlickrGallery($1);
}xmgei;
}egimx;
$text =~ s{
^&lt;FlickrPhoto:\s*(\d+)\s*([a-z0-9]*?)\s*($size)?\s*\>
}{
GetFlickrPhoto($1,$2,$3);
}xmgei;
}egimx;
return $text
}
@@ -134,7 +135,7 @@ sub FlickrGallery {
$result = $FlickrHeaderTemplate;
$result =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/gee;
$result =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/eeg;
# Get list of photos and process them
$url = $FlickrBaseUrl . "?method=flickr.photosets.getPhotos&api_key=" .
@@ -152,7 +153,7 @@ sub FlickrGallery {
my $footer = $FlickrFooterTemplate;
$footer =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/gee;
$footer =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/eeg;
$result .= $footer;
return $result;
@@ -191,7 +192,7 @@ sub FlickrPhoto {
my $output = $FlickrImageTemplate;
$output =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/gee;
$output =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/eeg;
return $output
}

View File

@@ -1,8 +1,11 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ footnotes.pl ]====================
=encoding utf8
=head1 NAME
footnotes - An Oddmuse module for adding footnotes to Oddmuse Wiki pages.
@@ -239,13 +242,13 @@ sub FootnotesRule {
# Footnotes and the set of all footnotes must be marked so as to ensure their
# reevaluation, as each of the footnotes might contain Wiki markup requiring
# reevaluation (like, say, free links).
if (m/\G($FootnotePattern)(?=([ \t]*$FootnotePattern)?)/gcos) {
if (m/\G($FootnotePattern)(?=([ \t]*$FootnotePattern)?)/cgs) {
Dirty($1); # do not cache the prefixing "\G"
my $footnote_text = $2;
my $is_adjacent_footnote = defined $3;
# A number range (e.g., "2-5") of references to other footnotes.
if ($footnote_text =~ m/^(\d+)-(\d+)$/o) {
if ($footnote_text =~ m/^(\d+)-(\d+)$/) {
my ($footnote_number_first, $footnote_number_last) = ($1, $2);
# '&#x2013;', below, is the HTML entity for a Unicode en-dash.
print $q->a({-href=> '#footnotes' .$footnote_number_first,
@@ -258,7 +261,7 @@ sub FootnotesRule {
}, $footnote_number_last.($is_adjacent_footnote ? ', ' : ''));
}
# A number (e.g., "5") implying reference to another footnote.
elsif ($footnote_text =~ m/^(\d+)$/o) {
elsif ($footnote_text =~ m/^(\d+)$/) {
my $footnote_number = $1;
print $q->a({-href=> '#footnotes' .$footnote_number,
-title=> 'Footnote #'.$footnote_number,
@@ -282,7 +285,7 @@ sub FootnotesRule {
return '';
}
# The "<footnotes>" list of all footnotes at the foot of a page.
elsif ($bol && m/\G($FootnotesPattern)/gcios) {
elsif ($bol && m/\G($FootnotesPattern)/cgis) {
Clean(CloseHtmlEnvironments());
Dirty($1); # do not cache the prefixing "\G"

View File

@@ -19,6 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('form_timeout.pl', 'Form Timeout Extension');

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ forms.pl ]====================
@@ -18,9 +19,9 @@ sub FormsRule {
my $oldpos = pos;
Clean(CloseHtmlEnvironments());
Dirty($form);
$form =~ s/\%([a-z]+)\%/GetParam($1)/ge;
$form =~ s/\%([a-z]+)\%/GetParam($1)/eg;
$form =~ s/\$([a-z]+)\$/$q->span({-class=>'param'}, GetParam($1))
.$q->input({-type=>'hidden', -name=>$1, -value=>GetParam($1)})/ge;
.$q->input({-type=>'hidden', -name=>$1, -value=>GetParam($1)})/eg;
print UnquoteHtml($form);
pos = $oldpos;
return AddHtmlEnvironment('p');

View File

@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('fractions.pl', 'Fractions');

View File

@@ -7,7 +7,7 @@
#
# Codes reused from questionasker.pl for Oddmuse
# Copyright (C) 2004 Brock Wilcox <awwaiid@thelackthereof.org>
# Copyright (C) 2006, 2007 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20062015 Alex Schroeder <alex@gnu.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,10 +23,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('gd_security_image.pl', 'GD Security Image Extension');
our ($q, $Now, %Action, $FullUrl, $LinkPattern, $FreeLinks, $FreeLinkPattern, $WikiLinks, $DataDir, $ModuleDir, @MyInitVariables, %CookieParameters, %InvisibleCookieParameters);
our ($q, $Now, %Action, $FullUrl, $LinkPattern, $FreeLinks, $FreeLinkPattern, $WikiLinks, $DataDir, $ModuleDir, @MyInitVariables, %CookieParameters, @MyFormChanges);
=head1 DESCRIPTION
@@ -239,9 +240,9 @@ sub GdSecurityImageCheck {
if ($answer ne '' && GdSecurityImageIsValidId($id)) {
my ($status, $data) = ReadFile(GdSecurityImageGetTicketFile($id));
if ($status) {
my %page = ParseData($data);
if ($page{generation_time} + $GdSecurityImageDuration > $Now) {
if ($answer eq $page{string}) {
my $page = ParseData($data);
if ($page->{generation_time} + $GdSecurityImageDuration > $Now) {
if ($answer eq $page->{string}) {
$GdSecurityImageId = '';
if (!$GdSecurityImageRememberAnswer) {
SetParam('gd_security_image_id', '');
@@ -324,22 +325,10 @@ sub NewGdSecurityImageDoPost {
return (OldGdSecurityImageDoPost(@params));
}
*OldGdSecurityImageGetEditForm = \&GetEditForm;
*GetEditForm = \&NewGdSecurityImageGetEditForm;
sub NewGdSecurityImageGetEditForm {
return GdSecurityImageAddTo(OldGdSecurityImageGetEditForm(@_), $_[1]);
}
*OldGdSecurityImageGetCommentForm = \&GetCommentForm;
*GetCommentForm = \&NewGdSecurityImageGetCommentForm;
sub NewGdSecurityImageGetCommentForm {
return GdSecurityImageAddTo(OldGdSecurityImageGetCommentForm(@_));
}
push(@MyFormChanges, \&GdSecurityImageAddTo);
sub GdSecurityImageAddTo {
my ($form, $upload) = @_;
my ($form, $type, $upload) = @_;
if (not $upload
and not GdSecurityImageException(GetId())
and not UserIsEditor()) {
@@ -396,7 +385,5 @@ sub GdSecurityImageInitVariables {
$GdSecurityImagePngToAA = "$ModuleDir/pngtoaa";
$CookieParameters{'gd_security_image_id'} = '';
$InvisibleCookieParameters{'gd_security_image_id'} = 1;
$CookieParameters{'gd_security_image_answer'} = '';
$InvisibleCookieParameters{'gd_security_image_answer'} = 1;
}

View File

@@ -14,6 +14,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('git-another.pl', 'Another Git Extension');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
=head1 NAME

View File

@@ -17,6 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
our ($q);
our ($GoogleCustomSearchEngine);

View File

@@ -18,41 +18,81 @@ use v5.10;
AddModuleDescription('google-plus-one.pl', 'Google Plus One Module');
our ($q, @MyAdminCode, %Action);
our ($q, $RCName, @MyFooters, @MyAdminCode, %Action, @MyInitVariables, $CommentsPrefix);
my $data_uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEwAAAAYCAMAAABnVuv4AAAAhFBMVEUAAAD////MzMz5+fkWau+zs7Pg4OD39/fh4eHu7u7z8/Pk5OTm5ubX19fx8fHj4+N+fn5jY2Ojo6N/f3/r7Ov29vbq6ero6Oj19fUVau0XafC3zO3q6ulKie2dve89ge1yoexkmeyNsepZk+/T3u4weu4jcu7E1Ox9p+rExMTX4vLi6PBsAh6oAAAAAXRSTlMAQObYZgAAAWtJREFUOMvFldluwjAQRU24LgHTpAsEgglL2Nv//7/OeGLLqlTXD5V6HM/c2NJRMJGilClSGCW8DbwEXgPvA+QqRylKI66kLNiKUZri72X6OQOdKxtn8E+yCTMOjQdBhbvEbNkkA5EBoJKULdc0ltHksv447ZaM7JJMNO1PstLZ9Gw2W9PgSxJXe4V1QZZIxiIGI4AbWs5hso1lFY0BwLXzEcBnWK8qJ9uIDKxlMbjyKnex6SoCcO2CKy7xupxZG57GKSBBbsSmp56btYC1t+l5v9vhNI0QmZyZVC+DPKa4IlkHR8f5gD4hQyzb0AhntvAcuo5U3YHzvrWLCJZFmlZ+pp/Rv9k022a75do0ABWKHCTJ9e0923Bmn6ij92xOrAaA1YpvLPZzCrJO+yxLE2Rm7rnfpfc4UjV+x2TLzEBtAvURvYnIl9UDJU8qcsmSL9myMoNs2VMGWtVZHxT9+N310ErVRYpaCToD9QXtvTL0OWiBLQAAAABJRU5ErkJggg==';
# Two step Google +1 button to protect your privacy: show this at the bottom
# of every form.
# Make sure journal pages set a global variable which we then use to
# hide the +1 button.
*MyOldGetCommentForm=*GetCommentForm;
*GetCommentForm=*MyNewGetCommentForm;
*OldGooglePlusPrintJournal = \&PrintJournal;
*PrintJournal = \&NewGooglePlusPrintJournal;
sub MyNewGetCommentForm {
return MyOldGetCommentForm(@_) . qq{
my $GooglePlusThisPagePrintedJournal;
push(@MyInitVariables, sub {
$GooglePlusThisPagePrintedJournal = 0;
});
sub NewGooglePlusPrintJournal {
$GooglePlusThisPagePrintedJournal = 1;
return OldGooglePlusPrintJournal(@_);
}
# Use a two step Google +1 button to protect your privacy: show this
# at the bottom of every page but not on comment pages, Recent
# changes, and pages that printed a journal.
unshift(@MyFooters, \&GooglePlusPrintFooter);
sub GooglePlusPrintFooter {
my ($id, $rev, $comment) = @_;
if (not $GooglePlusThisPagePrintedJournal
and (GetParam('action', 'browse') eq 'plusone'
or (GetParam('action', 'browse') eq 'browse'
and $id
and $id ne $RCName
and (not $CommentsPrefix or $id !~ /^$CommentsPrefix(.*)/)))) {
return q{
<!-- start of Google+ -->
<script type="text/javascript">
function loadScript(jssource,thelink) {
function loadScript(jssource) {
// add javascript
var jsnode = document.createElement('script');
jsnode.setAttribute('type','text/javascript');
jsnode.setAttribute('src',jssource);
document.getElementsByTagName('head')[0].appendChild(jsnode);
document.getElementById(thelink).innerHTML = "";
// add button
var butn = document.createElement('div');
butn.setAttribute('class', 'g-plusone');
butn.setAttribute('id', 'my_plusone');
var link = document.getElementById('plus1');
link.parentNode.insertBefore(butn, link);
// hide the link
link.innerHTML = "";
// when looking at action=plusone
var ul = document.getElementById('plus1s');
var children = ul.children;
for (var i = 0; i < children.length; i++) {
var li = children[i];
butn = document.createElement('g:plusone');
butn.setAttribute('href', li.firstElementChild.getAttribute('href'));
butn.setAttribute('id', 'my_plusone' + i);
li.appendChild(butn);
}
}
var plus1source = "https://apis.google.com/js/plusone.js";
</script>
<a id="plus1" href="javascript:loadScript(plus1source,'plus1')">
<img src="$data_uri" alt="Show Google +1" />
</a>
<!-- <g:plusone></g:plusone> -->
<div class="g-plusone" id="my_plusone"></div>
<script type="text/javascript">
document.getElementById("my_plusone").setAttribute("data-size", "medium");
document.getElementById("my_plusone").setAttribute("data-href", document.location.href);
</script>
<p id="plus1">
<a href="javascript:loadScript('https://apis.google.com/js/plusone.js')">
<img src="/pics/plusone-h24.png" alt="Show Google +1" />
</a>
</p>
<!-- end of Google+ -->
};
}
}
# Google +1 list
# Google +1 list
push(@MyAdminCode, sub {
my ($id, $menuref, $restref) = @_;
@@ -71,12 +111,10 @@ sub DoPlusOne {
foreach my $id (AllPagesList()) {
push(@pages, $id) if $id =~ /^\d\d\d\d-\d\d-\d\d/;
}
splice(@pages, 0, $#pages - 19); # last 20 items
print "<ul>";
splice(@pages, 0, $#pages - 19); # last 20 items
print '<ul id="plus1s">';
foreach my $id (@pages) {
my $url = ScriptUrl(UrlEncode($id));
print $q->li(GetPageLink($id),
qq{ <g:plusone href="$url"></g:plusone>});
print $q->li(GetPageLink($id), ' ');
}
print "</ul>";
print $q->end_div();

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('google-search.pl', 'Use Google For Searches');

View File

@@ -13,6 +13,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
our (%Page, %IndexHash, %AdminPages, $HomePage, $RCName, @MyInitVariables, $LinkPattern, $FreeLinkPattern, $FullUrlPattern, $InterLinkPattern, $UserGotoBar, @UserGotoBarPages);
@@ -38,7 +39,7 @@ sub GotobarInit {
@UserGotoBarPages = ();
$UserGotoBar = '';
my $count = 0;
while ($Page{text} =~ m/($LinkPattern|\[\[$FreeLinkPattern\]\]|\[\[$FreeLinkPattern\|([^\]]+)\]\]|\[$InterLinkPattern\s+([^\]]+?)\]|\[$FullUrlPattern[|[:space:]]([^\]]+?)\])/og) {
while ($Page{text} =~ m/($LinkPattern|\[\[$FreeLinkPattern\]\]|\[\[$FreeLinkPattern\|([^\]]+)\]\]|\[$InterLinkPattern\s+([^\]]+?)\]|\[$FullUrlPattern[|[:space:]]([^\]]+?)\])/g) {
my $page = $2||$3||$4||$6||$8;
my $text = $5||$7||$9;
$UserGotoBar .= ' ' if $UserGotoBar;

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2010 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20102015 Alex Schroeder <alex@gnu.org>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
@@ -13,12 +13,13 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('gravatar.pl', 'Gravatar');
use Digest::MD5 qw(md5_hex);
our ($q, $bol, %CookieParameters, $FullUrlPattern, @MyRules, @MyInitVariables);
our ($q, $bol, %CookieParameters, $FullUrlPattern, @MyRules, @MyInitVariables, @MyFormChanges);
# Same as in mail.pl
$CookieParameters{mail} = '';
@@ -28,7 +29,7 @@ my $gravatar_regexp = "\\[\\[gravatar:(?:$FullUrlPattern )?([^\n:]+):([0-9a-f]+)
push(@MyRules, \&GravatarRule);
sub GravatarRule {
if ($bol && m!\G$gravatar_regexp!cog) {
if ($bol && m!\G$gravatar_regexp!cg) {
my $url = $1;
my $gravatar = "https://secure.gravatar.com/avatar/$3";
my $name = FreeToNormal($2);
@@ -45,15 +46,14 @@ sub GravatarRule {
return;
}
*GravatarOldGetCommentForm = \&GetCommentForm;
*GetCommentForm = \&GravatarNewGetCommentForm;
sub GravatarFormAddition {
my ($html, $type) = @_;
# gravatars only make sense for comments
return $html unless $type eq 'comment';
sub GravatarNewGetCommentForm {
my $html = GravatarOldGetCommentForm(@_);
# the implementation in mail.pl takes precedence!
return $html if defined &MailNewGetCommentForm;
my $addition = $q->span({-class=>'mail'},
$q->label({-for=>'mail'}, T('Email: '))
$q->label({-for=>'mail'}, T('Email:') . ' ')
. ' ' . $q->textfield(-name=>'mail', -id=>'mail',
-default=>GetParam('mail', '')));
$html =~ s!(name="homepage".*?)</p>!$1 $addition</p>!i;
@@ -63,6 +63,12 @@ sub GravatarNewGetCommentForm {
push(@MyInitVariables, \&AddGravatar);
sub AddGravatar {
# the implementation in mail.pl takes precedence!
if (not grep { $_ == \&MailFormAddition } @MyFormChanges) {
push(@MyFormChanges, \&GravatarFormAddition);
}
my $aftertext = UnquoteHtml(GetParam('aftertext'));
my $mail = GetParam('mail');
$mail =~ s/^[ \t]+//;
@@ -84,6 +90,6 @@ sub AddGravatar {
sub GravatarNewGetSummary {
my $summary = GravatarOldGetSummary(@_);
$summary =~ s/^$gravatar_regexp *//o;
$summary =~ s/^$gravatar_regexp *//;
return $summary;
}

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('grep.pl');
@@ -44,7 +45,7 @@ sub PrintGrep {
foreach my $id (AllPagesList()) {
my $text = GetPageContent($id);
next if (TextIsFile($text)); # skip files
while ($text =~ m{($regexp)}ig) {
while ($text =~ m{($regexp)}gi) {
print $q->li(GetPageLink($id) . ': ' . $1);
}
}

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('header-and-footer-templates.pl', 'Comments on HTML Templates');

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('headers.pl', 'Header Markup Extension');
@@ -40,7 +41,7 @@ $RuleOrder{\&HeadersRule} = 95;
sub HeadersRule {
my $oldpos = pos;
if ($bol && (m/\G((.+?)[ \t]*\n(---+|===+)[ \t]*\n)/gc)) {
if ($bol && (m/\G((.+?)[ \t]*\n(---+|===+)[ \t]*\n)/cg)) {
my $html = CloseHtmlEnvironments() . ($PortraitSupportColorDiv ? '</div>' : '');
if (substr($3,0,1) eq '=') {
$html .= $q->h2($2);

View File

@@ -18,6 +18,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('headlines.pl', 'Headlines Extension');
@@ -31,7 +32,7 @@ push(@MyRules, \&HeadlinesRule);
$HeadlineNumber = 20;
sub HeadlinesRule {
if (m/\G(\&lt;headlines(:(\d+))?\&gt;)/gci) {
if (m/\G(\&lt;headlines(:(\d+))?\&gt;)/cgi) {
if (($3) and ($3>0)) {$HeadlineNumber = $3;};
Clean(CloseHtmlEnvironments());
Dirty($1);

View File

@@ -1,8 +1,12 @@
#!/usr/bin/env perl
use strict;
use v5.10;
use utf8;
# ====================[ hibernal.pl ]====================
=encoding utf8
=head1 NAME
hibernal - An Oddmuse module for improved multi- and single-blogging.
@@ -1208,7 +1212,7 @@ sub GetHibernalArchiveMonth {
~e;
$html_month =~ s~( {1,2})(\d{1,2})\b~
$1.GetHibernalArchiveMonthDay($post_name_regexp, $year, $month, $2)
~ge;
~eg;
# Float the HTML for each month horizontally past the month preceding it;
# failure to float months in this manner causes these months to stack

View File

@@ -25,6 +25,7 @@
# page cluster.
use strict;
use v5.10;
AddModuleDescription('hiddenpages.pl', 'Hidden Pages Extension');

View File

@@ -1,4 +1,5 @@
use strict;
use v5.10;
=head1 NAME

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('html-template.pl', 'HTML Templates');

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('html-uploads.pl', 'Restricted HTML Upload');

View File

@@ -11,6 +11,7 @@
# http://www.oddmuse.org/cgi-bin/oddmuse/Html_Comment_Extension
use strict;
use v5.10;
AddModuleDescription('htmlcomment.pl', 'Html Comment Extension');

View File

@@ -17,6 +17,7 @@
# Boston, MA 02111-1307 USA
use strict;
use v5.10;
AddModuleDescription('htmllinks.pl', 'HtmlLinks Module');

Some files were not shown because too many files have changed in this diff Show More