Compare commits

...

906 Commits

Author SHA1 Message Date
Alex Schroeder
76ce0426c7 wiki.pl: first steps towards HTML::Tiny and Mojolicious::Lite
The current state displays the HomePage and allows you to switch to RecentChanges and back.
Not much else works, I'm afraid.
2015-10-12 10:27:31 +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
Alex Schroeder
22bf1e8df3 static-copy.t skips a test without HTTPS support
The static.css file is copied from https://oddmuse.org/ -- so if
LWP::Protocol::https is not installed, this cannot work.
2015-07-21 12:42:06 +02:00
Alex Schroeder
9ec075c1c0 referrer-tracking.t switching to HTTPS 2015-07-21 12:31:13 +02:00
Alex Schroeder
a767bb5c94 static-copy.pl use HTTPS to access oddmuse.org 2015-07-21 12:22:39 +02:00
Alex Schroeder
6d62283927 referrer-tracking.t with new copyright year 2015-07-21 12:17:12 +02:00
Alex Schroeder
445e80cefc referrer-tracking.t skips test without HTTPS
As oddmuse.org now uses HTTPS, this test requires LWP::Protocol::https
to be installed.
2015-07-21 12:16:17 +02:00
Alex Schroeder
6589e84d10 near-links.t fix test for empty page 2015-07-21 11:32:55 +02:00
Alex Schroeder
59e79d2b17 Summary: Fix bug in NewText
If $CommentsPrefix was not set, all the pages were being treated like
comment pages.
2015-07-21 10:15:55 +02:00
Alex Schroeder
ea426db112 Fix bug in NewText
If $CommentsPrefix was not set, all the pages were being treated like
comment pages.
2015-07-21 10:14:34 +02:00
Alex Schroeder
b3759296e2 fcgi.pl deleted
As part of the big cleanup, files that haven't been used have been
deleted. The necessary info can still be found on the Oddmuse site:
https://oddmuse.org/wiki/Using_mod_fastcgi
2015-07-21 09:44:35 +02:00
Alex Schroeder
00388009f7 README.creole typo fixed 2015-07-21 09:41:18 +02:00
Alex Schroeder
c50fb63c36 Moved 404handler.pl to modules 2015-07-21 09:34:17 +02:00
Alex Schroeder
9f49cf49ea Deleted some more cruft
debian-packages, test.mime and test.png have been deleted.
2015-07-21 09:29:24 +02:00
Alex Schroeder
1c240033d8 localnames-server.pl moved to contrib 2015-07-21 09:28:15 +02:00
Alex Schroeder
c04743d6e1 mimedecode.pl moved to scripts 2015-07-21 09:25:49 +02:00
Alex Schroeder
f740251bbb templates subdirectory now with README 2015-07-21 09:25:06 +02:00
Alex Schroeder
4e90046b66 Moved rc2mail.pl into contrib 2015-07-21 09:23:51 +02:00
Alex Schroeder
d1f9c401cd Makefile stripped of untested junk
The Mac subdirectory and all the instructions of how to build and
install Oddmuse on a Mac using the OSX tools have been deleted.

The Slack subdirectory and all the instructions of how to build and
install Oddmuse on Slackware have been deleted.

The contrib/simple-install subdirectory and all the instructions on how
to quickly and easily install Oddmuse using Creole have been deleted.
2015-07-21 09:21:13 +02:00
Alex Schroeder
4027e142bc plink.js: moved into contrib directory 2015-07-21 09:19:48 +02:00
Alex Schroeder
76b26df765 README.creole: fix dependencies 2015-07-20 09:04:32 +02:00
Alex Schroeder
b054fa463d Default message for empty comment pages. 2015-07-20 08:12:46 +02:00
Aleks-Daniel Jakimenko
538dac4d3f No need to wait 10 mins if you waited for hours
Previously it was possible to see "The lock was created 1000 hours ago.
After ten minutes, you could try to unlock the wiki".
While technially that's true, it does not sound nice to humans.

Also, now the button to unlock the wiki is not displayed until 10 minutes
pass. This is probably a good idea to prevent unconscious unlocks.

T('Unlock Wiki') string is reused (the same string is displayed on the
Administration page)
2015-07-20 04:43:21 +03:00
Alex Schroeder
1a2d690487 README.creole improvement
Move data dir from /var/www to /var/local.
2015-07-19 22:42:38 +02:00
Alex Schroeder
b7ff38b8a8 README.creole use root at first 2015-07-19 22:38:21 +02:00
Alex Schroeder
c0c79cfbf2 README.creole improve installation instructions 2015-07-19 22:37:09 +02:00
Alex Schroeder
80ef71f3e4 Moved README to README.creole
The new file now contains much more detailed instructions for a Debian
system.
2015-07-19 22:10:39 +02:00
Alex Schroeder
846ddce24e $PrintedHeader renamed to $HeaderIsPrinted
I also added some comments explaining why we need it. When calling
ReportError, we don't know whether HTTP headers have already been
printed. If not, we need to print them or the error message will be an
invalid HTTP response. If we did, we must not reprint them or the HTML
page will contain HTTP headers as part of its response body.
$HeaderIsPrinted makes sure the HTTP headers are printed just once.
2015-07-17 15:21:16 +02:00
Alex Schroeder
4ec48bb963 $ValidatorLink removed 2015-07-17 15:11:37 +02:00
Alex Schroeder
70c7d154a3 pygmentize.t: make test for the error more robust 2015-07-17 14:20:39 +02:00
Alex Schroeder
eb0738dedc pygmentize.pl: warn if an error occured
There's now a test that checks the error message when no pygmentize tool
can be found on the PATH.
2015-07-16 22:14:32 +02:00
Aleks-Daniel Jakimenko
f993903c8c Revert changes in modules/recaptcha.pl, I did not mean this 2015-07-15 01:07:54 +03:00
Aleks-Daniel Jakimenko
a5ecd94393 File BUGS is deleted.
According to "git blame BUGS" all these bug reports are more than 10 years old.
2015-07-15 01:04:54 +03:00
Aleks-Daniel Jakimenko
2c823013e7 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-07-14 23:12:28 +03:00
Aleks-Daniel Jakimenko
e8b7ad4b67 Comments about perlcritic 2015-07-14 23:11:07 +03:00
Aleks-Daniel Jakimenko
3c84add52a Fixed incorrect usage of map 2015-07-14 23:10:25 +03:00
Aleks-Daniel Jakimenko
e0c38a6fe6 Declaring variables correctly 2015-07-14 23:07:02 +03:00
Alex Schroeder
f0588fa299 major.t: delete some tests that make no sense
The recent changes in commit 62d6dc4b—fixing the summary for last major
revisions—resulted in some changes in the output. These changes seem to
be OK so I removed the tests for the old output.

Basically, the tests created a new page using a minor change. What
should the output be when browsing the page with diff=1? "No diff
available" is correct. There is no need to mention the last major change
because there is none.

The next tests edited the same page using minor changes. What should the
output be when browsing the page with diff=1? "No diff available" is
still correct. There is still no need to mention the last major change
because there is none.
2015-07-14 17:30:05 +02:00
Alex Schroeder
2942b9427d removed package OddMuse declarations 2015-07-14 16:45:18 +02:00
Alex Schroeder
7acb6cf516 plainclusterrc.pl: deleted
The author's page describes it as follows: "This module is designed to
be used in conjunction with the ClusterMap Module and the Static Hybrid
Module. It alters the code that generates the RecentChanges page so that
links to a Cluster Page are direct links, not action links. This allows
your RecentChanges page to be more useful and use the pre-cached pages,
rather than calling the Oddmuse script."
http://fletcherpenney.net/2005/10/plain_cluster_rc_module

As nobody seems to be using it, I deleted it.
http://oddmuse.org/wiki/Module_Popularity
2015-07-13 15:46:10 +02:00
Alex Schroeder
2a433a7513 slideshow.pl: deleted
There was no documentation to be found on the wiki or in the comments of
the module. The module requires various CSS files that aren't part of
the module. That's why I deleted it.

Some more information is here:
http://fletcherpenney.net/2005/08/s5_slide_show

It's based on S5 - the Simple Standards-based Slide Show System.
http://meyerweb.com/eric/tools/s5/

"Basically, it’s a way to create slide shows using nothing more than
XHTML, CSS, and Javascript. In theory, they are compatible across all
compliant browsers, and built from quite small files making the
presentations perfect for web use."

The slide show example is no longer available.
2015-07-13 15:42:32 +02:00
Alex Schroeder
62d6dc4bd4 Fix summary of diff if showing last major revision
As reported by npostavs: When looking at an URL such as
http://www.emacswiki.org/emacs?action=rss;full=1;diff=1;page=0 and
looking at a minor change, we would see the diff for the last major
change. Instead of showing the summary for that change, however, we'd
see the summary for the last (minor) edit. This commit fixes this issue.
2015-07-13 11:22:46 +02:00
Alex Schroeder
9b35704a57 image.pl: comment explanining where $Monolithic comes from 2015-07-13 10:07:19 +02:00
Alex Schroeder
77fd49544c all.t: test for monolithic links of images 2015-07-13 10:04:00 +02:00
Alex Schroeder
b3fa76bfb6 all.t: add a test for transcluded images 2015-07-13 09:07:38 +02:00
Alex Schroeder
1ab2aa9427 all.t: add test for picture uploads 2015-07-13 09:00:39 +02:00
Alex Schroeder
57c2413b51 upload.t: add some explanations to the tests 2015-07-13 08:57:22 +02:00
Alex Schroeder
aa8dcd54fa namespaces.t: fix copyright year 2015-07-13 08:54:33 +02:00
Alex Schroeder
81721e29de links.t: GPLv3 and copyright year 2015-07-13 08:53:41 +02:00
Alex Schroeder
9d3b5e25ee usemod.pl: fix XSS vulnerability for $HtmlLinks 2015-07-13 08:48:18 +02:00
Alex Schroeder
2ca2d43068 test.pl: run_tests_negative and xpath variant
run_tests_negative and xpath_run_tests_negative are new. They
encapsulate the call to apply_rules.
2015-07-13 08:46:50 +02:00
Alex Schroeder
697c320d52 div-foo.pl: add rule order
%RuleOrder needs to be declared our.
2015-07-13 06:54:35 +02:00
Alex Schroeder
de1b4c3a3b div-foo.pl: add rule order
This moves the rule after usemod.pl
2015-07-13 06:52:55 +02:00
Alex Schroeder
c6f00323fc Get rid of last traces of $RecentTop
This variable disappered with commit 5ca75e87, back in 2008.
2015-07-08 15:25:14 +02:00
Alex Schroeder
300d8e9ad3 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-07-08 15:09:11 +02:00
Alex Schroeder
f78f0ad7e8 Added README showing how to do translation stats 2015-07-08 15:06:21 +02:00
Alex Schroeder
afb21a02d4 Translation system refactoring
All the translation files will call AddModuleDescription only if it is
defined, allowing us to run the translation files by themselves. A
further change to oddtrans got rid of some "Wide character in print"
warnings. Together, these changes now allow us to calculate how many
translation strings are missing for a given set of modules.
2015-07-08 14:53:49 +02:00
Aleks-Daniel Jakimenko
98af7703d7 Some tests for 𝖀𝖓𝖎𝖈𝖔𝖉𝖊𝓦𝓲𝓴𝓲𝓦𝓸𝓻𝓭𝓼 2015-07-07 23:04:53 +03:00
Alex Schroeder
b4b82e8050 german-utf8.pl: Update 2015-07-07 15:23:52 +02:00
Alex Schroeder
9636fe2e0a Various tests fixed
$WikiLinks changed default value and must therefore be provided.
CSS class for intermap links changed.
2015-07-07 14:17:30 +02:00
Alex Schroeder
cda31ad0aa WikiWords made Unicode aware
Now using \p{Uppercase}+\p{Lowercase}+\p{Uppercase}\p{Alphabetic}* to
identify WikiWords.
2015-07-07 13:47:33 +02:00
Alex Schroeder
5e35d0aa79 localnames.t: fix tests
$WikiLinks changed default value and must therefore be provided.
2015-07-07 13:46:03 +02:00
Alex Schroeder
66ea19a686 default-markup.t: fix tests
$WikiLinks changed default value and must therefore be provided.
CSS class for intermap links changed.
2015-07-07 13:43:26 +02:00
Alex Schroeder
b302e1f8d4 links.t: fix tests
$WikiLinks changed default value and must therefore be provided.
2015-07-07 13:25:11 +02:00
Alex Schroeder
874586f27d default-links.t: fix tests
$WikiLinks changed default value and must therefore be provided.
CSS class for intermap links changed.
2015-07-07 13:21:54 +02:00
Alex Schroeder
5566297f91 links.t: fix page/interpage test
A recent change introduced the "interpage" CSS class.
2015-07-07 12:54:18 +02:00
Alex Schroeder
295d64e34f ell-to-wiki.pl: use GPLv3 and gnu.org email 2015-07-07 12:46:26 +02:00
Alex Schroeder
8e3d36610e fix-copyright-years: new 2015-07-07 12:45:29 +02:00
Aleks-Daniel Jakimenko
e1781c0651 Merge branch 'sane-defaults'
Conflicts:
	wiki.pl
2015-07-06 16:05:49 +03:00
Aleks-Daniel Jakimenko
c53f9c7954 Merge branch 'stylesheet-changes' 2015-07-06 15:56:09 +03:00
Alex Schroeder
a8ca3b6b95 $SiteBase removed 2015-07-05 15:55:22 +02:00
Alex Schroeder
02d90f1fc2 referrer-tracking.t: independent of $ScriptName
$ScriptName may be http://localhost/wiki.pl instead of
http://localhost/cgi-bin/wiki.pl.
2015-07-05 08:47:54 +02:00
Alex Schroeder
2ddd13eea5 rollback.t: Remove duplicate lines. 2015-07-05 08:42:37 +02:00
Alex Schroeder
ff069557f5 test.pl: Fix setup for Darwin OS. 2015-07-05 08:42:10 +02:00
Alex Schroeder
51f85d9581 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-07-05 08:18:38 +02:00
Alex Schroeder
9e6f63c0e8 german-utf8.pl: missing translations 2015-07-05 08:17:00 +02:00
Aleks-Daniel Jakimenko
4689452d8e Removing clear_pages() from the beginning of tests (part 4, final)
Added clear_pages() before Init(). All tests pass without significant problems.

rollback.t is still confusing:
WriteStringToFile($RcFile, "1 FirstPage 1 \n");
AppendStringToFile($RcFile, "2 SecondPage 1 \n");
clear_pages();

What's the point of writing to rc file if we delete that immediately?

Besides that, everything is OK!
2015-07-05 03:58:39 +03:00
Aleks-Daniel Jakimenko
90829ca433 Removing clear_pages() from the beginning of tests (part 3)
Manual work.
2015-07-05 03:42:00 +03:00
Aleks-Daniel Jakimenko
eb3071d0db Removing clear_pages() from the beginning of tests (part 2)
This script was used:
perl -0pi -e 's/(use utf8[^\n]+)\n+clear_pages\(\);[^\n]*\n+/$1\n\n/' *.t
2015-07-05 03:32:04 +03:00
Aleks-Daniel Jakimenko
c4671a8909 Removing clear_pages() from the beginning of tests (part 1)
This script was used:
perl -0pi -e 's/(use Test[^\n]+)\n+clear_pages\(\);[^\n]*\n+/$1\n\n/' *.t
2015-07-05 03:28:46 +03:00
Aleks-Daniel Jakimenko
aa759e5c04 private-wiki.pl: Fixed a serious problem (wikis require reencryption)
Because of the lack of parenthesis CBC mode was not turned on. This was a
serious security problem. If you were using this module, now you have to
reencrypt the whole wiki. Instructions for doing this will be posted
on [[Private Wiki Extension]] eventually.
2015-07-04 16:47:28 +03:00
Alex Schroeder
7e27af5998 not-found-handler.pl passes perl -c
ToString needs parenthesis.
2015-07-03 14:33:24 +02:00
Alex Schroeder
3c25fcb9ba html-template.pl passes perl -c
ToString needs parenthesis.
2015-07-03 14:32:33 +02:00
Alex Schroeder
7aa86d29fe pdf.pl passes perl -c
ToString needs parenthesis.
2015-07-03 14:31:34 +02:00
Alex Schroeder
7a8ffb8e64 plainclusterrc.pl passes perl -c
GetRC needs parenthesis.
2015-07-03 14:29:34 +02:00
Alex Schroeder
f1f2ed71a5 static-hybrid.pl passes perl -c
ToString needs parenthesis.
2015-07-03 14:28:09 +02:00
Alex Schroeder
4f4ad14850 aggregate.pl passes perl -c
ToString needs parethesis.
2015-07-03 14:26:59 +02:00
Alex Schroeder
7ad2d0ed38 Use 1 | 3 | 7 | 30 | 90 days for RC
The old format was "1 day 3 days 7 days 14 days 21 days 28 days" and
that can be tricky in languages where the grammar doesn't work that way.
2015-07-03 14:16:31 +02:00
Alex Schroeder
9589c42a6a private-wiki.pl: remove debug print to STDERR 2015-07-03 13:01:45 +02:00
Alex Schroeder
8d4c15e948 Remove $NewText and $NewComment.
$NewText is replaced by a call to NewText() which you can overwrite. Or
you can provide translations for the texts used by NewText(). Basically,
the new text explains that the page in question does not exist and
invites you edit it.
2015-07-03 13:01:32 +02:00
Alex Schroeder
c7274a267b Remove README and $ReadMe
I don't think anybody ever relied on this feature.
2015-07-03 11:51:48 +02:00
Alex Schroeder
6cbcb4cd46 oddmuse-curl.el: oddmuse-read-wiki with completion 2015-07-03 09:38:47 +02:00
Alex Schroeder
8a9a0b6d50 Fix oddtrans again.
Changing all the double quotes to single quotes before processing was a
bad idea.
2015-06-28 00:53:24 +02:00
Alex Schroeder
25eb21b91e Oddtrans now handles split strings.
The issue was raised by a translation of this form:

T('something, something'
  . ' and something')';
2015-06-28 00:10:43 +02:00
Alex Schroeder
4686c37252 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-06-27 20:33:05 +02:00
Alex Schroeder
73b8caebb5 New google-plus-one.pl and tests.
This adds a Google +1 button to the bottom of a page.
2015-06-27 20:22:55 +02:00
Aleks-Daniel Jakimenko
9f636bd021 Correct shell quoting 2015-06-27 14:45:48 +03:00
Alex Schroeder
e066762122 Added like.pl and like.t
Implement a simple "I Like" link.
2015-06-27 11:57:59 +02:00
Alex Schroeder
2e91d5a722 test.pl: use '$DataDir' in shell commands
I ran some tests using a RAM Disk, so I set $DataDir to a directory
containing a space in its name. This broke clean_pages.
2015-06-26 20:12:40 +02:00
Alex Schroeder
89eca3212f oddmuse-curl.el: display diff after loading a page
When loading a page from the wiki, we compare it to the file on disk and
if there is a difference, we show a *Diff* buffer.
2015-06-26 11:55:06 +02:00
Alex Schroeder
8720b1e954 oddmuse-curl.el: doc string typo 2015-06-26 11:54:48 +02:00
Alex Schroeder
6d51cd321a oddmuse-curl.el: add wiki and pagename history 2015-06-26 11:54:15 +02:00
Alex Schroeder
f900c71aa7 add-link.pl test for duplicates as early as possible 2015-06-25 09:53:33 +02:00
Alex Schroeder
90f768c3a4 Moved add-link.pl into contrib/campaignwiki
We had two copies of the file in our repository.
2015-06-25 09:08:07 +02:00
Alex Schroeder
dab37b2038 Deleted .rpm files from 2007 2015-06-25 09:07:43 +02:00
Alex Schroeder
218dd6ae7a OddMuseWiki.spec: Fix name and URL 2015-06-25 09:07:19 +02:00
Alex Schroeder
b3678f4c96 surge-protection.t with smaller timeouts
We're trying to speed up tests. We're setting $SurgeProtectionViews and
$SurgeProtectionTime to small values before running tests.
2015-06-25 07:59:42 +02:00
Alex Schroeder
6bc9531986 big-brother.t: reduce $VisitorTime to 5
We're trying to speed up tests.
2015-06-25 07:52:32 +02:00
Alex Schroeder
c5cf5774aa Renamed subscribe.t to subscriberc.t
Module now matches test file.
2015-06-25 07:30:43 +02:00
Alex Schroeder
8974a8c433 oddmuse-curl.el: display match buffer 2015-06-25 07:25:58 +02:00
Alex Schroeder
d8b2e8f351 portrait.t renamed to portrait-support.t
Now test name matches module name.
2015-06-25 07:25:05 +02:00
Aleks-Daniel Jakimenko
5736d04431 module-popularity: print a table with links 2015-06-14 04:54:06 +03:00
Aleks-Daniel Jakimenko
c9dcd305ed Variables sorted a bit to make more sense 2015-06-14 03:31:51 +03:00
Aleks-Daniel Jakimenko
5c09684f58 Trying to get rid of monstrous declarations on top of the file 2015-06-14 02:21:29 +03:00
Alex Schroeder
205c103efa login.pl no longer translates HTML tags
The module had <ul>, <li>, and the corresponding closing tags marked
for translation. This was removed.
2015-06-02 14:12:48 +02:00
Alex Schroeder
d8ecc5c4e5 near.t renamed to near-links.t
The filename now matches the module name, near-links.pl.
2015-06-02 13:45:18 +02:00
Alex Schroeder
9546156b59 indexed-search.t deleted
It contained tests for search-freetext.pl which has been removed.
It was removed because Search::FreeText is no longer available.
2015-06-02 13:32:29 +02:00
Aleks-Daniel Jakimenko
4abe61ca5f wiki.css: this font is much wider, lets make the font size a little bit smaller 2015-06-02 12:54:02 +03:00
Aleks-Daniel Jakimenko
655c7eb7d6 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-06-01 23:49:23 +03:00
Aleks-Daniel Jakimenko
66e32c54dd russian-utf8.pl: "Comments" looks better than "Comments on this page" 2015-06-01 23:48:23 +03:00
Alex Schroeder
588b91e3f7 use strict and "our" for all the translation files 2015-06-01 22:39:06 +02:00
Alex Schroeder
22b43753d9 smiles.pl: support upsidedown smiley 2015-05-31 22:53:06 +02:00
Alex Schroeder
556b33bdd5 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-05-31 22:35:59 +02:00
Alex Schroeder
e93625680e smiles.pl: support upsidedown smiley 2015-05-31 22:34:47 +02:00
Aleks-Daniel Jakimenko
60d67a87af russian-utf8.pl: Some progress 2015-05-30 16:59:28 +03:00
Aleks-Daniel Jakimenko
6ba0176f44 div-foo.pl: allow numbers in css classes 2015-05-30 03:47:24 +03:00
Aleks-Daniel Jakimenko
00e96d8e65 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-05-29 22:07:03 +03:00
Aleks-Daniel Jakimenko
66be305e41 'journal' class for journal action
Otherwise if you click "More..." it will give you a page that cannot be styled
like a journal (there is just no way to tell that it is a journal from css).
2015-05-29 22:04:29 +03:00
Alex Schroeder
8808f16f8e No longer use URIs as class names
Neither the body tag nor the div created by transclusion will use an
URI as their class.
2015-05-27 18:34:26 +02:00
Aleks-Daniel Jakimenko
f782691e7e UTF-8, again! Also, new ToString sub. 2015-05-17 03:35:35 +03:00
Alex Schroeder
1c0801bd6c private-wiki.t
Added two working tests.
2015-05-15 16:51:37 +02:00
Alex Schroeder
32ab01dae4 :encoding(UTF-8) was changed back to :utf8
This didn't work as intended. Subroutines relying on memory strings such
as PageHtml were not returning any HTML leading to all sorts of
failures (no description items in RSS feeds, for example).
2015-05-15 16:36:16 +02:00
Alex Schroeder
615a78f0b7 static-copy.pl: fix partial change from F to $F
The file writing operations had been only partially changed from F to
$F. Unfortunately, the old code relied on the fact that a file glob like
F was global in scope. To make the change to the file handle variable
more obvious, $F was renamed to $fh and this variable is now passed to
the subroutines StaticFile and StaticHtml.

In addition to that, :encoding(UTF-8) was changed back to :utf8 because
sometimes, this didn't work as intended.
2015-05-15 16:31:47 +02:00
Alex Schroeder
5df789cf51 Silencing malformed UTF-8 character warning
Add use utf8.
2015-05-15 16:28:25 +02:00
Alex Schroeder
2902e9a872 Add forgotten $id parameter to history calls
DoHistory calls DoRawHistory or DoHtmlHistory and needs to pass $id as
a parameter. This fixes the failing tests in t/history.t and
t/namespaces.t.
2015-05-15 15:10:24 +02:00
Alex Schroeder
4388746064 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-05-11 16:50:25 +02:00
Alex Schroeder
dc50e5c814 Log Deletes
File deletion will now write to a dedicated log file.
2015-05-11 16:49:37 +02:00
Aleks-Daniel Jakimenko
179e64f7c8 No double negation 2015-05-11 17:35:47 +03:00
Alex Schroeder
ad0ef6139c Typo in the comments 2015-05-11 16:31:16 +02:00
Alex Schroeder
1c950b705c Improve test in PageMarkedForDeletion
If for some reason it would be possible to not read a file and not
crash, then PageMarkedForDeletion could have marked it as marked for
deletion: $Page{text} =~ /^\s*$/ might have returned true even if
$Page{text} was undefined. Now we test for existence of the key in
addition for just whitespace.
2015-05-11 16:27:48 +02:00
Aleks-Daniel Jakimenko
1fbd097422 There is no more need to do recursive grep-ing
-r was required earlier because we used separate directories to reduce
 the number of files in each directory. That's not the case anymore.
2015-05-08 11:00:03 +03:00
Aleks-Daniel Jakimenko
dd6f2205ec Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-05-04 14:08:56 +03:00
Aleks-Daniel Jakimenko
8a74f92ebb edit-assist.pl: Link to wiki page 2015-05-04 14:08:24 +03:00
Alex Schroeder
37aa9e52d4 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/oddmuse 2015-05-02 22:58:17 +02:00
Alex Schroeder
44a31c1e34 light.css: No longer support edit-paragraph.pl 2015-05-02 22:57:49 +02:00
Alex Schroeder
535dead4b4 light.css: Hexmap without border and white background. 2015-05-02 22:56:56 +02:00
Aleks-Daniel Jakimenko
b823d373b0 test.pl: UTF-8 instead of utf8 (attempt to tests - nope) 2015-05-02 05:18:09 +03:00
Aleks-Daniel Jakimenko
2894a4b381 latex.pl: correct eval usage 2015-05-02 04:19:09 +03:00
Aleks-Daniel Jakimenko
3a57912585 No more undefined map behaviour in scalar context (now in modules) 2015-05-02 04:11:36 +03:00
Aleks-Daniel Jakimenko
4b49c1d326 No more variables declared in conditional statements (in modules) 2015-05-02 04:03:30 +03:00
Aleks-Daniel Jakimenko
37da9c4f2c No more pointless nested subroutines
Fixes the following warning:
"Declaring a named sub inside another named sub does not prevent the
inner sub from being global."
2015-05-02 03:56:04 +03:00
Aleks-Daniel Jakimenko
d83106faa4 No more bareword filehandles in modules 2015-05-02 03:49:07 +03:00
Aleks-Daniel Jakimenko
f3fcf0a176 No more masking of earlier declarations 2015-05-02 03:44:07 +03:00
Aleks-Daniel Jakimenko
26b0853e13 No more two-arg open 2015-05-02 03:19:25 +03:00
Aleks-Daniel Jakimenko
0c0de3b838 Fixed warning about not defined sort behaviour in scalar context
Actually, we don't really care about these functions being called in scalar
context, but I fixed it so that the output of perlcritic is clean.
2015-05-02 00:34:07 +03:00
Aleks-Daniel Jakimenko
a57e296531 No more side effects when modifying $_ in map 2015-05-02 00:27:36 +03:00
Aleks-Daniel Jakimenko
a9d764aa94 No more variables declared in conditional statements 2015-05-02 00:22:43 +03:00
Aleks-Daniel Jakimenko
7b681bc1cd No more bareword filehandles 2015-05-02 00:04:29 +03:00
Aleks-Daniel Jakimenko
5ef2e2f5a9 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-05-01 23:49:14 +03:00
Aleks-Daniel Jakimenko
cd124f9c3a UTF-8 instead of utf8. See [[Refactoring]] for explanation. 2015-05-01 23:47:54 +03:00
Alex Schroeder
fa95f57fd0 oddmuse-curl.el: fixing buffer name issues
I had code in my init file that added an entry to auto-mode-alist for
oddmuse-mode. This resulted in oddmuse-mode being called twice. I'm
locally binding it to nil, now. I also used to call write-file at the
end of oddmuse-edit. This would change the buffer-name after I had
just changed it in oddmuse-mode. Now I'm using basic-save-buffer and
moved the call to oddmuse-mode to the end of oddmuse-edit.
2015-05-01 19:35:52 +02:00
Alex Schroeder
0949b1556d Makefile: move test target up 2015-05-01 19:33:14 +02:00
Alex Schroeder
eb94e8a0d6 search-freetext.pl deleted 2015-05-01 19:18:17 +02:00
Aleks-Daniel Jakimenko
636800a42c Undo the mess and uncry the tears 2015-05-01 13:32:51 +03:00
Alex Schroeder
82e46bc541 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/oddmuse
Conflicts:
	css/wiki.css
2015-04-30 15:02:34 +02:00
Alex Schroeder
4d73a37288 *** empty log message *** 2015-04-30 15:00:37 +02:00
Aleks-Daniel Jakimenko
a8c0ae3e3e Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-30 03:22:04 +02:00
Aleks-Daniel Jakimenko
047288bb53 Splitting huge subroutines (a bit of testing is probably required) 2015-04-30 03:22:04 +02:00
Aleks-Daniel Jakimenko
65dbdc576f wiki.css: max-width for images
Otherwise they blow up to full size.
95% value is arbitrary, maybe we can use calc() from CSS4 or provide a better
size for the surrounding container, hm.
2015-04-29 23:12:25 +03:00
Aleks-Daniel Jakimenko
302141de71 Do not modify $_ in map {} (actual bugs solved, I believe)
$_ is not a copy, it is an alias to the original value.
Therefore modifying it will mess with original list... That's
not what we want most of the time.
Also, using map to s/// two variables does not look right. What
a stupid race to save one line of code.
2015-04-28 02:21:03 +03:00
Aleks-Daniel Jakimenko
a615bedccf Fixed a bunch of stuff 2015-04-28 00:03:11 +03:00
Aleks-Daniel Jakimenko
10ca910c81 nosearch.pl: License notice 2015-04-27 18:20:48 +03:00
Aleks-Daniel Jakimenko
df87ff82c3 No more redundant 'package OddMuse;' 2015-04-27 17:41:59 +03:00
Aleks-Daniel Jakimenko
cdc499fd7a wiki.css: switched to web safe font "Palatino"
Sure, we can use any font on oddmuse.org, but I don't think that we should
treat some random font as the default and/or suggested one.
2015-04-25 06:46:30 +03:00
Aleks-Daniel Jakimenko
4a63d7e4df private-wiki.pl: done! Works great now 2015-04-25 06:17:08 +03:00
Aleks-Daniel Jakimenko
dc97c4c195 private-wiki.t: initial commit, does not work 2015-04-25 06:16:16 +03:00
Aleks-Daniel Jakimenko
8274d9054f wiki.css: whoops, fixed negative padding 2015-04-25 06:02:32 +03:00
Aleks-Daniel Jakimenko
aff58708b3 wiki.css: whitespace consistency 2015-04-25 05:58:57 +03:00
Aleks-Daniel Jakimenko
17234071cf wiki.css: autoindent, removed trailing whitespace 2015-04-25 05:54:07 +03:00
Aleks-Daniel Jakimenko
af2637cb3e wiki.css: Equal padding on gotobar links 2015-04-25 05:51:22 +03:00
Aleks-Daniel Jakimenko
85617ba255 GetHeader was split into GetHeader and GetHeaderDiv 2015-04-25 05:19:21 +03:00
Aleks-Daniel Jakimenko
9cfa86beec Increased password length limit from 50 to 64
Somehow the password form was limiting the number of characters to 50.
Private Wiki Extension relies on passwords that are 64 characters in length,
so I have increased the limit.
2015-04-25 05:00:12 +03:00
Aleks-Daniel Jakimenko
0f1486e4d7 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-24 16:31:36 +03:00
Aleks-Daniel Jakimenko
8b36bd14cb Fixed bug with max page name length, new option $PageNameLimit
It was checking if the number of utf8 characters is <= 120, but obviously utf8
characters could be up to 4 bytes in length. 120*4 is much greater than 255
(which is a limit on lots of file systems), so it attempted to write files
with illegal filenames. This is now fixed.

Additionally $PageNameLimit option was added. Now you can choose max page
name length yourself (which is very useful for extensions like mac.pl or
private-wiki.pl)
2015-04-24 16:26:33 +03:00
Alex Schroeder
e85f3e054b Improve feedback for the password page
If you have no password set, the password page will tell you as much
(instead of saying that it doesn't match).
2015-04-24 09:19:35 +02:00
Alex Schroeder
64aa833e95 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-24 08:50:41 +02:00
Alex Schroeder
bc4c26f26c test.pl: fix typo 2015-04-24 08:47:03 +02:00
Aleks-Daniel Jakimenko
5c47b84714 Splitting AllPagesList into smaller functions
And other small modifications regarding index file
2015-04-23 14:34:13 +03:00
Aleks-Daniel Jakimenko
10fbf17254 Removed debugging code
This key was used instead of using the password
2015-04-22 23:50:58 +03:00
Aleks-Daniel Jakimenko
2089fa60ea Regenerated russian translation 2015-04-21 23:05:15 +03:00
Aleks-Daniel Jakimenko
dbcc6d1459 "secure" and "httponly" flags for cookies (improved security)
These flags are essential for security. The problem we are trying to
solve is the following:
1) you visit a wiki using HTTPS and you set your password.
2) you accidentally visit the same website using plain HTTP
3) although you don't notice, your cookies are sent over the insecure
connection.
Even if that website has redirection, even it denies any insecure
traffic, your cookie is still leaked. That's how cookies work.

"secure" and "httponly" flags solve this. It means that these cookies
will only be sent over a secure connection. If you have set your
password using HTTPS and later you visit the same wiki using plain HTTP,
it will look like you are not logged in (because these cookies will not
be used when you access the website using a non-secure connection).

If you have HTTPS on your website -- ALWAYS make sure that you set your
password using it. Alternatively redirect all non-secure requests to
HTTPS - that's even better.

If you set your password using HTTP, the same cookie will be used for
both HTTP and HTTPS requests - this is done for compatibility with
HTTP-only wikis.

$ENV{'HTTPS'} returns 'on' or empty string. 'on' is truthy so it
should not create any problems, we can safely use it.

I've tested this, it works as expected.
2015-04-20 23:13:26 +03:00
Aleks-Daniel Jakimenko
b08a017a80 New module: private-wiki.pl (encrypt all data on the server) 2015-04-19 23:54:46 +03:00
Aleks-Daniel Jakimenko
195ed322d3 Another place where GetKeepDir should be used 2015-04-18 18:14:01 +03:00
Aleks-Daniel Jakimenko
864ba25b5b GetKeepFile chandged to use GetKeepDir (no duplicate logic) 2015-04-18 17:52:53 +03:00
Aleks-Daniel Jakimenko
5b731a61df No more trailing whitespace (I can do it, I can do it!) 2015-04-17 01:45:11 +03:00
Aleks-Daniel Jakimenko
7112f1c170 No more trailing whitespace (this time for sure) 2015-04-17 01:43:19 +03:00
Aleks-Daniel Jakimenko
c7bd5617ff No more trailing whitespace 2015-04-17 01:39:47 +03:00
Aleks-Daniel Jakimenko
892d352b9e webdav.pl: Hide 'once' warnings
Without this it throws warnings like 'Name "OddMuse::ScriptName" used only once'.
It is unclear whether these warnings make any sense. We will hide them for now.
2015-04-14 23:36:58 +03:00
Aleks-Daniel Jakimenko
fafb051632 intermap class 'page' clashes with journal pages. Therefore, 'page' -> 'interpage'
While this is not critical and could be worked around using more complex
css selectors, it would be much better if such thing was elimanated completely.
2015-04-13 11:38:35 +03:00
Alex Schroeder
39b8439371 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-13 07:59:57 +02:00
Alex Schroeder
e703a3ca89 webdav.pl: Add "if $verbose" to two warnings 2015-04-13 07:59:00 +02:00
Aleks-Daniel Jakimenko
17b2562054 No more "*Sub = *NewSub", \&NewSub used instead. (Completely now!) 2015-04-12 22:50:50 +03:00
Alex Schroeder
79da6c19aa fix portrait.t
The test hung because it used the following:

*ApplyRules = *OldTocApplyRules;
*RunMyRules = *RunMyRulesTocOld;

But recent changes in the modules make it necessary to use the "new"
style:

*ApplyRules = \&OldTocApplyRules;
*RunMyRules = \&RunMyRulesTocOld;
2015-04-12 18:54:23 +02:00
Aleks-Daniel Jakimenko
40ec24349a No more "*Sub = *NewSub", \&NewSub used instead. (Partial progress) 2015-04-11 23:41:33 +03:00
Alex Schroeder
f09bffb417 wiki.css: change the font-face order 2015-04-10 23:34:12 +02:00
Alex Schroeder
d8129c16dd Merge commit '6f8d281d7984e05edee03b0a04bf7b2be98555ac' 2015-04-10 17:24:24 +02:00
Alex Schroeder
9529850a08 Fix the statix-copy test after the CSS change
The change of the default CSS file caused a test to fail. In order to
fix the test, the new CSS file has to be installed as
http://www.oddmuse.org/default.css.
2015-04-10 17:20:15 +02:00
Alex Schroeder
44f66dbed6 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-10 17:12:15 +02:00
Alex Schroeder
472e8c5e73 cal3.pl deleted 2015-04-10 17:10:43 +02:00
Aleks-Daniel Jakimenko
6f8d281d79 No more "use vars"! 2015-04-10 13:31:28 +03:00
Aleks-Daniel Jakimenko
5acb280d27 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-10 11:50:08 +03:00
Aleks-Daniel Jakimenko
391eb1a222 module-popularity: save links for each module 2015-04-10 11:49:29 +03:00
Alex Schroeder
994de81c41 edit-paragraphs.pl: Fix bad filename in module description 2015-04-10 08:36:26 +02:00
Alex Schroeder
555bec1bdf The Oddmuse style sheet is now the default
All sites without a style sheet will now use the style sheet we used for
oddmuse.org.
2015-04-09 21:43:52 +02:00
Alex Schroeder
e7c77a7b0e Fix permissions for tests 2015-04-06 21:00:58 +02:00
Alex Schroeder
21d8ab6089 Move strip.pl to the right directory
It belongs with other near-links oriented files.
2015-04-06 20:57:35 +02:00
Alex Schroeder
238aa0778b Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-06 20:52:07 +02:00
Alex Schroeder
55c17249bd Moved the near site search proxies into directory
moin-search.pl, phpwiki-search.pl and usemod-search.pl were moved into a
new directory, modules/near-links, because they help support search of
near sites. They act as proxies, parsing the HTML and returning a file
format Oddmuse can understand.

See http://oddmuse.org/wiki/Near_Links#Searching_Near_Sites for more
information.
2015-04-06 20:49:39 +02:00
Aleks-Daniel Jakimenko
5d86d9aace pygmentize.pl: @KnownLocks and @MyInitVariables added to our 2015-04-06 04:08:29 +03:00
Aleks-Daniel Jakimenko
a305782062 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-04 23:13:23 +03:00
Aleks-Daniel Jakimenko
655f6bc6e3 Missing wiki links 2015-04-04 23:12:55 +03:00
Alex Schroeder
0db6f8e731 Moved ln.txt to the testing feeds 2015-04-03 10:45:37 +02:00
Alex Schroeder
3d85c07270 Moved the RSS files into a test subdirectory 2015-04-03 10:43:48 +02:00
Alex Schroeder
074450ce2f Moving more scripts into subdirectories 2015-04-03 10:39:22 +02:00
Alex Schroeder
d69e24f473 Moving more scripts into subdirectories 2015-04-03 10:30:13 +02:00
Alex Schroeder
a97f6baadf Makefile treats month-names-*.pl differently
Since these files are no longer in modules/ but in
modules/translations, something had to be done.
2015-04-03 09:21:37 +02:00
Alex Schroeder
50f4901cac Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-03 09:15:15 +02:00
Alex Schroeder
4156e34c1f pygmentize.pl: register lock 2015-04-03 09:14:04 +02:00
Aleks-Daniel Jakimenko
0c5ca9d432 headers.pl: no whitespace in $RuleOrder{...} for consistency and easier parsing 2015-04-03 01:35:46 +03:00
Alex Schroeder
d8fba591d5 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-02 23:24:29 +02:00
Alex Schroeder
2045d2471a raw.t uses new location of raw.pl 2015-04-02 23:24:14 +02:00
Alex Schroeder
b25135eeef oddmuse.css: equal padding on gotobar links 2015-04-02 23:22:22 +02:00
Alex Schroeder
115145017a More files moved to contrib and scripts
Also, added README files.
2015-04-02 23:14:10 +02:00
Alex Schroeder
cdb00faf65 Move raw.pl to scripts 2015-04-02 23:06:01 +02:00
Alex Schroeder
5e2d20ecdb Moved many files to scripts or contrib
These files were cluttering up the root directory.
2015-04-02 22:54:48 +02:00
Alex Schroeder
1b9183311c GetHiddenValue no longer sets the parameter.
Why does GetHiddenValue act like SetParam? There seems to be no reason
to do it, so I'm removing this call.
2015-04-02 22:46:00 +02:00
Alex Schroeder
199dd9cd63 Edit conflict involving Preview are now fixed
We had a problem in the following situation: User A starts editing a
page at t1. This timestamp is stored in a the parameter oldtime. In the
meantime user B edits and saves the same page at t2. If user A saves,
the changes will be merged. If user A previews and saves later, the
changes would not be merged because the preview changed oldtiem from t1
to t2. This commit makes sure that the an oldtime parameter is prefered
over the actual page timestamp.
2015-04-02 22:22:40 +02:00
Alex Schroeder
0b5ccf0bb3 t/test.pl xpath functions now return lists
xpath_do now returns a list of results if you're calling it in list
context. This will work, for example:

my ($ts, $title, $text) = xpath_test($page,
				     '//input[@name="oldtime"]/attribute::value',
				     '//input[@name="title"]/attribute::value',
				     '//textarea[@name="text"]/text()');
2015-04-02 21:46:49 +02:00
Alex Schroeder
a256edb54f conflict.t: Test for preview loosing oldtime parameter
We suspected that this is what prevents decent merging on oddmuse.org.
2015-04-02 21:26:18 +02:00
Alex Schroeder
00de66780a info-ref: No more $Id$ 2015-04-02 20:46:09 +02:00
Alex Schroeder
fb1507b6da pygmentize.pl: add our $TempDir 2015-04-02 10:46:54 +02:00
Aleks-Daniel Jakimenko
fd026eda27 pygmentize.pl: @PygmentizeArgs option 2015-04-02 04:59:35 +03:00
Aleks-Daniel Jakimenko
32568bc3d0 module-updater.pl: fixed a problem with unicode 2015-04-01 17:55:48 +03:00
Aleks-Daniel Jakimenko
8edf8e0c4e Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-04-01 01:07:02 +03:00
Aleks-Daniel Jakimenko
be44cc74c7 New module: pygmentize.pl (syntax highlighting) 2015-04-01 01:05:55 +03:00
Alex Schroeder
e67e519efa Copyright year 2015-03-30 22:15:31 +02:00
Alex Schroeder
88f472b4a3 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-03-30 22:11:05 +02:00
Alex Schroeder
1d1ab00fb8 anchors.pl supports redirection 2015-03-30 22:09:45 +02:00
Aleks-Daniel Jakimenko
88aac79df3 It is not that weird anymore! *Sub = *NewSub changed to *Sub = \&NewSub
We have just read-TFM and figured out that we can use \&Sub. This way it
passes "use strict" but produces a warning with "use warnings" (the
warning is "Subroutine package::Sub redefined at ...").

We can "fix" it with "no warnings 'redefine'"
2015-03-30 09:58:33 +03:00
Alex Schroeder
ab91ceece4 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-03-30 00:52:21 +02:00
Alex Schroeder
7f3e1592fc weblog-3.pl: Move $CategoryInit up 2015-03-30 00:47:19 +02:00
Alex Schroeder
6ae8b3c9b1 surge-protection.t: Fix number of tests
Like big-brother.t, the number of tests was off because
$SurgeProtectionViews has increased.
2015-03-30 00:44:12 +02:00
Alex Schroeder
4df99dc798 Banning modules use our instead of my
All the banning modules have a problem. They use code like the
following:

*StrangeOldBannedContent = *BannedContent;
*BannedContent = *StrangeNewBannedContent;

The code above changes both the sub and the variable. $BannedContent now
points to $StrangeNewBannedContent (which is undefined) and the name of
the Banned Content page is only accessible via $StrangeOldBannedContent.
If we copy $StrangeOldBannedContent to $BannedContent, everything else
will keep working.

$BannedContent = $StrangeOldBannedContent;

But now use strict will not work. When we tried this:

my $StrangeOldBannedContent; # use strict

Then BannedContent disappeared from the admin page as shown by the tests
in strange-spam.t; the correct solution uses our instead of my.

I'm not sure why.
2015-03-30 00:29:39 +02:00
Aleks-Daniel Jakimenko
95c8c6b39d Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-03-30 01:23:54 +03:00
Alex Schroeder
e664529904 big-brother.t: fix number of tests
The tests themselves didn't change.
2015-03-30 00:21:13 +02:00
Alex Schroeder
a8ea996232 markup.pl: fix issue that caused test to fail
The hashref for the attributes cannot be undefined. Use {} instead of
undef.
2015-03-30 00:20:27 +02:00
Aleks-Daniel Jakimenko
8f7fe86e63 static-hybrid.pl uses strict
It looks like a typo. This line looked like this right from the start.
2015-03-30 01:20:20 +03:00
Alex Schroeder
fbeea18137 Deleted t/balanced-page-directories.t
The module was deleted a little while ago.
2015-03-29 23:57:27 +02:00
Alex Schroeder
f23a2451a0 weblog-4.pl uses strict
The reference to %Categories was a copy and paste error from
weblog-3.pl.
2015-03-29 23:53:39 +02:00
Alex Schroeder
0f3c0c2717 weblog-3 uses strict
$CategoryInit prevents CategoryInit from running multiple times in a
mod_perl setup.
2015-03-29 23:46:26 +02:00
Alex Schroeder
432ad81993 sistersites.pl uses strict
Like in index.pl, we need to assign $match from the parameter, first.
2015-03-29 23:44:34 +02:00
Alex Schroeder
074d28aabf weblog-2.pl uses strict
Use GetId to determine $id.
2015-03-29 23:42:09 +02:00
Alex Schroeder
037f1aa009 simple-rules.pl uses strict
Variables which are essentially global and which contain state are
localized before they are set. In order to localize them, they have to
be declared here using vars, first.
2015-03-29 23:31:13 +02:00
Alex Schroeder
c3cb47e040 pdf.pl uses strict
PdfNewGetFooterLinks shows that @NoLinkToPdf is simply a list of pages
that should not offer a PDF link at the bottom. Authors can add their
own exceptions to PdfNewGetFooterLinks, I guess, but in order to do
this from your config file, use vars.

createPDF needs $id as a parameter in order to use it. This code
worked before because the calling context was missing a my $id and
thus $id ended up being a global variable.
2015-03-29 23:27:00 +02:00
Alex Schroeder
19d0a2a2df questionasker.pl ready for use strict
GetEditForm uses the second parameter to indicate that it's an upload.
We need to pass it via to QuestionAddTo if we want to use it there.
2015-03-29 23:21:14 +02:00
Alex Schroeder
1921487999 upgrade.pl uses strict
DoUpgrade is an alias for DoBrowseRequest which doesn't get $id as a
first parameter like many actions do. Therefore determine $id like
DoBrowseRequest does: call GetId.
2015-03-29 23:18:07 +02:00
Alex Schroeder
87a576271d namespaces.pl uses strict
Apparently whatever prevented this from working has been fixed in the
mean time.
2015-03-29 23:15:35 +02:00
Àngel Moreno
3a555f1cff catalan-utf8.pl is new
Downloaded from
http://usuaris.tinet.cat/amoreno/wiki/Wiki
2015-03-29 22:47:41 +02:00
Alex Schroeder
cfc811c2e0 recaptcha.pl uses strict
Same fix as for gd_security_image.pl.
2015-03-29 17:53:08 +02:00
Alex Schroeder
e27222374e strange-spam.pl uses strict 2015-03-29 17:50:51 +02:00
Aleks-Daniel Jakimenko
27233886bc Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-03-29 18:45:40 +03:00
Aleks-Daniel Jakimenko
24f0590f7c not-found-handler.pl uses strict 2015-03-29 18:45:14 +03:00
Alex Schroeder
123257d58d near.t add test to prove new near-links.pl 2015-03-29 17:38:06 +02:00
Alex Schroeder
47b7d205fa near-links.pl uses strict
This should also fix the searching for Near Pages which apparently
didn't work.
2015-03-29 16:46:20 +02:00
Alex Schroeder
d99f945656 Deleted nearlinks.pl
modules/near-links.pl is the real thing. This file is garbage.
2015-03-29 16:43:45 +02:00
Alex Schroeder
5d03331bb3 multi-url-spam-block uses strict 2015-03-29 16:36:51 +02:00
Alex Schroeder
06468e4310 markdown.pl deleted
This code was hard to maintain because it uses the actual markup code
and replaced a lot of Oddmuse machinery. Just use markdown-rule.pl
instead if you need it.
2015-03-29 15:43:50 +02:00
Alex Schroeder
c48a45d0b4 logbannedcontent.pl uses strict
Uses the same code and comment as banned-regexps.pl
2015-03-29 15:17:13 +02:00
Alex Schroeder
0f736b2a1c mac.pl actually uncomment use strict 2015-03-29 15:16:57 +02:00
Alex Schroeder
f9c7746956 list-banned-content uses strict
This should now correctly list pages banned due to BannedContent.
Previously, there was a stray variable $str instead of the actual page
content being matched.
2015-03-29 15:13:38 +02:00
Alex Schroeder
60561397aa link-all uses strict
Get rid of $IndexInit from UseMod days.
2015-03-29 15:07:37 +02:00
Alex Schroeder
671f71d9f8 mac.pl uses strict
Also get rid of $IndexInit from UseMod days.
2015-03-29 15:06:57 +02:00
Alex Schroeder
1c32e0d45c latex.pl uses strict
This should make sure that we do in fact run the cleanup code even if
an error occured. Also, whitespace changes because it was a pain to
read.
2015-03-29 14:56:52 +02:00
Alex Schroeder
ea15f107d7 journal-rss.pl uses strict
Should fix filtering by language, too.
2015-03-29 14:35:59 +02:00
Alex Schroeder
d45bd85ed1 index.pl uses strict
This should also fix the use of the 'match' parameter.
2015-03-29 14:27:52 +02:00
Alex Schroeder
5ad5ad265a Make creole.pl use strict 2015-03-29 14:22:52 +02:00
Alex Schroeder
da4de5acfc Deleted balanced-page-directories.pl
This module was deprecated. Oddmuse no longer disperses page data files
into 27 directories based on the first character of the page name. The
directories used to be "A" to "Z", and "other". If you uses your wiki as
a blog, all the pages starting with a date ended up in "other". If your
page names started with letters other than "A" to "Z", all the pages
ended up in "other". If you were using comment pages, all your comment
pages ended in "C". This module was intended to create more
subdirectories and spread them more evenly. This is no longer necessary,
as the typical filesystem's performance no longer degrades with tens of
thousands of files in a directory. I'm assuming most Oddmuse hosts to
use some form of GNU/Linux with ext3 or ext4 with dir_index option.
2015-03-29 13:45:03 +02:00
Alex Schroeder
46a1e974f7 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-03-29 13:42:37 +02:00
Alex Schroeder
aebacdfb4a Moved the month-names into translations subdir 2015-03-29 13:33:13 +02:00
Aleks-Daniel Jakimenko
0e9288b41d Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-03-28 18:28:52 +02:00
Aleks-Daniel Jakimenko
52809c6164 atom.pl ready for use strict 2015-03-28 18:28:33 +02:00
Alex Schroeder
f26164a432 joiner.pl is ready for use strict. 2015-03-28 17:20:03 +01:00
Alex Schroeder
6965f604e8 Make hibernal.pl ready for use strict. 2015-03-28 17:17:55 +01:00
Alex Schroeder
1e5fe85253 gravatar.pl ready for use strict
Looks like a simple typo.
2015-03-28 16:45:10 +01:00
Alex Schroeder
890e0fd7ec gd_security_image.pl ready for use strict
GetEditForm uses the second parameter to indicate that it's an upload.
We need to pass it via NewGdSecurityImageGetEditForm to
GdSecurityImageAddTo if we want to use it there.
2015-03-28 16:38:52 +01:00
Alex Schroeder
7367b759b3 edit-cluster.pl ready for use strict 2015-03-28 16:24:33 +01:00
Alex Schroeder
e38e5d4d97 Delete debug.pl
Nobody uses it and debugging usually needs more specific code.
2015-03-28 16:18:10 +01:00
Alex Schroeder
c990dff747 Deleting config.pl
DoConfig was implemented but DoClone was not; these days it makes more
sense to simply use a source repository to share wiki configurations.
2015-03-28 16:14:43 +01:00
Alex Schroeder
1580e3ad25 clustermap.pl fit for use strict 2015-03-28 16:11:03 +01:00
Alex Schroeder
90d4253811 Removed beautify.pl
The Beautifier::Core library is not available from CPAN.
The beautifier.org website is not longer available.
The sources are still on Source Forge but it seems clear that this is a
dead end.
2015-03-28 15:46:51 +01:00
Alex Schroeder
ada41ef14f Use strict
Added a comment to explain these lines.

my $RegexpOldBannedContent;
*RegexpOldBannedContent = *BannedContent;
*BannedContent = *RegexpNewBannedContent;
$BannedContent = $RegexpOldBannedContent;
2015-03-28 15:22:45 +01:00
Alex Schroeder
e9c9b9c65d anchors.pl: get rid of $free
This was a strange variable that wasn't set anywhere. At the same time,
we fixed the title attribute for bracket links like this: [1].
2015-03-28 14:55:25 +01:00
Alex Schroeder
46a5a32348 webdav.pl replace Perl license with GPL
According to http://dev.perl.org/licenses/ the Perl license is either
the GPL or the Artistic license. We'll pick the GPL so that it matches
the rest of Oddmuse.
2015-03-28 14:36:13 +01:00
Alex Schroeder
a3d69ae8c6 vcard.pl added license 2015-03-28 14:24:26 +01:00
Alex Schroeder
a3334f41ab edit-cluster.pl: add missing license 2015-03-28 14:16:17 +01:00
Alex Schroeder
026478b1f0 mail.pl: added missing licence 2015-03-28 14:12:26 +01:00
Alex Schroeder
572e9c899c Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-03-27 13:24:56 +01:00
Alex Schroeder
d595409c41 Get rid of extra $revision
Both despam.pl and static-hybrid.pl print a useless $revision at the
very end. This was removed.
2015-03-27 13:22:17 +01:00
Aleks-Daniel Jakimenko
e61eaf26cb Merge branch 'use-strict-in-modules' 2015-03-27 13:33:13 +02:00
Alex Schroeder
09697fba23 Merge commit '5e4426b' 2015-03-27 12:12:47 +01:00
Aleks-Daniel Jakimenko
812742a856 weblog-1.pl: $RefererTracking is a leftover from back when referrer tracking was part of the core. 2015-03-27 12:59:09 +02:00
Aleks-Daniel Jakimenko
d84d0c6b9b mail.pl: There is no reason to have module-global %h 2015-03-27 12:58:53 +02:00
Alex Schroeder
5e4426b9c8 Deleted thread.pl module 2015-03-27 11:44:54 +01:00
Aleks-Daniel Jakimenko
4492ede096 "use strict;" in modules (some modules have problems) 2015-03-27 03:01:01 +02:00
Aleks-Daniel Jakimenko
cb8c7a1234 NoMoreWikiWordsByDefault 2015-03-22 14:33:39 +02:00
Aleks-Daniel Jakimenko
4991910ee8 "1 days" -> "1 day" 2015-03-19 14:04:13 +02:00
Aleks-Daniel Jakimenko
e9bde11993 calendar.pl: no more annoying space delimiters in links 2015-03-19 04:02:40 +02:00
Alex Schroeder
66972c4dc4 markup.pl: fix corner cases for markup pairs
Some support for corner cases was added, including tests. Now it should
be possible to write the following without the code triggering:

"foo*bar is not ** foo bar" -- this should no longer be bold.
2015-03-17 07:48:29 +01:00
Alex Schroeder
ae6a6c1f05 all.pl: our $Monolithic
Using 'our' allows other modules to refer to this variable as well.
image.pl will now generate a local link, for example.
2015-03-17 07:15:41 +01:00
Alex Schroeder
089630a1e1 namespaces.pl: remove $Monolithic
This option is never set and even it was set (in the old days it
indicated that the entire wiki was going to be exported as a single
file), then I don't see why that should prevent namespaces from
working.
2015-03-17 07:13:44 +01:00
Aleks-Daniel Jakimenko
d4ff3072e2 New module imagify.pl (render text with imagemagick and display it as an image) 2015-03-14 05:07:02 +02:00
Aleks-Daniel Jakimenko
fd4ceb681c module-popularity: Sort similar modules alphabetically 2015-03-11 04:32:43 +02:00
Aleks-Daniel Jakimenko
820ab7f53f A simple script to gather stats about the usage of each module
Also, a new directory 'scripts' is created. I suggest to move
all other scripts to this directory
2015-03-11 04:25:25 +02:00
Aleks-Daniel Jakimenko
6d7892db73 Increased $SurgeProtectionViews from 10 to 20.
10 is just too low. For wikis with css page it means that you can only
fetch about 5 pages in 20 seconds.
I've seen my users complain about that limit and I've seen it myself
too many times.
Doubling the $SurgeProtectionViews should make it more sane.
2015-03-07 23:09:06 +02:00
Alex Schroeder
01086ab8e0 search.t: test whether replacement field is shown
Only admins should see the Replace text field.
2015-03-07 08:52:02 +01:00
Alex Schroeder
b55a5bc5fb Show replace only after a search 2015-03-06 13:17:40 +01:00
Alex Schroeder
7e72eaa6bd Get rid of $ReplaceForm
The old code decided whether the show the replacement field as part of
DoSearch and set $ReplaceForm. By that time, GetHeader had already
called GetSearchForm, so it was too late. I'm not sure why the
variable was necessary in the first place and so I'm removing it
entirely.

grep ReplaceForm *.pl modules/*.pl t/*.t comes up empty, now.
2015-03-06 11:24:26 +01:00
Alex Schroeder
022fd7bffc Set $StyleSheetPage to 'css' in test files
This setting was recently removed from wiki.pl, which caused these tests
to fail. Tests affected: css.t, balanced-page-directories.t.
2015-03-06 10:11:47 +01:00
Alex Schroeder
a09eea3984 wiki.pl: updated copyright years 2015-03-06 10:08:14 +01:00
Alex Schroeder
dd8c59d634 upload.t: removed spurious exit
This gets rid of the warning "Looks like you planned 12 tests but ran
4."
2015-03-06 10:06:08 +01:00
Aleks-Daniel Jakimenko
d8d37eb65c Merge branch 'refactoring-no-return-undef' 2015-03-06 02:20:47 +02:00
Alex Schroeder
fa7cf6226c $StyleSheetPage should be empty by default 2015-03-02 16:04:33 +01:00
Aleks-Daniel Jakimenko
62c7553d82 'return undef' changed to 'return'
This command was used:
find . -type f -print0 | xargs -0 sed -i 's/return undef/return/g'

The idea behind this commit is described on http://oddmuse.org/wiki/Refactoring page.
In short: 'return undef' returns (undef) in list context (a list with one element),
which is wrong.
2015-02-27 12:10:18 +02:00
Alex Schroeder
b5c30a5fdc Merge branch 'master' of github.com:kensanata/oddmuse 2015-02-23 08:21:22 +01:00
Alex Schroeder
8139036d82 Initial commit 2015-02-23 08:12:42 +01:00
Alex Schroeder
b1d39e3195 tables-long.pl: fix tracking of dirty blocks 2015-02-05 09:21:04 +01:00
Alex Schroeder
48a00a6ff6 rss.t: testing multiple feeds on a page 2015-02-05 08:30:12 +01:00
Alex Schroeder
a3ee3c60ce Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-02-04 22:30:29 +01:00
Matt Adams
d69063599e logout.pl: link back to the last page after logout
Users who currently use the back button to return to the previous page
after logging in or logging out need to select it more than once and are
often return to a cached version of the page they were previously
viewing instead of one that reflects an updated cookie state. The only
other option currently available to the user is to re-navigate to the
page which they wish to view (likely the previous page).

This change improves the usability of the logout functions by providing
a link to return to the previous pages after logging in or logging out.
Previous pages are returned without cache.
2015-02-04 19:09:44 +01:00
Alex Schroeder
0146225c4f Fix whitespace in message to match up with last commit. 2015-02-04 19:06:29 +01:00
Matt Adams
50fca72f82 Password action (login) has link back to last page. 2015-02-04 19:04:34 +01:00
Alex Schroeder
1a4e6aa527 Submit empty comment no longer wipes comment page. 2015-02-03 10:50:49 +01:00
Alex Schroeder
cdf8b561a6 Fix summary for uploaded files.
The summary for uploaded files had nested p elements; this was
removed. When no summary is provided, we now remove the "#FILE..."
stuff. In this case, no summary is better.
2015-02-01 00:26:43 +01:00
Alex Jakimenko
905d8c930e Fixed recently introduced XSS vulnerability 2015-01-31 20:50:26 +02:00
Matt Adams
f64c6d470b logout.pl: Provide login link if not logged in. 2015-01-31 16:13:01 +01:00
Matt Adams
0657d84769 Show latest summary when displaying uploaded files 2015-01-31 12:57:52 +01:00
Matt Adams
0181d8b944 hiddenpages.pl: stop breaking search & recent changes 2015-01-30 16:42:25 +01:00
Alex Schroeder
fae5f1e345 replacements: fixed recently introduced bug
The recently introduced code to prevent Perl injection broke repeated
replacements with backreferences.
2015-01-25 09:06:22 +01:00
Alex Schroeder
81b179acac search: fixed handling of missing grep
When closing the pipe to grep, check the status returned by the child
process in $? and return all pages if there was an error (which means
that grep did not filter any pages).
2015-01-25 08:40:07 +01:00
Alex Jakimenko
bc810ee0ce Fixed vulnerability (ugly, but works) 2015-01-25 08:09:07 +02:00
Alex Jakimenko
3a4236bc45 div-foo.pl: syntax for setting the "title" attribute; /x in regexes
The syntax is <class1 class2?My title stuff> ... </>
2015-01-25 06:03:20 +02:00
Alex Jakimenko
8642ae63a2 module-updater.pl: unnecessary () in sub declaration 2015-01-25 05:59:52 +02:00
Alex Jakimenko
3c5373f76b image.pl: It is already quoted, no need to quote it again. 2015-01-25 05:53:40 +02:00
Alex Schroeder
58e297b092 long-tables.pl: $rownum replaces $first and $odd
Updated tests, too.
2015-01-19 20:03:46 +01:00
Matt Adams
cd4f6dc64c tables-long.pl: add a class for even and odd rows 2015-01-19 19:45:14 +01:00
Alex Schroeder
5a112b64b3 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-01-19 10:06:19 +01:00
Alex Schroeder
a7b0c661c8 big-brother.pl: Remove password parameters.
Make sure admins and editors don't accidentally leave their passwords on
the Recent Visitors page.
2015-01-19 10:02:34 +01:00
Alex Schroeder
b2f9a0044b ParseData: Reverting to the code from 2006.
As explained on my blog
<https://alexschroeder.ch/wiki/2015-01-13_Handwritten_Optimization>,
the current implementation is "suddenly" very slow. This is specially
noticeable when loading large pages. Without quite understanding how
this is possible, I'm reverting to the old implementation.
2015-01-13 15:32:37 +01:00
Alex Schroeder
d0cdd451e4 oddmuse-2014.css: Add Symbola for smileys. 2015-01-13 13:11:26 +01:00
Alex Schroeder
86334d6532 Summary: tags.pl delete unnecessary calls to write hash
When running TagFind and TagCloud, writing the tag file is not
necessary. This is the result of a search and replace operation that
assumed every DB_File untie is equivalent to a write operation. This
is not true.
2015-01-09 17:09:56 +01:00
Alex Schroeder
733752727d tags.pl: Fixed error reporting for reindex action. 2015-01-09 17:00:43 +01:00
Alex Schroeder
6635803807 tags.pl: Use real lists instead of strings
The strings used to be concatenated elements using $FS as the
separator. Now they are references to lists.
2015-01-08 01:04:46 +01:00
Alex Schroeder
7f3488baaa tags.pl: Fixed tests, fixed bugs. 2015-01-08 00:37:37 +01:00
Alex Schroeder
dcc318f34e tags.pl: Switch from DB_File to Storable
The drawback will be that the entire tag database including all the
backlinks will be stored in a hash. On my wiki with 5799 pages the
tag.db file is just 333K so it’s not too bad.
2015-01-08 00:03:29 +01:00
Alex Schroeder
17edc1c523 namespaces.pl: add match to @NamespaceParameters
When using $MatchingPages = 1, the following URL would is a
possiblity:
https://campaignwiki.org/wiki/Adventures?search=&match=dung&dosearch=Go%21

In this situation, "Adventures" needs to be the namespace. The
'search' parameter is ignored and the script needs to react to
'match'.
2015-01-07 15:16:09 +01:00
Alex Schroeder
85912f211b add-link.pl: use https 2015-01-05 15:13:04 +01:00
Alex Schroeder
52d7239400 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/oddmuse 2015-01-05 14:57:18 +01:00
Alex Schroeder
9c691e5b9b add-link.pl: How to add entries to wikis.
These two wikis work as public bookmarking sites. This script allows
easy addition of links.

https://campaignwiki.org/wiki/LinksToWisdom/
https://campaignwiki.org/wiki/Adventures/
2015-01-05 14:57:05 +01:00
Alex Schroeder
0e45ea2e99 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-01-04 11:19:43 +01:00
Alex Schroeder
8773242dba Add support for zh-cn and zh-tw 2015-01-04 11:18:05 +01:00
Alex Schroeder
267cd53adb Update CSS files for emacswiki.org 2014-12-18 14:16:27 +01:00
Alex Schroeder
ce82a328b6 edit-paragraphs: fix $around parameter
In bullet lists, the $around parameter would overshoot. The link would
say around=20, for example, when in fact the correct value would be
around=18. It would add the "* " of the next list item, apparently. The
edit link would still look good because the test we're using is
"$EditParagraphs[0]->[1] <= $pos" -- but if we then don't set "$pos =
$EditParagraphs[0]->[1]" it won't help as we'll get a "Could not
identify the paragraph you were editing" error as soon as we try to edit
with around=20 instead of around=18.
2014-12-10 09:05:14 +01:00
Alex Schroeder
b925805800 edit-paragraphs.t: more tests
Unsuccessfully trying to find a bug by adding more tests.
But then again, more tests is good, so they'll stay.
2014-12-10 08:19:59 +01:00
Alex Schroeder
c8c50b4e81 Merge commit '8ec456e'
Conflicts:
	modules/upgrade.pl
2014-12-09 12:22:22 +01:00
Alex Schroeder
4a976278d5 alex-2014.css: better printing 2014-12-09 12:16:43 +01:00
Alex Schroeder
1255fe8168 Updated tests for ad/spans-and-divs branch. 2014-12-09 09:16:12 +01:00
Alex Schroeder
081e8243d7 Merge branch 'ad/spans-and-divs' 2014-12-09 03:02:34 +01:00
Alex Schroeder
a20fc60617 Merge branch 'as/search-form-rewrites'
Conflicts:
	css/alex-2014.css
2014-12-09 02:59:32 +01:00
Alex Schroeder
770de2986a edit-paragraphs.pl: handle page names containing & 2014-12-09 02:56:23 +01:00
Alex Schroeder
0551018de1 light.css: iPhone changes 2014-12-04 16:19:15 +01:00
Alex Schroeder
aa77f2ce2f Simplify DoSurgeProtection 2014-12-03 08:41:37 +01:00
Alex Schroeder
471994f7b1 Merge branch 'as/search-form-rewrites' of git.sv.gnu.org:/srv/git/oddmuse into as/search-form-rewrites
Conflicts:
	modules/edit-paragraphs.pl
2014-12-03 08:37:39 +01:00
Alex Jakimenko
9d2c0216f6 top gotobar and search form is now wrapped into 'menu' div (might break existing stylesheets) 2014-12-02 21:34:04 +02:00
Alex Jakimenko
82d888f0ea divs instead of <br> tags (might break existing stylesheets) 2014-12-02 21:06:53 +02:00
Alex Schroeder
ccaf283204 edit-paragraphs.pl: handle </p>\s*</form> 2014-11-30 01:22:45 +01:00
Alex Schroeder
3fb5319562 Merge branch 'as/search-form-rewrites' of ssh://git.sv.gnu.org/srv/git/oddmuse into as/search-form-rewrites 2014-11-26 12:24:18 +01:00
Alex Schroeder
76c92f027c edit-paragraphs.pl: handle empty rows 2014-11-26 12:08:38 +01:00
Alex Schroeder
d828454511 Merge branch 'as/search-form-rewrites' of git.sv.gnu.org:/srv/git/oddmuse into as/search-form-rewrites 2014-11-25 23:41:08 +01:00
Alex Schroeder
34c6e93780 Fake action for search and match.
A test for the action in GetRobots makes sure that the robots meta
element gets a NOINDEX if the action is not "browse". Since the
default is "browse", this means we need to set an action for
search=foo and match=foo.
2014-11-25 19:34:38 +01:00
Alex Schroeder
0a6f473098 alex-2014.css: don't hide all the input fields 2014-11-25 17:01:31 +01:00
Alex Schroeder
4d67f9bfd2 oddmuse-2014.css: new CSS file 2014-11-25 09:09:31 +01:00
Alex Schroeder
6e80adc293 alex-2014.css: iPhone adaptation
Depending on the number of visible fields, the form requires a submit button.
Instead of using display:none, use visibility:hidden;position:absolute in order
to "fix" this for the iPhone.

See:
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form
2014-11-25 08:21:49 +01:00
Alex Schroeder
dc3fb65317 light.css: adapting to search form 2014-11-24 22:55:44 +01:00
Alex Schroeder
6a652de193 Put matching pages into the same form as search.
This works if we later handle a stand-alone match parameter like we handle the search parameter.
We just fake an action.
2014-11-24 22:32:11 +01:00
Alex Schroeder
4747235fe7 light.css: Adaptations to the new layout of search. 2014-11-24 18:47:11 +01:00
Alex Schroeder
0ecbeeb2c4 alex-2014.css: Symbola for textareas 2014-11-24 10:16:38 +01:00
Alex Jakimenko
65378d91cb div-foo.pl: more restrictive regexes, added $DivFooPrefix 2014-11-23 23:04:07 +02:00
Alex Schroeder
cb6a6bf4a6 mail.pl: adapt to changes in the footer 2014-11-23 21:43:35 +01:00
Alex Schroeder
db67c34203 Font paths fixed. Search form changes. 2014-11-23 21:23:10 +01:00
Alex Schroeder
ccf8fe2314 Search form: fix HTML issues 2014-11-23 21:22:29 +01:00
Alex Schroeder
e336086cf0 Reorganizing the Search Form
Introducing  (0, 1, 2); supporting  (2);
adding .
2014-11-23 19:37:27 +01:00
Alex Schroeder
5315b3f6ad toc-js.pl: Fix typo 2014-11-19 13:05:11 +01:00
Alex Schroeder
e31abd57bc toc-js.pl: Provide my own endsWith implementation. 2014-11-19 13:03:54 +01:00
Alex Schroeder
5bf60bb5d8 oddmuse-2014.css: new 2014-11-17 14:23:10 +01:00
Alex Schroeder
ad672aff28 alex-2014.css: Font locations, iPhone optimisation. 2014-11-17 10:51:07 +01:00
Alex Schroeder
e49af47d30 alex-2014.css: keep search forms together 2014-11-15 08:55:10 +01:00
Alex Schroeder
ecbe6a859a Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-11-14 22:55:05 +01:00
Alex Schroeder
413228c56c Emacs interface: fixed vc-diff, history is back
The history command was interesting because it limits the display to
those revisions that are actually available for diff and rollback.
Eventually this might form the basis of a better interface.

The vc-diff code also needed to be fixed.
2014-11-14 22:51:46 +01:00
Alex Schroeder
a905de7ab5 alex-2014.css: get rid of line-height everywhere 2014-11-14 12:26:13 +01:00
Alex Schroeder
a09409f375 alex-2014.css: use Noticia Text as font 2014-11-13 13:08:30 +01:00
Alex Schroeder
764c0ffcf1 alex-2014.css: no bold, use local fonts 2014-11-13 11:37:47 +01:00
Alex Schroeder
5962745937 Fixed comment handling.
A simple $comment eq '' resulted in previews if page edits to no
longer work. The correct test is defined $comment and $comment eq ''.
2014-11-11 11:17:29 +01:00
Alex Schroeder
d380062ec6 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/oddmuse 2014-11-11 11:11:46 +01:00
Alex Schroeder
cd8066233c Unlock Wiki menu lists locks.
If no locks are set, the menu is not shown.
If the menu is shown, the known locks are listed.
2014-11-11 11:04:58 +01:00
Alex Schroeder
6f04d2044f edit-paragraphs: get rid of fuzzy matching
Too many bugs!
2014-11-10 23:17:00 +01:00
Alex Schroeder
f41ded592b Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-11-10 22:11:55 +01:00
Alex Schroeder
8a2c9eca9c edit-paragraphs: fix HTML quoting issues 2014-11-10 22:10:51 +01:00
Alex Schroeder
d712a17f82 toc-js.pl: remove multiple pencils
The existence of multiple pencils appears to be a bug in edit-paragraphs.
2014-11-10 15:39:51 +01:00
Alex Schroeder
504190b752 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/oddmuse 2014-11-10 15:37:50 +01:00
Alex Schroeder
56e515a791 toc-js.pl: remove pencil icon
This icon is added by edit-paragraphs.pl and it looks ugly.
2014-11-10 15:37:37 +01:00
Alex Schroeder
36feb62052 oddmuse-curl: provide oddmuse-curl
It used to provide oddmuse, and vc-oddmuse used to require oddmuse, but
that doesn't load oddmuse-curl.el.
2014-11-10 13:12:51 +01:00
Alex Schroeder
239f15cdbc Simplified handling of $NewComment
A long time ago, $NewComment was the default text for the comment form,
ie. aftertext. That's why the code still had some comparisons of
aftertext with $NewComment. Now that $NewComment is a label in the
comment form and no longer the content of the text area, these tests can
be removed.
2014-11-10 09:48:12 +01:00
Alex Schroeder
f39cfd3235 edit-paragraphs.pl: handle trailing newlines
This used to generate an extra entry for @EditParagraphs which in turn
prevented the page from ending with an edit link if it ended with
multiple newlines.

Also made $EditParagraphPencil settable in the config file.
2014-11-10 09:45:59 +01:00
Alex Schroeder
329699a6aa Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-11-09 17:56:45 +01:00
Alex Schroeder
28965bdaa6 edit-paragraphs.t: added test cases by Alex Daniel 2014-11-09 17:55:43 +01:00
Alex Schroeder
ed42d2dad5 oddmuse_stats: fixed handling of non-ASCII names 2014-11-09 17:05:02 +01:00
Alex Schroeder
45b21cbdb8 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-11-09 13:11:32 +01:00
Alex Schroeder
b540093c2c edit-paragraphs: handle pre, hr. 2014-11-09 13:09:44 +01:00
Alex Schroeder
d164d47e24 oddmuse-stats: a munin plugin 2014-11-09 12:29:28 +01:00
Alex Schroeder
a56b92ecb3 edit-paragraphs: fix HTML escaping 2014-11-08 21:15:15 +01:00
Alex Schroeder
114d914754 edit-paragraphs: pass around parameter to the form 2014-11-08 18:33:52 +01:00
Alex Schroeder
875051ea84 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse
Conflicts:
	t/edit-paragraphs.t
2014-11-08 18:02:01 +01:00
Alex Schroeder
003357acad edit-paragraphs: handle multiple paragraphs 2014-11-08 18:00:16 +01:00
Alex Schroeder
e1c77c4ba6 edit-paragraphs: handle multiple paragraphs 2014-11-08 17:59:44 +01:00
Alex Schroeder
88475c3e41 edit-paragraphs: fiddled with unit tests
Trying to find a constellation to reproduce missing edit links.
Adding support for editing table rows.
2014-11-08 13:37:26 +01:00
Alex Schroeder
e80f05301d edit-paragraphs: added unit test, fixed table bug
After a table, we'd get a lone link in a separate paragraph, just like
headers.
2014-11-07 23:04:12 +01:00
Alex Schroeder
a624e78975 edit-paragraphs: added unit tests, fixed table bug
Before a table, we'd get a lone link.
2014-11-07 22:47:02 +01:00
Alex Schroeder
8cd869f0f9 alex-2012.css: simplication of a.pencil stuff 2014-11-07 09:56:44 +01:00
Alex Schroeder
b09b3f8f8e light.css: new CSS file used by campaignwiki.org 2014-11-07 09:56:21 +01:00
Alex Schroeder
b9043ffd98 alex-2012.css: new stuff.
* a.pencil things for edit-paragraph.pl
* pre with word wrap
* limiting images to 100% width for the phone
2014-11-07 09:27:11 +01:00
Alex Schroeder
54d3dc400a edit-paragraph.js: new
This hides and shows the pencils at the end of each paragraph.
2014-11-06 21:48:08 +01:00
Alex Schroeder
3962068385 edit-paragraphs.pl: improve caching
Hook into PrintWikiToHTML instead of PrintPageContent in order to
avoid adding an edit link after every page link (as these are the
dirty blocks that get printed from the cache).
2014-11-06 16:01:01 +01:00
Alex Schroeder
a0b74ac3c6 edit-paragraph.pl: fixing stuff that didn't work 2014-11-06 15:38:21 +01:00
Alex Schroeder
870d75ac64 edit-paragraphs.pl: hack $Fragment
In order to get the edit button into the headings, we hack it into
$Fragment -- the current, clean HTML block being assembled by
ApplyRules.
2014-11-06 15:00:46 +01:00
Alex Schroeder
42d8260ce4 edit-paragraphs.pl: remove \r
Multiline paragraphs were not replaced correctly because of extra \r
in line endings.
2014-11-06 14:40:23 +01:00
Alex Schroeder
bfda4abe54 New module. 2014-11-06 13:43:20 +01:00
Alex Schroeder
4b0d411564 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse
Conflicts:
	wiki.pl
2014-11-01 01:03:16 +01:00
Alex Schroeder
6790de2d6a Yet another attempt at fixing encoding issues.
To facilitate future debugging, STDERR now also gets the UTF-8 layer.

Apparently CGI does not decode UTF-8 encoded URL parameters. Handle this
case in GetParam.

PageHtml can be called when STDOUT already has the UTF-8 layer. It needs
to be able to handle both cases. That's why we call binmode without any
layers and then we call binmode with the UTF-8 layer again. Now it will
work for RSS files as well.

Unrelated fix: In order to force a decent Etag header even if no index
file exists (and thus $LastUpdate is undef), we use $Now as an
alternative.
2014-11-01 00:52:55 +01:00
Alex Schroeder
2784628544 PageHtml no longer uses utf8 layer
binmode adding utf8 layer to STDOUT resulted in double encoded pages
included via PageHtml. On my homepage I was appending the comments to
every page using the following code:

    my $target = $CommentsPrefix . $id;
    my $page = '';
    $page = PageHtml($target) if $IndexHash{$target};
    print $q->div({-class=>'comment'},
                  $q->h2(T('Comments')),
                  $page);
2014-10-31 23:50:28 +01:00
Alex Schroeder
dd8c687b2b Caching: Fixed tests.
There is no problem generating an Etag header even if a Last Modified
header is provided.
2014-10-31 23:49:41 +01:00
Alex Jakimenko
9f4ceb2d72 module-updater.pl: No need to return when calling OrError subs 2014-10-31 18:48:48 +02:00
Alex Jakimenko
0f8a4fa1df module-updater.pl: Fixed cache problems 2014-10-31 18:48:06 +02:00
Alex Jakimenko
3b16b58880 module-bisect.pl: Solved cache problems, added 'Back' button from 'Stop' page, all strings are now translatable, some refactoring. 2014-10-31 18:41:08 +02:00
Alex Jakimenko
192a902932 Typos and language 2014-10-31 15:41:00 +02:00
Alex Schroeder
aedf77cff8 wiki.pl: Fix caching.
Previously, if calling GetHeader with 'nocache', this would get passed
on to GetHttpHeader as $ts. The code would then produce an etag header
with a value of 'nocache'. This is now fixed. A long comment now
explains how it is supposed to work to reduce confusion in the future.
2014-10-31 09:27:27 +01:00
Alex Schroeder
728547f309 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-10-31 09:10:08 +01:00
Alex Schroeder
33f5484441 oddmuse-curl.el: oddmuse-search, oddmuse-match
Both may use a prefix argument to search a different wiki.
2014-10-31 09:09:52 +01:00
Alex Schroeder
a225486709 vc-oddmuse.el: vc-oddmuse-diff, vc-oddmuse-checkin
These simply did not work.
2014-10-31 09:08:16 +01:00
Alex Jakimenko
3f7f9ec1eb module-bisect.pl: Indicate progress by using > signs 2014-10-31 04:45:45 +02:00
Alex Jakimenko
174aac5570 module-bisect.pl: Do binary search on your modules by disabling/enabling them 2014-10-31 04:09:33 +02:00
Alex Jakimenko
954232f7c8 module-updater.pl: Do not update modules immediately, just show diffs and ask the user whether he wants to apply those changes. 2014-10-29 23:40:09 +02:00
Alex Jakimenko
067658fd10 comment-div-wrapper.pl: Now using $q-> functions instead of printing html manually 2014-10-26 00:54:45 +03:00
Alex Jakimenko
b2b2b0f6cc comment-div-wrapper.pl: Use 'class' instead of 'id' (otherwise it creates multiple elements with the same id in journals) 2014-10-26 00:29:35 +03:00
Alex Jakimenko
408d169729 comment-div-wrapper.pl: indentation 2014-10-26 00:28:32 +03:00
Alex Schroeder
0eddbd5806 oddmuse-2013.css: white-space and word-wrap 2014-10-24 15:50:42 +02:00
Alex Schroeder
210a28afd4 oddmuse-2013.css: small changes 2014-10-24 15:50:31 +02:00
Alex Schroeder
94a16bd463 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-10-24 09:47:29 +02:00
Alex Schroeder
4005e246f7 oddmuse-curl.el: Emacs 24.4 compatibility
shell-command-on-region apparently no longer returns an error number.

Also, use quotes for oddmuse-get-command.
2014-10-24 09:46:51 +02:00
Alex Jakimenko
6b3cd0437f module-updater.pl: GetRaw() instead of wget, cgi functions instead of printing tags 2014-10-22 03:00:32 +03:00
Alex Jakimenko
c961748b49 image.pl: Commentable images (create divs with text above images) 2014-10-21 17:26:31 +03:00
Alex Jakimenko
7327eb8e0c div-foo.pl: Support for spans, paragraph problem solved 2014-10-21 16:27:14 +03:00
Alex Schroeder
1b0d595945 Oddmuse mode for Emacs: Fix diff support
C-x v = calls diff and it didn't work at all; now it works again but
something about the revisions still isn't right.
2014-10-16 23:29:37 +02:00
Alex Schroeder
b7e2a04bb4 search.t: test fix for encoding error
On my website, I noticed that searching for matching pages with a
string containing a non-ascii character worked, where as doing a
normal search resulted in an encoding error. The difference was this:

  # fix match parameter
  my $match = GetParam('match', '');
  SetParam('match', FreeToNormal($match)) if $match;

This may be necessary to remove underscores, but it should not be
necessary to fix encoding errors.
2014-10-10 18:15:54 +02:00
Alex Schroeder
848eb65ad0 use CGI qw/-utf8/
This option should allow automatic encoding and decoding of
parameters. This saves a few lines and solves an encoding error:
previously, searching for a text containing non-ASCII characters would
result in double-encoded text fields.
2014-10-10 17:15:28 +02:00
Alex Schroeder
7ae98f4ed9 $q->endform to $q->end_form
When updating to CGI 4.06, it turns out that $q->endform
is no longer defined.
2014-10-10 16:43:01 +02:00
Alex Jakimenko
dc792691d4 Fail less dramatically if h1 appears. 2014-10-02 16:29:45 +03:00
Alex Jakimenko
0a57a8e89b toc.pl: Treat h2 as the first header when Creole Extension is active. 2014-10-02 16:23:00 +03:00
Alex Jakimenko
f75d415322 Div Foo Extension 2014-09-29 03:46:02 +03:00
Gauthier Vandemoortele
1654562236 clustermap.pl: fixed regression (subrotine name was changed)
This module used a function called ‘DoRc’ that disappeared from the main oddmuse script since the 1.837 version. It was apparently replaced by ‘PrintRcHtml’.
2014-09-26 23:12:23 +03:00
Alex Schroeder
ba0535f39d Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-09-24 16:51:30 +02:00
Alex Schroeder
e5b069f70b upgrade.t: ensure modules directory exists
When calling clean_pages on OSX, the mac.pl module is installed via
add_module, which in turn calls mkdir. On other systems, however,
installing the old namespace module will not work since the module
directory will not exist. This change ensures that mkdir is called
before symlinking.
2014-09-24 16:49:29 +02:00
Alex Schroeder
d34b9f669b upgrade.t: ensure modules directory exists
When creating a symlink on HFS+, the directory doesn't need to exist,
apparently. On ext4, it needs to exist. Make the test more robust by
calling mkdir.
2014-09-24 16:42:46 +02:00
Alex Schroeder
ae2061fcaf referrer-tracking.t: skip if questionasker is installed 2014-09-24 16:27:21 +02:00
Alex Schroeder
65475cf2e8 git.t: make test more robust
Different git versions use different strings to report issues and the
tests don't use --porcelain. Made them a little more robust.
2014-09-24 16:17:25 +02:00
Alex Schroeder
ce2e63be6b Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-09-23 22:19:51 +02:00
Alex Schroeder
007ce8db86 cookie.t: no longer hardcode the wiki name
Changed the tests to no longer assume the default value for
$CookieName. This is important when running the tests on a system
where Apache starts a number of wikis for various virtual hosts and
one of them will end up as the host to use for http://localhost/. That
wiki might very well have a cookie name set.
2014-09-23 22:17:47 +02:00
IngoBelka
5997c3ea02 creole.pl: title-tag for images
This enables tooltips for images in FireFox and possibly in other browsers too
2014-09-13 14:55:38 +03:00
Alex Schroeder
6895428844 UserCanEditOrDie text preferred
It turns out that one of the tests in lock.t relied on the exact wording
of the error message. I decided to use the same wording for all
instances: "Editing not allowed: %s is read-only" and no longer using
"Editing not allowed for %s".
2014-09-12 15:30:20 +02:00
Alex Schroeder
2bc2d1f927 New convenience function UserCanEditOrDie
Closes bug #41625 "ban-quick-editors.pl can hide the error message".
DoPost now uses the same code as DoEdit and thus it will display the
error message, which solves the issue for ban-quick-editors.pl. Added a
test to demonstrate it.
2014-09-12 15:20:06 +02:00
Alex Schroeder
873ce10ced permanent-anchors.pl: report page deletion status
Make sure the status is returned if page deletion fails.
2014-09-12 11:50:51 +02:00
Alex Schroeder
3855c83a7e maintain.t: Verify that maintenance deletes pages 2014-09-12 11:45:24 +02:00
Alex Schroeder
281736a082 Merge: use [[foo bar]] and [[foo_bar]]
I find that removing " space" and "_underscore" made it easier for me to
visually compare the XPath expressions. I also wanted to keep the
[[foo bar|text]] test (and keep the XPath expression as similar as possible).
2014-09-11 22:08:50 +02:00
Alex Schroeder
63d8e24c2f creole.t: test for new free link rule
Make sure that [[foo bar]] turns to [[foo_bar?]] if foo_bar does not
exist, and [[foo bar|text]] turns to [[foo_bar?|text]].
2014-09-11 21:57:27 +02:00
Alex Jakimenko
c66f1a6f8e We have chosen a wrong way to compare $text with $id. It should be better now.
This also fixes recent test added to creole.t
2014-09-11 16:47:18 +03:00
Alex Jakimenko
6418cab98c creole.t: creole extension has its own link rules, so we have to test spaces in [[links]] 2014-09-11 16:43:52 +03:00
Alex Jakimenko
040d51bc93 default-links.t: test both underscores and spaces in [[links]] 2014-09-11 16:41:22 +03:00
Alex Schroeder
41c3245a51 default-links.t: test for new free link rule
Make sure that [[foo_bar]] turns to [[foo_bar?]] if foo_bar does not
exist.
2014-09-10 23:13:45 +02:00
Alex Schroeder
ffc2a0b12f Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-09-10 22:59:36 +02:00
Alex Schroeder
90c632f4ab Avoid Save button for comments after rollback
If you clicked on the Save button after rolling pack a comment page, the
content of the comment page would be deleted.
2014-09-10 22:56:54 +02:00
Alex Jakimenko
9e8def306a Fixed free links to nonexisting pages (now [[foo bar]] results in [[foo_bar?]] instead of [[foo_bar?|foo bar]]) 2014-09-03 15:25:13 +03:00
Alex Jakimenko
f4e551111a Executable flag is only useful when shebang is specified 2014-09-03 14:23:20 +03:00
Alex Jakimenko
1ead545561 Fix gravatar tests (https links from f7b99d4 commit) 2014-09-03 14:06:38 +03:00
Alex Schroeder
f5fc46821f emoji.pl: use \s+:3 2014-08-27 08:22:04 +02:00
Alex Schroeder
ce9f8d9b74 emoji.pl: require whitespace before :3 2014-08-27 08:19:03 +02:00
Alex Jakimenko
1104ecf72f emoji.pl: :3 smiley fixed
Previously it was matching dates like 12:31
2014-08-27 06:32:55 +03:00
Alex Schroeder
13fc4cc0a4 emoji.pl: fixed rule order 2014-08-26 22:39:39 +02:00
Alex Schroeder
31f7b330c5 emoji.pl: added more 2014-08-26 22:34:30 +02:00
Alex Schroeder
ad3909888b emoji.pl: added more 2014-08-26 22:24:08 +02:00
Alex Schroeder
f7b99d44fd gravatar.pl: use https 2014-08-25 20:29:25 +02:00
Alex Schroeder
2cf943d178 Makefile: more fixing for prepare target
The prepare target didn't handle wiki.pl itself correctly. This has been
fixed. The command to add the git tag was changed from sed to perl, like
for the other targets. As emoji.pl and smiles.pl refer to permanent
anchors, the addition of the anchor parameter to AddModuleDescription
was obviously misguided and I reverted it.
2014-08-24 22:20:50 +02:00
Alex Schroeder
b2b1c16247 markup.pl: link English documentation 2014-08-24 21:31:00 +02:00
Alex Schroeder
f91041b677 Handle AddModuleDescription for translations
The Makefile didn't add tag information for translation files when
running 'make prepare'. This has been fixed. As we cannot have a slash
in the file name, as slashes get escaped in UrlEncode, a new parameter
was added to AddModuleDescription and the Makefile will now set this
parameter for translation files such that the source link will point to
the correct directory ("translations/").
2014-08-24 21:25:38 +02:00
Alex Schroeder
30b0faa70e ban-contributors.t: fixed test
The test no longer refers to hostname but to IP number.
2014-08-24 13:05:03 +02:00
Alex Schroeder
174c4f6642 oddtrans: add fake AddModuleDescription
Add a fake AddModuleDescription such that the new translation files with
the new module description call don't fail on "do".

Also use :encoding(utf8) on opening the file as suggested by Ingo Belka
on the wiki instead of calling utf8::decode on every line.
2014-08-24 12:37:48 +02:00
Alex Schroeder
9ba5b119f8 Fix module description to handle version tag.
This makes sure that "make prepare" works once again by allowing an
optional argument to AddModuleDescription with the tag.
AddModuleDescription now also takes an optional anchor which is used by
emoji.pl and smiles.pl.

This commit also updates all the translation files and makes sure that
they all use AddModuleDescription.
2014-08-24 12:31:15 +02:00
Alex Schroeder
b8ce7f07df diff3 output decoded as UTF-8
Without this decoding, calling diff3 leads to UTF-8 corruption.
2014-08-24 09:01:58 +02:00
Alex Schroeder
c9a9db28a6 german-utf8.pl: updated 2014-08-24 08:46:48 +02:00
Alex Schroeder
b21dc2db01 Get rid of "Updates in the last 1 day"
If it's one day, write "Updates in the last day" instead.
2014-08-24 08:46:03 +02:00
Alex Schroeder
0f61a795ee Modules no longer refer to hostname banning
Hostnames are no longer tracked and therefore log messages such as
"hostname or IP number matched" no longer make sense.
2014-08-24 08:45:14 +02:00
Ingo Belka
ed30eeffb0 oddtrans: Keep translation headers 2014-08-24 08:44:31 +02:00
Alex Jakimenko
9473e08a14 smarttitles.pl allow intermap links in suburl
maybe this feature should have been called "sublink"...
2014-08-24 06:33:50 +03:00
Alex Jakimenko
16796b7fe5 smarttitles.pl: added #SUBURL
SUBURL is another optional feature that allows you to specify some arbitrary link to be displayed in the subtitle.
This might be handy to wikis where some pages are associated with particular URLs
2014-08-23 09:04:12 +03:00
Alex Jakimenko
1e704ece07 smarttitles.pl: do not match in the middle of the string 2014-08-23 06:27:15 +03:00
Alex Jakimenko
1f824d5838 diff.pl: fix corrupted html 2014-08-23 05:28:16 +03:00
Alex Jakimenko
d8bc7bd82f Module Updater Extension 2014-08-23 05:13:27 +03:00
Alex Jakimenko
a2e1a73d10 smarttitles.pl: fixed XSS, fixed wrong behaviour when #TITLE was not specified but #SUBTITLE was, fixed wrong behaviour when title or subtitle was specified in the end of the page, some refactoring 2014-08-22 22:01:50 +03:00
Alex Schroeder
68e71cc535 upgrade.t: fixed old namespaces problem
The problem was that the new namespaces.pl wants to call
AddModuleDescription which doesn't exist in oddmuse-2.2.6.pl -- but
that's the Oddmuse version that is used for the upgrade test.
2014-08-22 16:43:09 +02:00
Alex Schroeder
548bdf7d1c upgrade.pl: add module description 2014-08-22 16:17:18 +02:00
Alex Schroeder
a6314a2c44 Merge branch 'ad/module-description' 2014-08-22 09:09:03 +02:00
Alex Schroeder
85e8800435 offline.pl and webapp.pl: link wiki page 2014-08-22 08:49:40 +02:00
Alex Schroeder
41b5c65e22 national-days: moved to translations folder 2014-08-22 08:33:08 +02:00
Alex Schroeder
3ad0438a78 Revert changes made to translation files.
This reverts part of commit 5aba2ae56f.

Conflicts:
	modules/locked.pl
2014-08-22 00:10:04 +02:00
Alex Schroeder
3ab80d0e3f Merge branch 'ad/module-description' of git.sv.gnu.org:/srv/git/oddmuse into ad/module-description 2014-08-21 23:39:20 +02:00
Alex Schroeder
2312787ec1 simple-rules test moved to Test::More
Moved modules/simple-rules-test.pl to t/simple-rules.t and started using
the standard testing infrastructure.
2014-08-21 23:38:52 +02:00
Alex Schroeder
b8b2035151 simple-rules test moved to Test::More
Moved modules/simple-rules-test.pl to t/simple-rules.t and started using
the standard testing infrastructure.
2014-08-21 23:37:31 +02:00
Alex Schroeder
4aefc9a648 emoji.pl and smiles.pl: Fixed module description
These two modules used to link to a named anchor instead of a simple
page. This was dropped.
2014-08-21 22:32:37 +02:00
Alex Schroeder
c1cb7516a8 locked.pl is effectively a duplicate
listlocked.pl provides the same functionality and is actually installed
on emacswiki.org, so that's the one we'll keep.
2014-08-21 22:24:21 +02:00
Alex Schroeder
5aba2ae56f Fixed typo in AddModuleDescription sub name 2014-08-21 22:23:23 +02:00
Alex Schroeder
f958de8165 AddModuleDescription uses FreeToNormal
This makes sure that links to pages with spaces in their names have
spaces translated to underscores.
2014-08-21 22:22:10 +02:00
Alex Schroeder
f79b188e82 finnish-utf8.pl and swedish-utf8.pl: fix mode
The files specified fundamental-mode for Emacs users. I removed that
line because the defaults seem to work just fine.
2014-08-21 22:01:44 +02:00
Alex Schroeder
dc182fde16 brazilian-portuguese-utf8.pl: Added header back.
This header had somehow gotten lost.
2014-08-21 22:01:11 +02:00
Alex Jakimenko
5fbc444a53 Removed scripts for processing module descriptions 2014-08-21 16:48:49 +03:00
Alex Jakimenko
a7f83b2ba7 Added file descriptions without wiki links 2014-08-21 16:41:32 +03:00
Alex Jakimenko
5bfe0073d9 Fixed some module descriptions 2014-08-21 16:20:43 +03:00
Alex Schroeder
3b3e707d3b Fix Recent Changes pagination
The commit "RcHtml: fix generating More... links" introduced a bug. The
first page after clicking a More... link was the default page again. The
computation of the new FROM parameter wasn't working when neither UPTO
nor DAYS was set (as is the case when you look at the default Recent
Changes). A simple defaulting to $RcDefault did the trick.
2014-08-21 07:53:55 +02:00
Alex Jakimenko
ee932dee37 Automatically reformatted modules 2014-08-21 07:29:46 +03:00
Alex Jakimenko
772bf2745a Scripts to automatically clean module descriptions.
These files do not belong here, but they are commited intentionally (Just in case we need them again)
2014-08-21 07:17:26 +03:00
Alex Jakimenko
8cbd7dabec AddModuleDescription: allow modules without wiki pages 2014-08-21 05:44:00 +03:00
Alex Jakimenko
860d2f0bce AddModuleDescripton() 2014-08-21 04:35:53 +03:00
Alex Jakimenko
ef4aac31b4 Get rid of CRLF line endings 2014-08-21 02:46:47 +03:00
Alex Jakimenko
be1789f996 diff.pl: Fix removal of newline warning 2014-08-21 02:42:14 +03:00
Alex Schroeder
b7c1045783 Help users unlock a wiki.
When a lock is blocking the user, offer them a way to unlock the wiki.

Also, update the German translations.
2014-08-21 01:08:25 +02:00
Alex Schroeder
54913a0131 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-08-20 17:09:46 +02:00
Alex-Daniel Jakimenko
a6036d2455 Fix removal of newline warning 2014-08-20 17:08:12 +02:00
Alex-Daniel Jakimenko
12d362106e Use -- to delimit args from filenames.
This applies to the calls of diff and diff3. -- is required to
indicate the end of command line arguments, so that filenames that
start with dashes will not cause any trouble. Of course, since no one
will ever set his $TempDir to something like that, it is not critical.
2014-08-20 17:07:58 +02:00
Alex Schroeder
b292ab5983 Fix modules using PrintAllPages. 2014-08-20 17:07:54 +02:00
Alex-Daniel Jakimenko
090c708ce9 diff.pl: Diff Action Extension. 2014-08-20 17:07:36 +02:00
Alex-Daniel Jakimenko
67dc63c433 Fix removal of newline warning 2014-08-20 17:02:50 +02:00
Alex Schroeder
2606b846f0 Use -- to delimit args from filenames.
This applies to the calls of diff and diff3. -- is required to
indicate the end of command line arguments, so that filenames that
start with dashes will not cause any trouble. Of course, since no one
will ever set his $TempDir to something like that, it is not critical.
2014-08-20 08:31:32 +02:00
Alex Schroeder
ff66da7c65 Fix modules using PrintAllPages. 2014-08-20 08:28:36 +02:00
Alex Schroeder
76a6b4bfad diff.pl: Diff Action Extension. 2014-08-20 08:22:18 +02:00
Alex Schroeder
ddadb21517 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-08-20 08:21:37 +02:00
Alex Schroeder
e62423ec84 Fix edit link for the homepage.
The universal edit button link in the HTML header did not work when
looking at the home page if the home page did not appear in the URL.
2014-08-15 09:38:32 +02:00
Alex Jakimenko
083fdb3371 Refactor: Some code extracted from GetHeader
The code was moved into the new subroutine GetHeaderTitle.
2014-08-13 15:55:23 +02:00
Alex-Daniel Jakimenko
6cfe1ab29a Links With AccessKeys Extension
Oddmuse provides several shortcuts, like ‘e’ to edit page or ‘c’ to open
comments page and several others. In most browsers it means that
pressing Alt+Shift+e should automatically click (or at least focus) edit
link. However, by default there is no way to provide accesskey for links
on your wiki pages. This module is trying to solve this.
2014-08-13 12:17:24 +02:00
Alex-Daniel Jakimenko
4e43357daa Another Git Extension
Unlike Git Extension, this extension initializes git repository right
inside your Page Directory. This approach simplifies the code because
there is no need to copy files from one location to another.
2014-08-13 12:13:21 +02:00
Alex-Daniel Jakimenko
7a82dd40ff New Window Links Extension
This is a simple extension that provides syntax for creating links that
open in new windows or tabs.
2014-08-13 12:11:54 +02:00
Alex-Daniel Jakimenko
584f23b08a Comment Div Wrapper Extensions
This module will place all comments into <div> tags.
2014-08-13 12:10:08 +02:00
Alex-Daniel Jakimenko
b21f33951f Advanced Uploading
This module adds file upload buttons to comment and edit forms.
2014-08-13 12:06:55 +02:00
Alex Schroeder
acacd5ff01 GetFooterLinks avoids useless link. 2014-08-06 12:25:54 +02:00
Alex Schroeder
a333fbf3b1 creole.pl: Fixed list item issues.
creole.t now runs again.
2014-08-06 11:01:15 +02:00
Alex Jakimenko
eb7de3c722 Allow mixed mode lists.
OpenHtmlEnvironment now accepts fourth parameter that defines similar
tags.

creole.pl now passes 'ol|ul' as fourth parameter to OpenHtmlEnvironment.

In addition to that, the creole.pl code was refactored a little bit to
remove copy-pasted part.
2014-08-05 22:59:17 +02:00
Alex Schroeder
ac7ca05707 oddmuse-curl: make nicer RC buffer
Use shadow face for author.
2014-08-03 01:02:50 +02:00
Alex Schroeder
32ce6cde2d Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-08-03 01:02:22 +02:00
Alex Schroeder
d922b7413c RcHtml: fix generating More... links
When using days for RecentChanges, the More... links after the first
one reverted to $RcDefault instead of keeping the same time period.
This is now fixed.
2014-08-03 01:01:42 +02:00
Alex Schroeder
54b0fbcfaf RcHtml: fix generating More... links
When using days for RecentChanges, the More... links after the first
one reverted to $RcDefault instead of keeping the same time period.
This is now fixed.
2014-08-03 00:59:41 +02:00
Alex Schroeder
d919dd5d94 rc.t: Add test for More... links 2014-08-03 00:50:42 +02:00
Alex Schroeder
48ec41b566 git: added git.t, rewrote git.pl
Tests were added. As I wrote the tests, I realized that GitRun was
printing to STDOUT even though we had created a local *STDOUT and opened
it to write to a memory file (like PageHtml does). Apparently this is
not inherited to the child process. I now use the solution provided for
in the perldoc for open. Unfortunately it requires a temp file. Trying
to use a memory file results in an error. Temporary files are a mess if
I want to access the output: I need to close it and reopen it for
reading. That's why GitRun only does that if $GitDebug is set. This is
what most of the tests will use: set $GitDebug and examine $GitResult.
At the same time I realized that the error message was never being
triggered. The previous code was tricky because it only considered
showing an error message in a non-void context, ie. when called from
maintenance. I wasn't sure this was an actual benefit and decided to
remove it altogether. I we really want to, we can set $GitDebug and
examine $GitResult in GitCleanup.
2014-07-31 13:18:32 +02:00
Alex Schroeder
0d592e12f2 test.pl: extract config file writing
Move the writing of the config file (and the resetting of the important
variables) into a separate file so that tests can reset the config file
without clearing all the pages.
2014-07-31 13:17:02 +02:00
Alex Schroeder
ee8b8db17f oddmuse-curl.el: pwd parameter handling
Two commands used 'password' instead of 'pwd' as parameter for the
password. In addition to that, oddmuse-run will now report errors, if it
thinks there are any.
2014-07-30 14:12:19 +02:00
Alex Jakimenko
252033bff8 git.pl: Some significant changes.
Added: $GitPageFile variable. Set it to true if you want to keep
complete page files in git and not just text.

Fixed: previously git extension was chdir-ing into $GitRepo directory
without ever going back, this could have lead to problems if some other
code needed access to file system.

Fixed: now this extension will work smoothly if $DataDir is set to a
relative path.

Fixed: this extension was probably broken for wiki pages starting with
two dashes (e.g. --SomePage), this is now fixed by using -- to indicate
the end of command-line options.

Changed: GitCleanup is now using GitRun instead of backticks (like
everywhere else). It will also print the exit status of 'git commit'
command.

Changed: some tiny style improvements.
2014-07-30 14:06:07 +02:00
Alex Schroeder
e21333faca Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-07-28 11:36:38 +02:00
Alex Schroeder
ff3d7a9ea2 Search & Replace: use → instead of -> 2014-07-28 11:35:36 +02:00
Alex Schroeder
dd34aff9ef oddmuse-curl.el: Fixed message for new pages.
oddmuse-get-latest-revision doesn't return anything when the page is
new. In this case the previous message was confusing. Now it just says
that the page must be new.
2014-07-28 10:37:21 +02:00
Alex Schroeder
9eee99514b add-link.pl: more improvements 2014-07-27 22:36:38 +02:00
Alex Schroeder
5ead2bdcf2 add-link.pl: added support for /top and /match 2014-07-27 15:48:36 +02:00
Alex Schroeder
8b5267a013 oddmuse-curl.el: Markup for interlinks. 2014-07-26 23:18:22 +02:00
Alex Schroeder
423dad59b1 oddmuse-curl.el: fixing prefix arg handling for previews. 2014-07-26 23:08:47 +02:00
Alex Schroeder
f79aa04c68 oddmuse-curl.el: Support matching page names 2014-07-26 22:46:50 +02:00
Alex Schroeder
7535c859b9 oddmuse-curl.el: Fix Preview. 2014-07-26 16:43:04 +02:00
Alex Schroeder
ac34706853 oddmuse-curl.el, vc-oddmuse.el: Refactor. 2014-07-26 11:38:55 +02:00
Alex Schroeder
b705fcb3f1 oddmuse-curl.el: Reorganize code. 2014-07-25 15:20:59 +02:00
Alex Schroeder
ae13fe5235 oddmuse-curl.el: refactor
Use with-oddmuse-wiki-and-pagename.
2014-07-25 11:12:57 +02:00
Alex Schroeder
5830fbcd71 oddmuse-curl.el, vc-oddmuse.el: Revert support.
Also, a lot of refactoring and preparing to refactor some more.
2014-07-24 23:37:53 +02:00
Alex Schroeder
a2123aeb76 copy.pl: Moved to the campaignwiki subdir 2014-07-23 16:28:08 +02:00
Alex Schroeder
f07bdddb5d oddmuse-curl.el: oddmuse-reload
Added oddmuse-reload as an alias for
oddmuse-compute-pagename-completion-table.
2014-07-23 16:27:59 +02:00
Alex Schroeder
5da39c28a8 copy.pl: major rewrite 2014-07-23 16:24:53 +02:00
Alex Schroeder
28f08d9583 oddmuse-curl.el: Change key-bindings.
Use C-c C-e for editing and C-c C-f for following, freeing C-c C-o.
2014-07-23 09:52:12 +02:00
Alex Jakimenko
0ba55b13d6 Code style and refactoring. 2014-07-21 20:48:47 +02:00
Alex Schroeder
270e1aad9e oddmuse-curl.el: Add wiki searching.
Use C-c C-s to search the wiki. Introduces oddmuse-search-command,
oddmuse-search, etc.

Also: Get rid of %?. Improve documentation for percent format strings.
2014-07-21 09:56:00 +02:00
Alex Schroeder
ec1b7d1a46 Code style.
Simplify A ? A : B to A || B.
2014-07-18 14:11:08 +02:00
Alex Schroeder
718e17f07f recaptcha.t: skip if dependency is not installed
The CPAN module Captcha::reCAPTCHA is required for this test to run.
2014-07-18 14:07:11 +02:00
Alex Jakimenko
48ff67a27c Code style and refactoring 2014-07-18 13:15:29 +02:00
Alex Schroeder
39eabb6cbb Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-07-16 12:45:13 +02:00
Alex Schroeder
28d7d0a897 oddmuse-curl.el: handle ampersand in pagenames 2014-07-16 12:43:21 +02:00
Alex Schroeder
3f295e7a88 RSS 3.0 doesn't need HTML quoted. 2014-07-16 10:44:13 +02:00
Alex Schroeder
d6ef6bb56c alex-2012.css: fix CSS for numbered links 2014-07-12 20:20:00 +02:00
Alex Schroeder
f276ae6469 Don't store host names.
Get rid of the option $UseLookup. Remove GetRemoteHost and rename
GetRemoteAddress to GetRemoteHost. Thus, it now returns IP number only.
2014-07-11 19:09:33 +02:00
Alex Schroeder
f6d4d5f517 gotobar.pl: Use PageMarkedForDeletion 2014-07-11 10:23:46 +02:00
Alex Schroeder
0ee7a23018 all.pl: Add variation parameter to PrintAllPages call. 2014-07-10 17:02:35 +02:00
Alex Schroeder
61dec7317b journal3.t: Add variation=journal to the tests. 2014-07-10 16:56:49 +02:00
Alex Schroeder
7a1b4c38b1 bbcode.t: Fix smiley and frowning face character 2014-07-10 16:53:52 +02:00
Alex Jakimenko
0e97e7bee5 Refactoring 2014-07-10 15:04:47 +02:00
Alex Schroeder
769bc55821 oddmuse-curl.el: Improved pagename handling.
1. Use completion-ignore-case when reading a pagename.
2. Replace _ with spaces when inserting a pagename into the buffer.
3. URL-encode pagename when concatenating with the wiki URL.
2014-07-09 10:42:27 +02:00
Alex Schroeder
bd9cdf56bf oddmuse-curl.el: Only highlight bullet with space.
This avoids conflict with bold words at the beginning of a line.
2014-07-09 10:41:24 +02:00
Alex Schroeder
be97b89b87 journal.t: whitespace 2014-07-09 10:40:34 +02:00
Alex Jakimenko
a9f5fe4374 journal.t: Tests for the new journal syntax 2014-07-05 12:39:47 +02:00
Alex Schroeder
a88878dc08 bbcode.pl: Different Unicode smilies.
The smilies now match emoji.p: use 😊 instead of ☺ and 😟 instead of😊☹.
2014-07-04 16:38:32 +02:00
Alex Schroeder
dcaabca09f emoji.pl: Added module description. 2014-07-04 10:33:33 +02:00
Alex Schroeder
d680d0173b emoji.pl: fix one entity 2014-07-03 15:11:12 +02:00
Alex Schroeder
3e8cb56f37 smiles.pl: Using the data URI schema.
The smilies are from the Emacs 24 distribution.
2014-07-03 15:02:35 +02:00
Alex Schroeder
33ec1b1743 emoji.pl: More.
Also, use 😊 instead of ☺ and 😟 instead of😊☹.
2014-07-03 14:37:16 +02:00
Alex Schroeder
6f4b5451fc emoji.pl: Using Unicode characters.
Instead of using %Smilies (as seen in smiles.pl), this translates
sequences like :) to Unicode characters such as ☺.
2014-07-03 13:44:32 +02:00
Alex Jakimenko
2770defdc4 Additional features for journal syntax.
If you set 0 as the number of entries for More... pages, the More...
button will be disabled completely (e.g. <journal 3,0> to show only 3
entries without giving a link to other pages).

You can specify initial offset by using journal:OFFSET (e.g. <journal:3
5 "News_\d+"> will skip first three news pages).

The :OFFSET syntax might be confusing, but it is quite easy to remember:
in bash ${arr:3:5} will get five elements of array arr starting with the
third index (fourth element, thus the offset is 3). Therefore, to make
it even more confusing, it is now possible to write previous example as
<journal:3:5 "News_\d+">.

Now you can use <titles> to get links without displaying the contents.
It accepts exactly the same arguments as <journal>. For example
<titles:3 5 "News_\d+">.
2014-07-03 12:58:48 +02:00
Alex Jakimenko
1d6f435ca8 askpage.pl: Fixed variable name.
Fixed variable name (this module was not working previously), comments
and minor fixes.
2014-07-03 09:17:49 +02:00
Alex Schroeder
00856c0436 oddmuse-curl.pl: Editable *Preview* buffer.
Switch to fundamental mode (undoing view-mode) before loading a new
preview.
2014-07-03 09:10:22 +02:00
Alex Schroeder
e0ee3bb24d oddmuse-curl.el: Fix line-breaking.
Allow line-breaking when we're right at the start of a link.
2014-07-02 09:46:50 +02:00
Alex Schroeder
8bbbed026d add-link.pl: Handle & in names.
Handle HTML quoting correctly when it comes to site names such that
sites containing an ampersand show up as & and not as &amp;.

Inline the star.png in order to be stand-alone.
2014-07-01 16:07:19 +02:00
Alex Schroeder
c9767ce84b alex-2012.css: Button icon shadow. 2014-07-01 13:36:50 +02:00
Alex Schroeder
b984f3ecad alex-2012.css: Button size. 2014-07-01 13:16:54 +02:00
Alex Schroeder
f58f784009 oddmuse-curl.el: Fix parameters for oddmuse-follow 2014-07-01 10:09:54 +02:00
Alex Schroeder
b6ee8da7c6 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-07-01 10:08:51 +02:00
Alex Schroeder
ae59ab3746 GetParam: only call utf8::decode on defined values
In some recent versions of Perl such as v5.18.0, when $foo is undef,
utf8::decode($foo) modifies $foo to '' (defined null string). This
causes problems. When the Preview button is clicked, for example, a
nomal page is shown instead of the preview, because of this. Thus, we
need to avoid calling utf8::decode on undefined value.
2014-07-01 09:33:17 +02:00
Alex Schroeder
28ab5885a0 contrib: README with an explanation of the files 2014-06-30 14:43:48 +02:00
Alex Schroeder
881dbc7094 copy.pl: add use utf-8. 2014-06-30 14:40:51 +02:00
Alex Schroeder
2537a97900 description: added for gitweb. 2014-06-30 14:29:45 +02:00
Alex Schroeder
20de100781 contrib: Add +x to all .pl files 2014-06-30 14:25:10 +02:00
Alex Schroeder
e1c3445136 add-link.pl: Undid commit to the wrong location. 2014-06-30 14:24:23 +02:00
Alex Schroeder
e8be707079 add-link.pl: Script used to maintain a bookmark wiki. 2014-06-30 14:22:35 +02:00
Alex Schroeder
680c3b96ce oddmuse-curl.el: Remove extra closing parenthesis. 2014-06-30 10:00:41 +02:00
Alex Schroeder
ba4ce729e6 alex-2012.css: Add a download link class 2014-06-30 09:37:14 +02:00
Alex Schroeder
d74da11382 raw.pl: Use new page directory structure.
And added a test for raw.pl.
2014-06-27 11:30:33 +02:00
Alex Schroeder
9d0e6cb3cb upgrade.pl: Fix handling of dot files 2014-06-26 18:52:21 +02:00
Alex Schroeder
027557999d Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-06-26 18:47:15 +02:00
Alex Schroeder
41fb4d0c4b Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-06-26 18:44:45 +02:00
Alex Schroeder
7cf0904b2b oddmuse-curl.el: Infer wiki and pagename
Replace oddmuse-read-wiki-and-pagename by oddmuse-pagename such that
the user will not be asked for a wiki and a pagename if it can be
inferred from the context.
2014-06-26 18:35:20 +02:00
Alex Schroeder
7330f1961b oddmuse-curl.el: C-u shows preview in browser 2014-06-26 18:33:55 +02:00
Alex Schroeder
6e9d50204f oddmuse-curl.el: C-c C-b to browse this page 2014-06-26 18:31:06 +02:00
Alex Schroeder
629157d367 oddmuse-curl.el: more fiddling with markup order 2014-06-25 12:17:32 +02:00
Alex Schroeder
23af89d21e oddmuse-2013.css: smaller font-size for code 2014-06-25 12:16:36 +02:00
Alex Schroeder
a3cf3dbb99 oddmuse-2013.css: black line before comment 2014-06-24 16:18:57 +02:00
Alex Schroeder
a28f380125 journal-rss.pl: monthly parameter
As suggested by Ingo Belka on the wiki: The parameter monthly=1 will
set the match parameter to the current year and the current month.
2014-06-24 16:13:59 +02:00
Alex Schroeder
eb8fd17e01 oddmuse-curl.el: Reorganized, mostly for font-lock
Changed all the oddmuse-*-markup functions to variables. Reorganized
oddmuse-mode.
2014-06-24 11:46:18 +02:00
Alex Schroeder
4784e3bc88 oddmuse-curl.el: oddmuse-revert confirmation
oddmuse-revert will now ask for confirmation before reverting the
current buffer.
2014-06-24 11:44:23 +02:00
Alex Schroeder
cff287ee24 oddmuse-curl.el: Remove Oddmuse Wiki from oddmuse-wikis
There don't seem to be a big overlap between Emacs users and Oddmuse
Wiki editors.
2014-06-24 11:42:32 +02:00
Alex Schroeder
07eeffa3e3 oddmuse-curl.el: add nobreak property
oddmuse-nobreak-p now takes into account the nobreak property. This
property is added to font-lock-extra-managed-props and used by *bold*,
_underline_ and /italic/.
2014-06-23 13:50:07 +02:00
Alex Schroeder
fe7a5e564a admin.pl: Get rid of CreatePageDir. 2014-06-23 12:54:39 +02:00
Alex Schroeder
00aa0761d7 referrer-tracking.t: Clean up after the last test. 2014-06-23 12:24:51 +02:00
Alex Schroeder
f09a81b3b9 referrer-tracking: Get rid of CreatePageDir.
Fix the unit tests, too.
2014-06-23 12:19:07 +02:00
Alex Schroeder
c43b0695c2 oddmuse-curl.t: fix handing of ' in summary
Shell quoting issues, the bane of every programmer.
2014-06-23 11:32:08 +02:00
Alex Schroeder
e9e436c0b8 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-06-23 09:53:17 +02:00
Alex Schroeder
c0194c1178 pageidx file now no longer contains all those ones
Previously, the pageidx file contained the serialized hash. If we had
two pages A and B, it contained A 1 B 1. When you install this version,
your wiki will report extra pages of "1" until you delete your pageidx
file, or until you create a new page (which will delete your pageidx
file).
2014-06-22 23:28:56 +02:00
Alex Schroeder
c6a0cb33ac Raw RSS adds "minor: 1" for minor changes
If you looked at an URL like the following, you wouldn't know which
items referred to minor changes and which didn't. They all looked the
same.
http://localhost/cgi-bin/wiki.pl?action=rc;showedit=1;raw=1

This change adds "minor: 1" to items caused by minor changes, and
oddmuse-curl.el (the Oddmuse Mode for Emacs), handles this.
2014-06-22 23:14:55 +02:00
Alex Schroeder
e9375974cb rollback.t: Get rid of stat
Using stat to get the last edit timestamp can lead to a failing test.
To be absolutely certain, use the timestamp stored in the page file.
As it stands, $Now is used for the timestamp in the page file but if
this is a new file (revision 1), then the index file gets rewritten
and its timestamp changes.
2014-06-22 23:11:35 +02:00
Alex Schroeder
a226902617 oddmuse-curl.el: RecentChanges with Summary
Recent Changes will now show the summary.
2014-06-22 22:20:25 +02:00
Aki Goto
213774d6ff joiner.pl: Support Questionasker and reCaptcha.
These are used in the Register and Login forms.

And, the deprecated CreatePageDir is replaced by CreateDir (fixes a bug
introduced by Oddmuse version 2.3.0).
2014-06-22 12:10:53 +02:00
Aki Goto
98d96fd1d8 gd_security_image.pl: New CAPTCHA module.
This one uses GD::SecurityImage.
2014-06-22 12:06:14 +02:00
Alex Schroeder
ddb8fb06e6 gotobar.pl: Add support for external links 2014-06-22 00:21:46 +02:00
Alex Schroeder
25989f78a5 Merge branch 'as/no-more-page-subdirectories' 2014-06-21 21:30:27 +02:00
Aki Goto
afdb7a9dcb form_timeout.pl: an anti-spam module for Oddmuse
This is an anti-spam module for Oddmuse using form timeout. Edit
permission times out after a specified duration (the default is 30
minutes). When edit content is posted directly by a spam bot without
viewing the edit form, edit will be denied.
2014-06-21 12:18:26 +02:00
Alex Schroeder
2e79a843c8 oddmuse-curl.el: Fix URL 2014-06-21 12:01:08 +02:00
Alex Schroeder
54370da235 oddmuse-curl.el: whitespace 2014-06-21 12:00:26 +02:00
Alex Schroeder
8ec456ed41 Merge branch 'as/no-more-page-subdirectories' of ssh://git.sv.gnu.org/srv/git/oddmuse into as/no-more-page-subdirectories 2014-06-21 05:51:35 -04:00
Alex Schroeder
020df9098d upgrade.pl: Fix globbing.
The globbing expression was broken such that pages starting with a dot
("invisible" files) were not migrated.
2014-06-21 05:49:31 -04:00
Alex Schroeder
43839ac1aa upgrade.t: Testing for the changes to upgrade.pl 2014-06-21 10:45:21 +02:00
Alex Schroeder
3c2f96250b upgrade.pl: Use variables; print utf8.
Instead of fiddling with @MyInitVariables, set the options naming
pages to the empty string.
2014-06-21 04:44:33 -04:00
Alex Schroeder
9def2d2eb2 upgrade.pl: Disable some module initialisations
Some modules read a page file when initializing. As these cannot be
found before the upgrade, we need to disable them.
2014-06-21 04:18:16 -04:00
Alex Schroeder
3ad40b84fb .gitignore: .DS_Store 2014-06-20 22:39:37 +02:00
Alex Schroeder
ecda4c3d98 oddmuse-curl.el: Preview shows just the preview
Don't show the header, footer and textarea; show just the preview div.
2014-06-20 22:36:09 +02:00
Alex Schroeder
74a0576c5d oddmuse-curl.el: Font lock restructuring
All the font-locking functions are now modifying font-lock-defaults
instead of calling font-lock-add-keywords because that's what it says
in the elisp manual.
2014-06-20 21:23:30 +02:00
Alex Schroeder
a6e07a9886 oddmuse-curl.el: Preview command
The preview command uses shr, a built in HTML renderer.
2014-06-20 18:31:33 +02:00
Alex Schroeder
b76b61dc86 .gitignore: .DS_Store 2014-06-19 23:11:04 +02:00
Alex Schroeder
c3cb434973 upgrade.pl: handle name spaces 2014-06-19 23:00:18 +02:00
Alex Schroeder
62f82c2af2 upgrade.pl: New interface.
Don't rely on a separate upgrade action. Any request except for login
and unlock will trigger an upgrade, if you're an admin. Once the upgrade
is complete, the module will rename itself such that it will no longer
load.
2014-06-17 13:14:13 +02:00
Alex Schroeder
d454973294 oddmuse-curl.el: fix order of font-locking
oddmuse-basic-markup must come last (which prepends its rules to the
front) such that links get precedence over other markup.
2014-06-17 12:26:50 +02:00
Alex Schroeder
cba29c8981 oddmuse-curl.el: added oddmuse-new
A function to make it easy to blog by offering the current ISO date as
page name.
2014-06-17 10:39:05 +02:00
Alex Schroeder
4a812931c8 oddmuse-curl.el: do not break links
Added a fill-nobreak-predicate to prevent links from breaking. This uses
the face property and checks for the link face.
2014-06-17 10:37:57 +02:00
Alex-Daniel Jakimenko
093a6da63d askpage.pl: Don't keep old value of $NewComment
Resetting the value was dead code. Instead of fixing this, the old value
is now discarded. There is no point in keeping it around.
2014-06-16 15:40:13 +02:00
Aki Goto
0ab5261bc6 load-lang.pl: add $LoadLanguageDir
The new option $LoadLanguageDir specifies a directory for the language
files.
2014-06-16 15:33:53 +02:00
Alex Schroeder
1d4f3e4a28 Ask Page extension
This is a simple extension to create a page for asking questions. The
process of writing a question is similar to writing a comment, for the
only exception that after pressing the ‘Save’ button the user will be
redirected to the newly created page containing his question.
2014-06-16 11:25:13 +02:00
Alex Jakimenko
6babcffd00 Consistency in file permissions.
Some modules are executable where as others are not. This patch fixes
this.
2014-06-16 11:19:24 +02:00
Alex Jakimenko
977cbba251 Fix two issues with $NewComment.
Display $NewComment above comment textarea.

'c' is now an access key to focus comment textarea.
2014-06-16 11:06:20 +02:00
Alex Schroeder
2fc4f4b054 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse into as/no-more-page-subdirectories 2014-06-16 10:32:31 +02:00
Alex Schroeder
53566c8434 Use a function instead of $ENV{REMOTE_ADDR}
When the webserver is behind a reverse proxy, $ENV{REMOTE_ADDR} is not
the actual remote client's address but the reverse proxy's address. The
actual remote client's address is available from an environment
variable. The name of this variable depends on the proxy, e.g. pound
uses $ENV{HTTP_X_FORWARDED_FOR}.

As suggested by tyatsumi on the wiki, all access $ENV{REMOTE_ADDR} now
happens via a new function which allows users to override it in their
config file.
2014-06-16 09:50:05 +02:00
Alex Schroeder
563e5cd9c6 upgrade.pl: delete empty directories after upgrade 2014-06-07 17:08:18 +02:00
Alex Schroeder
365d33b602 Get rid of one letter sub-directories.
Recent GNU/Linux systems use ext3 or ext4 file systems. These use HTree
to index files. Wikipedia says: "HTree indexing improved the scalability
of Linux ext2 based filesystems from a practical limit of a few thousand
files, into the range of tens of millions of files per directory. [...]
HTree indexes are available in ext3 when the dir_index feature is
enabled. [...] HTree indexes are turned on by default in ext4."

Thus, instead of working on balanced-page-directories.pl, we decided to
get rid of these sub-directories altogether.

Unfortunately, this is backwards incompatible. Users wanting to upgrade
will need to install the upgrade.pl extension in order to upgrade the
file database.
2014-06-06 17:32:44 +02:00
Alex Schroeder
eef56e435d questionasker.t: fixed number of tests 2014-06-05 17:07:15 +02:00
Alex Schroeder
2044564981 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/oddmuse 2014-06-05 05:34:08 -04:00
Aki Goto
50c9b79858 balanced-page-directories: reset GetPageDirectory
The test for migration sets GetPageDirectory; when the test fails and
we're not migrating, we need to reset GetPageDirectory to its old value.
2014-06-04 16:14:26 +02:00
Alex Schroeder
d99f62ea7e balanced-page-directories: fix page creation
Previously, no new pages could be created because of a deadlock. The
code mistakenly attempted to start migrating when a new page was
created, and since DoPost already held the main lock, migration failed.
The check was now fixed such that migration is not started when a new
page is being created.
2014-06-04 09:58:37 +02:00
Alex Schroeder
c11188fd3e fixed documentation typo 2014-06-03 16:17:07 +02:00
Alex Schroeder
dd22a852eb balanced-page-directories: new module 2014-06-03 16:14:48 +02:00
Alex Schroeder
62b2e22da8 Questionasker: encoding issue with hidden fields
We need to get rid of $q->hidden when using Unicode, as suggested by
tyatsumi on the wiki.
2014-06-03 11:19:50 +02:00
Alex Schroeder
5483bbf386 joiner: fix URL 2014-06-02 09:37:55 +02:00
Alex Schroeder
8608464863 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-06-02 09:22:38 +02:00
Aki Goto
b0d983c817 joiner: user registration module 2014-06-02 09:21:15 +02:00
Alex Schroeder
26a5db86b0 Fix module description. 2014-05-27 14:48:02 +02:00
Aki Goto
5f58256543 Updated Japanese translation. 2014-05-27 14:45:50 +02:00
Alex Jakimenko
c5c088deb1 Do not rehash the password for every entry. 2014-04-23 17:41:44 +02:00
Alex Schroeder
a5b5af9c07 Add $PassHashFunction and $PassSalt
This allows users to have the passwords encrypted in their config
file, as suggested by Alex Jakimenko.
2014-04-23 10:32:36 +02:00
Alex Jakimenko
0dcf49e2cf Add $CommentsPattern to supplement $CommentsPrefix
$CommentsPrefix is used in the code in two contexts:

- as a string added to the original page name to create links (used as
  a plain string)

- and as a way to detect whether the page has comments or not (used as
  a regular expression)

It feels natural to split this functionality into two separate
variables. $CommentsPattern is now the regular expression. No more
CommentsPrefix='.*' hacks!

For example, now you can do some complex stuff like this:

    $CommentsPrefix = 'Comments_on_';
    $CommentsPattern = '^(?|Comments_on_(.*)|Rant_About_(.*)|\d\d\d\d-\d\d-\d\d.*|FAQ)$';

Comments_on_ , Rant_About_ and journal pages will work correctly as
comments pages, but you can also specify some other pages as well, like
FAQ. Basically it can get as complex as one wants. $1 will be used to
create a link to the original page, which means that in this particular
example both Comments_on_Test and Rant_About_Test will have a link to
Test page, while FAQ will have no link to the original page at all.

Of course, by default there will only be "$CommentsPrefix . $id" link in
the footer, so you have to provide links to Rant_About_ pages elsewhere
yourself.

If you don't want to provide a regular expression pattern, you can leave
it undefined. It will be created automatically, keeping functionality
backwards compatible. If you were using $CommentsPrefix='.*' you should
now change it to $CommentsPattern='.*'.
2014-04-21 18:43:40 +02:00
Alex Jakimenko
f3885aa213 OpenPage: Remove useless test. 2014-04-20 00:26:29 +02:00
Alex Schroeder
6136b399a6 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-04-15 07:45:01 +02:00
Alex Schroeder
5cc7d55152 License, dependencies. 2014-04-15 07:39:01 +02:00
Alex Schroeder
4112d2acc4 New URL, trimmed wiki list. 2014-04-15 07:38:01 +02:00
Alex Jakimenko
f270a3ced4 Two small fixes
User input needs to be HTML quoted when printed.
The regular expression matching needs the ignore case flag.
2014-04-15 07:31:50 +02:00
Alex Schroeder
7f74d3c211 Use smaller headers 2014-04-09 08:34:14 -04:00
Alex Jakimenko
375c844e37 Specifying the number of entries for More...
This patch addes a new parameter to PrintJournal
such that a journal can have a certain number of
entries but when the user clicks on the More...
link, pagination happens with a different number.
<Journal 1,5>
2014-04-08 10:43:28 +02:00
Alex Jakimenko
efce35e250 Simplify FreeToNormal and remove if statement 2014-04-06 15:14:59 +02:00
Alex Schroeder
cff4f1fd28 Enabling diff usince C-x v = 2014-04-04 18:12:04 +02:00
Alex Schroeder
6f9ded7e41 vc-oddmuse.el added with support for C-x v l 2014-04-04 15:15:00 +02:00
Alex Jakimenko
40c01683fd Split pageidx file using space
Previously, we split it using whitespace (/\s+/). This caused a problem
if somebody managed to create a page containing non-breaking whitespace.
2014-03-29 09:42:00 +01:00
Alex Schroeder
ab3a7752ba New highlighting to look like Emacs buffers. 2014-03-21 19:18:15 +01:00
Alex Schroeder
08a4861dc3 Get rid of cloud icon. 2014-03-21 07:43:24 +01:00
Alex Schroeder
d7c40d4dbe Fix dead comment links
If the comment page does not exist, the static copy contains an anchor
element with no href attribute. Better avoid this situation.
2014-03-18 13:01:27 +01:00
Alex Schroeder
f8360bebad Produce static.css as well when exporting 2014-03-18 12:47:16 +01:00
Alex Schroeder
45a0558fcc Fixing the UTF-8 encoding issues for static export 2014-03-18 11:49:28 +01:00
Alex Schroeder
f4ff56e69f Fix HTML output for static export 2014-03-18 11:21:08 +01:00
Alex Schroeder
0d7236c047 More tests regarding local links in static exports 2014-03-18 10:32:22 +01:00
Alex Schroeder
686f24251b Fix static export of HTML pages
Apparently the html=1 parameter got lost so that you could not force an
export of all the pages.
2014-03-18 09:26:04 +01:00
Alex Schroeder
0841c834b9 Escape URL of More... links
When computing the More... link at the end of a journal, we need to URL
escape all user input. In this case, that's the regexp and search
parameter.
2014-03-17 09:52:30 +01:00
Alex Schroeder
5225bded01 Revert "Homepage URL fixing works recognizes https."
I must have been hallucinating. Instead of committing the change I
wanted to commit, I added a file that wasn't ready.

This reverts commit 670b69c118.
2014-03-17 09:51:11 +01:00
Alex Schroeder
e0d18c31e2 Homepage URL fixing works recognizes https.
When leaving a comment, users are given the option of providing a
homepage to link their name to. A common error is to just provide a
domain like "oddmuse.org" instead of a real URL. The resulting markup
used to be [oddmuse.org YourName] which doesn't do what the user
expected. That's why a piece of code used to check whether the homepage
starts with "http://" and if it doesn't, it prefixes it, resulting in
"[http://oddmuse.org YourName]". If the homepage started with
"https://", however, the code did the wrong thing. That's why we're now
checking whether the homepage starts with any known URL-protocol and a
colon.
2014-03-17 09:50:32 +01:00
Alex Schroeder
670b69c118 Homepage URL fixing works recognizes https.
When leaving a comment, users are given the option of providing a
homepage to link their name to. A common error is to just provide a
domain like "oddmuse.org" instead of a real URL. The resulting markup
used to be [oddmuse.org YourName] which doesn't do what the user
expected. That's why a piece of code used to check whether the homepage
starts with "http://" and if it doesn't, it prefixes it, resulting in
"[http://oddmuse.org YourName]". If the homepage started with
"https://", however, the code did the wrong thing. That's why we're now
checking whether the homepage starts with any known URL-protocol and a
colon.
2014-03-16 08:48:36 +01:00
Alex Schroeder
f4d0f300e6 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse
Conflicts:
	modules/translations/chinese_cn-utf8.pl
2014-03-07 09:02:41 +01:00
Andy Stewart
53a7a9a80c chinese_cn-utf8.pl: Updated translation
Simplified Chinese, fixed.
2014-03-07 08:38:15 +01:00
Alex Schroeder
4f675de687 oddmuse-curl.el: Fix following page links. 2014-03-07 08:31:08 +01:00
Alex Schroeder
dffe5e3053 Updated with new texts. 2014-03-06 17:15:35 +01:00
Alex Schroeder
201970ba0b Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2014-03-06 16:28:27 +01:00
Alex Schroeder
7e9137c6f8 Changing 回復 to 回滾 after feedback from Andy Stewart. 2014-03-06 16:23:04 +01:00
Alex Schroeder
9d81a1e3d2 DoDuckDuckGoSearch uses UrlEncode on the argument.
Drew Adams reported that clicking on the title of a page with a + in
its name had the + replaced by a space. This commit fixes this issue.
2014-03-03 08:30:21 +01:00
Alex Schroeder
2f58de9aa4 $NewText and $NewComment can be translated.
As suggested by Dexasys on the wiki.
2014-02-01 23:49:48 +01:00
543 changed files with 39434 additions and 12490 deletions

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@
/Mac/pkg/
*.dmg
*.pkg
.DS_Store
wiki.log

16
BUGS
View File

@@ -1,16 +0,0 @@
I've seen a bug that shows as follows: <strong class="changes">think
it belongs anymore.</stron><strong class="changes">g>.
Is DiffHtmlMarkWords called twice for a chunk?
It seems that following the diff link from RC to a page that has
a minor edit at the end will show a minor diff instead of a major
diff, eventhough it *says* that it will show a major diff!
mod_perl:
After a while, the script forgets some pages, so that links to these
pages turn into questionmarks.
From time to time, the script will show for a page X the page content
of the previous page.

675
LICENSE Normal file
View File

@@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDeleteWarning</key>
<string></string>
<key>IFPkgDescriptionDescription</key>
<string>A wiki engine.</string>
<key>IFPkgDescriptionTitle</key>
<string>Oddmuse</string>
<key>IFPkgDescriptionVersion</key>
<string></string>
</dict>
</plist>

View File

@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>Oddmuse</string>
<key>CFBundleName</key>
<string>Oddmuse</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>IFMajorVersion</key>
<integer>1</integer>
<key>IFMinorVersion</key>
<integer>0</integer>
<key>IFPkgFlagAllowBackRev</key>
<false/>
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
<key>IFPkgFlagDefaultLocation</key>
<string>/Library/WebServer</string>
<key>IFPkgFlagFollowLinks</key>
<false/>
<key>IFPkgFlagInstallFat</key>
<false/>
<key>IFPkgFlagIsRequired</key>
<false/>
<key>IFPkgFlagOverwritePermissions</key>
<false/>
<key>IFPkgFlagRelocatable</key>
<false/>
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagRootVolumeOnly</key>
<true/>
<key>IFPkgFlagUpdateInstalledLanguages</key>
<false/>
<key>IFPkgFlagUseUserMask</key>
<integer>0</integer>
<key>IFPkgFormatVersion</key>
<real>0.10000000149011612</real>
</dict>
</plist>

View File

@@ -1,4 +0,0 @@
#!/usr/bin/perl
package OddMuse;
$DataDir = '/Library/WebServer/Oddmuse';
do 'current';

View File

@@ -1 +0,0 @@
$AdminPass = '';

View File

@@ -1 +0,0 @@
$AdminPass = '';

View File

@@ -1,4 +0,0 @@
#!/usr/bin/perl
package OddMuse;
$DataDir = '/Library/WebServer/Oddmuse';
do 'current';

156
Makefile
View File

@@ -1,8 +1,9 @@
# The Makefile is only for developpers wanting to prepare the tarball.
# Make sure the CVS keywords for the sed command on the next line are not expanded.
# In order to build a copy of Oddmuse with all the version numbers, use:
# make build. This creates modified copies of the files in the build
# subdirectory.
VERSION_NO=$(shell git describe --tags)
TRANSLATIONS=$(wildcard modules/translations/[a-z]*-utf8.pl$)
TRANSLATIONS=$(wildcard modules/translations/[a-z]*.pl$)
MODULES=$(wildcard modules/*.pl)
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
@@ -16,152 +17,37 @@ prepare: build $(BUILD)
build:
mkdir -p build
clean:
rm -rf build
build/wiki.pl: wiki.pl
sed "s/\\\$$q->a({-href=>'http:\/\/www.oddmuse.org\/'}, 'Oddmuse')/\\\$$q->a({-href=>'http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . &/" < $< > $@
perl -lne "s/(\\\$$q->a\({-href=>'http:\/\/www.oddmuse.org\/'}, 'Oddmuse'\))/\\\$$q->a({-href=>'http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
build/%-utf8.pl: modules/translations/%-utf8.pl
sed "s/<a href=\"http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tree\/modules\/translations\/\\(.*\\).pl\">\\(.*\\).pl<\/a>/<a href=\"http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tree\/modules\/translations\/\\1.pl?id=$(VERSION_NO)\">\\1.pl<\/a> (for $(VERSION_NO))/" < $< > $@
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
# Currently oddtrans introduces encoding errors!
build/national-%.pl: modules/translations/national-%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
# %-utf8.pl: wiki.pl $(MODULES)
# perl oddtrans -l $@ $^ > $@-new && mv $@-new $@
build/month-names-%.pl: modules/translations/month-names-%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
# from: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
# to: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
build/%.pl: modules/%.pl
sed "s/<a href=\"http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tree\/modules\/\\(.*\\).pl\">\\(.*\\).pl<\/a>/<a href=\"http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tree\/modules\/\\1.pl?id=$(VERSION_NO)\">\\1.pl<\/a> (for $(VERSION_NO))/" < $< > $@
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
# UNTESTED/OBSOLETE: these targets have not been tested in a long time
# and are potentially obsolete.
VERSION=oddmuse-$(VERSION_NO)
UPLOADVERSION=oddmuse-inkscape-$(VERSION_NO)
INKSCAPE=GPL $(wildcard inkscape/*.py inkscape/*.inx inkscape/*.sh)
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
DIST=$(VERSION).tar.gz $(VERSION).tar.gz.sig \
contrib/simple-install/$(VERSION)-simple.tar.gz \
contrib/simple-install/$(VERSION)-simple.tar.gz.sig
OLDDIST=$(VERSION).dmg $(VERSION).dmg.sig \
$(VERSION).tgz $(VERSION).tgz.sig
PWD=$(shell pwd)
dist: $(DIST)
upload: $(DIST)
translations: $(TRANSLATIONS)
for f in $^; do \
scp $$f as@dl.sv.nongnu.org:/releases/oddmuse/; \
echo updating $$f...; \
perl stuff/oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
done
upload-text: new-utf8.pl
wikiupload new-utf8.pl http://www.oddmuse.org/cgi-bin/oddmuse-en/New_Translation_File
contrib/simple-install/$(VERSION)-simple.tar.gz:
cd contrib/simple-install && make $(VERSION)-simple.tar.gz
$(VERSION).tar.gz: README FDL GPL ChangeLog wiki.pl $(TRANSLATIONS) $(MODULES) current.pl
rm -rf $(VERSION)
mkdir $(VERSION)
cp $^ $(VERSION)
tar czf $@ $(VERSION)
$(UPLOADVERSION).tar.gz: $(INKSCAPE)
rm -rf $(UPLOADVERSION)
mkdir $(UPLOADVERSION)
cp $^ $(UPLOADVERSION)
cp wikiupload $(UPLOADVERSION)/oddmuse-upload.py
tar czf $@ $(UPLOADVERSION)
%.sig: %
gpg --sign -b $<
# OSX: .pkg is the package, and .dmg is the disk image.
# Make sure to copy the files into a new directory so that the CVS
#subdirectory are not inlcuded in the .pkg. And fix permissions. Skip
#if we can't run PackageMaker. All cp commands need sudo because on a
#second run the directories will already exist.
$(VERSION).pkg: wiki.pl modules/creole.pl Mac/config Mac/wiki
if test -x $(PACKAGEMAKER); then \
mkdir -p Mac/pkg/CGI-Executables; \
sudo cp wiki.pl Mac/pkg/CGI-Executables/current; \
sudo cp Mac/wiki Mac/pkg/CGI-Executables/wiki; \
sudo chown -R root:admin Mac/pkg/CGI-Executables; \
sudo chmod 644 Mac/pkg/CGI-Executables/current; \
sudo chmod 755 Mac/pkg/CGI-Executables/wiki; \
mkdir -p Mac/pkg/Oddmuse; \
sudo cp Mac/config Mac/pkg/Oddmuse; \
sudo chown www:admin Mac/pkg/Oddmuse; \
sudo chmod 775 Mac/pkg/Oddmuse; \
sudo chown root:admin Mac/pkg/Oddmuse/config; \
sudo chmod 664 Mac/pkg/Oddmuse/config; \
mkdir -p Mac/pkg/Oddmuse/modules; \
sudo cp modules/mac.pl Mac/pkg/Oddmuse/modules; \
sudo cp modules/creole.pl Mac/pkg/Oddmuse/modules; \
sudo chown -R root:admin Mac/pkg/Oddmuse/modules; \
sudo chmod 775 Mac/pkg/Oddmuse/modules; \
sudo chmod 644 Mac/pkg/Oddmuse/modules/*; \
$(PACKAGEMAKER) -build \
-p $(PWD)/$@ \
-i $(PWD)/Mac/Info.plist \
-d $(PWD)/Mac/Description.plist \
-f $(PWD)/Mac/pkg; \
fi;
$(VERSION).dmg: $(VERSION).pkg
hdiutil create -srcfolder $< -fs HFS+ -volname "Oddmuse" $@
# Slackware: .tgz are .tar.gz files used by the installer
# Slackware webserver is run by nobody uid/gid 99/99.
$(VERSION).tgz: wiki.pl modules/creole.pl Mac/config Mac/wiki
sudo rm -rf Slack/var Slack/install
mkdir -p Slack/var/www/wiki/modules
mkdir -p Slack/var/www/cgi-bin
mkdir -p Slack/install
sudo cp Mac/config Slack/var/www/wiki
sudo cp Mac/wiki Slack/var/www/cgi-bin
sudo cp README Slack/var/www/wiki
sudo cp modules/creole.pl Slack/var/www/wiki/modules
sudo cp wiki.pl Slack/var/www/cgi-bin/current
sudo sed -e 's/VERSION/$(VERSION_NO)/' < Slack/slack-desc > Slack/install/slack-desc
sudo chown -R 0:0 Slack/var Slack/install
sudo chgrp 99 Slack/var/www/cgi-bin/wiki
sudo chmod 644 Slack/var/www/cgi-bin/current
sudo chmod 775 Slack/var/www/cgi-bin/wiki
cd Slack && tar czf ../$@ var install
update-translations: $(TRANSLATIONS)
upload-translations: always
for f in $(TRANSLATIONS); do \
cvs status $$f | grep 'Status: Up-to-date'; \
wikiput -z "ham" -u "cvs" -s "update" \
"http://www.oddmuse.org/cgi-bin/oddmuse/raw/$$f" < $$f; \
done
deb:
equivs-build control
install:
@echo This only installs the deb file, not the script itself.
dpkg -i oddmuse*.deb
test:
prove t
package-upload: debian-$(VERSION).tar.gz debian-$(VERSION).tar.gz.sig
curl -T "{debian-$(VERSION).tar.gz,debian-$(VERSION).tar.gz.sig}" \
ftp://savannah.gnu.org/incoming/savannah/oddmuse/
package: debian-$(VERSION).tar.gz
gpg --ascii --encrypt $<
debian-$(VERSION).tar.gz:
rm -rf $(VERSION)
mkdir $(VERSION)
cp README FDL GPL wiki.pl $(VERSION)
tar czf $@ $(VERSION)

View File

@@ -1,37 +0,0 @@
# Copyright (C) 2005 Alex Schroeder <alex@emacswiki.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 Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => qw(OK);
package OddMuse;
$RunCGI = 0;
require 'wiki.pl';
sub handler {
my $r = shift;
for my $var (qw{DataDir UseConfig ConfigFile ModuleDir ConfigPage
AdminPass EditPass ScriptName FullUrl}) {
no strict "refs";
$$var = $ENV{"Wiki$var"} if exists $ENV{"Wiki$var"}; # symbolic references
}
DoWikiRequest();
return Apache2::Const::OK;
}

48
README
View File

@@ -1,48 +0,0 @@
This is the README file distributed together with the Oddmuse script.
To install the script, copy wiki.pl into your cgi-bin directory. This
will store the pages in a temporary directory for you. In order to
make this permanent, change the $DataDir option in the script from
'/tmp/oddmuse' to 'oddmuse'. This will save the pages in a
subdirectory of your cgi-bin directory.
In order to start your wiki, click on the edit link (the first link
below the navigation bar, at the bottom of the page). This will allow
you to enter some text for this page. Click the Save button and you
are done.
To add new pages, edit the homepage and add links to new pages. Links
are traditionally formed by ConcatenatingCapitalizedWords. This kind
of link pattern is called a wiki word.
Alternatively, put links in [[double square brackets]]. This kind of
link pattern is called a free link.
As long as the new pages don't exist, links to these pages are
followed by a clickable question mark. Click on the question mark to
create the new page.
Enjoy your wiki experience.
Visit http://www.oddmuse.org/ to learn more about the translation
files and modules that are part of this package.
----------------------------------------------------------------------
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation.
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.
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.

159
README.creole Normal file
View File

@@ -0,0 +1,159 @@
This is the README file distributed together with the
[[https://oddmuse.org/|Oddmuse]] script.
== Installing Oddmuse on a Debian System running Apache
The following instructions require a number of tools. You can make sure
they're all installed by issuing the following command as {{{root}}}:
{{{
apt-get install coreutils apache2 sudo wget w3m perl \
libwww-perl libxml-rss-perl diffutils
}}}
You probably created an account for yourself. You might have to add this
user to the {{{sudo}}} group. Here's how I created my own user as
{{{root}}}:
{{{
adduser alex
usermod -a -G sudo alex
}}}
Now you can login as {{{alex}}} and do everything else using {{{sudo}}}.
You need to copy wiki.pl into your cgi-bin directory, and you need to
make the script executable.
{{{
sudo wget -O /usr/lib/cgi-bin/wiki.pl \
http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
sudo chmod +x /usr/lib/cgi-bin/wiki.pl
}}}
You should be able to test it right now! Visit
{{{http://localhost/cgi-bin/wiki.pl}}}. If your site is available from
the outside, you will be able to use a normal browser. If don't have a
domain name yet, you'll probably have to use a text browser like
{{{w3m}}}.
{{{
w3m http://localhost/cgi-bin/wiki.pl
}}}
If you create pages in this wiki, these will get stored in a temporary
directory. You need change the data directory from {{{"/tmp/oddmuse"}}}
to like {{{"/var/local/oddmuse"}}}. The best way to do this without
changing {{{wiki.pl}}} is by editing
{{{/etc/apache2/sites-available/default}}}. Add the following line:
{{{
SetEnv WikiDataDir /var/local/oddmuse
}}}
Enable the default site by calling the following command:
{{{
sudo a2ensite default
}}}
Reload the Apache configuration by calling the following command:
{{{
sudo service apache2 reload
}}}
You need to create the new data directory. You webserver runs CGI
scripts as {{{www-data}}}. Thus, you need to change the owner and group
of the directory to {{{www-data}}}.
{{{
sudo mkdir -p /var/local/oddmuse
sudo chown www-data.www-data /var/local/oddmuse
}}}
Done! Visit your wiki and start editing. Click on the edit link (the
first link below the navigation bar, at the bottom of the page). This
will allow you to enter some text for this page. Click the Save button
and you are done.
To add new pages, edit the homepage and add links to new pages by
putting their names in {{{[[double square brackets]]}}}.
Enjoy your wiki experience.
Visit https://www.oddmuse.org/ to learn more about the translation
files and modules that are part of this package.
== Apache
If you think this information doesn't work for you, here are some things
to check.
Apache's config directory is {{{/etc/apache2/apache2.conf}}}. This is
where we get the {{{www-data}}} username from. It says:
{{{
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
}}}
Checking {{{/etc/apache2/envvars}}} we see the following:
{{{
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
}}}
So that's what we're using in the {{{chown}}} command in our
instructions above.
The default site is configured in
{{{/etc/apache2/sites-available/default}}}. In order for it to be
//enabled//, there must be a symlink from a file in
{{{/etc/apache2/sites-enabled}}} to the file in
{{{sites-available}}}. You can enable it using the following command:
{{{
sudo a2ensite default
}}}
This file also lists the directories we've used in out instructions
above.
{{{
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
}}}
This means that {{{http://localhost/cgi-bin/wiki.pl}}} will call
{{{/usr/lib/cgi-bin/wiki.pl}}}
Don't forget to reload the Apache configuration as shown above, or
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
any later version published by the Free Software Foundation.
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.
Both the GNU Free Documentation License, and the GNU General Public
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,19 +0,0 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
oddmuse: Oddmuse VERSION
oddmuse:
oddmuse: Oddmuse is the name of the wiki engine being further developed by
oddmuse: Alex Schröder. The wiki engine consists of one big Perl script.
oddmuse: When installed on a web host, the script generates a wiki -- a
oddmuse: web site where users can read pages, change pages, add new pages,
oddmuse: and delete old pages. All pages are accessed via the script.
oddmuse:
oddmuse: This package will also install the Creole markup extension.
oddmuse:
oddmuse: Package created by Alex Schröder

View File

@@ -1,172 +0,0 @@
Name: OddMuseWiki
Version: 2007.12.31
Release: 1suse
Group: Applications/Productivity
License: /opt/OddMuseWiki/doc/COPYING
Summary: Simple user-editted website (wiki)
Distribution: any perl+webserver+cgi distro
Vendor: Alex Schröder
Packager: Dr. Robert J. Meier <grandfather@sourceforge.org>
URL: http://www.oddmusewiki.org/
BuildRoot: /var/tmp/rpm-oddmusewiki-root
BuildArch: noarch
Prefix: /opt/OddMuseWiki
Prefix: /srv/www/wiki
Prefix: /srv/www/cgi-bin
Prefix: /etc/httpd/conf.d
Source0: %{name}-%{version}.tar.gz
Source1: %{name}-modules-%{version}.tar.gz
Source2: %{name}-contents-%{version}.tar.gz
Provides: wiki
Requires: perl >= 5.0.0
# Avoid automatic dependency calculation macros, as they are seldom portable.
AutoReq: no
AutoProv: no
%description
OddMuseWiki is a program to run a wiki.
A wiki can be used for communication in a team or for documentation,
when things have to be quick and easy: Content Management for everybody.
A wiki enables other people to quickly join efforts. In the office,
you can introduce new employees, distribute phone lists, store memos,
plan trips, document projects, prepare meetings,
or describe internal processes.
For many free software projects wikis have taken an important role
somewhere between manual, FAQ, IRC, and mailing lists.
OddMuseWiki is very easy to install: Simple installation, compact code,
and easy extensibility were the most important design factors.
Features
1. Easy to install: Just copy one file into the correct directory.
2. No dependencies on version management tools or database installation.
3. Web server needs only Perl installed.
4. Easy to use for users, easy to hack for programmers.
5. Capable of multilingual sites.
6. Unicode (UTF-8) per default.
7. Valid HTML; CSS friendly.
8. Caching on several levels.
9. Easy to download.
%prep
# Record the environment variables
# $RPM_ARCH $RPM_OS - host configuration
# $RPM_OPT_FLAGS - c compile flags
# $RPM_PACKAGE_[NAME VERSION RELEASE] - spec file fields
# $RPM_SOURCE_DIR - base for Source and Patch filenames
# $RPM_BUILD_DIR - base for setup macro filenames
# $RPM_BUILD_ROOT - %{BuildRoot}
# modified by rpmbuild --buildroot
# $RPM_DOC_DIR - base for doc macro filenames
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-prep.log; fi
%setup -q -b1 -b2
%build
# Record the environment variables
# Nomimally these are the same as for %prep
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-build.log; fi
# Nothing to build yet.
%install
# Record the environment variables
# Nomimally these are the same as for %prep
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-install.log; fi
rm -rf "$RPM_BUILD_ROOT"
mkdir -p "$RPM_BUILD_ROOT"/opt/OddMuseWiki/cgi-bin
mkdir -p "$RPM_BUILD_ROOT"/opt/OddMuseWiki/doc
mkdir -p "$RPM_BUILD_ROOT"/opt/OddMuseWiki/etc
mkdir -p "$RPM_BUILD_ROOT"/opt/OddMuseWiki/libperl
mkdir -p "$RPM_BUILD_ROOT"/srv/www/cgi-bin
mkdir -p "$RPM_BUILD_ROOT"/srv/www/wiki
mkdir -p "$RPM_BUILD_ROOT"/etc/httpd/conf.d
install cgi-bin/wiki.pl "$RPM_BUILD_ROOT"/opt/OddMuseWiki/cgi-bin
install cgi-bin/wiki.pl "$RPM_BUILD_ROOT"/srv/www/cgi-bin
install doc/COPYING "$RPM_BUILD_ROOT"/opt/OddMuseWiki/doc
install etc/oddmusewiki.conf "$RPM_BUILD_ROOT"/opt/OddMuseWiki/etc
install libperl/current libperl/*.pl "$RPM_BUILD_ROOT"/opt/OddMuseWiki/libperl
cp -r wiki "$RPM_BUILD_ROOT"/srv/www
%clean
# Record the environment variables
# Nomimally these are the same as for %prep
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-clean.log; fi
rm -rf "$RPM_BUILD_ROOT"
%pre
# Record local environment variables.
# $RPM_INSTALL_PREFIX* reflect the Prefix: field(s)
# modified by --relocate and --prefix arguments
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-pre.log; fi
%post
# Record local environment variables
# $RPM_INSTALL_PREFIX* reflect the Prefix: field(s)
# modified by --relocate and --prefix arguments
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-post.log; fi
# Because relocation may change configuration,
# it cannot be symlinked into a public access site at rpmbuild -bb time.
if [ \( -d "$RPM_INSTALL_PREFIX2" -a -w "$RPM_INSTALL_PREFIX2" \) -o -w "$RPM_INSTALL_PREFIX2"/wiki.pl ]; then
cat "$RPM_INSTALL_PREFIX0"/cgi-bin/wiki.pl |
perl -pe 's:/opt/OddMuseWiki:'"$RPM_INSTALL_PREFIX0"':;' |
perl -pe 's:/srv/www/wiki:'"$RPM_INSTALL_PREFIX1"':;' |
cat > "$RPM_INSTALL_PREFIX2"/wiki.pl
fi
%preun
# Record local environment variables
# $RPM_INSTALL_PREFIX* reflect the Prefix: field(s)
# modified by --relocate and --prefix arguments at rpm -i time
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-preun.log; fi
%postun
# Record local environment variables
# $RPM_INSTALL_PREFIX* reflect the Prefix: field(s)
# modified by --relocate and --prefix arguments at rpm -i time
if [ "$RPM_DUMPENV" != "" ] ; then env | sort > /tmp/rpm-postun.log; fi
%files
# The doc, config, attr and many other macros are well documented in RPM-HOWTO
%defattr(0444,root,root)
%license
%attr(0555,root,root) /opt/OddMuseWiki
%config /opt/OddMuseWiki/etc/oddmusewiki.conf
%attr(0777,root,root) /srv/www/wiki
%attr(0555,root,root) /srv/www/cgi-bin/wiki.pl
%changelog
* Wed Jan 3 2008 Dr. Robert Meier <grandfather@sourceforge.org> 2007.12.13-1suse
- copy-and-edit from hello.rpm

8
contrib/README.md Normal file
View File

@@ -0,0 +1,8 @@
Code for Special Circumstances
==============================
The files in this directory serve a particular purpose which might be
of interest to others. These are not generic scripts (there is a
separate directory for those). These are CGI scripts that post to a
Campaign Wiki, that allow you to edit wikis using Emacs, that copy
data from a particular site and post them to the Emacs Wiki.

View File

@@ -0,0 +1,37 @@
The files in this directory are used to run https://campaignwiki.org/
add-link.pl
===========
This is used to add links to the Links To Wisdom wiki. This wiki is a
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.
https://campaignwiki.org/wiki/LinksToWisdom/HomePage
copy.pl
=======
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.
https://campaignwiki.org/wiki/BlogArchive/HomePage
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.
https://campaignwiki.org/wiki/Monsters/HomePage
submit.pl
=========
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.
https://campaignwiki.org/wiki/Planet/HomePage

View File

@@ -1,6 +1,6 @@
#! /usr/bin/perl
# Copyright (C) 2011 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20112015 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
@@ -15,23 +15,46 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
package OddMuse;
use LWP::UserAgent;
use HTML::TreeBuilder;
use JSON::PP;
use utf8;
# load Oddmuse core
$RunCGI = 0;
do "wiki.pl";
# globals
my $name = "OSR Links to Wisdom";
my $wiki = 'LinksToWisdom';
my $site = "http://campaignwiki.org/wiki/$wiki";
# globals depending on the name of the script
my ($self, $name, $wiki);
if ($0 eq '/home/alex/campaignwiki.org/add-link.pl') {
$self = "https://campaignwiki.org/add-link";
$name = "OSR Links to Wisdom";
$wiki = 'LinksToWisdom';
} elsif ($0 eq '/home/alex/campaignwiki.org/add-adventure.pl') {
$self = "https://campaignwiki.org/add-adventure";
$name = "OSR Links to Adventures";
$wiki = 'Adventures';
} else {
ReportError('Cannot determine wiki!', '500 INTERNAL SERVER ERROR');
}
# derived variables
my $site = "https://campaignwiki.org/wiki/$wiki";
# my $site = "http://localhost/wiki.pl";
my $home = "$site/$HomePage";
# http://www.emacswiki.org/pics/star.png
my $stardata = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEUAAHkAAACzdRTapx3twwD/9qb////1YCa0AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfXAQYCJAu+WhwbAAAAKnRFWHRDb21tZW50AGJ5IFJhZG9taXIgJ1RoZSBTaGVlcCcgRG9waWVybGFza2kVfTXbAAAAYElEQVQI12NgQAKMMIaYAFTAzRDKCHOEMETCnEFyjIJhYS6OggwMoqGhaS7GRgIMjC6uYc5GikA5YRcXIyWwotBgJUWw7lAXsAyDaIihMlhK1FFA0AjEEAESQgJQu4EYAPAPC2XcokgQAAAAAElFTkSuQmCC';
main();
sub canonical {
my $url = shift;
# handle blogspot domain munging
$url =~ s/blogspot(\.[a-z]+)+/blogspot.com/;
return $url;
}
sub toc {
# start with the homepage
my @values;
@@ -47,9 +70,60 @@ sub toc {
$labels{$value} = $label;
}
}
return \@values, \%labels;
}
sub top {
# start with the homepage
my %blog;
my $n;
for my $id (GetPageContent($HomePage) =~ /\* \[\[(.*?)\]\]/g) {
for my $item (GetPageContent(FreeToNormal($id)) =~ /^\*+\s+\[(https?:\/\/[^\/\n\t ]+)/mg) {
$n++;
$blog{canonical($item)}++;
}
}
print $q->p("Total links counted: $n.");
my @list = sort { $blog{$b} <=> $blog{$a} } keys %blog;
# my $max = scalar @list;
# $max = 20 if $max > 20;
# @list = @list[0 .. $max -1];
@list = map {
my $domain = substr($_, index($_, '://') + 3);
my $term = quotemeta($domain);
# handle blogspot domain munging
$term =~ s/blogspot\\\.com/blogspot(\\.[a-z]+)+/;
$term = QuoteHtml($term);
$q->a({-href => $_}, $domain)
. " (" . $q->a({-href => "$self/match/$term"}, $blog{$_}) . ")";
} @list;
return \@list;
}
sub match {
my $term = shift;
# start with the homepage
my @list;
my $title;
for my $id (GetPageContent($HomePage) =~ /\* \[\[(.*?)\]\]/g) {
for my $line (split /\n/, GetPageContent(FreeToNormal($id))) {
if ($line =~ /^\*+\s+([^][\n]*)$/) {
$title = $1;
} elsif ($line =~ /$term/o) {
if ($line =~ /^\*+\s+\[(https?:\S+)\s+([^]]+)\]/) {
push (@list, $q->a({-href => $1}, $2) . " (" . $title . ")");
}
}
}
}
return \@list;
}
sub html_toc {
my ($values, $labels) = toc();
return $q->radio_group(-name =>'toc',
-values => \@values,
-labels => \%labels,
-values => $values,
-labels => $labels,
-linebreak=>'true');
}
@@ -57,102 +131,134 @@ sub default {
print $q->p("Add a link to the " . $q->a({-href=>$home}, $name) . ".");
print $q->start_multipart_form(-method=>'get', -class=>'submit');
print $q->p($q->label({-for=>'url'}, T('URL:')) . ' '
. $q->textfield(-name=>'url', -id=>'url', -size=>50));
print toc();
print $q->submit('go', 'Add!');
print $q->end_form();
print $q->p("Drag this bookmarklet to your bookmarks bar for easy access:",
. $q->textfield(-name=>'url', -id=>'url', -size=>80));
print $q->p({-style=>'font-size: 10pt'},
"(Drag this bookmarklet to your bookmarks bar for easy access:",
$q->a({-href=>q{javascript:location='}
. $q->url()
. qq{?url='+encodeURIComponent(window.location.href)}},
"Submit $name") . ".");
"Submit $name") . ".)");
print html_toc();
print $q->submit('go', 'Add!');
print $q->end_form();
}
sub check_url {
my $toc = GetParam('toc');
return default() unless $toc;
my $url = shift;
if (not GetParam('confirm', 0)) {
my $name = get_name($url);
print $q->p("Please confirm that you want to add "
. GetUrl($url, $name)
. " to the section “$toc”.");
print $q->start_form(-method=>'get');
print $q->p($q->label({-for=>'name', -style=>'display: inline-block; width:30ex'},
T('Use a different link name:')) . ' '
. $q->textfield(-style=>'display: inline-block; width:60ex',
-name=>'name', -id=>'name', -size=>50, -default=>$name)
. $q->br()
. $q->label({-for=>'username', -style=>'display: inline-block; width:30ex'},
T('Your name for the log file:')) . ' '
. $q->textfield(-style=>'display: inline-block; width:60ex',
-name=>'username', -id=>'username', -size=>50));
my $star = $q->img({-src=>'http://www.emacswiki.org/pics/star.png', -class=>'smiley',
-alt=>'star'});
print '<p>Optionally: Do you want to rate it?<br />';
my $i = 0;
foreach my $label ($q->span({-style=>'display: inline-block; width:15ex'}, $star)
. 'I might use this for my next campaign',
$q->span({-style=>'display: inline-block; width:15ex'}, $star x 2)
. 'I have used this in a campaign and it worked as intended',
$q->span({-style=>'display: inline-block; width:15ex'}, $star x 3)
. 'I have used it in many of my campaigns',
$q->span({-style=>'display: inline-block; width:15ex'}, $star x 4)
. 'Everybody should give it a try',
$q->span({-style=>'display: inline-block; width:15ex'}, $star x 5)
. 'Everybody should use it, that is how awesome it is!') {
$i++;
print qq{<label><input type="radio" name="stars" value="$i" $checked/>$label</label><br />};
sub links {
# start with the homepage
my @links; # [["url", "title", "page id"], ...]
for my $id (GetPageContent($HomePage) =~ /\* \[\[(.*?)\]\]/g) {
for my $item (GetPageContent(FreeToNormal($id)) =~ /^\*+\s+\[(https?:\/\/.*?)\]/mg) {
my ($url, $title) = split(/\s+/, $item, 2);
push(@links, [$url, $title, $id]);
}
print '</p>';
print $q->hidden('url', $url);
print $q->hidden('toc', $toc);
print $q->hidden('confirm', 1);
print $q->submit('go', 'Continue');
print $q->end_form();
} else {
post_addition($q->param('name'), $url, $toc);
}
return @links;
}
sub is_duplicate {
my $url = shift;
for my $link (links()) {
if ($link->[0] eq $url) {
print $q->p($q->strong("Oops, we seem to have a problem!"));
print $q->p(GetPageLink(NormalToFree($link->[2])),
" already links to the URL you submitted:",
GetUrl($link->[0], $link->[1]));
return 1;
}
}
return 0;
}
sub confirm {
my ($url, $name, $toc) = @_;
print $q->p("Please confirm that you want to add "
. GetUrl($url, $name)
. " to the section “$toc”.");
print $q->start_form(-method=>'get');
print $q->p($q->label({-for=>'name', -style=>'display: inline-block; width: 15em'},
T('Use a different link name:')) . ' '
. $q->textfield(-style=>'display: inline-block; width:50ex',
-name=>'name', -id=>'name', -size=>50, -default=>$name)
. $q->br()
. $q->label({-for=>'summary', -style=>'display: inline-block; width:15em'},
T('An optional short summary:')) . ' '
. $q->textfield(-style=>'display: inline-block; width:50ex',
-name=>'summary', -id=>'summary', -size=>50)
. $q->br()
. $q->label({-for=>'username', -style=>'display: inline-block; width:15em'},
T('Your name for the log file:')) . ' '
. $q->textfield(-style=>'display: inline-block; width:50ex',
-name=>'username', -id=>'username', -size=>50));
my $star = $q->img({-src=>$stardata, -class=>'smiley', -alt=>'☆'});
print '<p>Optionally: Do you want to rate it?<br />';
my $i = 0;
foreach my $label ($q->span({-style=>'display: inline-block; width:3em'}, $star)
. 'I might use this for my campaign',
$q->span({-style=>'display: inline-block; width:3em'}, $star x 2)
. 'I have used this in a campaign and it worked as intended',
$q->span({-style=>'display: inline-block; width:3em'}, $star x 3)
. 'I have used this in a campaign and it was ' . $q->em('great')) {
$i++;
print qq{<label><input type="radio" name="stars" value="$i" $checked/>$label</label><br />};
}
print '</p>';
print $q->hidden('url', $url);
print $q->hidden('toc', $toc);
print $q->hidden('confirm', 1);
print $q->submit('go', 'Continue');
print $q->end_form();
}
# returns unquoted html
sub get_name {
my $url = shift;
my $tree = HTML::TreeBuilder->new_from_content(GetRaw($url));
my $h = $tree->look_down('_tag', 'h1');
$h = $tree->look_down('_tag', 'title') unless $h;
my $h = $tree->look_down('_tag', 'title');
$h = $tree->look_down('_tag', 'h1') unless $h;
$h = $h->as_text if $h;
return $h;
}
sub post_addition {
my ($name, $url, $toc) = @_;
my ($url, $name, $toc, $summary) = @_;
my $id = FreeToNormal($name);
my $display = $name;
utf8::decode($display); # we're dealing with user input
utf8::decode($summary); # we're dealing with user input
print $q->p("Adding ", GetUrl($url, $display), " to “$toc”.");
# start with the homepage
my @pages = GetPageContent($HomePage) =~ /\* \[\[(.*?)\]\]/g;
for my $id (@pages) {
return post($id, undef, $name, $url, GetParam('stars', '')) if $id eq $toc;
return post($id, undef, $name, $summary, $url, GetParam('stars', '')) if $id eq $toc;
my $data = GetPageContent(FreeToNormal($id));
while ($data =~ /(\*+ ([^][\n]*))$/mg) {
return post($id, $1, $name, $url, GetParam('stars', '')) if $2 eq $toc;
return post($id, $1, $name, $summary, $url, GetParam('stars', '')) if $2 eq $toc;
}
}
print $q->p("Whoops. I was unable to find “$toc” in the wiki. Sorry!");
}
sub post {
my ($id, $toc, $name, $url, $stars) = @_;
my ($id, $toc, $name, $summary, $url, $stars) = @_;
my $data = GetPageContent(FreeToNormal($id));
my $re = quotemeta($url);
if ($data =~ /$re\s+(.*?)\]/) {
my $display = $1;
print $q->p($q->strong("Oops, we seem to have a problem!"));
print $q->p(GetPageLink(NormalToFree($id)),
" already links to the URL you submitted:",
GetUrl($url, $display));
return;
}
$stars = ' ' . (':star:' x $stars) if $stars;
$summary = ': ' . $summary if $summary;
if ($toc) {
$toc =~ /^(\*+)/;
my $depth = "*$1"; # one more!
my $regexp = quotemeta($toc);
$data =~ s/$regexp/$toc\n$depth \[$url $name\]$stars/;
$data =~ s/$regexp/$toc\n$depth \[$url $name\]$summary$stars/;
} else {
$data = "* [$url $name]$stars\n" . $data;
$data = "* [$url $name]$summary$stars\n" . $data;
}
my $ua = LWP::UserAgent->new;
my %params = (text => $data,
@@ -166,37 +272,77 @@ sub post {
my $response = $ua->post($site, \%params);
if ($response->is_error) {
print $q->p("The submission failed!");
print $q->pre($response->status_line . "\n"
. $response->content);
print $response->content;
} else {
print $q->p("See for yourself: ", GetPageLink($id));
}
}
sub print_end_of_page {
print $q->p('Questions? Send mail to Alex Schroeder <'
. $q->a({-href=>'mailto:kensanata@gmail.com'},
'kensanata@gmail.com') . '>');
print $q->end_div();
PrintFooter();
}
sub main {
$ConfigFile = "$DataDir/config"; # read the global config file
$DataDir = "$DataDir/$wiki"; # but link to the local pages
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') {
seek DATA, 0, 0;
print "Content-type: text/plain; charset=UTF-8\r\n\r\n", <DATA>;
} elsif ($q->path_info eq '/structure') {
my ($values, $labels) = toc();
my @indented = map {
($labels->{$_} || $_) =~ /^(*)/;
[$_, length($1)]
} @$values;
print "Content-type: application/json; charset=UTF-8\r\n\r\n";
binmode(STDOUT,':raw'); # because of encode_json
print JSON::PP::encode_json(\@indented);
} elsif ($q->path_info eq '/toc') {
my ($values, $labels) = toc();
print "Content-type: application/json; charset=UTF-8\r\n\r\n";
binmode(STDOUT,':raw'); # because of encode_json
print JSON::PP::encode_json($values);
} elsif ($q->path_info eq '/top') {
print GetHeader('', 'Top Blogs');
print $q->start_div({-class=>'content top'});
print $q->ol($q->li(top()));
print_end_of_page();
} elsif ($q->path_info =~ '^/match/(.*)') {
my $term = $1;
print GetHeader('', "Entries Matching '$term'");
print $q->start_div({-class=>'content match'});
print $q->ol($q->li(match($term)));
print_end_of_page();
} else {
push(@UserGotoBarPages, 'Help');
$UserGotoBar = $q->a({-href=>$q->url . '/source'}, 'Source');
print GetHeader('', 'Submit a new link');
print $q->start_div({-class=>'content index'});
if (not GetParam('url')) {
my $url = canonical(GetParam('url'));
my $name = UnquoteHtml(GetParam('name', get_name($url)));
my $toc = GetParam('toc');
my $confirm = GetParam('confirm');
my $summary = GetParam('summary');
if (not $url) {
default();
} elsif (not $toc) {
default() if not is_duplicate($url);
} elsif (not $confirm) {
confirm($url, $name, $toc);
} else {
check_url(GetParam('url'));
post_addition($url, $name, $toc, $summary);
}
print $q->p('Questions? Send mail to Alex Schroeder <'
. $q->a({-href=>'mailto:kensanata@gmail.com'},
'kensanata@gmail.com') . '>');
print $q->end_div();
PrintFooter();
print_end_of_page();
}
}

View File

@@ -1,6 +1,6 @@
#! /usr/bin/perl
# Copyright (C) 2011 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20112014 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
@@ -17,63 +17,62 @@
package OddMuse;
use LWP::UserAgent;
use HTML::TreeBuilder;
use utf8;
# load Oddmuse core
$RunCGI = 0;
do "wiki.pl";
# globals
my $wiki = 'BlogArchive';
my $site = "http://campaignwiki.org/wiki/$wiki";
# my $site = "http://localhost/wiki.pl";
my $home = "$site/HomePage";
$default_namespace = 'NameOfYourWiki';
main();
sub default {
print $q->p("Copy a blog article to the "
. $q->a({-href=>$home}, $wiki) . ".");
print $q->start_multipart_form(-method=>'get', -class=>'submit');
print $q->p($q->label({-for=>'url'}, T('URL:')) . ' '
. $q->textfield(-name=>'url', -id=>'url', -size=>50));
my ($url, $ns) = @_;
print $q->start_multipart_form(-method=>'get', -class=>'copy');
print $q->p("This script helps you copy of a blog post to your Campaign Wiki.");
print $q->p($q->label({-for=>'url', -style=>'display: inline-block; width: 20ex'}, 'Blog post URL:'),
$q->textfield(-name=>'url', -id=>'url', -size=>50),
$q->br(),
$q->label({-for=>'ns', -style=>'display: inline-block; width: 20ex'}, 'Name of your wiki:'),
$q->textfield(-name=>'ns', -id=>'ns', -size=>50, -default=>$default_namespace));
if ($url and not $ns) {
print $q->p($q->em('Please provide the name of your wiki. It is mandatory. Use “NameOfYourWiki” if you just want to test something.'));
}
print $q->submit('go', 'Go!');
print $q->end_form();
print $q->p("Please make sure youre only submitting your own articles",
"or articles with an appropriate license.");
print $q->p("Drag this bookmarklet to your bookmarks bar for easy access:",
$q->a({-href=>q{javascript:location='http://campaignwiki.org/copy?url='+encodeURIComponent(window.location.href)}}, $wiki) . ".");
$q->a({-href=>q{javascript:location='http://campaignwiki.org/copy?url='+encodeURIComponent(window.location.href)}}, 'Copy Blog Post') . ".");
}
sub check_url {
my $url = shift;
print $q->p("Looking at ", $q->a({-href=>$url}, $url));
my ($name, $data) = get_data($url);
$name = GetParam('name', $name);
if (name_exists($name) and not GetParam('confirm', 0)) {
print $q->p("We already have a page with that name: ",
$q->a({-href=>$duplicate}, $duplicate));
print $q->start_multipart_form(-method=>'get', -class=>'submit');
print $q->p($q->label({-for=>'name'}, T('New name:')) . ' '
. $q->textfield(-name=>'name', -id=>'name', -size=>50,
-default=>$name));
print $q->hidden('url', $url);
print $q->hidden('confirm', 1);
print $q->submit('go', 'Continue');
print $q->end_form();
} elsif (not GetParam('confirm', 0)) {
print $q->p("Please confirm that you want to copy this article to the wiki.");
print $q->start_multipart_form(-method=>'get', -class=>'submit');
print $q->p($q->label({-for=>'name'}, T('Name:')) . ' '
. $q->textfield(-name=>'name', -id=>'name', -size=>50,
-default=>$name));
print $q->hidden('url', $url);
print $q->hidden('confirm', 1);
print $q->submit('go', 'Continue');
print $q->end_form();
} else {
post_addition($name, $data, $url);
}
sub confirm_overwrite {
my ($url, $ns, $name) = @_;
print $q->p("We already have a page with that name: ", GetPageLink($name));
print $q->start_multipart_form(-method=>'get', -class=>'submit');
print $q->p($q->label({-for=>'name'}, T('New name:')) . ' '
. $q->textfield(-name=>'name', -id=>'name', -size=>50, -default=>$name));
print $q->hidden('url', $url);
print $q->hidden('ns', $ns);
print $q->hidden('confirm', 1);
print $q->submit('go', 'Continue');
print $q->end_form();
}
sub confirm_save {
my ($url, $ns, $name) = @_;
my $ns = GetParam('ns', $default_namespace);
print $q->p("Please confirm that you want to copy",
$q->a({-href=>$url}, "this article"), "to", GetPageLink($HomePage, $ns) . ".");
print $q->start_multipart_form(-method=>'get', -class=>'submit');
print $q->p($q->label({-for=>'name'}, T('Name:')) . ' '
. $q->textfield(-name=>'name', -id=>'name', -size=>50, -default=>$name));
print $q->hidden('url', $url);
print $q->hidden('ns', $ns);
print $q->hidden('confirm', 1);
print $q->submit('go', 'Continue');
print $q->end_form();
}
sub get_data {
@@ -82,24 +81,32 @@ sub get_data {
my $h = $tree->look_down('_tag', 'h1');
$h = $tree->look_down('_tag', 'title') unless $h;
$h = $h->as_text if $h;
my $b = $tree->look_down('_tag', 'body');
if ($b = $tree->look_down('_tag', 'div',
'class', qr/post-body/)) {
# blogspot
my $b;
if ($b = $tree->look_down('_tag', 'div', 'class', qr/post-body/)) {
# Blogspot
$b = html($b);
} elsif ($b = $tree->look_down('_tag', 'div', 'class', qr/content/)) {
# Oddmuse
$b = html($b);
} else {
# no idea, just get the text
$b = $b->as_text if $b;
# default: get it all
$b = html($tree->look_down('_tag', 'body'));
}
# common illegal character for page names
$h =~ s/:/,/g;
return ($h, $b);
}
sub html {
my $tree = shift;
my ($tree, $p) = @_;
# $p indicates whether we need an empty line or not
my $str;
for my $element ($tree->content_list()) {
if (not ref $element) {
$str .= $element;
} elsif ($element->tag() eq 'p') {
$str .= ($p == 1 ? "\n\n" : "") . html($element);
$p = 1;
} elsif ($element->tag() eq 'br') {
$str .= "\n\n";
} elsif ($element->tag() eq 'span'
@@ -107,6 +114,20 @@ sub html {
$str .= "[b]" . html($element) . "[/b]";
} elsif ($element->tag() =~ m/^(b|i|h[1-6])$/) {
$str .= "[$1]" . html($element) . "[/$1]";
} elsif ($element->tag() eq 'a'
and $element->attr('href')) {
$str .= "[url=" . $element->attr('href') . "]" . html($element) . "[/url]";
} elsif ($element->tag() eq 'img'
and $element->attr('src')) {
$str .= "[img]" . $element->attr('src') . "[/img]";
} elsif ($element->tag() eq 'pre') {
$str .= "\n\n[code]\n" . $element->as_text() . "\n[/code]";
$p = 1;
} elsif ($element->tag() eq 'div'
and ($element->attr('style') =~ /float: *(left|right)/
or $element->attr('style') =~ /text-align: *(center)/)) {
$str .= "\n[$1]" . html($element) . "[/$1]";
$p = 1;
} else {
$str .= html($element);
}
@@ -123,25 +144,25 @@ sub name_exists {
}
sub post_addition {
my ($name, $data, $url) = @_;
my ($url, $ns, $name, $data) = @_;
my $id = FreeToNormal($name);
print $q->p("Adding ", $q->a({-href=>$url}, $name));
print $q->p("Copying ", $q->a({-href=>$url}, "the blog post") . "…");
my $text = "Based on [$url $name].\n----\n" . $data;
my $ua = LWP::UserAgent->new;
my %params = (text => $text,
title => $id,
summary => $name,
username => GetParam('username'),
ns => $ns,
pwd => GetParam('pwd'));
$params{$QuestionaskerSecretKey} = 1 if $QuestionaskerSecretKey;
my $response = $ua->post($site, \%params);
my $response = $ua->post($FullUrl, \%params);
if ($response->is_error) {
print $q->p("The submission failed!");
print $q->pre($response->status_line . "\n"
. $response->content);
print $q->p("Copying failed!");
print $q->p($q->strong($response->status_line));
print $response->content;
} else {
print $q->p("See for yourself: ",
$q->a({-href=>"$site/$id"}, $name));
print $q->p("Your copy: ", GetPageLink($name) . ".");
}
}
@@ -152,12 +173,22 @@ sub main {
print "Content-type: text/plain; charset=UTF-8\r\n\r\n", <DATA>;
} else {
$UserGotoBar .= $q->a({-href=>$q->url . '/source'}, 'Source');
print GetHeader('', 'Submit a new blog article');
print GetHeader('', 'Copy a blog article');
print $q->start_div({-class=>'content index'});
if (not GetParam('url')) {
default();
my $url = GetParam('url');
my $ns = GetParam('ns');
if (not $url or not $ns) {
default($url, $ns);
} else {
check_url(GetParam('url'));
my ($name, $data) = get_data($url);
$name = GetParam('name', $name);
if (name_exists($name) and not GetParam('confirm', 0)) {
confirm_overwrite($url, $ns, $name);
} elsif (not GetParam('confirm', 0)) {
confirm_save($url, $ns, $name);
} else {
post_addition($url, $ns, $name, $data);
}
}
print $q->p('Questions? Send mail to Alex Schröder <'
. $q->a({-href=>'mailto:kensanata@gmail.com'},

0
contrib/campaignwiki/monster-tag.pl Normal file → Executable file
View File

0
contrib/campaignwiki/submit.pl Normal file → Executable file
View File

View File

@@ -1,26 +1,20 @@
#!/usr/bin/perl
# -*- coding: utf-8 -*-
# Copyright (C) 2004 Alex Schroeder <alex@emacswiki.org>
# Copyright (C) 2004 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2007 Vinicius José Latorre <viniciusjl at ig.com.br>
#
# 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 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.
# 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
# $Id: ell-to-wiki.pl,v 1.5 2007/02/15 22:00:26 as Exp $
# 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 LWP::UserAgent;
use XML::Parser;

122
contrib/fix-copyright-years Executable file
View File

@@ -0,0 +1,122 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2006 Free Software Foundation, Inc.
#
# GNU Radio 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, or (at your option)
# any later version.
#
# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
# This file is based on code from GNU Radio.
# https://github.com/balister/GNU-Radio/blob/master/dtools/bin/fix-copyright-years
import re
import datetime
import subprocess
import multiprocessing
def command(*args): return subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
def is_free_software(lines):
for line in lines[:50]:
if 'This program is free software' in line: return True
return False
def get_copyright_lines(lines):
start = -1
end = -1
for i, line in enumerate(lines[:20]):
if line.startswith('# Copyright'):
if start == -1: start = i
end = i
if start == -1: raise Exception
return start, end
def copyright_line(author, years):
from_year = years.pop()
to_year = from_year
for year in years:
if year > to_year: to_year = year
elif year < from_year: from_year = year
if from_year == to_year:
return '# Copyright (C) %d %s\n' % (from_year, author)
else:
return '# Copyright (C) %d%d %s\n' % (from_year, to_year, author)
author_re = re.compile('\nAuthor: (.*)\nDate:.* (\d\d\d\d) ')
def fix_co_years(files):
for file in files:
print file
years = {}
changed = False
lines = open(file).readlines()
if not is_free_software(lines):
print ' is not Free Software'
continue
# extract authors and years from git log
log = command('git', 'log', file)
it = re.finditer(author_re, log)
for match in it:
author, year = match.groups()
if author in years:
years[author].add(int(year))
else:
years[author] = set([int(year)])
# extract copyright beginning and end from
try:
start, end = get_copyright_lines(lines)
except:
print ' copyright lines not found'
continue
# only update or add existing authors, don't touch authors not in git log
for author in years.keys():
found = False
for i in range(start, end + 1):
if author in lines[i]:
line = copyright_line(author, years[author])
if line != lines[i]:
lines[i] = line
changed = True
found = True
continue
if not found:
lines.insert(end, copyright_line(author, years[author]))
changed = True
# write file
if changed:
# print ''.join(lines[:30])
# print '------------------------------------------------------------------------'
open(file, 'w').write(''.join(lines))
if __name__ == "__main__":
# get recursive list of files in the repo
files = command('git', 'ls-tree', '--name-only', 'HEAD', '-r').splitlines()
# files = ['contrib/campaignwiki/add-link.pl']
# start n+1 processes to handle the files
num_procs = multiprocessing.cpu_count()
# num_procs = 1
procs = [multiprocessing.Process(
target=lambda *files: fix_co_years(files),
args=files[num::num_procs],
) for num in range(num_procs)]
map(multiprocessing.Process.start, procs)
map(multiprocessing.Process.join, procs)

File diff suppressed because it is too large Load Diff

108
contrib/oddmuse_stats Executable file
View File

@@ -0,0 +1,108 @@
#!/usr/bin/perl -w
# -*- perl -*-
=head1 NAME
oddmuse-stats - Plugin to monitor Oddmuse edits
=head1 CONFIGURATION
Set env.parent_dirs in the config file. The directories in this list
are searched for data directories containing rc.log files. No
whitespace in the directory names, sorry.
Example:
[oddmuse_stats]
user www-data
env.parent_dirs /home/alex /home/alex/campaignwiki
=head1 AUTHORS
Original Author: Alex Schroeder
=head1 LICENSE
GPLv3
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
use Munin::Plugin;
use File::Basename;
# The wiki directories may not contain any spaces.
# Use the config file to set the environment variable!
my @parent_dirs = ();
my %logfiles = ();
my %names = ();
my $debug = $ENV{MUNIN_DEBUG};
if ($ENV{'parent_dirs'}) {
@parent_dirs = split(/ /, $ENV{'parent_dirs'});
} else {
die "The parent_dirs environment variable must be set.\n";
}
for my $parent_dir (@parent_dirs) {
warn "opening $parent_dir\n" if $debug;
if (opendir(my $dh, $parent_dir)) {
while(readdir $dh) {
next if $_ eq '.' or $_ eq '..';
if (-r "$parent_dir/$_/rc.log") {
my $basename = basename($_);
$names{clean_fieldname($basename)}
= $basename;
$logfiles{clean_fieldname($basename)}
= "$parent_dir/$_/rc.log";
} else {
warn "discarding $_\n" if $debug;
}
}
closedir $dh;
}
}
my $yesterday = time() - 86400;
if ($ARGV[0]) {
if ($ARGV[0] eq 'autoconf') {
if (keys %logfiles) {
print "yes\n";
exit 0;
} else {
print "no (no logfiles found in " . join(", ", @parent_dirs) . ")\n";
exit 0;
}
} elsif ($ARGV[0] eq 'config') {
print "graph_title Oddmuse Wikis\n";
print "graph_category wikis\n";
print "graph_info This graph shows how many edits the wiki had in the last 24h.\n";
print "graph_vlabel edits/day\n";
print "graph_order";
for my $wiki (sort keys %logfiles) {
print " $wiki";
};
print "\n";
for my $wiki (sort keys %logfiles) {
my $name = $names{$wiki};
print "$wiki.label $name\n";
}
exit 0;
}
}
for my $wiki (sort keys %logfiles) {
open (my $fh, '<', $logfiles{$wiki})
or die "cannot open " . $logfiles{$wiki} . ": $!";
my $value = 0;
while (<$fh>) {
my ($ts) = split(/\x1e/);
$value++ if $ts and $ts >= $yesterday;
}
print "$wiki.value $value\n";
}

View File

@@ -1,6 +1,9 @@
/* Copyright 2005 Alex Schroeder <alex@emacswiki.org>
based on http://simon.incutio.com/archive/2004/05/30/plinks#p-13
Copyright 2004 Simon Willison
This script adds purple numbers to paragraphs.
https://oddmuse.org/wiki/Purple_Numbers_Extension
*/
function plinkHighlight() {

View File

@@ -1,17 +0,0 @@
DirectoryIndex wiki.pl
Options ExecCGI SymLinksIfOwnerMatch
AddHandler cgi-script .pl
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ wiki.pl?$1 [L,QSA]
# The config file might contain passwords. Also protect possible
# backup filenames.
RewriteRule ^config(\~|\.bak)?$ wiki.pl/config [L]
# The visitor.log file contains IP numbers of visitors.
RewriteRule ^visitors.log$ wiki.pl/visitor.log [L]
</IfModule>

View File

@@ -1,14 +0,0 @@
all:
@echo Please invoke make dist on the top level
%-simple.tar.gz: README config wiki.pl .htaccess current.pl FDL GPL
tar czf $@ $^
current.pl: ../../wiki.pl
cp $^ $@
FDL: ../../FDL
cp $^ $@
GPL: ../../GPL
cp $^ $@

View File

@@ -1,76 +0,0 @@
This is the README file distributed as part of the simple-install
package together with the Oddmuse script.
Unzip all the files into a directory served by Apache. Get the
current.pl file from here: http://emacswiki.org/scripts/current.pl
Your directory should now contain the following files:
* README (this file)
* .htaccess (information for Apache)
* config (a simple config file for you to modify)
* wiki.pl (a wrapper script setting the data directory)
* current.pl (the main script)
* modules (a directory containing modules)
* modules/creole.pl (support for the standard wiki markup)
The wiki pages will be saved in this directory.
Make sure the www user (or whoever Apache runs under) has write access
to this directory. In that directory, try chmod o+w . and see if that
helps when you get an error message saying that Oddmuse cannot create
the temp directory.
You need to make sure that your administrator has allowed
AllowOverride All in his httpd.conf file for the settings in the
.htaccess file provided to have an effect.
Running Oddmuse will create more files, eventually.
* pages (the directory containing the pages)
* keep (the directory containing older versions of pages)
* pageidx (a file containing the names of existing pages)
* rc.log (the file used to produce RecentChanges)
* visitors.log (the file used to log the most recent visitors)
* temp (a temporary directory for log files and the like)
In order to start your wiki, click on the edit link (the first link
below the navigation bar, at the bottom of the page). This will allow
you to enter some text for this page. Click the Save button and you
are done.
To add new pages, edit the homepage and add links to new pages. Links
are traditionally formed by ConcatenatingCapitalizedWords. This kind
of link pattern is called a wiki word.
Alternatively, put links in [[double square brackets]]. This kind of
link pattern is called a free link.
As long as the new pages don't exist, links to these pages are
followed by a clickable question mark. Click on the question mark to
create the new page.
Enjoy your wiki experience.
Visit http://www.oddmuse.org/ to learn more about the translation
files and modules that are part of this package.
----------------------------------------------------------------------
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation.
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.
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.

View File

@@ -1,2 +0,0 @@
# Where to find diff(1) and grep(1)
$ENV{PATH} = '/usr/bin:/bin';

View File

@@ -1,10 +0,0 @@
#!/usr/bin/perl
# This wrapper does nothing but tell Oddmuse to use the current
# directory as its data directory.
package OddMuse;
$DataDir = '.';
# You need to get the latest copy of this script from
# http://emacswiki.org/scripts/current.pl
do 'current.pl';

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);
}

168
contrib/vc-oddmuse.el Normal file
View File

@@ -0,0 +1,168 @@
;;; vc-oddmuse.el -- add VC support to oddmuse-curl
;;
;; Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
;;
;; Latest version:
;; http://git.savannah.gnu.org/cgit/oddmuse.git/plain/contrib/vc-oddmuse.el
;; Discussion, feedback:
;; http://www.emacswiki.org/cgi-bin/wiki/OddmuseCurl
;;
;; 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 GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; Add the following to your init file:
;;
;; (add-to-list 'vc-handled-backends 'oddmuse)
(add-to-list 'vc-handled-backends 'oddmuse)
(require 'oddmuse-curl)
(require 'diff)
(defun vc-oddmuse-revision-granularity () 'file)
(defun vc-oddmuse-registered (file)
"Handle files in `oddmuse-directory'."
(string-match (concat "^" (expand-file-name oddmuse-directory))
(file-name-directory file)))
(defun vc-oddmuse-state (file)
"Return the current version control state of FILE.
For a list of possible values, see `vc-state'."
;; Avoid downloading the current version from the wiki and comparing
;; the text: Too much traffic!
'edited)
(defun vc-oddmuse-working-revision (file)
"The current revision based on `oddmuse-revisions'."
(oddmuse-revision-get oddmuse-wiki oddmuse-page-name))
(defun vc-oddmuse-checkout-model (files)
"No locking."
'implicit)
(defun vc-oddmuse-create-repo (file)
(error "You cannot create Oddmuse wikis using Emacs."))
(defun vc-oddmuse-register (files &optional rev comment)
"This always works.")
(defun vc-oddmuse-revert (file &optional contents-done)
"No idea"
nil)
(defvar vc-oddmuse-log-command
(concat "curl --silent %w"
" --form action=rc"
" --form showedit=1"
" --form all=1"
" --form from=1"
" --form raw=1"
" --form match='%r'")
"Command to use for publishing index pages.
It must print the page to stdout.
See `oddmuse-format-command' for the formatting options.")
(defun vc-oddmuse-print-log (files buffer &optional shortlog start-revision limit)
"Load complete recent changes for the files."
;; Derive `oddmuse-wiki' from the first file
(with-oddmuse-file (car files)
;; The wiki expects a Perl regular expression!
(let ((regexp (concat "^(" (mapconcat 'file-name-nondirectory files "|") ")$")))
(oddmuse-run "Getting recent changes" vc-oddmuse-log-command nil nil buffer)))
(with-current-buffer buffer
(oddmuse-render-rss3))
'limit-unsupported)
(defun vc-oddmuse-log-outgoing ()
(error "This is not supported."))
(defun vc-oddmuse-log-incoming ()
(error "This is not supported."))
(defvar vc-oddmuse-get-revision-command
(concat "curl --silent"
" --form action=browse"
" --form id=%t"
" --form revision=%v"
" --form raw=1"
" '%w'")
"Command to use to get older revisions of a page.
It must print the page to stdout.
%? '?' character
%w URL of the wiki as provided by `oddmuse-wikis'
%t Page title as provided by `oddmuse-page-name'
%v Revision to retrieve as provided by `oddmuse-revision'")
(defun oddmuse-revision-filename (rev)
"Return filename for revision REV.
This uses `oddmuse-directory', `wiki' and `pagename' as bound by
`with-oddmuse-file'."
(concat oddmuse-directory
"/" wiki
"/" pagename
".~" rev "~"))
(defun vc-oddmuse-diff (files &optional rev1 rev2 buffer)
"Report the differences for FILES."
(setq buffer (or buffer (get-buffer-create "*vc-diff*")))
(dolist (file files)
(with-oddmuse-file file
(setq rev1 (or rev1 (oddmuse-get-latest-revision wiki pagename)))
(dolist (rev (list rev1 rev2))
(when (and rev (not (file-readable-p (oddmuse-revision-filename rev))))
(let* ((oddmuse-revision rev)
(command vc-oddmuse-get-revision-command)
(filename (oddmuse-revision-filename rev)))
(with-temp-buffer
(oddmuse-run
(concat "Downloading revision " rev)
command wiki pagename)
(write-file filename)))))
(diff-no-select
(if rev1 (oddmuse-revision-filename rev1) file)
(if rev2 (oddmuse-revision-filename rev2) file)
nil
(vc-switches 'oddmuse 'diff)
buffer))))
(defun vc-oddmuse-revert (file &optional contents-done)
"Revert FILE back to the wiki revision.
If optional arg CONTENTS-DONE is non-nil, then nothing needs to
be done, as the contents of FILE have already been reverted from
a version backup."
(unless contents-done
(with-oddmuse-file file
(let ((command (oddmuse-format-command vc-oddmuse-get-revision-command)))
(with-temp-buffer
(oddmuse-run "Loading" command)
(write-file file))))))
(defun vc-oddmuse-checkin (files rev comment)
"Commit changes in FILES to this backend.
REV is a historical artifact and should be ignored. COMMENT is
used as a check-in comment."
(dolist (file files)
(with-oddmuse-file file
(let* ((summary comment)
(command (oddmuse-format-command oddmuse-post-command))
(buf (get-buffer-create " *oddmuse-response*")))
(with-temp-buffer
(insert-file-contents file)
(oddmuse-run "Posting" command wiki pagename buf t 302))))))
(provide 'vc-oddmuse)

14
control
View File

@@ -1,14 +0,0 @@
Maintainer: Alex Schroeder <alex@oddmuse.org>
Section: web
Priority: optional
Standards-Version: 3.5.10
Package: oddmuse
Architecture: any
Depends: httpd, perl5, perl-modules
Suggests: libwww-perl, libxml-rss-perl, libmime-base64-perl, diff
Description: wiki engine
A "wiki" is a website that is usally collaboratively edited
by its users, including the ability to alter text written by
other users. It is a simple and efficient content management
system (CMS).

View File

@@ -74,6 +74,55 @@ h1 a:visited, h2 a:visited, h3 a:visited {
color: inherit;
}
/* for download buttons and the like */
.button {
display: inline-block;
font-size: 120%;
cursor: pointer;
padding: 0.4em 0.6em;
text-shadow: 0px -1px 0px #ccc;
background-color: #cfa;
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset, 0px 1px 3px black;
}
.button .icon {
color: #363;
text-shadow: 0px -1px 1px white, 0px 1px 3px #666;
}
.button a {
text-decoration: none;
font-weight: normal;
}
/* links */
a.pencil {
padding-left: 1ex;
text-decoration: none;
color: inherit;
visible: hidden;
transition: visibility 0s 1s, opacity 1s linear;
opacity: 0;
}
*:hover > a.pencil {
visible: visible;
transition: opacity .5s linear;
opacity: 1;
}
@media print {
a.pencil {
display: none;
}
}
a.number {
text-decoration: none;
}
/* stop floating content from flowing over the footer */
hr {
@@ -110,6 +159,15 @@ pre, code, tt {
line-height: 110%;
}
pre {
overflow:hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
/* styling for divs that will be invisible when printing
when printing. */
@@ -235,8 +293,8 @@ div.comment h2 {
margin-top: 5em;
}
/* comment pages with username, homepage, and email subscription */
.comment span { display: block; }
.comment span label { display: inline-block; width: 10em; }
.comment form span { display: block; }
.comment form span label { display: inline-block; width: 10em; }
/* IE sucks */
.comment input#username,
.comment input#homepage,
@@ -336,6 +394,10 @@ div.image span.caption {
margin: 0 1em;
}
img {
max-width: 100%;
}
.left { float:left; margin-right: 1em; }
.right { float:right; margin-left: 1em; }
.half a img { height: 50%; width: 50%; }

632
css/alex-2014.css Normal file
View File

@@ -0,0 +1,632 @@
/* font-face includes TTF for PDF generation */
/* 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') url('/fonts/NoticiaText-Regular.ttf') format('truetype');
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') url('/fonts/NoticiaText-Regular.ttf') format('truetype');
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') url('/fonts/NoticiaText-Regular.ttf') format('truetype');
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') url('/fonts/NoticiaText-Bold.ttf') format('truetype');
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') url('/fonts/NoticiaText-Bold.ttf') format('truetype');
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') url('/fonts/NoticiaText-Bold.ttf') format('truetype');
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') url('/fonts/NoticiaText-Italic.ttf') format('truetype');
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') url('/fonts/NoticiaText-Italic.ttf') format('truetype');
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') url('/fonts/NoticiaText-Italic.ttf') format('truetype');
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') url('/fonts/NoticiaText-BoldItalic.ttf') format('truetype');
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') url('/fonts/NoticiaText-BoldItalic.ttf') format('truetype');
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') url('/fonts/NoticiaText-BoldItalic.ttf') format('truetype');
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-style: normal;
font-size: 14pt;
margin: 1em 3em;
padding:0;
}
@media print {
body {
font-size: 12pt;
color: #000;
background-color: #fff;
}
/* hide all the crap */
div.diff, div.diff+hr, div.refer, div.near, div.definition, div.sister,
div.cal, div.footer, span.specialdays, span.gotobar, a.edit, a.number span,
div.rc form, form.tiny, p.comment, p#plus1, div.g-plusone, div.content a.feed {
display:none;
}
div.content a.book,
div.content a.movie {
text-decoration: none;
}
a cite {
font-style: italic;
}
img[alt="RSS"] { display: none }
a.rss { font-size: 8pt }
}
/* headings: we can use larger sizes if we use a lighter color.
we cannot inherit the font-family because header and footer use a narrow font. */
h1, h2, h3, title {
font-family: inherit;
font-weight: normal;
}
h1, channel title {
font-size: 32pt;
margin: 1em 0 0.5em 0;
padding: 0.4em 0;
}
h2 {
font-size: 18pt;
margin: 2em 0 0 0;
padding: 0;
}
h3 {
font-size: inherit;
font-weight: bold;
padding: 0;
margin: 1em 0 0 0;
clear: both;
}
/* headers in the journal are smaller */
div.journal h1, item title {
font-size: inherit;
padding: 0;
clear: both;
border-bottom: 1px solid #000;
}
div.journal h2 {
font-family: inherit;
font-size: inherit;
}
div.journal h3 {
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font-style: italic;
}
div.journal hr {
visibility: hidden;
}
p.more {
margin-top: 3em;
}
/* Links in headings appear on journal pages. */
h1 a, h2 a, h3 a {
color:inherit;
text-decoration:none;
font-weight: normal;
}
h1 a:visited, h2 a:visited, h3 a:visited {
color: inherit;
}
/* for download buttons and the like */
.button {
display: inline-block;
font-size: 120%;
cursor: pointer;
padding: 0.4em 0.6em;
text-shadow: 0px -1px 0px #ccc;
background-color: #cfa;
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset, 0px 1px 3px black;
}
.button .icon {
color: #363;
text-shadow: 0px -1px 1px white, 0px 1px 3px #666;
}
.button a {
text-decoration: none;
font-weight: normal;
}
/* links */
a.pencil {
padding-left: 1ex;
text-decoration: none;
color: inherit;
visibility: hidden;
transition: visibility 0s 1s, opacity 1s linear;
opacity: 0;
}
*:hover > a.pencil {
visibility: visible;
transition: opacity .5s linear;
opacity: 1;
}
@media print {
a.pencil {
display: none;
}
}
a.number {
text-decoration: none;
}
/* stop floating content from flowing over the footer */
hr {
clear: both;
}
/* the distance between links in the navigation bars */
span.bar a {
margin-right: 1ex;
}
a img {
border: none;
}
/* search box in the top bar */
.header form, .header p {
display: inline;
white-space: nowrap;
}
label[for="searchlang"], #searchlang, .header input[type="submit"] {
/* don't use display: none! http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
visibility: hidden; position: absolute;
}
/* wrap on the iphone */
@media media only screen and (max-device-width: 480px) {
}
.header input {
width: 10ex;
}
/* other form fields */
input[type="text"] {
padding: 0;
font-size: 80%;
line-height: 125%;
}
/* code */
textarea, pre, code, tt {
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, "Symbola";
font-size: 80%;
}
pre {
overflow:hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
/* styling for divs that will be invisible when printing
when printing. */
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 14pt;
}
@media print {
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 8pt;
}
}
div.footer form.search {
display: none;
}
div.rc li + li {
margin-top: 1em;
}
div.rc li strong, table.history strong, strong.description {
font-family: inherit;
font-weight: inherit;
}
div.diff {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
color: #000;
}
div.old {
background-color: #ffffaf;
}
div.new {
background-color: #cfffcf;
}
div.refer {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
}
div.message {
background-color:#fee;
color:#000;
}
img.xml {
border:none;
padding:1px;
}
a.small img {
max-width:300px;
}
a.large img {
max-width:600px;
}
div.sister {
margin-right:1ex;
background-color:inherit;
}
div.sister p {
margin-top:0;
}
div.sister hr {
display:none;
}
div.sister img {
border:none;
}
div.near, div.definition {
background-color:#efe;
}
div.sidebar {
float:right;
border:1px dotted #000;
padding:0 1em;
}
div.sidebar ul {
padding-left:1em;
}
/* replacements, features */
ins {
color: #b33;
text-decoration: none;
}
acronym, abbr {
letter-spacing:0.1em;
font-variant:small-caps;
}
/* Interlink prefix not shown */
a .site, a .separator {
display: none;
}
a cite { font:inherit; }
/* browser borkage */
textarea[name="text"] { width:97%; height:80%; }
textarea[name="summary"] { width:97%; height:3em; }
/* comments */
textarea[name="aftertext"] { width:97%; height:10em; }
div.commentshown {
font-size: 12pt;
padding: 2em 0;
}
div.commenthidden {
display:none;
}
div.commentshown {
display:block;
}
p.comment {
margin-bottom: 0;
}
div.comment {
font-size: 14pt;
}
div.comment h2 {
margin-top: 5em;
}
/* comment pages with username, homepage, and email subscription */
.comment form span { display: block; }
.comment form span label { display: inline-block; width: 10em; }
/* IE sucks */
.comment input#username,
.comment input#homepage,
.comment input#mail { width: 20em; }
/* cal */
div.month { padding:0; margin:0 2ex; }
body > div.month {
float:right;
background-color: inherit;
border:solid thin;
padding:0 1ex;
}
div.year > div.month {
float:left;
}
div.footer {
clear:both;
}
div.content div.month a.edit {
color:inherit;
font-weight:inherit;
text-decoration: none;
}
/* history tables and other tables */
table.history {
border: none;
}
td.history {
border: none;
}
table.user {
border: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 1em;
margin: 1em 2em;
}
table.user tr td, table.user tr th {
border: none;
padding: 0.2em 0.5em;
vertical-align: top;
}
table.arab tr th {
font-weight:normal;
text-align:left;
vertical-align:top;
}
table.arab, table.arab tr th, table.arab tr td {
border:none;
}
th.nobreak {
white-space:nowrap;
}
table.full { width:99%; margin-left:1px; }
table.j td, table.j th, table tr td.j, table tr th.j, .j { text-align:justify; }
table.l td, table.l th, table tr td.l, table tr th.l, .l { text-align:left; }
table.r td, table.r th, table tr td.r, table tr th.r, .r { text-align:right; }
table.c td, table.c th, table tr td.c, table tr th.c, .c { text-align:center; }
table.t td { vertical-align: top; }
td.half { width:50%; }
td.third { width:33%; }
form table td { padding:5px; }
/* lists */
dd { padding-bottom:0.5ex; }
dl.inside dt { float:left; }
/* search */
div.search span.result { font-size:larger; }
div.search span.info { font-size:smaller; font-style:italic; }
div.search p.result { display:none; }
img.logo {
float: right;
margin: 0 0 0 1ex;
padding: 0;
border: 1px solid #000;
opacity: 0.3;
background-color:#ffe;
}
/* images */
div.content a.feed img, div.journal a.feed img,
div.content a img.smiley, div.journal a img.smiley, img.smiley,
div.content a.inline img, div.journal a.inline img,
div.content li a.image img, div.journal li a.image img {
margin: 0; padding: 0; border: none;
}
div.image a img {
margin-bottom: 0;
}
div.image span.caption {
margin: 0 1em;
}
img {
max-width: 100%;
}
.left { float:left; margin-right: 1em; }
.right { float:right; margin-left: 1em; }
.half a img { height: 50%; width: 50%; }
div.left .left, div.right .right {
float:none;
}
.center { text-align:center; }
table.aside {
float:right;
width:40%;
margin-left: 1em;
padding: 1ex;
border: 1px dotted #666;
}
table.aside td {
text-align:left;
}
div.sidebar {
float:right; width: 250px;
text-align: right;
border: none;
margin: 1ex;
}
.bigsidebar {
float:right;
width: 500px;
border: none;
margin-left: 1ex;
font-size: 80%;
}
dl.irc dt { width:20ex; float:left; text-align:right; clear:left; }
dl.irc dt span.time { float:left; }
dl.irc dd { margin-left:22ex; }
/* portrait */
div.footer, div.comment, hr { clear: both; }
.portrait { float: left; font-size: small; margin-right: 1em; }
.portrait a { color: #999; }
div.left { float:left; margin:1em; padding: 0.5em; }
div.left p { display:table-cell; }
div.left p + p { display:table-caption; caption-side:bottom; }
p.table a { float:left; width:20ex; }
p.table + p { clear:both; }
/* no bleeding
@media screen {
div.content, div.rc {
overflow:hidden;
}
} */
/* rss */
channel * { display: block; }
channel title {
margin-top: 30pt;
}
copyright {
font-size: 14pt;
margin-top: 1em;
}
channel > link:before {
font-size: 18pt;
display: block;
margin: 1em;
padding: 0.5em;
content: "This is an RSS feed, designed to be read in a feed reader.";
color: red;
border: 1px solid red;
}
link, license {
font-size: 11pt;
margin-bottom: 9pt;
}
username:before { content: "Last edited by "; }
username:after { content: "."; }
generator:before { content: "Feed generated by "; }
generator:after { content: "."; }
channel description {
font-weight: bold;
}
item description {
font-style: italic;
font-weight: normal;
margin-bottom: 1em;
}
docs, language,
pubDate, lastBuildDate, ttl, guid, category, comments,
docs, image title, image link,
status, version, diff, history, importance {
display: none;
}

642
css/alex-2015.css Normal file
View File

@@ -0,0 +1,642 @@
/* 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-style: normal;
font-size: 14pt;
margin: 1em 3em;
padding:0;
}
@media print {
body {
font-size: 12pt;
color: #000;
background-color: #fff;
}
/* hide all the crap */
div.diff, div.diff+hr, div.refer, div.near, div.definition, div.sister,
div.cal, div.footer, span.specialdays, span.gotobar, a.edit, a.number span,
div.rc form, form.tiny, p.comment, p#plus1, div.g-plusone, div.content a.feed {
display:none;
}
div.content a.book,
div.content a.movie {
text-decoration: none;
}
a cite {
font-style: italic;
}
img[alt="RSS"] { display: none }
a.rss { font-size: 8pt }
}
/* headings: we can use larger sizes if we use a lighter color.
we cannot inherit the font-family because header and footer use a narrow font. */
h1, h2, h3, title {
font-family: inherit;
font-weight: normal;
}
h1, channel title {
font-size: 32pt;
margin: 1em 0 0.5em 0;
padding: 0.4em 0;
}
h2 {
font-size: 18pt;
margin: 2em 0 0 0;
padding: 0;
}
h3 {
font-size: inherit;
font-weight: bold;
padding: 0;
margin: 1em 0 0 0;
clear: both;
}
/* headers in the journal are smaller */
div.journal h1, item title {
font-size: inherit;
padding: 0;
clear: both;
border-bottom: 1px solid #000;
}
div.journal h2 {
font-family: inherit;
font-size: inherit;
}
div.journal h3 {
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font-style: italic;
}
div.journal hr {
visibility: hidden;
}
p.more {
margin-top: 3em;
}
/* Links in headings appear on journal pages. */
h1 a, h2 a, h3 a {
color:inherit;
text-decoration:none;
font-weight: normal;
}
h1 a:visited, h2 a:visited, h3 a:visited {
color: inherit;
}
/* for download buttons and the like */
.button {
display: inline-block;
font-size: 120%;
cursor: pointer;
padding: 0.4em 0.6em;
text-shadow: 0px -1px 0px #ccc;
background-color: #cfa;
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset, 0px 1px 3px black;
}
.button .icon {
color: #363;
text-shadow: 0px -1px 1px white, 0px 1px 3px #666;
}
.button a {
text-decoration: none;
font-weight: normal;
}
/* links */
a.pencil {
padding-left: 1ex;
text-decoration: none;
color: inherit;
visibility: hidden;
transition: visibility 0s 1s, opacity 1s linear;
opacity: 0;
}
*:hover > a.pencil {
visibility: visible;
transition: opacity .5s linear;
opacity: 1;
}
@media print {
a.pencil {
display: none;
}
}
a.number {
text-decoration: none;
}
/* stop floating content from flowing over the footer */
hr {
clear: both;
}
/* the distance between links in the navigation bars */
span.bar a {
margin-right: 1ex;
}
a img {
border: none;
}
/* search box in the top bar */
.header form, .header p {
display: inline;
white-space: nowrap;
}
label[for="searchlang"], #searchlang, .header input[type="submit"] {
/* don't use display: none! http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
visibility: hidden; position: absolute;
}
/* wrap on the iphone */
@media only screen and (max-device-width: 480px) {
}
.header input {
width: 10ex;
}
/* other form fields */
input[type="text"] {
padding: 0;
font-size: 80%;
line-height: 125%;
}
/* code */
textarea, pre, code, tt {
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, "Symbola";
font-size: 80%;
}
pre {
overflow:hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
/* styling for divs that will be invisible when printing
when printing. */
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 14pt;
}
@media print {
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
font-size: 8pt;
}
}
div.footer form.search {
display: none;
}
div.rc li + li {
margin-top: 1em;
}
div.rc li strong, table.history strong, strong.description {
font-family: inherit;
font-weight: inherit;
}
div.diff {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
color: #000;
}
div.old {
background-color: #ffffaf;
}
div.new {
background-color: #cfffcf;
}
div.refer {
padding-left: 5%;
padding-right: 5%;
font-size: 12pt;
}
div.message {
background-color:#fee;
color:#000;
}
img.xml {
border:none;
padding:1px;
}
a.small img {
max-width:300px;
}
a.large img {
max-width:600px;
}
div.sister {
margin-right:1ex;
background-color:inherit;
}
div.sister p {
margin-top:0;
}
div.sister hr {
display:none;
}
div.sister img {
border:none;
}
div.near, div.definition {
background-color:#efe;
}
div.sidebar {
float:right;
border:1px dotted #000;
padding:0 1em;
}
div.sidebar ul {
padding-left:1em;
}
/* replacements, features */
ins {
color: #b33;
text-decoration: none;
}
acronym, abbr {
letter-spacing:0.1em;
font-variant:small-caps;
}
/* Interlink prefix not shown */
a .site, a .separator {
display: none;
}
a cite { font:inherit; }
/* browser borkage */
textarea[name="text"] { width:97%; height:80%; }
textarea[name="summary"] { width:97%; height:3em; }
/* comments */
textarea[name="aftertext"] { width:97%; height:10em; }
div.commentshown {
font-size: 12pt;
padding: 2em 0;
}
div.commenthidden {
display:none;
}
div.commentshown {
display:block;
}
p.comment {
margin-bottom: 0;
}
div.comment {
font-size: 14pt;
}
div.comment h2 {
margin-top: 5em;
}
/* comment pages with username, homepage, and email subscription */
.comment form span { display: block; }
.comment form span label { display: inline-block; width: 10em; }
/* IE sucks */
.comment input#username,
.comment input#homepage,
.comment input#mail { width: 20em; }
/* cal */
div.month { padding:0; margin:0 2ex; }
body > div.month {
float:right;
background-color: inherit;
border:solid thin;
padding:0 1ex;
}
.year > .month {
float:left;
}
.footer {
clear:both;
}
.month .title a.local {
background-color: inherit;
}
.month a.local {
background-color: #ddf;
}
.month a.today {
background-color: #fdd;
}
.month a {
color:inherit;
font-weight:inherit;
text-decoration: none;
background-color: #eee;
}
/* history tables and other tables */
table.history {
border: none;
}
td.history {
border: none;
}
table.user {
border: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 1em;
margin: 1em 2em;
}
table.user tr td, table.user tr th {
border: none;
padding: 0.2em 0.5em;
vertical-align: top;
}
table.arab tr th {
font-weight:normal;
text-align:left;
vertical-align:top;
}
table.arab, table.arab tr th, table.arab tr td {
border:none;
}
th.nobreak {
white-space:nowrap;
}
table.full { width:99%; margin-left:1px; }
table.j td, table.j th, table tr td.j, table tr th.j, .j { text-align:justify; }
table.l td, table.l th, table tr td.l, table tr th.l, .l { text-align:left; }
table.r td, table.r th, table tr td.r, table tr th.r, .r { text-align:right; }
table.c td, table.c th, table tr td.c, table tr th.c, .c { text-align:center; }
table.t td { vertical-align: top; }
td.half { width:50%; }
td.third { width:33%; }
form table td { padding:5px; }
/* lists */
dd { padding-bottom:0.5ex; }
dl.inside dt { float:left; }
/* search */
div.search span.result { font-size:larger; }
div.search span.info { font-size:smaller; font-style:italic; }
div.search p.result { display:none; }
img.logo {
float: right;
margin: 0 0 0 1ex;
padding: 0;
border: 1px solid #000;
opacity: 0.3;
background-color:#ffe;
}
/* images */
div.content a.feed img, div.journal a.feed img,
div.content a img.smiley, div.journal a img.smiley, img.smiley,
div.content a.inline img, div.journal a.inline img,
div.content li a.image img, div.journal li a.image img {
margin: 0; padding: 0; border: none;
}
div.image a img {
margin-bottom: 0;
}
div.image span.caption {
margin: 0 1em;
}
img {
max-width: 100%;
}
.left { float:left; margin-right: 1em; }
.right { float:right; margin-left: 1em; }
.half a img { height: 50%; width: 50%; }
div.left .left, div.right .right {
float:none;
}
.center { text-align:center; }
table.aside {
float:right;
width:40%;
margin-left: 1em;
padding: 1ex;
border: 1px dotted #666;
}
table.aside td {
text-align:left;
}
div.sidebar {
float:right; width: 250px;
text-align: right;
border: none;
margin: 1ex;
}
.bigsidebar {
float:right;
width: 500px;
border: none;
margin-left: 1ex;
font-size: 80%;
}
dl.irc dt { width:20ex; float:left; text-align:right; clear:left; }
dl.irc dt span.time { float:left; }
dl.irc dd { margin-left:22ex; }
/* portrait */
div.footer, div.comment, hr { clear: both; }
.portrait { float: left; font-size: small; margin-right: 1em; }
.portrait a { color: #999; }
div.left { float:left; margin:1em; padding: 0.5em; }
div.left p { display:table-cell; }
div.left p + p { display:table-caption; caption-side:bottom; }
p.table a { float:left; width:20ex; }
p.table + p { clear:both; }
/* no bleeding
@media screen {
div.content, div.rc {
overflow:hidden;
}
} */
/* rss */
channel * { display: block; }
channel title {
margin-top: 30pt;
}
copyright {
font-size: 14pt;
margin-top: 1em;
}
channel > link:before {
font-size: 18pt;
display: block;
margin: 1em;
padding: 0.5em;
content: "This is an RSS feed, designed to be read in a feed reader.";
color: red;
border: 1px solid red;
}
link, license {
font-size: 11pt;
margin-bottom: 9pt;
}
username:before { content: "Last edited by "; }
username:after { content: "."; }
generator:before { content: "Feed generated by "; }
generator:after { content: "."; }
channel description {
font-weight: bold;
}
item description {
font-style: italic;
font-weight: normal;
margin-bottom: 1em;
}
docs, language,
pubDate, lastBuildDate, ttl, guid, category, comments,
docs, image title, image link,
status, version, diff, history, importance {
display: none;
}

347
css/bootstrap.css vendored Normal file
View File

@@ -0,0 +1,347 @@
/* Public Domain
Written by Alex Schroeder and Evgkeni Sampelnikof */
textarea { width:100%; }
h1 a { color: inherit }
div.journal h1 { font-size:large; }
table { margin-bottom: 1em; }
div.diff { padding-left:5%; padding-right:5%; }
div.old { background-color:#FFFFAF; }
div.new { background-color:#CFFFCF; }
img.portrait { float: left; clear: left; margin: 1ex; border:#999 1px solid; }
div.footer, div.comment, hr { clear: both; }
div.portrait { float: left; clear: left; font-size: xx-small; margin-right: 1em; }
div.portrait img.portrait { float: none; margin: 0; }
div.portrait a { text-decoration: none; color: #999; }
div.color {
clear: both;
padding: 1ex 2em;
margin: 0 -1em;
box-shadow: inset 40px 0px 20px -20px #EEEEEE,
inset -40px 0px 20px -20px #EEEEEE;
}
.left { float:left; margin-right:1em; }
.right { float:right; margin-left:1em; }
div.two, div.one {
color: #444;
background-color: #f8f8f8;
margin: 7px -1em;
box-shadow: inset 40px 0px 20px -20px #EEEEEE,
inset -40px 0px 20px -20px #EEEEEE,
0px 8px 4px -8px #ccc,
0px -6px 4px -8px #ccc;
}
.irc .time { display: none; }
dl.irc dt { float: left; text-align: right; width: 13ex; }
dl.irc dd { margin-left: 15ex; display: block; }
div.toc {
background-color: #FAFAFA;
border: 1px solid #dddddd;
font-family: sans-serif;
font-size: 80%;
line-height: 90%;
margin: 3em 0 1em;
padding: 1em 0px 0px 1em;
border-radius: 3px;
}
div.toc li {
font-size: 12px;
line-height: 20px;
}
.ell .toc li {
display: inline;
padding-right: 1em;
}
div.letter { column-count: 3; -webkit-column-count: 3; -moz-column-count: 3 }
.footer .edit.bar {
display: block;
text-align: center;
}
.specialdays {
line-height: 1em; /* has no effect: set for div.header instead? */
font-size: 0.9em;
}
.footer .time {
display: block;
text-align: center;
color: #666;
font-size: 10px;
font-weight: bold;
line-height: 12px;
}
.footer {
color: #888;
line-height: 20px;
}
.footer .legal {
text-align: justify;
-moz-text-align-last: center;
text-align-last: center;
font-size: 0.9em;
line-height: 1.4em;
margin: 0 120px 0;
padding: 1em 0 0;
}
.footer .legal a {
color: #888;
text-decoration: underline;
}
.translation.bar {
display: block;
text-align: center;
font-size: 0.8em;
padding-top: 5px;
}
/* .include.WikiLanguageMenu could share those styles,
(altough it might be better to leave it left-aligned) */
.translation.bar a:nth-child(n+2) {
border-left: 1px solid #999;
}
.translation.bar a {
padding: 6px;
display: inline-block;
}
.navbar .nav > li > a.brand {
color: #C76A0D;
padding: 5px 8px 0;
}
a {
color: #C76A0D;
}
a:hover {
color: #8F3E0F;
}
body {
word-wrap: break-word;
padding-left: 20px;
padding-right: 20px;
background-color: #EEEEEE;
color: #000;
font-size: 0.8em;
}
pre {
font-size: 1em;
line-height: 1.5em;
}
hr {
border-top: #ccc 1px solid;
border-bottom: #fff 1px solid;
}
.footer_wrapper {
background: #EEEEEE;
background: linear-gradient(to bottom, #EEEEEE, #CCCCCC);
padding-bottom: 20px;
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
.footer.container hr:first-child {
display: none;
}
.footer hr {
margin: 10px 100px 0;
}
.footer.container {
padding-top: 10px;
margin-top: 10px;
background: radial-gradient(
50% 8px at top,
rgba(0, 0, 0, 0.3) 0%,
rgba(0, 0, 0, 0) 100%
);
box-shadow: 0 -1px 2px -2px white;
/* border-top: 1px #ccc solid; */
}
body, li {
line-height: 2em;
}
h1, h2, h3 {
text-shadow: 1px 1px white;
}
.navbar-inner {
border-radius: 0 0 4px 4px;
border-width: 0 1px 1px;
}
.navbar .nav > li > a {
padding: 10px;
}
label[for="searchlang"], input#searchlang {
display: none;
}
@media (max-width:480px){
h1 { font-size: 1.8em; }
.navbar .nav > li > a {
padding: 0px 2px;
line-height: 10px;
}
/* hide CC logo */
.footer .licence {
display: none;
}
/* make legal foo*/
.footer .legal {
margin: 5px 5px 5px;
}
.footer .bar a {
margin: 2px 0;
}
}
/* Right-alignment. Will make it harder to achieve responsive behaviour:
twitter.github.com/bootstrap/components.html#navbar
Look for "Responsive navbar" heading.
If this is undesirable, remove the lines with the "RA" comment;
*/
.navbar .nav {
text-align: right; /* RA */
*text-align: left; /* RA */
width: 100%; /* RA */
}
.navbar .nav > li:first-child {
float: left; /* RA */
}
.navbar .nav > li {
display: inline-block; /* RA */
float: none; /* RA */
*float: left;
*display: inline;
line-height: 20px;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
border-color: rgba(236,160,73,.8);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075),
0 0 8px rgba(236,160,73,.6);
}
/* IE7/8 Flexibility */
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: auto;
max-width: 940px;
}
/* Don't widen the layout past 940 */
@media (min-width: 1200px) {
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
}
div.comment {
background: radial-gradient(
50% 8px at top,
rgba(0, 0, 0, 0.3) 0%,
rgba(0, 0, 0, 0) 100%
);
background-repeat: no-repeat;
box-shadow: 0 -1px 2px -2px white;
padding-top: 20px;
}
div.comment p:nth-child(2) {
color: #666;
/* line-height: 15px; */
font-size: 0.9em;
line-height: 1.4em;
}
div.comment p:nth-child(1) {
margin-bottom: 0px;
}
.comment textarea {
width: 100%;
*width: auto;
resize: vertical;
*resize: both;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* highlighting source code */
span.builtin { color: #483d8b; } /* DarkSlateBlue */
span.comment { color: #b22222; } /* Firebrick */
span.constant { color: #008b8b; } /* DarkCyan */
span.function { color: #0000ff; } /* Blue1 */
span.keyword { color: #7f007f; } /* Purple */
span.string { color: #8b475d; } /* VioletRed4 */
span.type { color: #228b22; } /* ForestGreen */
span.warning { color: #ff0000; font-weight: bold; } /* Red1 */
span.comment span,
span.string span { color: inherit; }
span.comment span.important.constant,
span.string span.important.constant { color: #008b8b; }
/* old: Equivalent to Output::HTML */
span.linecomment { color: #b22222; } /* firebrick */
span.blockcomment { color: #b22222; } /* firebrick */
span.prepro { color: purple; }
span.select { font-weight: bold; }
span.quote { color: #8b475d; } /* VioletRed4 */
span.category_1 { color: teal; }
span.category_2 { color: blue; }
span.category_3 { color: blue; }
code {
white-space: pre-wrap;
}
/* Local Variables: */
/* css-indent-offset: 4 */
/* End: */

View File

@@ -115,6 +115,7 @@ div.toc h2 {
/* get rid of useless "10 results found" when using indexed search. */
div.search p.result { display:none; }
label[for="searchlang"], input#searchlang { display: none; }
form.tiny, form.tiny p {
display:inline;
@@ -237,9 +238,6 @@ a.near:link {
a.near:visited {
color:#550;
}
a.tag:before {
content:"\2601\ ";
}
ol, ul, dl {
padding-top:0.5em;
}
@@ -338,7 +336,22 @@ div.month a.local {
/* highlighting */
/* Equivalent to Output::HTML */
/* highlighting source code */
span.builtin { color: #483d8b; } /* DarkSlateBlue */
span.comment { color: #b22222; } /* Firebrick */
span.constant { color: #008b8b; } /* DarkCyan */
span.function { color: #0000ff; } /* Blue1 */
span.keyword { color: #7f007f; } /* Purple */
span.string { color: #8b475d; } /* VioletRed4 */
span.type { color: #228b22; } /* ForestGreen */
span.warning { color: #ff0000; font-weight: bold; } /* Red1 */
span.comment span,
span.string span { color: inherit; }
span.comment span.important.constant,
span.string span.important.constant { color: #008b8b; }
/* old: Equivalent to Output::HTML */
span.linecomment { color: green; }
span.blockcomment { color: green; }

361
css/light.css Normal file
View File

@@ -0,0 +1,361 @@
/* This file is in the public domain. */
/* Esteban is nice, but bold is not so nice, and on Windows it suffers.
@import url(http://fonts.googleapis.com/css?family=Esteban&subset=latin,latin-ext);
For campaignwiki.org, we need to use the same URL in the config file when
calling wkhtmltopdf.
@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-size: 14pt;
color: #000;
background-color: #eed;
margin:1em 2em;
}
textarea, pre, code, tt {
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
font-size: 80%;
}
@media print {
body {
background-color: white;
font-family: Times, serif;
font-size:10pt;
}
}
/* iPhone */
@media only screen and (max-device-width: 480px) {
img { max-width: 480px !important; }
}
/* iPad */
@media only screen and (min-device-width: 481px) and (max-device-width: 900px) {
body { font-size: 150%; }
textarea,input { font-size: 100%; }
img { max-width: 550px !important; }
}
/* general */
.browse { min-height: 3em; }
.header form, .header p { margin: 0; }
/* hide the buttons but don't use display:none because of
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
.header input[type="submit"] { position: absolute; visibility: hidden; }
.header input { width: 5em; font-size: 80%; }
.footer { clear:both; font-size: 90%; }
.content input { font-size: 80%; line-height: 125%; }
/* comments, footer */
div.commentshown {
padding-bottom: 1ex;
padding-left: 2em;
border-left: 2px solid black;
font-size: smaller;
}
div.commenthidden { display:none; }
div.commentshown { display:block; }
/* comment pages with username, homepage, and email subscription */
.comment span { display: block; }
.comment span label {
display: inline-block; width: 10em;
}
input#mail, input#homepage, input#username {
display: inline-block; width: 20em;
}
/* titles */
h1 {
font-weight: bold;
font-size: 150%;
padding: 1em 0;
}
h1 a:link, h1 a:visited {
color: inherit;
background-color: inherit;
text-decoration: inherit;
}
h2 {
font-weight: bold;
font-size: 130%;
padding: 1em 0;
clear: both;
}
@media print {
h1 a, h2 a, h3 a, h4 a { font-style: normal; }
}
/* links */
a:link {
color: #851;
background-color: inherit;
}
a:visited {
color: #542;
background-color: inherit;
}
a:active {
color:#a41;
background-color: inherit;
}
.button {
display: inline-block;
font-size: 150%;
cursor: pointer;
padding: 0.3em 0.5em;
text-shadow: 0px -1px 0px #ccc;
background-color: #cfa;
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset,
0px 1px 3px black;
}
.button a {
text-decoration: none;
font-weight: normal;
}
.bar a { padding-right: 1em; }
@media print {
a, a:link, a:visited {
color:#000;
text-decoration:none;
font-weight: normal;
}
a.edit, div.footer, form, span.gotobar, a.number span { display:none; }
img[smiley] { line-height: inherit; }
}
/* edit paragraphs: no more */
a.pencil { display: none; }
/* table of contents */
.toc {
font-size: smaller;
border-left: 1em solid #886;
}
.toc ol {
list-style-type: none;
padding-left: 1em;
}
.toc a {
font-weight: normal;
}
/* images with links, captions, etc */
div.image { display: inline; margin: 1em; font-size: 90%; text-align: center; }
.left { float: left; margin-right: 1em; }
.right { float: right; margin-left: 1em; }
div.right .right { float: none; }
div.left .left { float: none; }
.caption { padding: 0 1em; }
.license { font-size: small; }
.aside {
font-size: small;
width: 30%;
float: right;
margin-left: 1em;
margin-bottom: 1em;
padding-left: 1em;
}
.aside img.smiley { height: 1em; }
.narrow {
width: 70%;
}
a img { border: 1px solid #333; }
.fit img { width: 80%; text-align: center; margin: 2em 8%; }
.half img { width: 50%; height: 50%; text-align: center; margin: 2em 8%; }
.noborder img { border: none; }
.twenty img { max-width: 20em; }
img.logo {
float: right;
clear: right;
border-style:none;
margin-left: 1em;
margin-bottom: 1ex;
border: 1px solid black;
}
.hexmap a img { background: #fff; border: none; }
/* fancy bold underline */
em.underline { font-weight: bold; }
/* editing, previewing */
textarea { width:100%; }
div.edit { padding-right: 1em; }
div.diff { padding-left:5%; padding-right:5%; }
div.old { background-color:#FFFFAF; }
div.new { background-color:#CFFFCF; }
/* div.message { background-color:#FEE; } */
div.message {
background-color: inherit;
font-size: smaller;
}
table.history { border-style:none; }
td.history { border-style:none; }
span.result { font-size:larger; }
span.info { font-size:smaller; font-style:italic; }
div.rc hr { display: none; }
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;
}
div.aside table.user {
margin: 1em 0;
padding: 0;
}
table.user td, table.user th {
border-style: none;
padding:5px 10px;
vertical-align: top;
}
table.user th { font-weight:bold; }
table.user td.r { text-align:right; }
table.user td.l { text-align:left; }
table.user td.c { text-align:center; }
table.user td.j { text-align:justify; }
table.user td.mark { background-color:yellow; }
tr:empty { display: block; height: 0.5em; }
@media print {
table {
font-size: 9pt;
margin: 0;
}
table.user td, table.user th {
padding: 0 1ex;
}
}
/* Calendar */
div.month { margin:0; padding:0; font-size:x-small; float:right; }
div.content div.month { float:none; }
div.year div.month { float:left; font-size:medium; padding:1ex; }
div.month pre { margin:0; padding:0 0 0 1ex; }
div.month a { text-decoration:none; font: inherit; }
div.month span.title a { font: inherit; }
/* no difference between a.exact and a.collection */
div.month a.local { font-weight: bold; }
div.month a.local:link { color: #562; }
div.month a.local:visited { color: #542; }
div.month a.today { background-color: #faa; }
div.month span.title a.local { font-weight: normal; color: #842; }
@media print {
div.month { display: none; }
div.year div.month { display: block; }
div.year div.month a { display: inline; }
}

88
css/minimal.css Normal file
View File

@@ -0,0 +1,88 @@
body { background-color:#FFF; color:#000; margin:1em 2em; }
@media only screen and (max-device-width: 480px) {
body { font-size: 300%; }
}
textarea { width:100%; }
a:link { color:#00F; }
a:visited { color:#A0A; }
a:active { color:#F00; }
a.alias { text-decoration:none; border-bottom: thin dashed; }
a.near:link { color:#093; }
a.near:visited { color:#550; }
img.logo { float: right; clear: right; border-style:none; }
div.diff { padding-left:5%; padding-right:5%; }
div.old { background-color:#FFFFAF; }
div.new { background-color:#CFFFCF; }
div.message { background-color:#FEE; }
div.journal h1 { font-size:large; }
table.history { border-style:none; }
td.history { border-style:none; }
span.result { font-size:larger; }
span.info { font-size:smaller; font-style:italic; }
div.rss { background-color:#EEF; }
div.search { background-color:#F1F5FF }
div.sister { float:left; margin-right:1ex; background-color:#FFF; }
div.sister p { margin-top:0; }
div.sister img { border:none; }
div.near, div.definition { background-color:#EFE; }
div.near p, div.definition p { margin-top:0; }
form.comment span { display: block; }
@media print {
body { font:12pt sans-serif; }
a, a:link, a:visited { color:#000; text-decoration:none; font-style:oblique; }
h1 a, h2 a, h3 a, h4 a { font-style: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; }
}
/* calendar */
div.month { margin:0; padding:0; font-size:x-small; float:right; }
div.content div.month { float:none; }
div.footer { clear:both; }
div.year div.month { float:left; font-size:medium; padding:1ex; }
div.month pre { margin:0; padding:0 0 0 1ex; background-color:#ffe; }
div.month a { text-decoration:none; color:inherit; }
div.month span.title a { background-color:inherit; }
div.month a.exact { background-color:#eef; }
div.month a.collection { background-color:#ccf; }
div.month a.today { background-color:#fcc; }
div.month a[class~="today"][class~="exact"] { background-color:#fcf; }
div.month a[class~="today"][class~="collection"] { background-color:#faf; }
@media print {
div.month { display: none; }
div.year div.month { display: block; }
div.year div.month a { display: inline; }
}
/* crumbs */
span.crumbs { font-size: smaller; }
/* dynamic comments */
div.commenthidden { display:none; }
div.commentshown { display:block; background-color:#ffc; padding:1ex; }
/* irc */
dl.irc dt { width:12ex; float:left; text-align:right; }
dl.irc dd { margin-left:15ex; }
/* page trail */
@media print { span.trail { display: none; }}
/* portrait support */
img.portrait { float: left; clear: left; margin: 1ex; border:#999 1px solid; }
div.footer, div.comment, hr { clear: both; }
div.portrait { float: left; clear: left; font-size: xx-small; margin-right: 1em; }
div.portrait img.portrait { float: none; margin: 0; }
div.portrait a { text-decoration: none; color: #999; }
div.color { clear: both; }
div.one { background-color: #ddd; }
/* referrer tracking */
div.refer { padding-left:5%; padding-right:5%; font-size:smaller; }
@media print { div.refer { display:none; }}
/* usemod, tables, long tables */
table.user { border-style:solid; border-width:thin; }
table.user td, table.user th { border-style:solid; border-width:thin; padding:5px; }
table.user th { font-weight:bold; }
table.user td.r { text-align:right; }
table.user td.l { text-align:left; }
table.user td.c { text-align:center; }
table.user td.j { text-align:justify; }
table.user td.mark { background-color:yellow; }
/* sidebar */
div.sidebar { float: left; margin-right: 2em; margin-bottom: 3em; }

View File

@@ -28,7 +28,7 @@ body {
padding:2% 5%;
margin:0;
font-family: "Gentium Basic", "Bookman Old Style", "Times New Roman", serif;
font-size: 18pt;
font-size: 16pt;
}
div.header h1 {
@@ -129,9 +129,15 @@ dd {
margin-bottom:1ex;
}
textarea { width:100%; height:80%; }
textarea {
width:100%;
height:80%;
font-size: 12pt;
}
textarea#summary { height: 3em; }
input {
font-size: 12pt;
}
div.image span.caption {
margin: 0 1em;
}
@@ -191,6 +197,19 @@ hr {
div.footer hr {
height:4px;
margin: 2em 0 1ex 0;
clear:both;
}
div.content > div.comment {
border-top: none;
padding-top: none;
border-left: 1ex solid #bbb;
padding-left: 1ex;
}
div.wrapper > div.comment {
border-top: 2px solid #000;
padding-top: 2em;
}
pre {
@@ -199,9 +218,13 @@ pre {
margin-right: 2em;
white-space: pre;
overflow:hidden;
font-size: smaller;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
div.footer hr {
clear:both;
}
tt, pre, code {
font-size: 80%;
};

250
css/oddmuse-2014.css Normal file
View File

@@ -0,0 +1,250 @@
@font-face {
font-family: 'Gentium Basic';
font-style: normal;
font-weight: 400;
src: local('Gentium Basic'), local('GentiumBasic'), url(/fonts/GenBasR.woff) format('woff');
}
@font-face {
font-family: 'Gentium Basic';
font-style: normal;
font-weight: 700;
src: local('Gentium Basic Bold'), local('GentiumBasic-Bold'), url(/fonts/GenBasB.woff) format('woff');
}
@font-face {
font-family: 'Gentium Basic';
font-style: italic;
font-weight: 400;
src: local('Gentium Basic Italic'), local('GentiumBasic-Italic'), url(/fonts/GenBasI.woff) format('woff');
}
@font-face {
font-family: 'Gentium Basic';
font-style: italic;
font-weight: 700;
src: local('Gentium Basic Bold Italic'), local('GentiumBasic-BoldItalic'), url(/fonts/GenBasBI.woff) format('woff');
}
@font-face {
font-family: 'Gentium Plus';
font-style: normal;
font-weight: 400;
src: local('Gentium Plus'), local('GentiumPlus'), url(/fonts/GentiumPlus-R.woff) format('woff');
}
@font-face {
font-family: 'Gentium Plus';
font-style: italic;
font-weight: 400;
src: local('Gentium Plus Italic'), local('GentiumPlus-Italic'), url(/fonts/GentiumPlus-I.woff) format('woff');
}
@font-face {
font-family: 'Symbola';
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff') url('/fonts/Symbola.ttf') format('truetype');
}
body {
background:#fff;
padding:2% 5%;
margin:0;
font-family: "Gentium Basic", "Gentium Plus", "Symbola", serif;
font-size: 16pt;
}
div.header h1 {
margin-top:2ex;
}
a {
text-decoration: none;
color: #a00;
}
a:visited {
color: #d88;
}
div.header h1 a:hover, h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover,
a:hover, span.caption a.image:hover {
background:#fee;
}
img.logo {
float: right;
clear: right;
border-style:none;
background-color:#fff;
}
img {
padding: 0.5em;
margin: 0 1em;
}
a.image:hover {
background:inherit;
}
a.image:hover img {
background:#fee;
}
/* a.definition soll aussehen wie h2 */
h2, p a.definition {
display:block;
clear:both;
}
/* Such Link im h1 soll nicht auffallen. */
h1, h2, h3, h4, h1 a, h1 a:visited, p a.definition {
color:#666;
font-size: 30pt;
font-weight: normal;
margin: 4ex 0 1ex 0;
padding: 0;
border-bottom: 1px solid #000;
}
h3, h4 {
font-size: inherit;
}
div.diff {
padding: 1em 3em;
}
div.old {
background-color:#FFFFAF;
}
div.new {
background-color:#CFFFCF;
}
div.old p, div.new p {
padding: 0.5em 0;
}
div.refer { padding-left:5%; padding-right:5%; font-size:smaller; }
div[class="content refer"] p { margin-top:2em; }
div.content div.refer hr { display:none; }
div.content div.refer { padding:0; font-size:medium; }
div.content div.refer p { margin:0; }
div.refer a { display:block; }
table.history { border-style:none; }
td.history { border-style:none; }
table.user {
border-style: none;
margin-left: 3em;
}
table.user tr td {
border-style: none;
padding:0.5ex 1ex;
}
dt {
font-weight:bold;
}
dd {
margin-bottom:1ex;
}
textarea {
width:100%;
height:80%;
font-size: 12pt;
}
textarea#summary { height: 3em; }
input {
font-size: 12pt;
}
div.image span.caption {
margin: 0 1em;
}
li img, img.smiley, .noborder img {
border:none;
padding:0;
margin:0;
background:#fff;
color:#000;
}
/* Google +1 */
a#plus1 img {
background-color: #fff;
padding: 0;
margin: 0;
border: none;
}
div.header img, div.footer img { border:0; padding:0; margin:0; }
/* No goto bar at the bottom. */
.footer .gotobar, .footer .edit br { display: none; }
.left { float:left; }
.right { float:right; }
div.left .left, div.right .right {
float:none;
}
.center { text-align:center; }
span.author {
color: #501;
}
span.bar a {
padding-right:1ex;
}
.rc .author {
color: #655;
}
.rc strong {
font-weight: normal;
color: inherit;
}
.rc li {
position:relative;
padding: 1ex 0;
}
hr {
border:none;
color:black;
background-color:#000;
height:2px;
margin-top:2ex;
}
div.footer hr {
height:4px;
margin: 2em 0 1ex 0;
clear:both;
}
div.content > div.comment {
border-top: none;
padding-top: none;
border-left: 1ex solid #bbb;
padding-left: 1ex;
}
div.wrapper > div.comment {
border-top: 2px solid #000;
padding-top: 2em;
}
pre {
padding: 0.5em;
margin-left: 1em;
margin-right: 2em;
white-space: pre;
overflow:hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
tt, pre, code {
font-size: 80%;
};

View File

@@ -58,8 +58,12 @@ div.left .left, div.right .right {
span.author {
color: #501;
}
span.bar a:first-child {
margin-left:-0.5ex;
}
span.bar a {
padding-right:1ex;
padding-right:0.5ex;
padding-left:-0.5ex;
}
body {
background:#fff;

View File

@@ -1,88 +1,268 @@
body { background-color:#FFF; color:#000; margin:1em 2em; }
@media only screen and (max-device-width: 480px) {
body { font-size: 300%; }
/* This is the default CSS file for Oddmuse wikis. It is dedicated to
the public domain. You can copy, modify, distribute and use the
work, even for commercial purposes, all without asking permission.
https://creativecommons.org/publicdomain/zero/1.0/ */
body {
background: #fff;
padding: 2% 5%;
margin: 0;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 15pt;
}
textarea { width:100%; }
a:link { color:#00F; }
a:visited { color:#A0A; }
a:active { color:#F00; }
a.alias { text-decoration:none; border-bottom: thin dashed; }
a.near:link { color:#093; }
a.near:visited { color:#550; }
img.logo { float: right; clear: right; border-style:none; }
div.diff { padding-left:5%; padding-right:5%; }
div.old { background-color:#FFFFAF; }
div.new { background-color:#CFFFCF; }
div.message { background-color:#FEE; }
div.journal h1 { font-size:large; }
table.history { border-style:none; }
td.history { border-style:none; }
span.result { font-size:larger; }
span.info { font-size:smaller; font-style:italic; }
div.rss { background-color:#EEF; }
div.search { background-color:#F1F5FF }
div.sister { float:left; margin-right:1ex; background-color:#FFF; }
div.sister p { margin-top:0; }
div.sister img { border:none; }
div.near, div.definition { background-color:#EFE; }
div.near p, div.definition p { margin-top:0; }
form.comment span { display: block; }
@media print {
body { font:12pt sans-serif; }
a, a:link, a:visited { color:#000; text-decoration:none; font-style:oblique; }
h1 a, h2 a, h3 a, h4 a { font-style: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; }
div.header h1 {
margin-top: 2ex;
}
/* calendar */
div.month { margin:0; padding:0; font-size:x-small; float:right; }
div.content div.month { float:none; }
div.footer { clear:both; }
div.year div.month { float:left; font-size:medium; padding:1ex; }
div.month pre { margin:0; padding:0 0 0 1ex; background-color:#ffe; }
div.month a { text-decoration:none; color:inherit; }
div.month span.title a { background-color:inherit; }
div.month a.exact { background-color:#eef; }
div.month a.collection { background-color:#ccf; }
div.month a.today { background-color:#fcc; }
div.month a[class~="today"][class~="exact"] { background-color:#fcf; }
div.month a[class~="today"][class~="collection"] { background-color:#faf; }
@media print {
div.month { display: none; }
div.year div.month { display: block; }
div.year div.month a { display: inline; }
a {
text-decoration: none;
color: #a00;
}
a:visited {
color: #d88;
}
div.header h1 a:hover, h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover,
a:hover, span.caption a.image:hover {
background: #fee;
}
img.logo {
float: right;
clear: right;
border-style: none;
background-color: #fff;
}
img {
padding: 0.5em;
margin: 0 1em;
max-width: 95%;
}
a.image:hover {
background: inherit;
}
a.image:hover img {
background: #fee;
}
/* a.definition soll aussehen wie h2 */
h2, p a.definition {
display: block;
clear: both;
}
/* Such Link im h1 soll nicht auffallen. */
h1, h2, h3, h4, h1 a, h1 a:visited, p a.definition {
color: #666;
font-size: 30pt;
font-weight: normal;
margin: 4ex 0 1ex 0;
padding: 0;
border-bottom: 1px solid #000;
}
h3, h4 {
font-size: inherit;
}
div.diff {
padding: 1em 3em;
}
div.old {
background-color: #FFFFAF;
}
div.new {
background-color: #CFFFCF;
}
div.old p, div.new p {
padding: 0.5em 0;
}
div.refer { padding-left: 5%; padding-right: 5%; font-size: smaller; }
div[class="content refer"] p { margin-top: 2em; }
div.content div.refer hr { display: none; }
div.content div.refer { padding: 0; font-size: medium; }
div.content div.refer p { margin: 0; }
div.refer a { display: block; }
table.history { border-style: none; }
td.history { border-style: none; }
table.user {
border-style: none;
margin-left: 3em;
}
table.user tr td {
border-style: none;
padding: 0.5ex 1ex;
}
dt {
font-weight: bold;
}
dd {
margin-bottom: 1ex;
}
textarea {
width: 100%;
height: 80%;
font-size: 12pt;
}
textarea#summary { height: 3em; }
input {
font-size: 12pt;
}
div.image span.caption {
margin: 0 1em;
}
li img, img.smiley, .noborder img {
border: none;
padding: 0;
margin: 0;
background: #fff;
color: #000;
}
/* Google +1 */
a#plus1 img {
background-color: #fff;
padding: 0;
margin: 0;
border: none;
}
div.header img, div.footer img { border: 0; padding: 0; margin: 0; }
/* No goto bar at the bottom. */
.footer .gotobar, .footer .edit br { display: none; }
.left { float: left; }
.right { float: right; }
div.left .left, div.right .right {
float: none;
}
.center { text-align: center; }
span.author {
color: #501;
}
span.bar a:first-child {
margin-left: -0.5ex;
}
span.bar a {
padding-right: 0.5ex;
padding-left: 0.5ex;
}
.rc .author {
color: #655;
}
.rc strong {
font-weight: normal;
color: inherit;
}
.rc li {
position: relative;
padding: 1ex 0;
}
hr {
border: none;
color: black;
background-color: #000;
height: 2px;
margin-top: 2ex;
}
div.footer hr {
height: 4px;
margin: 2em 0 1ex 0;
clear: both;
}
div.content > div.comment {
border-top: none;
padding-top: 0;
border-left: 1ex solid #bbb;
padding-left: 1ex;
}
div.wrapper > div.comment {
border-top: 2px solid #000;
padding-top: 2em;
}
pre {
padding: 0.5em;
margin-left: 1em;
margin-right: 2em;
white-space: pre;
overflow: hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
tt, pre, code {
font-size: 80%;
}
code {
background: #eee;
white-space: pre-wrap;
}
@font-face {
font-family: 'Gentium Basic';
font-style: normal;
font-weight: 700;
src: local('Gentium Basic Bold'), local('GentiumBasic-Bold'), url(/fonts/GenBasB.woff) format('woff');
}
@font-face {
font-family: 'Gentium Basic';
font-style: italic;
font-weight: 400;
src: local('Gentium Basic Italic'), local('GentiumBasic-Italic'), url(/fonts/GenBasI.woff) format('woff');
}
@font-face {
font-family: 'Gentium Basic';
font-style: italic;
font-weight: 700;
src: local('Gentium Basic Bold Italic'), local('GentiumBasic-BoldItalic'), url(/fonts/GenBasBI.woff) format('woff');
}
@font-face {
font-family: 'Gentium Basic';
font-style: normal;
font-weight: 400;
src: local('Gentium Basic'), local('GentiumBasic'), url(/fonts/GenBasR.woff) format('woff');
}
@font-face {
font-family: 'Gentium Plus';
font-style: normal;
font-weight: 400;
src: local('Gentium Plus'), local('GentiumPlus'), url(/fonts/GentiumPlus-R.woff) format('woff');
}
@font-face {
font-family: 'Gentium Plus';
font-style: italic;
font-weight: 400;
src: local('Gentium Plus Italic'), local('GentiumPlus-Italic'), url(/fonts/GentiumPlus-I.woff) format('woff');
}
@font-face {
font-family: 'Symbola';
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff') url('/fonts/Symbola.ttf') format('truetype');
}
/* crumbs */
span.crumbs { font-size: smaller; }
/* dynamic comments */
div.commenthidden { display:none; }
div.commentshown { display:block; background-color:#ffc; padding:1ex; }
/* irc */
dl.irc dt { width:12ex; float:left; text-align:right; }
dl.irc dd { margin-left:15ex; }
/* page trail */
@media print { span.trail { display: none; }}
/* portrait support */
img.portrait { float: left; clear: left; margin: 1ex; border:#999 1px solid; }
div.footer, div.comment, hr { clear: both; }
div.portrait { float: left; clear: left; font-size: xx-small; margin-right: 1em; }
div.portrait img.portrait { float: none; margin: 0; }
div.portrait a { text-decoration: none; color: #999; }
div.color { clear: both; }
div.one { background-color: #ddd; }
/* referrer tracking */
div.refer { padding-left:5%; padding-right:5%; font-size:smaller; }
@media print { div.refer { display:none; }}
/* usemod, tables, long tables */
table.user { border-style:solid; border-width:thin; }
table.user td, table.user th { border-style:solid; border-width:thin; padding:5px; }
table.user th { font-weight:bold; }
table.user td.r { text-align:right; }
table.user td.l { text-align:left; }
table.user td.c { text-align:center; }
table.user td.j { text-align:justify; }
table.user td.mark { background-color:yellow; }
/* sidebar */
div.sidebar { float: left; margin-right: 2em; margin-bottom: 3em; }

View File

@@ -1,7 +0,0 @@
#!/bin/sh
# minimum
apt-get install perl-modules
# recommended
apt-get install diff libwww-perl libxml-rss-perl
# optional
apt-get install libcgi-fast-perl

1
description Normal file
View File

@@ -0,0 +1 @@
Oddmuse

202
info-ref
View File

@@ -1,202 +0,0 @@
#!/usr/bin/perl
# Copyright (C) 2005 Alex Schroeder <alex@emacswiki.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;
use warnings;
use CGI;
use LWP::UserAgent;
use XML::LibXML;
use URI;
my @indexes = qw(
http://www.gnu.org/software/emacs/manual/html_node/Command-Index.html
http://www.gnu.org/software/emacs/manual/html_node/Variable-Index.html
http://www.gnu.org/software/emacs/manual/html_node/Concept-Index.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_728.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_729.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_730.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_731.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_732.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_733.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_734.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_735.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_736.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_737.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_738.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_739.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_740.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_741.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_742.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_743.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_744.html
);
my $db = '/org/org.emacswiki/htdocs/emacs/info-ref.dat';
my $nl = "\n";
my $fs = "\023";
my $gs = "\024";
my $rs = "\025";
my $q = new CGI;
ProcessRequest();
sub ProcessRequest {
if ($q->param('init')) {
Initialize();
} elsif ($q->param('find')) {
Find($q->param('find'));
} else {
ShowForm();
}
}
sub ShowForm {
print $q->header, $q->start_html,
$q->start_form, "Index entry: ", $q->textfield('find'), $q->submit, $q->end_form,
$q->p('$Id: info-ref,v 1.6 2005/08/31 14:01:17 as Exp $'),
$q->end_html;
}
sub Find {
my $str = shift;
my %map = ();
my $data = ReadFileOrDie($db);
foreach my $line (split(/$nl/, $data)) {
my ($key, $rest) = split(/$fs/, $line);
$map{$key} = ();
foreach my $a (split(/$gs/, $rest)) {
my ($link, $label) = split(/$rs/, $a);
$map{$key}{$link} = $label;
}
}
my @links = keys %{$map{$str}};
if ($#links < 0) {
ReportError("No matches found for '$str'", '404 Not Found');
} elsif ($#links == 0) {
print $q->redirect($links[0]);
} else {
my @list = map { $q->a({-href=>$_}, $map{$str}{$_}) } @links;
print $q->header, $q->h1($str), $q->ol($q->li(\@list));
}
}
sub Initialize {
my %map = ();
print $q->header, $q->start_html;
foreach my $url (@indexes) {
print $q->p($url);;
# determine base URI
my $base = URI->new($url);
# fetch and parse data
my $data = GetRaw($url);
# some markup fixes for the elisp manual
$data =~ s/&([<"])/&amp;$1/g;
$data =~ s/<([<"])/&lt;$1/g;
$data =~ s/="fn_"">/="fn_&quot;">/;
$data =~ s/<!DOCTYPE.*?>//;
$data =~ s'</?font.*?>''gi;
$data =~ s'</table><br></P>'</table><br>';
my $parser = XML::LibXML->new();
my $doc;
eval { $doc = $parser->parse_html_string($data); };
print $q->p($@) if $@;
next if $@;
# emacs manual
my @nodelist = $doc->findnodes('/html/body/ul/li');
foreach my $node (@nodelist) {
my $text = $node->textContent;
my ($key) = split(/: /, $text);
my $a = $node->findnodes('descendant::a')->[0];
my $label = $a->textContent;
my $link = $a->getAttribute('href');
my $l = URI->new_abs($link, $base);
# print "$key -> $label $l\n";
$map{$key} = () unless $map{$key};
$map{$key}{$l->canonical} = $label;
}
# elisp manual
@nodelist = $doc->findnodes('descendant::table[position()=3]/descendant::tr');
foreach my $node (@nodelist) {
my ($item, $section) = $node->findnodes('td/a');
next unless $item and $section;
my $key = $item->textContent;
my $label = $section->textContent;
my $link = $item->getAttribute('href');
my $l = URI->new_abs($link, $base);
# print "$key -> $label $l\n";
$map{$key} = () unless $map{$key};
$map{$key}{$l->canonical} = $label;
}
}
my $data = join($nl, map {
my $key = $_;
$key . $fs . join($gs, map {
my $link = $_;
join($rs, $link, $map{$key}{$link});
} keys %{$map{$_}})
} keys %map);
WriteStringToFile($db, $data);
print $q->p('Database initialized'), $q->end_html;
}
sub GetRaw {
my $uri = shift;
return unless eval { require LWP::UserAgent; };
my $ua = LWP::UserAgent->new;
my $response = $ua->get($uri);
return $response->content;
}
sub ReadFile {
my ($filename) = @_;
my ($data);
local $/ = undef; # Read complete files
if (open(IN, "<$filename")) {
$data=<IN>;
close IN;
return (1, $data);
}
return (0, '');
}
sub ReadFileOrDie {
my ($filename) = @_;
my ($status, $data);
($status, $data) = ReadFile($filename);
if (!$status) {
ReportError("Cannot open $filename: $!", '500 Internal Server Error');
}
return $data;
}
sub WriteStringToFile {
my ($file, $string) = @_;
open(OUT, ">$file")
or ReportError("Cannot write $file: $!", '500 Internal Server Error');
print OUT $string;
close(OUT);
}
sub ReportError { # fatal!
my ($errmsg, $status, $log) = @_;
print $q->header(-status => $status);
print $q->start_html, $q->h2($errmsg), $q->end_html;
exit (1);
}

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
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/aawrapperdiv.pl">aawrapperdiv.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/WrapperDiv_Module">WrapperDiv Module</a></p>';
*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);
}

39
modules/accesskeys.pl Normal file
View File

@@ -0,0 +1,39 @@
# Copyright (C) 2014 Alex-Daniel Jakimenko <alex.jakimenko@gmail.com>
# Copyright (C) 2014 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 strict;
use v5.10;
AddModuleDescription('accesskeys.pl', 'Links With AccessKeys Extension');
our (@MyRules, $FreeLinkPattern);
push(@MyRules, \&LinksWithAccessKeys);
sub LinksWithAccessKeys {
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cg) {
my ($id, $key) = ($2, $3);
Dirty($1);
$id = FreeToNormal($id);
my ($class, $resolved, $title, $exists) = ResolveId($id);
my $text = NormalToFree($id);
if ($resolved) { # anchors don't exist as pages, therefore do not use $exists
print ScriptLink(UrlEncode($resolved), $text, $class, undef, $title, $key);
} else {
print "[[" . QuoteHtml($text) . GetEditLink($id, '?') . "]]";
}
return ''; # this is a dirty rule that depends the definition of other pages
}
return; # the rule didn't match
}

View File

@@ -16,7 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/admin.pl">admin.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Admin_Power_Extension">Admin Power Extension</a></p>';
use strict;
use v5.10;
our ($q, %Page, %Action, $IndexFile, $PageDir, $KeepDir, @MyAdminCode, $RefererDir);
AddModuleDescription('admin.pl', 'Admin Power Extension');
$Action{delete} = \&AdminPowerDelete;
$Action{rename} = \&AdminPowerRename;
@@ -35,7 +40,7 @@ sub AdminPowerDelete {
} 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
@@ -62,13 +67,13 @@ sub AdminPowerRename {
# Regenerate index on next request -- remove this before errors can occur!
unlink($IndexFile);
# page file
CreatePageDir($PageDir, $new); # It might not exist yet
CreateDir($PageDir); # It might not exist yet
rename($fname, $newfname)
or ReportError(Tss('Cannot rename %1 to %2', $fname, $newfname) . ": $!", '500 INTERNAL SERVER ERROR');
# keep directory
my $kdir = GetKeepDir($id);
my $newkdir = GetKeepDir($new);
CreatePageDir($KeepDir, $new); # It might not exist yet (only the parent directory!)
CreateDir($KeepDir); # It might not exist yet (only the parent directory!)
rename($kdir, $newkdir)
or ReportError(Tss('Cannot rename %1 to %2', $kdir, $newkdir) . ": $!", '500 INTERNAL SERVER ERROR')
if -d $kdir;
@@ -76,7 +81,7 @@ sub AdminPowerRename {
if (defined(&GetRefererFile)) {
my $rdir = GetRefererFile($id);
my $newrdir = GetRefererFile($new);
CreatePageDir($RefererDir, $new); # It might not exist yet
CreateDir($RefererDir); # It might not exist yet
rename($rdir, $newrdir)
or ReportError(Tss('Cannot rename %1 to %2', $rdir, $newrdir) . ": $!", '500 INTERNAL SERVER ERROR')
if -d $rdir;
@@ -84,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

@@ -14,20 +14,24 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/adsense.pl">adsense.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/AdSense_Module">AdSense Module</a></p>';
use strict;
use v5.10;
use vars qw($AdSensePageName $AdSensePlace);
AddModuleDescription('adsense.pl', 'AdSense Module');
our (@MyInitVariables, @MyFooters);
our ($AdSensePageName, $AdSensePlace);
push (@MyInitVariables, \&AdSenseInit);
sub AdSenseInit {
$AdSensePageName = "AdSense" unless $AdSensePageName;
$AdSensePlace = "top" unless $AdSensePlace;
$AdSensePlace = "top" unless $AdSensePlace;
if ($AdSensePlace eq 'bottom') { # Process adsense after all modules have been loaded
push (@MyFooters, \&GetAdSense);
} elsif ($AdSensePlace eq 'top') {
*AdSenseOldGetHtmlHeader = *GetHtmlHeader;
*GetHtmlHeader = *AdSenseNewGetHtmlHeader;
*AdSenseOldGetHtmlHeader = \&GetHtmlHeader;
*GetHtmlHeader = \&AdSenseNewGetHtmlHeader;
}
}
@@ -40,4 +44,3 @@ sub AdSenseNewGetHtmlHeader {
sub GetAdSense {
return GetPageContent($AdSensePageName) if GetParam('action', 'browse') eq 'browse';
}

View File

@@ -0,0 +1,37 @@
# Copyright (C) 2014 Alex-Daniel Jakimenko <alex.jakimenko@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 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 strict;
use v5.10;
AddModuleDescription('advanced-uploads.pl', 'Advanced File Upload Extension');
our ($q, $HtmlHeaders);
$HtmlHeaders .= '<script type="text/javascript" src="/js/uploader.js"></script>';
*AdvancedUploadsOldGetTextArea = \&GetTextArea;
*GetTextArea = \&AdvancedUploadsNewGetTextArea;
sub AdvancedUploadsNewGetTextArea {
my ($name, $text, $rows) = @_;
return AdvancedUploadsOldGetTextArea(@_) . $q->br() . ($name =~ 'text|aftertext' ? GetUploadForm() : '');
}
sub GetUploadForm {
return $q->span({-class=>'upload'}, $q->label({-for=>'fileToUpload'}, T('Attach file:')),
$q->filefield(-name=>'fileToUpload', -id=>'fileToUpload', -multiple=>'multiple', -onChange=>'fileSelected()', -size=>20),
$q->span({-id=>'fileSize'}, ''),
$q->button(-name=>'uploadButton', -value=>T('Upload'), -onClick=>'uploadFile()'),
$q->span({-id=>'progressNumber'}));
}

View File

@@ -16,9 +16,13 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/age.pl">age.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Age_Indication_Extension">Age Indication Extension</a></p>';
use strict;
use v5.10;
use vars qw(%AgeEffect $AgeParameter);
AddModuleDescription('age.pl', 'Age Indication Extension');
our (%Page, $Now, $ScriptName);
our (%AgeEffect, $AgeParameter);
# map page age to theme
%AgeEffect = (60*60*24 => 'day',
@@ -31,8 +35,8 @@ use vars qw(%AgeEffect $AgeParameter);
# if using creationdate.pl.
$AgeParameter = 'ts';
*OldAgeGetHeader = *GetHeader;
*GetHeader = *NewAgeGetHeader;
*OldAgeGetHeader = \&GetHeader;
*GetHeader = \&NewAgeGetHeader;
sub NewAgeGetHeader {
my $header = OldAgeGetHeader(@_);
@@ -46,7 +50,7 @@ sub NewAgeGetHeader {
}
}
return $header unless $theme;
$oldtheme = GetParam('theme', $ScriptName);
my $oldtheme = GetParam('theme', $ScriptName);
$header =~ s/class="$oldtheme"/class="$theme"/; # touch as little as possible
return $header;
}

View File

@@ -16,12 +16,17 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/aggregate.pl">aggregate.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Front_Page_Extension">Front Page Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('aggregate.pl', 'Front Page Extension');
our ($q, $bol, %Action, %Page, $OpenPageName, $UseDiff, $UsePathInfo, $RssStyleSheet, $RssLicense, $RssRights, $RssImageUrl, $CommentsPrefix, $SiteName, $ScriptName, $HomePage, $SiteDescription, @MyRules, $LastUpdate, $InterWikiMoniker);
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);
@@ -61,7 +66,7 @@ sub AggregateRule {
($_, pos) = ($old_, $oldpos); # restore \G (assignment order matters!)
return '';
}
return undef;
return;
}
$Action{aggregate} = \&DoAggregate;
@@ -121,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----");
@@ -131,20 +136,15 @@ 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;
{
local *STDOUT;
open(STDOUT, '>', \$description) or die "Can't open memory file: $!";
ApplyRules(QuoteHtml($page), 1, 0, undef, 'p');
}
my $description = ToString(sub { ApplyRules(QuoteHtml($page), 1, 0, undef, 'p') });
$description .= $q->p(GetPageLink($id, T('Learn more...')))
if length($page) < $size;
$rss .= "\n<item>\n";

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

@@ -16,11 +16,16 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/all.pl">all.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/All_Action">All Action</a></p>';
use strict;
use v5.10;
AddModuleDescription('all.pl', 'All Action');
our ($q, %Action, $HomePage, $UrlProtocols);
$Action{all} = \&DoPrintAllPages;
my $Monolithic = 0;
our $Monolithic = 0;
sub DoPrintAllPages {
return if (!UserIsAdminOrError());
@@ -28,12 +33,12 @@ sub DoPrintAllPages {
print GetHeader('', T('Complete Content'))
. $q->p(Ts('The main page is %s.', $q->a({-href=>'#' . $HomePage}, $HomePage)));
print $q->p($q->b(Ts('(for %s)', GetParam('lang', 0)))) if GetParam('lang', 0);
PrintAllPages(0, 0, undef, AllPagesList());
PrintAllPages(0, 0, undef, undef, AllPagesList());
PrintFooter();
}
*OldAllScriptLink = *ScriptLink;
*ScriptLink = *NewAllScriptLink;
*OldAllScriptLink = \&ScriptLink;
*ScriptLink = \&NewAllScriptLink;
sub NewAllScriptLink {
my ($action, $text, $class, $name, $title, $accesskey, $nofollow) = @_;
@@ -41,6 +46,7 @@ sub NewAllScriptLink {
and $action !~ /^($UrlProtocols)\%3a/
and $action !~ /^\%2f/
and $action !~ /=/) {
my %params;
$params{-href} = '#' . $action;
$params{'-class'} = $class if $class;
$params{'-name'} = $name if $name;

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2004, 2005, 2009 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20042015 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
@@ -12,18 +12,22 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/anchors.pl">anchors.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Local_Anchor_Extension">Local Anchor Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('anchors.pl', 'Local Anchor Extension');
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 '[[[');
@@ -35,14 +39,30 @@ sub AnchorsRule {
if (!$text && $bracket) {
$text = BracketLink(++$FootnoteNumber); # s/_/ /g happens further down!
$class .= ' number';
$title = $id; # override title
$title =~ s/_/ /g if $free;
# Since we're displaying a number such as [1], the title attribute should tell us where this will go.
$title = "$2 ($3)";
# The user might have writen [[[FooBar#one two]]] or [[[FooBar#one_two]]]
$title =~ s/_/ /g;
}
$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 undef;
return;
}
*OldAnchorsBrowsePage=\&BrowsePage;
*BrowsePage=\&NewAnchorsBrowsePage;
sub NewAnchorsBrowsePage {
my ($id) = @_;
OpenPage($id);
if (not GetParam('revision', '')
and not GetParam('oldid', '')
and $Page{text} =~ /^\#REDIRECT\s+\[\[$FreeLinkPattern\#$FreeLinkPattern\]\]/) {
return ReBrowsePage(FreeToNormal($1 . '#' . $2), $id);
}
return OldAnchorsBrowsePage(@_);
}

44
modules/antispam.pl Executable file → Normal file
View File

@@ -16,9 +16,13 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/antispam.pl">antispam.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Antispam_Module">Antispam Module</a></p>';
use strict;
use v5.10;
use vars qw($DoMaskEmail $CreateMailtoLinks);
AddModuleDescription('antispam.pl', 'Antispam Module');
our (@MyRules);
our ($DoMaskEmail, $CreateMailtoLinks, $EmailRegExp);
$DoMaskEmail = 1; # Mask all email, not just those in []'s
$CreateMailtoLinks = 1; # Create mailto's for all addresses
@@ -27,33 +31,33 @@ $EmailRegExp = '[\w\.\-]+@([\w\-]+\.)+[\w]+';
push(@MyRules, \&MaskEmailRule);
sub MaskEmailRule {
# Allow [email@foo.bar Email Me] links
if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/igc) {
$chunk = $1;
if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/cgi) {
my $chunk = $1;
$chunk =~ s/($EmailRegExp)//i;
$email = $1;
my $email = $1;
$chunk =~ s/^\s*//;
$chunk =~ s/\s*$//;
$masked="";
@decimal = unpack('C*', $email);
foreach $i (@decimal) {
$masked.="&#".$i.";";
my $masked = '';
my @decimal = unpack('C*', $email);
for (@decimal) {
$masked .= '&#' . $_ . ';';
}
$email = $masked;
$chunk = $email if $chunk eq "";
return "<a href=\"mailto:" . $email . "\">$chunk</a>";
return "<a href=\"mailto:$email\">$chunk</a>";
}
if (m/\G($EmailRegExp)/igc) {
$email=$1;
if (m/\G($EmailRegExp)/cgi) {
my $email = $1;
if ($DoMaskEmail) {
$masked="";
@decimal = unpack('C*', $email);
foreach $i (@decimal) {
$masked.="&#".$i.";";
my $masked="";
my @decimal = unpack('C*', $email);
for (@decimal) {
$masked .= '&#' . $_ . ';';
}
$email = $masked;
}
@@ -62,5 +66,5 @@ sub MaskEmailRule {
}
return $email;
}
return undef;
return;
}

View File

@@ -16,10 +16,15 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/archive.pl">archive.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Archive_Extension">Archive Extension</a></p>';
use strict;
use v5.10;
*OldArchiveGetHeader = *GetHeader;
*GetHeader = *NewArchiveGetHeader;
AddModuleDescription('archive.pl', 'Archive Extension');
our ($q);
*OldArchiveGetHeader = \&GetHeader;
*GetHeader = \&NewArchiveGetHeader;
# this assumes that *all* calls to GetHeader will print!
sub NewArchiveGetHeader {
@@ -32,7 +37,7 @@ sub NewArchiveGetHeader {
print $q->div({-class=>'archive'},
$q->p($q->span(T('Archive:')),
map {
$key = $_;
my $key = $_;
my ($year, $month) = split(/-/, $key);
if (defined(&month_name)) {
ScriptLink('action=collect;match=' . UrlEncode("^$year-$month"),

69
modules/askpage.pl Normal file
View File

@@ -0,0 +1,69 @@
# Copyright (C) 2014 Alex-Daniel Jakimenko <alex.jakimenko@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 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 strict;
use v5.10;
AddModuleDescription('askpage.pl', 'Ask Page Extension');
use Fcntl qw(:DEFAULT :flock);
our ($DataDir, %Translate, @MyFooters);
our ($AskPage, $QuestionPage, $NewQuestion);
# Don't forget to set your $CommentsPattern to include both $AskPage and $QuestionPage
$AskPage = 'Ask';
$QuestionPage = 'Question_';
$NewQuestion = 'Write your question here:';
sub IncrementInFile {
my $filename = shift;
sysopen my $fh, $filename, O_RDWR|O_CREAT or die "can't open $filename: $!";
flock $fh, LOCK_EX or die "can't flock $filename: $!";
my $num = <$fh> || 1;
seek $fh, 0, 0 or die "can't rewind $filename: $!";
truncate $fh, 0 or die "can't truncate $filename: $!";
(print $fh $num+1, "\n") or die "can't write $filename: $!";
close $fh or die "can't close $filename: $!";
return $num;
}
*OldAskPageDoPost = \&DoPost;
*DoPost = \&NewAskPageDoPost;
sub NewAskPageDoPost {
my $id = FreeToNormal(shift);
if ($id eq $AskPage and not GetParam('text', undef)) { # comment, not a regular edit
my $currentQuestion = IncrementInFile("$DataDir/curquestion");
$currentQuestion =~ s/[\s\n]//g;
return OldAskPageDoPost($QuestionPage . $currentQuestion, @_); # hack page name
}
OldAskPageDoPost($id, @_); # keep original functionality for regular edits
}
*OldAskPageGetCommentForm = \&GetCommentForm;
*GetCommentForm = \&NewAskPageGetCommentForm;
@MyFooters = map { $_ == \&OldAskPageGetCommentForm ? \&NewAskPageGetCommentForm : $_ } @MyFooters;
sub NewAskPageGetCommentForm {
my ($id) = @_;
$Translate{'Add your comment here:'} = $NewQuestion if $id eq $AskPage;
OldAskPageGetCommentForm(@_);
}
*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

@@ -1,4 +1,4 @@
# Copyright (C) 2004, 2006, 2008 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2004, 2006, 2008, 2014 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
@@ -13,11 +13,17 @@
# 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 strict;
use v5.10;
use XML::Atom;
use XML::Atom::Entry;
use XML::Atom::Link;
use XML::Atom::Person;
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/atom.pl">atom.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Atom_Extension">Atom Extension</a></p>';
AddModuleDescription('atom.pl', 'Atom Extension');
our ($q, %Page, %Action, $CommentsPrefix, $ScriptName, $SiteName, $MaxPost, $UseDiff, $DeletedPage, @MyInitVariables, @MyMacros, $FS, $BannedContent, $RssStyleSheet, $RssRights, $RssLicense, $RssImageUrl, $RssExclude, $RCName, @UploadTypes, $UploadAllowed, $UsePathInfo, $SiteDescription, $LastUpdate, $InterWikiMoniker);
push(@MyInitVariables, \&AtomInit);
@@ -98,6 +104,14 @@ sub GetRcAtom {
(ref $RssLicense eq 'ARRAY' ? @$RssLicense : $RssLicense));
$feed .= AtomTag('wiki:interwiki', $InterWikiMoniker) if $InterWikiMoniker;
$feed .= AtomTag('logo', $RssImageUrl) if $RssImageUrl;
my %excluded = ();
if (GetParam("exclude", 1)) {
foreach (split(/\n/, GetPageContent($RssExclude))) {
if (/^ ([^ ]+)[ \t]*$/) { # only read lines with one word after one space
$excluded{$1} = 1;
}
}
}
# Now call GetRc with some blocks of code as parameters:
ProcessRcLines(sub {}, sub {
my ($pagename, $timestamp, $host, $username, $summary, $minor, $revision, $languages, $cluster) = @_;
@@ -111,7 +125,7 @@ sub GetRcAtom {
. (GetParam('all', $cluster)
? QuoteHtml($ScriptName) . "?" . GetPageParameters('browse', $pagename, $revision, $cluster)
: $url . UrlEncode($pagename)) . qq{"/>\n};
$feed .= AtomLink("$ScriptName/atom/wiki/$id");
$feed .= AtomLink("$ScriptName/atom/wiki/$pagename");
$feed .= AtomTag('summary', QuoteHtml($summary));
$feed .= qq{<content type="xhtml">\n<div xmlns="http://www.w3.org/1999/xhtml">\n}
. PageHtml($pagename, 50*1024,$q->div(T('This page is too big to send over RSS.')))
@@ -136,15 +150,15 @@ 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()
my $id = FreeToNormal($title) if ValidIdOrDie($title);
my $id = FreeToNormal($title);
UserCanEditOrDie($id);
$oldid = $id unless $oldid;
ValidIdOrDie($oldid);
my $summary = $entry->summary();
ReportError(Ts('Editing not allowed for %s.', $id), '403 FORBIDDEN') unless UserCanEdit($id, 1);
# Lock before getting old page to prevent races
RequestLockOrError(); # fatal
OpenPage($oldid);
@@ -173,7 +187,7 @@ sub DoAtomSave {
my $oldrev = $Page{revision};
if ($old eq $string and $oldid eq $id) {
ReportError(T('No changes to be saved.'), '200 OK'); # an update without consequence
} elsif ($oldrev == 0 and ($string eq $NewText or $string eq "\n")) {
} elsif ($oldrev == 0 and $string eq "\n") {
ReportError(T('No changes to be saved.'), '400 BAD REQUEST'); # don't fake page creation because of webdav
} else {
# My providing a different title, the entry is automatically renamed
@@ -217,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,4 +1,7 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ autolock.pl ]====================
=head1 NAME
@@ -23,9 +26,9 @@ autolock is easily installable: move this file into the B<wiki/modules/>
directory of your Oddmuse Wiki.
=cut
package OddMuse;
AddModuleDescription('autolock.pl', 'Autolock Extension');
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/autolock.pl">autolock.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Autolock_Extension">Autolock Extension</a></p>';
our (@MyInitVariables, $CommentsPrefix, $EditAllowed, $NoEditFile, %LockOnCreation);
# ....................{ CONFIGURATION }....................
@@ -35,9 +38,9 @@ autolock is easily configurable: set these variables in the B<wiki/config.pl>
file for your Oddmuse Wiki.
=cut
use vars qw($AutoLockPagesMatching
$AutoLockCommentsPagesMatching
$AutoLockSeverity
our ($AutoLockPagesMatching,
$AutoLockCommentsPagesMatching,
$AutoLockSeverity,
$AutoLockUserCanEditEditorFix);
=head2 $AutoLockPagesMatching
@@ -133,13 +136,13 @@ sub AutoLockInit {
}
if ($AutoLockUserCanEditEditorFix) {
*UserCanEditAutoLockOld = *UserCanEditAutoLockFix;
*UserCanEditAutoLockOld = \&UserCanEditAutoLockFix;
}
}
# ....................{ REDEFINITIONS }....................
*UserCanEditAutoLockOld = *UserCanEdit;
*UserCanEdit = *UserCanEditAutoLock;
*UserCanEditAutoLockOld = \&UserCanEdit;
*UserCanEdit = \&UserCanEditAutoLock;
sub UserCanEditAutoLock {
my ($page_name, $is_editing, $is_comment) = @_;
@@ -172,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

@@ -19,8 +19,14 @@
# Grab MLDBM at http://search.cpan.org/dist/MLDBM/lib/MLDBM.pm
# 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 );
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/backlinkage.pl">backlinkage.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Inline_Backlinks">Inline Backlinks</a></p>';
AddModuleDescription('backlinkage.pl', 'Inline Backlinks');
our ($q, %Action, %Page, @MyAdminCode, $DataDir, $LinkPattern);
my $debug=1; # Set Text Output Verbosity when compiling
my $backfile = $DataDir . '/backlinks.db'; # Where data lives
@@ -54,9 +60,9 @@ sub BuildBacklinkDatabase {
$hash->{'link' . $backlinkcount} = $link;
}
log2("$backlinkcount Links found in $name\n") if $backlinkcount;
$backhash{$name} = $hash; # Store Hash data in HoH
}
$backhash{$name} = $hash; # Store Hash data in HoH
}
if ($debug >= 3) {
log4("Printing dump of USABLE Data we stored, sorted and neat\n");
for my $source (sort keys %backhash) {
@@ -84,7 +90,7 @@ sub BacklinkProcess {
if ($exists) {
push (@backlinks,$resolved) unless (($seen{$resolved}++) or ($resolved eq $name));
}
}
}
return @backlinks;
}
@@ -92,14 +98,14 @@ sub BacklinkProcess {
sub GetBackLink {
my (@backlinks, @unpopped, @alldone);
my $id = $_[0];
use vars qw($BacklinkBanned);
our ($BacklinkBanned);
$BacklinkBanned = "HomePage|ScratchPad" if !$BacklinkBanned;
tie my %backhash, 'MLDBM', $backfile, O_CREAT|O_RDWR, 0644 or die "Cannot open file $backfile $!\n";
tie my %backhash, 'MLDBM', $backfile, O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
# Search database for matches
while ( ($source, $hashes) = each %backhash ) {
while ( ($key, $value) = each %$hashes ) {
while ( my ($source, $hashes) = each %backhash ) {
while ( my ($key, $value) = each %$hashes ) {
if ($id =~ /$value/) {
push (@backlinks, $source);
}
@@ -114,11 +120,11 @@ sub GetBackLink {
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, T('Internal Page: ' . $resolved)));
}
}
my $arraycount = @unpopped;
return if !$arraycount; # Dont bother with the rest if empty results
# Pop and Push data to make it look good (no trailing commas)
# Pop and Push data to make it look good (no trailing commas)
my $temp = pop(@unpopped);
foreach my $backlink (@unpopped) {
push(@alldone, $backlink . ", ");

21
modules/backlinks.pl Executable file → Normal file
View File

@@ -1,19 +1,24 @@
# Copyright (C) 2008 Weakish Jiang <weakish@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# You can get a copy of GPL version 2 at
# http://www.gnu.org/licenses/gpl-2.0.html
#
# For user doc, see:
# For user doc, see:
# http://www.oddmuse.org/cgi-bin/oddmuse/Backlinks_Extension
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/backlinks.pl">backlinks.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Backlinks_Extension">Backlinks Extension</a></p>';
use strict;
use v5.10;
*OldGetSearchLink = *GetSearchLink;
*GetSearchLink = *NewGetSearchLink;
AddModuleDescription('backlinks.pl', 'Backlinks Extension');
our ($q, %Action, %Page, $OpenPageName);
*OldGetSearchLink = \&GetSearchLink;
*GetSearchLink = \&NewGetSearchLink;
sub NewGetSearchLink {
my ($text, $class, $name, $title) = @_;
my $id = UrlEncode(QuoteRegexp($text));
@@ -30,7 +35,7 @@ my $id = shift;
my $search = GetParam('search', '');
my $taglabel = $search;
$taglabel =~ s/\\\[\\\[//;
$taglabel =~ s/\\\]\\\]//;
$taglabel =~ s/\\\]\\\]//;
ReportError(T('The search parameter is missing.')) unless $search;
print GetHeader('', Ts('Pages link to %s', $taglabel), '');
local (%Page, $OpenPageName);
@@ -46,6 +51,6 @@ my $taglabel = $search;
}
@found = map { $q->li(GetPageLink($_)) } @found;
print $q->start_div({-class=>'search list'}),
$q->ul(@found), $q->end_div;
$q->ul(@found), $q->end_div;
PrintFooter();
}
}

View File

@@ -24,8 +24,11 @@ allowing you to ban him or her immediately. If you click the button,
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);
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/ban-contributors.pl">ban-contributors.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Ban_Contributors_Extension">Ban Contributors Extension</a></p>';
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
push(@MyAdminCode, \&BanMenu);
@@ -112,8 +115,8 @@ that will be added to BannedHosts.
=cut
*OldBanContributorsWriteRcLog = *WriteRcLog;
*WriteRcLog = *NewBanContributorsWriteRcLog;
*OldBanContributorsWriteRcLog = \&WriteRcLog;
*WriteRcLog = \&NewBanContributorsWriteRcLog;
sub NewBanContributorsWriteRcLog {
my ($tag, $id, $to) = @_;
@@ -121,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
@@ -150,7 +153,7 @@ sub NewBanContributorsWriteRcLog {
$q->submit(T('Ban!'))),
$q->end_form();
};
print $q->p(T("Consider banning the hostname or 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
@@ -15,17 +15,22 @@
# This file must load before logbannedcontent.pl such that quick
# editors will be logged.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/ban-quick-editors.pl">ban-quick-editors.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Banning_Quick_Editors">Banning Quick Editors</a></p>';
use strict;
use v5.10;
*BanQuickOldUserIsBanned = *UserIsBanned;
*UserIsBanned = *BanQuickNewUserIsBanned;
AddModuleDescription('ban-quick-editors.pl', 'Banning Quick Editors');
our ($q, $Now, %RecentVisitors, $SurgeProtection);
*BanQuickOldUserIsBanned = \&UserIsBanned;
*UserIsBanned = \&BanQuickNewUserIsBanned;
sub BanQuickNewUserIsBanned {
my $rule = BanQuickOldUserIsBanned(@_);
if (not $rule
and $SurgeProtection # need surge protection
and GetParam('title')) {
my $name = GetParam('username', $ENV{'REMOTE_ADDR'});
my $name = GetParam('username', $q->remote_addr());
my @entries = @{$RecentVisitors{$name}};
# $entry[0] is $Now after AddRecentVisitor
my $ts = $entries[1];

View File

@@ -12,15 +12,18 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
package OddMuse;
use strict;
use v5.10;
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/banned-regexps.pl">banned-regexps.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Banning_Regular_Expressions">Banning Regular Expressions</a></p>';
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.
@@ -42,7 +45,8 @@ This extension works with logbannedcontent.pl.
=cut
use vars qw($BannedRegexps);
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile);
our ($BannedRegexps);
$BannedRegexps = 'BannedRegexps';
@@ -52,11 +56,8 @@ push(@MyInitVariables, sub {
$PlainTextPages{$BannedRegexps} = 1;
});
*RegexpOldBannedContent = *BannedContent;
*BannedContent = *RegexpNewBannedContent;
# the above also changes the mapping for the variable!
$BannedContent = $RegexpOldBannedContent;
*RegexpOldBannedContent = \&BannedContent;
*BannedContent = \&RegexpNewBannedContent;
sub RegexpNewBannedContent {
my $str = shift;

View File

@@ -12,13 +12,16 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/bbcode.pl">bbcode.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/bbCode_Extension">bbCode Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('bbcode.pl', 'bbCode Extension');
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
push(@MyRules, \&bbCodeRule);
$RuleOrder{\&bbCodeRule} = 100; # must come after PortraitSupportRule
use vars qw($bbBlock);
our ($bbBlock);
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);
# This code does not allow the nesting of block elements such as quote
@@ -58,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();
@@ -100,7 +103,7 @@ sub bbCodeRule {
elsif (/\G(\[\/([a-z][a-z1-6]*)\])/cgi) {
my $bbcode = $1;
my $tag = lc($2);
%translate = qw{b b i i u em color em size em font span url a
my %translate = qw{b b i i u em color em size em font span url a
quote blockquote h1 h1 h2 h2 h3 h3 h4 h4 h5 h5
h6 h6 center div left div right div list ul
s del strike del sub sub sup sup highlight strong
@@ -122,15 +125,15 @@ sub bbCodeRule {
# smiley
elsif (/\G(:-?[()])/cg) {
if (substr($1,-1) eq ')') {
# '☺' 0009786 00263a WHITE SMILING FACE, So, 0, ON, N,
return '&#x263a;'; }
# 😊 1F60A SMILING FACE WITH SMILING EYES
return '&#x1F60A;'; }
else {
# '☹' 0009785 002639 WHITE FROWNING FACE, So, 0, ON, N,
return '&#x2639;'; }}
# 😟 1F61F WORRIED FACE
return '&#x1F61F;'; }}
elsif (/\G:(?:smile|happy):/cg) {
return '&#x263a;'; }
return '&#x1F60A;'; }
elsif (/\G:(?:sad|frown):/cg) {
return '&#x2639;'; }
return '&#x1F61F;'; }
# no match
return undef;
return;
}

View File

@@ -1,50 +0,0 @@
# Copyright (C) 2004 Xavier Maillard
# Copyright (C) 2004 Alex Schroeder <alex@emacswiki.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
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/beautify.pl">beautify.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Source_Code_Beautification_Extension">Source Code Beautification Extension</a></p>';
use Beautifier::Core;
use Output::HTML;
push(@MyRules, \&BeautificationRule);
sub BeautificationRule {
if ($bol and m/\G&lt;source\s+([a-zA-Z0-9]+)\s*&gt;\n?(.*?\n)&lt;\/source&gt;[ \t]*\n?/cgs) {
my $old_ = $_;
my $oldpos = pos;
my $lang = $1;
my $source= $2;
my $result = $source;
eval { $result = Beautify($lang, $source); };
$result = $@ if $@;
$_ = $old_;
pos = $oldpos;
return CloseHtmlEnvironments() . $q->div({-class=>'beauty'}, $result) . AddHtmlEnvironment('p');
}
return undef;
}
sub Beautify {
my ($lang, $source) = @_;
eval "use HFile::HFile_$lang";
my $Hfile = eval "new HFile::HFile_$lang";
return $q->strong(Ts('Cannot highlight the language %s.', $lang)) . "\n\n" . $source if $@;
my $highlighter = new Beautifier::Core($Hfile, new Output::HTML);
return $highlighter->highlight_text(UnquoteHtml($source));
}

View File

@@ -13,16 +13,22 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
package OddMuse;
use strict;
use v5.10;
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/big-brother.pl">big-brother.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Big_Brother_Extension">Big Brother Extension</a></p>';
AddModuleDescription('big-brother.pl', 'Big Brother Extension');
use vars qw($VisitorTime);
our ($q, $Now, %Action, $SurgeProtectionViews, $SurgeProtectionTime, @MyAdminCode, $RCName, $VisitorFile, $FS);
our ($VisitorTime, @BigBrotherSecretParameters);
my $US = "\x1f";
$VisitorTime = 7200; # keep visitor data arround for 2 hours.
# normal password parameter from wiki.pl
# password parameters from login.pl
@BigBrotherSecretParameters = qw(pwd pwd1 pwd2 oldpwd);
push(@MyAdminCode, \&BigBrotherVisitors);
sub BigBrotherVisitors {
@@ -47,7 +53,13 @@ sub AddRecentVisitor {
$ts++ while $entries{$ts};
my $action = GetParam('action', 'browse');
my $id = GetId(); # script/p/q -> q
my $url = $q->url(-path_info=>1,-query=>1);
my %params = map { $_ => 1 } $q->param;
for my $bad (@BigBrotherSecretParameters) {
delete $params{$bad};
}
my $url = ScriptUrl(join(';', "action=$action;id=" . UrlEncode($id),
map { $_ . '=' . UrlEncode(GetParam($_)) }
keys %params));
my $download = GetParam('action', 'browse') eq 'download'
|| GetParam('download', 0)
|| $q->path_info() =~ m/\/download\//;

13
modules/blockquote.pl Executable file → Normal file
View File

@@ -16,20 +16,25 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/blockquote.pl">blockquote.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Comments_on_Text_Formatting_Rules">Comments on Text Formatting Rules</a></p>';
use strict;
use v5.10;
AddModuleDescription('blockquote.pl', 'Comments on Text Formatting Rules');
our ($bol, @MyRules);
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');
}
return undef;
return;
}

View File

@@ -1,89 +0,0 @@
# Copyright (C) 2004 Alex Schroeder <alex@emacswiki.org>
# 2004 Tilmann Holst <spam@tholst.de>
#
# 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
# You may need to set $calcmd below.
# Without the cal program (shipped with almost every unix) this extension
# is useless. This extension will not work under Windows/IIS unless cal
# is installed.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/cal3.pl">cal3.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Cal3_Extension">Cal3 Extension</a></p>';
*OldCalendarGetHeader = *GetHeader;
*GetHeader = *NewCalendarGetHeader;
sub NewCalendarGetHeader {
my ($csec, $cmin, $chour, $cmday, $cmon, $cyear) = gmtime();
$cyear += 1900;
$cmon += 1;
my qw($cal $prevmon $prevyear $nextmon $nextyear);
# check if previous month is in previous year
if ($cmon == 1){
$prevmon = "12";
$prevyear = ($cyear - 1);
} else {
$prevmon = ($cmon - 1);
$prevyear = $cyear;
}
# check if next month is in next year
if ($cmon == "12") {
$nextmon = "1";
$nextyear = ($cyear + 1);
} else {
$nextmon = ($cmon + 1);
$nextyear = $cyear;
}
my $header = OldCalendarGetHeader(@_);
# commenting out the last line of this paragraph makes cal3 a cal2
# extension.
$cal = Cal($nextmon,$nextyear);
$cal .= Cal($cmon,$cyear);
$cal .= Cal($prevmon,$prevyear);
$header =~ s/<div class="header">/$cal<div class="header">/;
return $header;
}
sub Cal {
my ($month,$year) = @_;
# set $calcmd to an appropriate value
my $calcmd = 'cal'; # week starts with sunday
# my $calcmd = 'cal -m'; # week starts with monday
# my $calcmd = 'export LC_ALL=de_DE.UTF-8;/insert/path/here/cal -m'; # example with different path to cal and different locale
my $cal = `$calcmd $month $year`;
return unless $cal;
my ($sec, $min, $hour, $mday, $mon, $myyear) = gmtime($Now);
$cal =~ s|\b( ?\d?\d)\b|{
my $day = $1;
my $date = sprintf("%d-%02d-%02d", $year, $month, $day);
my $class;
if ($month == ($mon + 1)) {
$class = ($day == $mday) ? 'today'
: ($IndexHash{$date} ? 'exists' : 'wanted');
} else {
$class = ($IndexHash{$date} ? 'exists' : 'wanted');
}
"<a class=\"$class\" href=\"$ScriptName/$date\">$day</a>";
}|ge;
return "<div class=\"cal\"><pre>$cal</pre></div>";
}

View File

@@ -17,16 +17,20 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/calendar.pl">calendar.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Calendar_Extension">Calendar Extension</a></p>';
use strict;
use v5.10;
use vars qw($CalendarOnEveryPage $CalAsTable $CalStartMonday);
AddModuleDescription('calendar.pl', 'Calendar Extension');
our ($q, %Page, %Action, $Now, $OpenPageName, $CollectingJournal, $FreeLinkPattern, @MyRules);
our ($CalendarOnEveryPage, $CalAsTable, $CalStartMonday);
$CalendarOnEveryPage = 0; # 1=on every page is a month-div situated in the header, use css to control
$CalAsTable = 0; # 0=every month-div is "free", 1=every month-div is caught in a table, use css to control
$CalStartMonday = 0; # 0=week starts with Su, 1=week starts with Mo
*OldCalendarGetHeader = *GetHeader;
*GetHeader = *NewCalendarGetHeader;
*OldCalendarGetHeader = \&GetHeader;
*GetHeader = \&NewCalendarGetHeader;
sub NewCalendarGetHeader {
my $header = OldCalendarGetHeader(@_);
@@ -51,7 +55,7 @@ sub Cal {
}
my @pages = AllPagesList();
my $cal = draw_month($mon, $year);
$cal =~ s{( {1,2}\d{1,2})\b}{{
$cal =~ s{ ( ?\d{1,2})\b}{{
my $day = $1;
my $date = sprintf("%d-%02d-%02d", $year, $mon, $day);
my $re = "^$date";
@@ -61,16 +65,16 @@ sub Cal {
my $class = '';
$class .= ' today' if $day == $mday_now and $mon == $mon_now and $year == $year_now;
my @matches = grep(/$re/, @pages);
my $link;
my $link = ' ';
if (@matches == 0) { # not using GetEditLink because of $class
$link = ScriptLink('action=edit;id=' . UrlEncode($page), $day, 'edit' . $class);
$link .= ScriptLink('action=edit;id=' . UrlEncode($page), $day, 'edit' . $class);
} elsif (@matches == 1) { # not using GetPageLink because of $class
$link = ScriptLink($matches[0], $day, 'local exact' . $class);
$link .= ScriptLink($matches[0], $day, 'local exact' . $class);
} else {
$link = ScriptLink('action=collect;match=' . UrlEncode($re), $day, 'local collection' . $class);
$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);
@@ -104,7 +108,7 @@ sub DoCollect {
# Now save information required for saving the cache of the current page.
local (%Page, $OpenPageName);
print $q->start_div({-class=>'content journal collection'});
PrintAllPages(1, 1, undef, @pages);
PrintAllPages(1, 1, undef, undef, @pages);
print $q->end_div();
}
$CollectingJournal = 0;
@@ -114,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);
@@ -144,26 +148,26 @@ sub CalendarRule {
pos = $oldpos;
return AddHtmlEnvironment('p');
}
return undef;
return;
}
sub PrintYearCalendar {
my $year = shift;
print $q->p({-class=>nav},
print $q->p({-class=>'nav'},
ScriptLink('action=calendar;year=' . ($year-1), T('Previous')),
'|',
ScriptLink('action=calendar;year=' . ($year+1), T('Next')));
if ($CalAsTable) {
print '<table><tr>';
for $mon ((1..12)) {
for my $mon (1..12) {
print '<td>'.Cal($year, $mon, 1).'</td>';
if (($mon==3) or ($mon==6) or ($mon==9)) {
if ($mon == 3 or $mon == 6 or $mon == 9) {
print '</tr><tr>';
}
}
print '</tr></table>';
} else {
for $mon ((1..12)) {
for my $mon (1..12) {
print Cal($year, $mon, 1);
}
}
@@ -234,7 +238,7 @@ sub draw_month {
}
# formula of Zeller (Julius Christian Johannes Zeller * 1822, + 1899) for countig the day of week
# only works for all years greater then 0 and can handle 1582 the year Pope Gregor has changed the
# only works for all years greater then 0 and can handle 1582 the year Pope Gregor has changed the
# calculation of times from the Julian calendar to the Gregorian calendar
sub zeller {
my $t = shift;

View File

@@ -16,12 +16,15 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/canonical.pl">canonical.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Canonical_Names">Canonical Names</a></p>';
use strict;
use v5.10;
AddModuleDescription('canonical.pl', 'Canonical Names');
use utf8;
*OldCanonicalResolveId = *ResolveId;
*ResolveId = *NewCanonicalResolveId;
*OldCanonicalResolveId = \&ResolveId;
*ResolveId = \&NewCanonicalResolveId;
my %CanonicalName = ();

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

@@ -16,7 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/checkbox.pl">checkbox.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Checklist_Extension">Checklist Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('checkbox.pl', 'Checklist Extension');
our ($q, $bol, @HtmlStack, %Action, %Page, $OpenPageName, @MyRules);
# [[ : To do]]
# [[X: Done]]
@@ -53,7 +58,7 @@ sub CheckBoxRule {
return $1;
}
}
return undef;
return;
}
$Action{checkbox} = \&DoCheckBox;
@@ -72,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{$_}) {

94
modules/clustermap.pl Executable file → Normal file
View File

@@ -16,9 +16,15 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/clustermap.pl">clustermap.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/ClusterMap_Module">ClusterMap Module</a></p>';
use strict;
use v5.10;
use vars qw($ClusterMapPage $ClusterMapTOC $FilterUnclusteredRegExp @ClusterMapAdminPages);
AddModuleDescription('clustermap.pl', 'ClusterMap Module');
our ($q, %Action, %Page, $OpenPageName, @MyRules, @MyAdminCode, $HomePage, $DeletedPage, $RCName, $InterMap, $BannedContent, $BannedHosts, %AdminPages, $RssExclude, @AdminPages, $NearMap);
our ($ClusterMapPage, %ClusterMap, $ClusterMapTOC, $FilterUnclusteredRegExp, @ClusterMapAdminPages, $PrintTOCAnchor);
my %Unclustered = ();
$ClusterMapPage = "Site_Map" unless defined $ClusterMapPage;
@@ -32,16 +38,16 @@ $FilterUnclusteredRegExp = '\d\d\d\d-\d\d-\d\d|\d* *Comments on .*'
# They are also added to the Important Pages list on the administration page
@ClusterMapAdminPages = ( $HomePage, $DeletedPage, $BannedContent,
$BannedHosts, $InterMap, $NearMap, $RCName, $RssExclude)
unless defined @ClusterMapAdminPages;
unless @ClusterMapAdminPages;
$ClusterMapTOC = 1 unless defined $ClusterMapTOC;
$PrintTOCAnchor = 0;
%ClusterMap = ();
*OldDoRc = *DoRc;
*DoRc = *ClusterMapDoRc;
*OldPrintRcHtml = \&PrintRcHtml;
*PrintRcHtml = \&ClusterMapPrintRcHtml;
push(@MyAdminCode, \&ClusterMapAdminRule);
@@ -56,10 +62,10 @@ 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;
$oldstr = $_;
my $oldstr = $_;
CreateClusterMap();
print "</p>"; # Needed to clean up, but could cause problems
# if <clustermap> isn't put into a new paragraph
@@ -69,8 +75,7 @@ sub ClusterMapRule {
$_ = $oldstr;
return '';
}
return undef;
return;
}
@@ -79,7 +84,7 @@ sub DoClusterMap {
# For each cluster, get list of all pages in that cluster
# Create map, using body of cluster pages, followed by titles of pages
# within that cluster
print GetHeader('',$ClusterMapPage,'');
CreateClusterMap();
@@ -94,21 +99,20 @@ sub DoClusterMap {
print '</ol></div>';
$PrintTOCAnchor = 1;
}
print '<div class="content">';
PrintClusterMap();
print '<div class="content">';
PrintClusterMap();
print '</div>';
PrintFooter();
}
sub DoUnclustered {
print GetHeader('','Pages without a Cluster','');
print '<div class="content">';
CreateClusterMap();
PrintUnclusteredMap();
print '</div>';
PrintFooter();
}
@@ -122,7 +126,7 @@ sub PrintClusterMap {
$free =~ s/_/ /g;
OpenPage($cluster);
if ( FreeToNormal(GetCluster($Page{text})) eq $cluster ) {
# Don't display the page name twice if the cluster page is also
# a member of the cluster
@@ -137,7 +141,7 @@ sub PrintClusterMap {
print $q->h1(GetPageOrEditLink($free, $free));
}
PrintWikiToHTML($Page{text}, 0);
print "<ul>";
foreach my $page (sort keys %{$ClusterMap{$cluster}}) {
my $title = $page;
@@ -150,57 +154,56 @@ sub PrintClusterMap {
sub CreateClusterMap {
my @pages = AllPagesList();
local %Page;
local $OpenPageName='';
foreach my $page ( @pages) {
OpenPage($page);
my $cluster = FreeToNormal(GetCluster($Page{text}));
next if ($cluster eq $DeletedPage); # Don't map Deleted Pages
next if (TextIsFile($Page{text})); # Don't map files
if ($cluster eq "") { # Grab Unclustered Pages
$Unclustered{$page} = 1;
next;
}
if ($cluster ne FreeToNormal($page)) { # Create Cluster Map
$ClusterMap{$cluster}{$page} = 1;
}
}
# Strip out Admin Pages
foreach my $page (@AdminPages) {
delete($Unclustered{$page});
}
}
sub ClusterMapDoRc {
sub ClusterMapPrintRcHtml {
my ( @options ) = @_;
my $page = "";
my $cluster = GetParam(rcclusteronly);
my $cluster = GetParam('rcclusteronly');
if ($cluster ne "") {
CreateClusterMap();
print "Pages in this cluster:";
print "<ul>";
foreach $page (sort keys %{$ClusterMap{$cluster}}) {
foreach my $page (sort keys %{$ClusterMap{$cluster}}) {
my $title = $page;
$title =~ s/_/ /g;
print "<li>" . ScriptLink($page, $title, 'local') . "</li>";
}
print "</ul>";
}
OldDoRc(@options);
OldPrintRcHtml(@options);
}
sub PrintUnclusteredMap {
print "<ul>";
foreach $page (sort keys %Unclustered) {
foreach my $page (sort keys %Unclustered) {
my $title = $page;
$title =~ s/_/ /g;
if ($title !~ /^($FilterUnclusteredRegExp)$/) {
@@ -208,18 +211,17 @@ sub PrintUnclusteredMap {
}
}
print "</ul>";
}
sub ClusterMapAdminRule {
($id, $menuref, *restref) = @_;
my ($id, $menuref) = @_;
push(@$menuref, ScriptLink('action=clustermap', T('Clustermap'), 'clustermap'));
push(@$menuref, ScriptLink('action=unclustered', T('Pages without a Cluster'), 'unclustered'));
}
*OldBrowseResolvedPage = *BrowseResolvedPage;
*BrowseResolvedPage = *ClusterMapBrowseResolvedPage;
*OldBrowseResolvedPage = \&BrowseResolvedPage;
*BrowseResolvedPage = \&ClusterMapBrowseResolvedPage;
sub ClusterMapBrowseResolvedPage {
my $title = shift;
@@ -228,7 +230,7 @@ sub ClusterMapBrowseResolvedPage {
if ($id eq $ClusterMapPage) {
CreateClusterMap();
print GetHeader('',$title,'');
print '<div class="content">';
print '<div class="content">';
if ($ClusterMapTOC) {
my $TOCCount = 0;
print '<div class="toc"><h2>Categories</h2><ol>';
@@ -241,15 +243,15 @@ sub ClusterMapBrowseResolvedPage {
$PrintTOCAnchor = 1;
}
PrintClusterMap();
print '</div>';
print '</div>';
PrintFooter();
} else {
OldBrowseResolvedPage($id);
}
}
*OldPrintWikiToHTML = *PrintWikiToHTML;
*PrintWikiToHTML = *ClusterMapPrintWikiToHTML;
*OldPrintWikiToHTML = \&PrintWikiToHTML;
*PrintWikiToHTML = \&ClusterMapPrintWikiToHTML;
sub ClusterMapPrintWikiToHTML {
my ($pageText, $savecache, $revision, $islocked) = @_;
@@ -260,7 +262,7 @@ sub ClusterMapPrintWikiToHTML {
&& ($pageText =~ /^\s*$/s)){
SetParam('rcclusteronly',0);
CreateClusterMap();
print '<div class="content">';
print '<div class="content">';
if ($ClusterMapTOC) {
my $TOCCount = 0;
print '<div class="toc"><h2>Contents</h2><ol>';
@@ -272,7 +274,7 @@ sub ClusterMapPrintWikiToHTML {
$PrintTOCAnchor = 1;
}
PrintClusterMap();
print '</div>';
print '</div>';
}
OldPrintWikiToHTML(@_);
}

View File

@@ -0,0 +1,57 @@
# Copyright (C) 2014 Alex-Daniel Jakimenko <alex.jakimenko@gmail.com>
# Copyright (C) 2014 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 strict;
use v5.10;
AddModuleDescription('comment-div-wrapper.pl', 'Comment Div Wrapper Extension');
our ($q, $bol, $OpenPageName, @MyRules, %RuleOrder, $CommentsPrefix, $CommentsPattern, $FS);
my $CommentDiv = 0;
push(@MyRules, \&CommentDivWrapper);
$RuleOrder{\&CommentDivWrapper} = -50;
sub CommentDivWrapper {
if (substr($OpenPageName, 0, length($CommentsPrefix)) eq $CommentsPrefix) {
if (pos == 0 and not $CommentDiv) {
$CommentDiv = 1;
return $q->start_div({-class=>'userComment'});
}
}
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'})
. AddHtmlEnvironment('p');
return $html;
}
}
return;
}
# close final div
*OldCommentDivApplyRules = \&ApplyRules;
*ApplyRules = \&NewCommentDivApplyRules;
sub NewCommentDivApplyRules {
my ($blocks, $flags) = OldCommentDivApplyRules(@_);
if ($CommentDiv) {
print $q->end_div();
$blocks .= $FS . $q->end_div();
$flags .= $FS . 0;
$CommentDiv = 0;
}
return ($blocks, $flags);
}

View File

@@ -16,10 +16,15 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/commentcount.pl">commentcount.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Comment_Count_Extension">Comment Count Extension</a></p>';
use strict;
use v5.10;
*OldCommentcountAddComment = *AddComment;
*AddComment = *NewCommentcountAddComment;
AddModuleDescription('commentcount.pl', 'Comment Count Extension');
our ($CommentsPrefix);
*OldCommentcountAddComment = \&AddComment;
*AddComment = \&NewCommentcountAddComment;
sub NewCommentcountAddComment {
my ($old, $comment) = @_;
@@ -39,15 +44,15 @@ sub NewCommentcountAddComment {
return $new;
}
*OldCommentcountScriptLink = *ScriptLink;
*ScriptLink = *NewCommentcountScriptLink;
*OldCommentcountScriptLink = \&ScriptLink;
*ScriptLink = \&NewCommentcountScriptLink;
sub NewCommentcountScriptLink {
my ($action, $text, @rest) = @_;
if ($CommentsPrefix && $action =~ /^$CommentsPrefix(.*)/) {
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?\. ===/) {

View File

@@ -16,7 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/compilation.pl">compilation.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Compilation_Extension">Compilation Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('compilation.pl', 'Compilation Extension');
our ($q, $bol, %Action, %Page, $OpenPageName, $CollectingJournal, @MyRules);
$Action{compilation} = \&DoCompilation;
@@ -49,7 +54,7 @@ sub PrintCompilation {
local %Page;
local $OpenPageName='';
print '<div class="compilation">';
PrintAllPages(1, 1, undef, @pages);
PrintAllPages(1, 1, undef, undef, @pages);
print '</div>';
}
return @pages;
@@ -67,5 +72,5 @@ sub CompilationRule {
pos = $oldpos; # restore \G after call to ApplyRules
return AddHtmlEnvironment('p');
}
return undef;
return;
}

View File

@@ -1,104 +0,0 @@
# Copyright (C) 2006 Alex Schroeder <alex@emacswiki.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
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/config.pl">config.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Plans">Plans</a></p>';
$Action{config} = \&DoConfig;
$Action{clone} = \&DoClone;
sub DoConfig {
print GetHttpHeader('text/plain') . qq{# Wiki Config
# Source Wiki: $SiteName <$ScriptName>
# } . TimeToText($Now) . qq{
\$AdminPass = "";
\$EditPass = "";
};
my $source = GetRaw('http://www.emacswiki.org/scripts/current');
foreach my $var qw($HomePage $MaxPost $StyleSheet $StyleSheetPage $NotFoundPg
$NewText $NewComment $EditAllowed $BannedHosts
$BannedCanRead $BannedContent $WikiLinks $FreeLinks
$BracketText $BracketWiki $NetworkFile $AllNetworkFiles
$PermanentAnchors $InterMap $NearMap $RssInterwikiTranslate
$SurgeProtection $SurgeProtectionTime $SurgeProtectionViews
$DeletedPage $RCName @RcDays $RcDefault $KeepDays
$KeepMajor $SummaryHours $SummaryDefaultLength $ShowEdits
$UseLookup $RecentTop $RecentLink $PageCluster
$InterWikiMoniker $SiteDescription $RssImageUrl $RssRights
$RssExclude $RssCacheHours $RssStyleSheet $UploadAllowed
@UploadTypes $EmbedWiki $FooterNote $EditNote $TopLinkBar
@UserGotoBarPages $UserGotoBar $ValidatorLink
$CommentsPrefix $HtmlHeaders $IndentLimit $LanguageLimit
$JournalLimit $SisterSiteLogoUrl %SpecialDays %Smilies
%Languages) {
my $default = undef;
my $re = quotemeta($var);
if ($source =~ m!\n$re\s*=\s*(\d+(\s*[*+-/]\s*\d+)*|'[^']*'|"[^"]*"|\(.*?\)|qw\(.*?\))\s*;!) {
$default = $1;
}
$type = substr($var, 0, 1);
if ($type eq '$') {
my $val = eval($var);
print "$var = " . ConfigStr($val) . "; # default: $default\n"
if $val ne eval($default);
} elsif ($type eq '@') {
my @list = eval($var);
my @default = eval($default);
print "$var = (", join(', ', map { ConfigStr($_) } @list)
. "); # default: $default\n"
unless ConfigListEqual(\@list, \@default);
} elsif ($type eq '%') {
my %hash = eval($var);
my @default = eval($default);
print "$var = (", join(', ', map { ConfigStr($_)
. ' => ' . ConfigStr($hash{$_})}
keys %hash) . "); # default: $default\n"
unless ConfigHashEqual(\%hash, \%default);;
}
}
print "# Done!\n";
}
sub ConfigStr {
$_ = shift;
if (m/^\d+$/) {
$_;
} elsif (m/'/) {
"q{$_}";
} else {
"'$_'";
}
}
sub ConfigListEqual {
my ($a, $b) = @_;
return 0 if @$a != @$b;
for ($i = 0; $i < @$a; $i++) {
return 0 unless @$a[$i] eq @$b[$i];
}
return 1;
}
sub ConfigHashEqual {
my ($a, $b) = @_;
return 0 unless ConfigListEqual([keys %$a], [keys %$b]);
foreach my $key (keys %$a) {
next if $$a{$key} eq $$b{$key};
return 0;
}
return 1;
}

View File

@@ -13,8 +13,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/context.pl">context.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Calendar_Extension">Calendar Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('context.pl', 'Calendar Extension');
our ($q, @Debugging, $UserGotoBar, @MyInitVariables);
push (@MyInitVariables, \&ContextMenuItem);
sub ContextMenuItem {

View File

@@ -16,17 +16,22 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
#
# This module stores additional information about a page when it is
# This module stores additional information about a page when it is
# first created:
# created = the date the page is FIRST saved
# originalAuthor = the username that first created a page
#
# Of course, you can customize this to store more information
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/creationdate.pl">creationdate.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/CreationDate_Module">CreationDate Module</a></p>';
use strict;
use v5.10;
*CreationDateOldOpenPage = *OpenPage;
*OpenPage = CreationDateOpenPage;
AddModuleDescription('creationdate.pl', 'CreationDate Module');
our (%Page, $Now);
*CreationDateOldOpenPage = \&OpenPage;
*OpenPage = \&CreationDateOpenPage;
sub CreationDateOpenPage{
CreationDateOldOpenPage(@_);

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ creole.pl ]====================
=head1 NAME
@@ -12,9 +15,9 @@ creole is easily installable; move this file into the B<wiki/modules/>
directory for your Oddmuse Wiki.
=cut
package OddMuse;
AddModuleDescription('creole.pl', 'Creole Markup Extension');
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/creole.pl">creole.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Creole_Markup_Extension">Creole Markup Extension</a></p>';
our ($q, $bol, %InterSite, $FullUrlPattern, $FreeLinkPattern, $FreeInterLinkPattern, $InterSitePattern, @MyRules, %RuleOrder, @MyInitVariables, @HtmlStack, @HtmlAttrStack);
# ....................{ CONFIGURATION }....................
@@ -24,9 +27,9 @@ creole is easily configurable; set these variables in the B<wiki/config.pl>
file for your Oddmuse Wiki.
=cut
use vars qw($CreoleLineBreaks
$CreoleTildeAlternative
$CreoleTableCellsContainBlockLevelElements
our ($CreoleLineBreaks,
$CreoleTildeAlternative,
$CreoleTableCellsContainBlockLevelElements,
$CreoleDashStyleUnorderedLists);
=head2 $CreoleLineBreaks
@@ -215,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'
@@ -231,60 +234,65 @@ 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'},
$q->img({-src=> UnquoteHtml($1),
-alt=> UnquoteHtml($3),
-title=> UnquoteHtml($3),
-class=> 'url outside'})));
}
# 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)),
$q->img({-src=> GetDownloadLink(FreeToNormal($3), 2),
-alt=> UnquoteHtml($text),
-title=> UnquoteHtml($text),
-class=> 'upload'}), 'image')), $text);
}
# 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)),
$q->img({-src=> UnquoteHtml($3),
-alt=> UnquoteHtml($text),
-title=> UnquoteHtml($text),
-class=> 'url outside'}), 'image')), $text);
}
# 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'},
$q->img({-src=> GetDownloadLink(FreeToNormal($3), 2),
-alt=> UnquoteHtml($text),
-title=> UnquoteHtml($text),
-class=> 'upload'}))), $text);
}
# 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),
-alt=> UnquoteHtml($4),
-title=> UnquoteHtml($4),
-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;
@@ -297,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;
@@ -307,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;
@@ -416,7 +424,7 @@ sub CreoleRule {
return OpenHtmlEnvironment('table', 1, 'user').AddHtmlEnvironment('tr');
}
return undef;
return;
}
sub CreoleHeadingRule {
@@ -449,28 +457,23 @@ sub CreoleHeadingRule {
return $header_html;
}
return undef;
return;
}
sub CreoleListAndNewLineRule {
my $is_in_list_item = InElement('li');
# # numbered list
if (($bol and m/\G[ \t]*(#)[ \t]*/cg) or
($is_in_list_item and m/\G[ \t]*\n+[ \t]*(#+)[ \t]*/cg)) {
# * bullet list (nestable; needs space when nested to disambiguate from bold)
if (($bol and m/\G[ \t]*([#*])[ \t]*/cg) or
($is_in_list_item and m/\G[ \t]*\n+[ \t]*(#+)[ \t]*/cg) or
($is_in_list_item and m/\G[ \t]*\n+[ \t]*(\*+)[ \t]+/cg)) {
# Note: the first line of this return statement is --not-- equivalent to:
# "return CloseHtmlEnvironmentUntil('li')", as that line does not permit
# modules overriding the CloseHtmlEnvironments() function to "have a say."
return ($is_in_list_item ? CloseHtmlEnvironmentUntil('li') : CloseHtmlEnvironments())
.OpenHtmlEnvironment('ol', length($1))
.AddHtmlEnvironment ('li');
}
# * bullet list (nestable; needs space when nested to disambiguate from bold)
elsif (($bol and m/\G[ \t]*(\*)[ \t]*/cg) or
($is_in_list_item and m/\G[ \t]*\n+[ \t]*(\*+)[ \t]+/cg)) {
return ($is_in_list_item ? CloseHtmlEnvironmentUntil('li') : CloseHtmlEnvironments())
.OpenHtmlEnvironment('ul', length($1))
.AddHtmlEnvironment ('li');
.OpenHtmlEnvironment(substr($1, 0, 1) eq '#' ? 'ol' : 'ul', length($1), '', 'ol|ul')
.AddHtmlEnvironment('li');
}
# - bullet list (not nestable; always needs space)
elsif ($CreoleDashStyleUnorderedLists and (
@@ -492,7 +495,7 @@ sub CreoleListAndNewLineRule {
return $q->br();
}
return undef;
return;
}
# ....................{ HTML }....................
@@ -559,8 +562,8 @@ sub GetCreoleLinkHtml {
}
# ....................{ FUNCTIONS }....................
*RunMyRulesCreoleOld = *RunMyRules;
*RunMyRules = *RunMyRulesCreole;
*RunMyRulesCreoleOld = \&RunMyRules;
*RunMyRules = \&RunMyRulesCreole;
=head2 RunMyRulesCreole
@@ -590,11 +593,14 @@ C<CreoleRule>. This function ensures, among other safeties, that the
C<CreoleRule> function is not recursed into more than once.
=cut
our $CreoleRuleRecursing; # must have a variable to localize below
sub CreoleRuleRecursive {
my $markup = shift;
return $markup if $CreoleRuleRecursing; # avoid infinite loops
local $CreoleRuleRecursing = 1;
local $bol = 0; # prevent block level element handling
local $CreoleRuleRecursing = 1; # use local for the mod_perl case
local $bol = 0; # prevent block level element handling
# Preserve global variables.
my ($oldpos, $old_) = (pos, $_);

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ creoleaddition.pl ]====================
=head1 NAME
@@ -20,10 +23,9 @@ creoleaddition is simply installable; simply:
=back
=cut
package OddMuse;
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/creoleaddition.pl">creoleaddition.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Creole_Addition_Markup_Extension">Creole Addition Markup Extension</a></p>';
AddModuleDescription('creoleaddition.pl', 'Creole Addition Markup Extension');
our ($bol, @MyRules, %RuleOrder);
# ....................{ CONFIGURATION }....................
=head1 CONFIGURATION
@@ -34,13 +36,12 @@ B<wiki/config.pl> file for your Oddmuse Wiki.
=cut
# Since these rules are not official now, users can turn off some of
# them.
use vars qw($CreoleAdditionSupSub
$CreoleAdditionDefList
$CreoleAdditionIndentedParagraphs
$CreoleAdditionQuote
$CreoleAdditionMonospace
$CreoleAdditionSmallCaps $CreoleAdditionIsInSmallCaps
);
our ($CreoleAdditionSupSub,
$CreoleAdditionDefList,
$CreoleAdditionIndentedParagraphs,
$CreoleAdditionQuote,
$CreoleAdditionMonospace,
$CreoleAdditionSmallCaps, $CreoleAdditionIsInSmallCaps);
=head2 $CreoleAdditionSupSub
@@ -112,9 +113,9 @@ sub CreoleAdditionRule {
elsif ($CreoleAdditionDefList && $bol && m/\G\s*\;[ \t]*(?=(.+(\n)(\s)*\:))/cg
or InElement('dd') && m/\G\s*\n(\s)*\;[ \t]*(?=(.+\n(\s)*\:))/cg) {
return CloseHtmlEnvironmentUntil('dd') . OpenHtmlEnvironment('dl', 1)
. AddHtmlEnvironment('dt'); }# `:' needs special treatment, later
. AddHtmlEnvironment('dt'); }# `:' needs special treatment, later
elsif (InElement('dt') and m/\G\s*\n(\s)*\:[ \t]*(?=(.+(\n)(\s)*\:)*)/cg) {
return CloseHtmlEnvironment() . AddHtmlEnvironment('dd');}
return CloseHtmlEnvironment() . AddHtmlEnvironment('dd');}
elsif (InElement('dd') and m/\G\s*\n(\s)*\:[ \t]*(?=(.+(\n)(\s)*\:)*)/cg) {
return CloseHtmlEnvironment() . AddHtmlEnvironment('dd');}
# """block quotes"""
@@ -137,7 +138,7 @@ sub CreoleAdditionRule {
return AddOrCloseHtmlEnvironment('span', 'style="font-variant: small-caps"');
}
return undef;
return;
}
=head1 COPYRIGHT AND LICENSE

45
modules/crossbar.pl Executable file → Normal file
View File

@@ -1,4 +1,7 @@
#!/usr/bin/env perl
use strict;
use v5.10;
# ====================[ crossbar.pl ]====================
=head1 NAME
@@ -33,11 +36,13 @@ crossbar is easily installable; move this file into the B<wiki/modules/>
directory for your Oddmuse Wiki.
=cut
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/crossbar.pl">crossbar.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Crossbar_Extension">Crossbar Extension</a></p>';
AddModuleDescription('crossbar.pl', 'Crossbar Extension');
our ($q, $bol, $OpenPageName, @HtmlStack, @MyInitVariables, @MyRules, %AdminPages, $DeletedPage, $SidebarName, $TocIsApplyingAutomaticRules);
# ....................{ CONFIGURATION }....................
use vars qw($CrossbarPageName
$CrossbarDivIsOutsideContentDiv
our ($CrossbarPageName,
$CrossbarDivIsOutsideContentDiv,
$CrossbarSubstitutionPattern);
=head1 CONFIGURATION
@@ -108,15 +113,15 @@ sub CrossbarInit {
# If pulling the crossbar div outside the content div, we redefine the
# default PrintPageContent() function to do this.
if ($CrossbarDivIsOutsideContentDiv) {
*PrintPageContentCrossbarOld = *PrintPageContent;
*PrintPageContent = *PrintPageContentCrossbar;
*PrintPageContentCrossbarOld = \&PrintPageContent;
*PrintPageContent = \&PrintPageContentCrossbar;
}
# If this user is an authenticated administrator, forcefully clear the page
# cache whenever saving the crossbar page.
if (UserIsAdmin()) {
*SaveCrossbarOld = *Save;
*Save = *SaveCrossbar;
*SaveCrossbarOld = \&Save;
*Save = \&SaveCrossbar;
}
# If the Table of Contents module is also installed, we must prevent handling
@@ -128,14 +133,14 @@ sub CrossbarInit {
# headers would add those headers to the Table of Contents for //every// page.
# (Trust us on this one...)
if (defined &RunMyRulesToc) {
*RunMyRulesCrossbarOld = *RunMyRules;
*RunMyRules = *RunMyRulesCrossbar;
*RunMyRulesCrossbarOld = \&RunMyRules;
*RunMyRules = \&RunMyRulesCrossbar;
}
}
# ....................{ MARKUP =before }....................
*OldCrossbarApplyRules = *ApplyRules;
*ApplyRules = *NewCrossbarApplyRules;
*OldCrossbarApplyRules = \&ApplyRules;
*ApplyRules = \&NewCrossbarApplyRules;
sub NewCrossbarApplyRules {
my $text = shift;
@@ -174,7 +179,7 @@ sub CrossbarRule {
}
}
return undef;
return;
}
=head2 RunMyRulesCrossbar
@@ -223,8 +228,8 @@ sub PrintPageContentCrossbar {
}
# ....................{ EDITING }....................
*GetEditFormCrossbarOld = *GetEditForm;
*GetEditForm = *GetEditFormCrossbar;
*GetEditFormCrossbarOld = \&GetEditForm;
*GetEditForm = \&GetEditFormCrossbar;
sub GetEditFormCrossbar {
my ($page_name) = @_;
@@ -259,17 +264,17 @@ sub SaveCrossbar {
# Prevent the RequestLockOrError() and ReleaseLock() functions from doing
# anything while in the DoClearCache() method, since the default Save()
# function already obtains the lock. (We can't obtain it twice!)
*RequestLockOrErrorCrossbarOld = *RequestLockOrError;
*RequestLockOrError = *RequestLockOrErrorCrossbarNoop;
*ReleaseLockCrossbarOld = *ReleaseLock;
*ReleaseLock = *ReleaseLockCrossbarNoop;
*RequestLockOrErrorCrossbarOld = \&RequestLockOrError;
*RequestLockOrError = \&RequestLockOrErrorCrossbarNoop;
*ReleaseLockCrossbarOld = \&ReleaseLock;
*ReleaseLock = \&ReleaseLockCrossbarNoop;
# Clear the page cache, now. Go! (Note: this prints a heap of HTML.)
DoClearCache();
# Restore locking functionality.
*RequestLockOrError = *RequestLockOrErrorCrossbarOld;
*ReleaseLock = *ReleaseLockCrossbarOld;
*RequestLockOrError = \&RequestLockOrErrorCrossbarOld;
*ReleaseLock = \&ReleaseLockCrossbarOld;
}
}

View File

@@ -16,15 +16,20 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/crumbs.pl">crumbs.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/List_Parent_Pages_Extension">List Parent Pages Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('crumbs.pl', 'List Parent Pages Extension');
our ($q, %RuleOrder, @MyRules, $LinkPattern, $FreeLinks, $FreeLinkPattern, $WikiLinks);
push(@MyRules, \&CrumbsRule);
$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);
@@ -44,5 +49,5 @@ sub CrumbsRule {
pos = $oldpos; # set after $_ is set!
return $result; # clean rule, will be cached!
}
return undef;
return;
}

View File

@@ -1,3 +1,6 @@
use strict;
use v5.10;
=head1 NAME
css-install - an Oddmuse module that allows users to change the site CSS
@@ -15,7 +18,7 @@ automatically.
=cut
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/css-install.pl">css-install.pl</a></p>';
AddModuleDescription('css-install.pl');
=head1 CONFIGURATION
@@ -25,9 +28,8 @@ C<@CssList> contains a list of all the recommended CSS URLs.
=cut
package OddMuse;
use vars qw(@CssList);
our ($q, %Action, @MyAdminCode, $StyleSheet, $StyleSheetPage);
our (@CssList);
# List of Oddmuse CSS URLs

View File

@@ -16,7 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/csv.pl">csv.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Comments_on_Long_Table_Markup_Extension">Comments on Long Table Markup Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('csv.pl', 'Comments on Long Table Markup Extension');
our ($bol, @MyRules);
push(@MyRules, \&CsvRule);
@@ -40,5 +45,5 @@ sub CsvRule {
return "</td><td>";
}
# an empty line will end the table automatically; no closing tag is required
return undef;
return;
}

View File

@@ -13,8 +13,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/dates.pl">dates.pl</a>, see <a href="http://www.oddmuse.org/cgi-bin/oddmuse/Dates_Extension">Dates Extension</a></p>';
use strict;
use v5.10;
AddModuleDescription('dates.pl', 'Dates Extension');
our ($q, %Action, @MyAdminCode);
push(@MyAdminCode, \&DatesMenu);
sub DatesMenu {
@@ -39,8 +43,8 @@ sub DoDates {
my %date_collection;
my $date_page;
*OldDatesSearchString = *SearchString;
*SearchString = *NewDatesSearchString;
*OldDatesSearchString = \&SearchString;
*SearchString = \&NewDatesSearchString;
sub NewDatesSearchString {
$date_page = $_[1]; # save the page text!

View File

@@ -12,14 +12,18 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
$ModulesDescription .= '<p><a href="http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/delete-all.pl">delete-all.pl</a></p>';
use strict;
use v5.10;
use vars qw($DeletedAge);
AddModuleDescription('delete-all.pl');
our (%Page, $Now, $OpenPageName, %LockOnCreation);
our ($DeleteAge);
$DeleteAge = 172800; # 2*24*60*60
*OldDelPageDeletable = *PageDeletable;
*PageDeletable = *NewDelPageDeletable;
*OldDelPageDeletable = \&PageDeletable;
*PageDeletable = \&NewDelPageDeletable;
# All pages will be deleted after two days of inactivity!
sub NewDelPageDeletable {

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