Compare commits

...

880 Commits

Author SHA1 Message Date
Alex Schroeder
9238e42cfd banned-regexps: updated copyright year 2018-09-04 09:54:04 +02:00
Alex Schroeder
836f3abecb Fixed bug in banned-regexps
BannedRegexps needs to check for BannedContent before it does
anything. BannedContent checks the URLs, and so BannedRegexps wants to
check everything except for the URLs. The order is important: the old
code used to remove the URLs before handing the text to BannedContent,
so it never found a thing. Changing the order fixed this.
2018-09-04 09:45:47 +02:00
Alex Schroeder
d669f783bb t/ban: test for homepage field 2018-09-04 09:37:49 +02:00
Alex Schroeder
c18279ca4c alex-2018.css: bigger fonts, wrapping pre 2018-08-24 11:29:23 +02:00
Alex Schroeder
bbd280abf9 ban-mixed-script: better fix for encoding issue 2018-08-14 15:01:01 +02:00
Alex Schroeder
c15e6041ef ban-mixed-scripts: silence meta.t warning 2018-08-14 11:57:26 +02:00
Alex Schroeder
e4c84d9b3a ban-mixed-scripts 2018-08-12 19:43:58 +02:00
Alex Schroeder
a49afca3f7 gopher-server: fix regular expressions for links
The regular expression now also matches mardown style external links.
Now using /x and named groups. This makes the entire thing much more
readable.
2018-08-10 20:45:11 +02:00
Alex Schroeder
883f07f926 Fix URL in Makefile 2018-08-06 12:07:18 +02:00
Alex Schroeder
b5d182582f Fix URLs in AddModuleDescription 2018-08-06 11:19:45 +02:00
Alex Schroeder
fe26471abb wiki.css: update for All Modules
Although I must say, the more I see of Div Foo, the less I like it. I
can't wrap a div around the <titles ...> rule and so now I use the
following on the All_Modules page:

<list>
<titles ...>

This introduces an empty div before the div I care about and the CSS
then does .foo_list + .journal etc.
2018-07-25 17:21:01 +02:00
Alex Schroeder
96a3cbbb22 tags: fix double quote bug
The old code removed double quotes before passing the search string on
to SearchString. Thus, "a b" would become a search for "a" and "b".
2018-07-24 12:56:08 +02:00
Alex Schroeder
d303e5e955 journal-rss: switch to full page feed always 2018-07-19 16:18:17 +02:00
Alex Schroeder
dd6198ffca journal-rss.t: simplify tests accordingly
Once the journal RSS just uses the latest edits, we don't have to care
about all the stuff involving major and minor versions.
2018-07-19 16:15:29 +02:00
Alex Schroeder
ae646290ed journal-rss: fix handling of new offset parameter 2018-07-19 16:02:24 +02:00
Alex Schroeder
1a74dc9605 journal-rss: don't ignore minor changes
If a page was created by just minor edits, then it is visible in a
journal. We shouldn't skip it from the journal RSS. Furthermore:
what's the point in showing the text from the last major version? Show
the latest version!
2018-07-19 15:52:17 +02:00
Alex Schroeder
0c19bd13cd tags.t: some more tests for filtering RC 2018-07-19 15:38:14 +02:00
Alex Schroeder
42bb4888a2 rss-journal: support feed pagination 2018-07-19 14:36:27 +02:00
Alex Schroeder
9a5e44aba3 Make feed pagination possible for journal-rss.pl
This works without changes to journal-rss.pl itself. All we do is make
sure that RcSelfAction, RcPreviousAction, and RcLastAction don't get
the action (rc vs. rss) from their arguments but determine it by
looking at the script parameters. Since journal-rss simply uses the
journal action, this will then get picked up correctly.
2018-07-19 13:04:31 +02:00
Alex Schroeder
78b5dd3737 rss.t: add more tests for RSS pagination 2018-07-19 11:43:07 +02:00
Alex Schroeder
b8717c4084 rss.t: add tests for RSS pagination 2018-07-19 11:39:06 +02:00
Alex Schroeder
42f4816ae5 gopher-server: surge protection disabled for tests
Make sure the gopher server reads the config file and skips surge
protection if $SurgeProtection is set to 0. The tests do this. If we
don't do this, tests start failing after a while.
2018-07-19 00:10:24 +02:00
Alex Schroeder
ff8d671787 wiki: first draft at implementing RFC 5005
We can easily provide the latest and the previous feed URL in addition
to the current (self) URL.
2018-07-18 23:53:18 +02:00
Alex Schroeder
e16cda46c1 gopher-server: rewrote surge protection
Instead of calling DoSurgeProtection as part of process_request and
faking username and overwriting ReportError, I've moved the essential
code to allow_deny_hook which seems to be the place dedicated to this
sort of code. Sadly, push(@{$self->{server}->{deny}}, $peeraddr) seems
to have no effect. When the next request comes around, the deny list
is empty again. I guess we would have to persist this somehow. For
now, we're simply using allow_deny_hook and that seems to be just as
well.
2018-07-16 21:34:11 +02:00
Alex Schroeder
431e792e52 gopher-server: add surge protection 2018-07-16 09:37:39 +02:00
Alex Schroeder
c9f3060e42 release: accept non-numeric versions like 2.3.11a 2018-07-13 00:52:35 +02:00
Alex Schroeder
ec4987e817 rc.t: fix copyright year 2018-07-13 00:20:09 +02:00
Alex Schroeder
655d3b47c6 checkbox.t: new tests for checkbox.pl 2018-06-28 10:31:36 +02:00
Alex Schroeder
8b85c6e9dd Save Anonymous username without translation
When saving, write "Anonymous" without translating it. When displaying
"Anonymous", translate it.
2018-06-28 00:51:46 +02:00
Alex Schroeder
ef35e4eda6 rc2mail: update timestamp in any case 2018-06-28 00:49:46 +02:00
Alex Schroeder
7bb1ca239b search-inclusion: new test and fix
I must have misunderstood how 'local' works because it turns out that
you need to move it out of the block for it to work as intended.
2018-06-28 00:49:38 +02:00
Alex Schroeder
a7625b35f4 README: mention problem with non-existing $DataDir 2018-06-28 00:49:23 +02:00
Alex Schroeder
1d239aa9a6 latex.pl: don't read and write; rename instead
Using ReadFileOrDie and WriteStringToFile on a PNG file borks it
because we're decoding and encoding the file as UTF-8. Let's use
Rename instead.
2018-06-28 00:49:10 +02:00
Alex Schroeder
3f1e5caaad bootstrap.js: bootstrap integration example 2018-06-28 00:48:58 +02:00
Alex Schroeder
bdbd6c8ba7 wiki: allow mixing of search and match
Move search up in the list of actions so that it takes precedence over
match if both parameters are provided and add matching to the Filtered
function so that it is taken into account when searching.
2018-06-28 00:48:43 +02:00
Alex Schroeder
1a898ee589 wiki: anonymize rc.log entries even if they are not moved 2018-06-28 00:34:08 +02:00
Alex Schroeder
9609adb575 gopher-server: own implementation of NormaltoFree
We want to avoid turning & into &amp; when printing a menu, so we don't
want to call NormalToFree because it callse QuoteHtml. Replaced all
calls with normal_to_free which only translates underscores to spaces.
2018-06-28 00:31:29 +02:00
Alex Schroeder
34c10202b0 wiki.pl: anonymous entries report as Anonymous
Two changes: First, when moving entries from rc.log to oldrc.log, make
sure we use the string "Anonymous" for the host instead of translating
it. Second, when printing the author link using GetAuthorLink, don't
call ColorCode for anonymous authors if the IP number has been replaced
by the string "Anonymous". In this case, just return "Anonymous".
Otherwise we're getting the color code of the string "Anonymous" which
is confusing.
2018-06-28 00:31:29 +02:00
Alex Schroeder
1457fad242 wiki.pl: update copyright year 2018-06-28 00:31:29 +02:00
Alex Schroeder
ce355499c7 oddtrans: fix missing . in @INC 2018-06-28 00:31:29 +02:00
Alex Schroeder
2bb3d2f967 strip-hosts: also strip ip keys 2018-06-28 00:31:29 +02:00
Alex Schroeder
a301ab5e1c strip-host: fix data corruption 2018-06-28 00:31:29 +02:00
Alex Schroeder
d74d29fa13 Anonymize IPs that we do show using a color code. 2018-06-28 00:31:29 +02:00
Alex Schroeder
96c54d9d66 New: strip-host.pl for DSGVO 2018-06-28 00:31:29 +02:00
Alex Schroeder
9a0700cac1 Getting ready for #DSGVO
Removing IP number ("host") from page files and keep files. The IP
numbers remain in the RC file. GetAuthor and GetAuthorLink now take
username as a first argument and host as an optional second argument.
Sorry for the incompatible change.
2018-06-28 00:31:29 +02:00
Alex Schroeder
864890c168 Added logo previews 2018-06-28 00:31:29 +02:00
Alex Schroeder
a93873d1d4 Logo updates 2018-06-28 00:31:29 +02:00
Alex Schroeder
b0a8fa2141 Logo files
Added old logo by Murray Altheim and new logo by Falky.
2018-06-28 00:31:29 +02:00
Alex Schroeder
88799b3ebc gopher-server: better handle links gopher urls
Accept links without path, i.e. gopher://alexschroeder.ch.
2018-06-28 00:31:29 +02:00
Alex Schroeder
4032aa563c gopher-server: ignore the period issues of RFC 1436
As discussed in issue #38 of VF-1 and on the #gopherproject channel,
newer software does not double leading periods and does send final
periods, so this commit simplifies the code and no longer does that,
either. https://github.com/solderpunk/VF-1/issues/38
2018-06-28 00:31:29 +02:00
Alex Schroeder
2b9fd67dbd gopher-server: support / 2018-06-28 00:31:29 +02:00
Alex Schroeder
62056409de gopher-server: add RSS support 2018-06-28 00:31:29 +02:00
Alex Schroeder
f45f4eb49f gopher-server: add support or external images 2018-06-28 00:31:29 +02:00
Alex Schroeder
acd4d42561 gopher-server: Add support for HTML links 2018-06-28 00:31:29 +02:00
Alex Schroeder
8375c3a842 gopher-server: add support for adding maps
Gopher maps can be added to the main menu.
2018-06-28 00:31:29 +02:00
Alex Schroeder
54138b7998 alex-2018.css: small changes 2018-06-28 00:31:29 +02:00
Alex Schroeder
3816567543 gopher-server: redesign of main menu 2018-06-28 00:31:29 +02:00
Alex Schroeder
c6954437ea gopher-server: URL escape all ids in the log 2018-06-28 00:31:29 +02:00
Alex Schroeder
f3725a4938 gopher-server: header and footer for html items 2018-06-28 00:31:29 +02:00
Alex Schroeder
fc8f6b4a42 gopher_server: Two separate options for SSL
I replaced --wiki_pem_file with two options, --wiki_key_file for your
private key and --wiki_cert_file for your full certificate chain.
2018-06-28 00:31:29 +02:00
Alex Schroeder
b6109e37ad gopher-server: support TLS 2018-06-28 00:31:29 +02:00
Alex Schroeder
b3b98e2b82 gopher-server: handle gopher links 2018-06-28 00:31:29 +02:00
Alex Schroeder
74f6a4b314 gopher-server: url escape selectors 2018-06-28 00:31:29 +02:00
Alex Schroeder
19a9ad3da0 gopher-server: fix handling of image:link 2018-06-28 00:31:29 +02:00
Alex Schroeder
2d99025024 css: added CSS files for alexschroeder.ch/wiki 2018-06-28 00:31:29 +02:00
Alex Schroeder
63370f31d7 markdown-rule: robuster _underline_ and /italic/ 2018-06-28 00:31:29 +02:00
Alex Schroeder
752daa81b5 gopher-server: don't need to decode text 2018-06-28 00:31:29 +02:00
Alex Schroeder
429ead8c69 gopher-server: host and port are arrays
$self->{server}->{host}->[0] instead of $self->{server}->{host}
2018-06-28 00:31:29 +02:00
Alex Schroeder
52f4aad356 gopher-server: don't just use sockaddr 2018-06-28 00:31:29 +02:00
Alex Schroeder
4abd0a26cf gopher-server: switch back to Net::Server again
I'm hoping that this works better than the async framework.
2018-06-28 00:31:29 +02:00
Alex Schroeder
c8173cac04 gopher-server: refactor
Format code, remove unnecessary test for $continue_reading at the end.
2018-06-28 00:31:29 +02:00
Alex Schroeder
be4b141c43 gopher-server: more debug logging 2018-06-28 00:31:29 +02:00
Alex Schroeder
f9d6258744 gopher-server: make sure to use correct info items
Also other improvements, hopefully. There are still problems regarding
feedback. When uploading a file twice in succession, for example, the
second call produces no output until a few seconds have passed.

echo -e "Alex/image/png/write/file\t"`wc -c < test.png` \
| cat - test.png   | nc localhost 7070

echo -e "Alex/image/png/write/file\t"`wc -c < test.png` \
| cat - test.png   | nc localhost 7070

I really have no idea why this is. The log output is correct but
printing to the stream just doesn't work anymore. Has it been closed
in the mean time?
2018-06-28 00:31:29 +02:00
Alex Schroeder
66234d7785 gopher-server: upload binary files with content-length 2018-06-28 00:31:29 +02:00
Alex Schroeder
c67b4a7f12 gopher-server: final period and line breaks
Not sure what we should be stripping, here?
2018-06-28 00:31:29 +02:00
Alex Schroeder
4a94023be2 gopher-server: final period required on uploads
When uploading big files, they get sent in chunks we therefore have to
detect the end of the file being sent. A final period on a line by
itself ("\n.\n") will have to do -- even for binary uploads.
2018-06-28 00:31:29 +02:00
Alex Schroeder
9535f45647 gopher-server: refactor info printing
We're now printing (useless) host and port data on info lines as well,
just because these lines might otherwise not get parsed correctly by
clients. It's a useless waste of bandwidth, though.
2018-06-28 00:31:29 +02:00
Alex Schroeder
8f585bcd29 gopher-server: remove unnecessary Init call 2018-06-28 00:31:29 +02:00
Alex Schroeder
d95d7b0674 wiki.pl: shorten search fields
The search fields at the top were shortened such that they all fit on
one line when all of them are shown (set %Languages and $MatchingPages
to show them all), on a terminal 80 characters wide, using a text
browser like Lynx or w3m.
2018-06-28 00:31:29 +02:00
Alex Schroeder
50fcd7eb0b gopher-server: add a test for large uploads 2018-06-28 00:31:29 +02:00
Alex Schroeder
e5b46fe1a4 gopher-server: refactor test 2018-01-05 11:21:20 +01:00
Alex Schroeder
28872646d0 gopher-server: more fiddling with menu labels 2018-01-05 11:05:43 +01:00
Alex Schroeder
d059e09104 gopher-server: fixed menu labels 2018-01-05 11:03:47 +01:00
Alex Schroeder
545cd78805 gopher-server: refactor comment and history link 2018-01-05 10:57:53 +01:00
Alex Schroeder
1e7a7d2fa7 gopher-server: change the order of links 2018-01-05 10:53:22 +01:00
Alex Schroeder
1b540fc294 gopher-server: after page save, link back to page 2018-01-05 10:45:21 +01:00
Alex Schroeder
493ddc233c markdown-rule: space after list item marker
Common Marks agrees. There, one to four spaces are required after * or
- or 1. to make it a list item.
2018-01-05 08:52:56 +01:00
Alex Schroeder
07b3169c5b Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2018-01-04 14:02:26 +01:00
Alex Schroeder
e73707a16f gopher-server: log level error for tests 2018-01-04 13:57:41 +01:00
Alex Schroeder
5323399bc8 gopher-server: clear metadata on each loop
This resets $q on every call such that no parameters are carried over
to the next request.

Also, refactor printing of menu lines.
2018-01-04 13:55:09 +01:00
Alex Schroeder
13ac083542 gopher-server: serve non-existing pages 2018-01-04 13:55:08 +01:00
Alex Schroeder
3dee191328 gopher-server: changed how new files are created 2018-01-04 13:55:01 +01:00
Alex Schroeder
e13524c1d3 gopher-server: prepare for appending text 2018-01-04 13:51:51 +01:00
Alex Schroeder
dc82b7d64f gopher-server: serve non-existing pages 2018-01-03 22:45:31 +01:00
Alex Schroeder
d68163ee90 gopher-server: changed how new files are created 2018-01-03 18:46:23 +01:00
Alex Schroeder
349ed2722c gopher-server: allow creating new pages 2018-01-03 14:53:30 +01:00
Alex Schroeder
e01b39edf6 gopher-server: link to comment page 2018-01-03 13:25:17 +01:00
Alex Schroeder
783325509a gopher-server: fix tests 2018-01-03 08:54:49 +01:00
Alex Schroeder
2db3736a70 gopher-server: fix port and host handling 2018-01-03 08:53:55 +01:00
Alex Schroeder
22cf00c28f gopher-server: handle encoding issues 2018-01-02 12:42:29 +01:00
Alex Schroeder
3fe2736ad4 gopher-server: remove pid file handling
Usage no suggests using an external tool like daemonize instead.
2018-01-02 11:55:46 +01:00
Alex Schroeder
03b38673f7 gopher-server: fix log setup 2018-01-01 22:36:39 +01:00
Alex Schroeder
3590bb96dd gopher-server: switch to Mojo::IOLoop
This makes it possible to use telnet and nc as a client, and this
makes a separate gopher-client unnecessary.
2018-01-01 22:00:52 +01:00
Alex Schroeder
5051b9602a gopher: client and server, with file uploads 2017-12-31 14:32:39 +01:00
Alex Schroeder
af9da2be34 gopher-server: posting to the wiki 2017-12-30 20:42:24 +01:00
Alex Schroeder
0c17454a0c gopher-server: refactor routing
Use regular expression matching instead of substrings to identify page
names.
2017-12-30 18:56:59 +01:00
Alex Schroeder
d789bc40f0 gopher-server: finished unit tests and more
Fixed the serving of text and html versions of older revisions.
2017-12-30 17:26:41 +01:00
Alex Schroeder
3a97171320 gopher-server: added revisions and tests 2017-12-29 23:20:47 +01:00
Alex Schroeder
110970f310 gopher-server: add toggle for minor edits to rc 2017-12-29 15:28:10 +01:00
Alex Schroeder
9986552ffb gopher-server: simple recent changes 2017-12-29 15:18:55 +01:00
Alex Schroeder
64277e26ed gopher-server: sort search results newest first 2017-12-29 14:55:12 +01:00
Alex Schroeder
b35e867b55 gopher-server: include search 2017-12-29 11:37:56 +01:00
Alex Schroeder
67c6db4b03 gopher-server: more tag support 2017-12-28 21:40:21 +01:00
Alex Schroeder
eec5307bc3 gopher-server; print more entries in main menu 2017-12-28 21:03:50 +01:00
Alex Schroeder
6a3b9a9916 Merge branch 'master' of github.com:kensanata/oddmuse 2017-12-28 19:43:56 +01:00
Alex Schroeder
e6880ae469 Summary: gopher-server more stringent
While testing with the cgo client, I ran into a few problems which are
now fixed. No more mixing of text and menu!
https://github.com/kieselsteini/cgo
2017-12-28 19:39:26 +01:00
Alex Schroeder
40de3ea9a1 gopher-server: image support 2017-12-28 19:09:11 +01:00
Alex Schroeder
93d40b022f Sort tag searches newest first 2017-12-28 13:15:44 +01:00
Alex Schroeder
dec6acf354 gopher-server: Net::Server personality
Switch from Net::Server::PreFork to Net::Server::Fork because I think
all the children will exit due to timeouts anyway.
2017-12-28 13:06:26 +01:00
Alex Schroeder
062cd9b5b9 gopher-server: just link to tag page 2017-12-28 12:54:54 +01:00
Alex Schroeder
31574e3606 gopher-server: handle [[tag:foo]] links 2017-12-28 12:48:34 +01:00
Alex Schroeder
ca01d9d3d6 gopher-server: handle [[foo|bar]] links 2017-12-28 12:16:25 +01:00
Alex Schroeder
9c69322289 gopher-server now with links 2017-12-28 11:07:03 +01:00
Alex Schroeder
c13841e30a gopher-server: add --wiki_pages 2017-12-27 15:26:32 +01:00
Alex Schroeder
9ae1ff22c7 gopher-server: better first page 2017-12-27 15:14:03 +01:00
Alex Schroeder
8db5a45dcd gopher-server: fix copyright year 2017-12-27 12:52:06 +01:00
Alex Schroeder
b3e2485cd0 gopher-server: changes to make it work 2017-12-27 11:11:06 +01:00
Alex Schroeder
6c135be248 gopher-server: new 2017-12-27 09:45:43 +01:00
Alex Schroeder
b5a4af9656 usemod: fix tables and ''''' 2017-12-22 00:18:13 +01:00
Alex Schroeder
b23f1d777b markdown-rule.pl: small change to code 2017-12-21 23:28:56 +01:00
Alex Schroeder
2f49adf605 Merge git.sv.gnu.org:/srv/git/oddmuse 2017-12-17 22:52:39 +01:00
Alex Schroeder
76f9eb7945 markdown-rule: added test 2017-12-17 22:41:40 +01:00
Alex Schroeder
0c2718ca8c markdown-rule: fix /emphasis/
Sometimes I write things like 5./month and that would have
triggered (?<=\P{Word})\/ so I decided to switch that the more
demanding (?<=\s)\/. In order to have italic items start table cells,
however, \G(?<=[|[:space:]])\/ instead.
2017-12-17 22:38:23 +01:00
Alex Schroeder
7109c5be9c markdown-rule: fix /emphasis/
Sometimes I write things like 5./month and that would have
triggered (?<=\P{Word})\/ so I decided to switch that the more
demanding (?<=\s)\/.
2017-12-17 22:34:54 +01:00
Alex Schroeder
e9fad88a10 markdown-rule: fix setext headers
In this situation, the old order caused a problem:

```
---
pandoc: variable
---
```

The result would be <h2>```</h2> and worse to follow.
2017-12-17 22:25:36 +01:00
Alex Schroeder
d94d571881 Perl 5.26 no longer adds . to @INC
test.pl calls stuff/server.pl and needs to pass a qualified
script (./wiki.pl instead of wiki.pl).
2017-11-07 15:06:05 +01:00
Alex Schroeder
d663c2b61d Perl 5.26 no longer adds . to @INC
Trying a different solution. The existing solution only worked for
relative paths in $DataDir. Now we check whether $DataDir starts with /
or ./ and only prepend a ./ if it does not.
2017-11-07 14:49:52 +01:00
Alex Schroeder
a3cbd8db8b Fixed mojolicious-namespaces hack
This is apparently no longer necessary with Perl 5.26.
2017-11-03 18:41:33 +01:00
Alex Schroeder
90e92c27b8 Perl 5.26 no longer adds . to @INC
More changes required, finding more places where do or require is
used.
2017-11-03 18:37:52 +01:00
Alex Schroeder
76b433c1da Perl 5.26 no longer adds . to @INC
More changes required, such as server.pl requiring wiki.pl in the
current directory, which isn't in @INC anymore.
2017-11-03 18:00:50 +01:00
Alex Schroeder
b116a0103e Perl 5.26 no longer adds . to @INC
This is why all the tests requiring t/test.pl had to be changed.
Similarly, the main script loads config and modules using the same
mechanism and paths had to be similarly qualified: prepending './'.
2017-11-03 17:51:30 +01:00
Alex Schroeder
6a7a0dd24d Makefile: Don't set PERL5LIB if it is already set 2017-11-03 13:05:46 +01:00
Alex Schroeder
c2366aa36f Test: give Mojolious server a sec to start up 2017-11-03 11:03:42 +01:00
Alex Schroeder
4da50ef125 Summary: Export PERL5LIB for Alexine
Try again, now using the current directory in the test target of the
Makefile instead of changing run-tests.
2017-11-03 10:48:16 +01:00
Alex Schroeder
2e0f293dcd Export PERL5LIB for Alexine
Try again, now using ODDMUSE_TEST_LOCATION instead of the current
directory.
2017-11-03 10:45:05 +01:00
Alex Schroeder
d0095a36b5 Export PERL5LIB for Alexine 2017-11-03 10:15:01 +01:00
Alex Schroeder
1eae7852c4 Set PERL5LIB for Alexine 2017-11-03 10:12:57 +01:00
Alex Schroeder
da06278df8 Fixed display of comment pages
There was a bug where showing the non-existing comment page for an
existing page: BrowseResolvedPage used to return BrowsePage($id,
GetParam('raw', 0), undef, '404 NOT FOUND') and we wanted to change
this to a 200 response and so we returned BrowsePage($resolved,
GetParam('raw', 0)); -- but that is wrong because in this situation
$id is defined and $resolved is not! This commit fixes the problem.
2017-11-03 10:03:39 +01:00
Alex Schroeder
bd8f914804 Use lib '.' for Alexine 2017-11-03 10:02:42 +01:00
Alex Schroeder
51b24309a7 Allow exclamation mark in page names 2017-11-02 14:06:30 +01:00
Alex Schroeder
60a4572087 creole: fix left alignment of th 2017-11-01 16:51:23 +01:00
Alex Schroeder
248af821a7 Comment pages and $CommentsPattern, again
If $CommentsPattern is a regular expression that matches without
setting $1, we want to avoid the “Use of uninitialized value $1 in
hash element” warning.
2017-10-30 15:56:06 +01:00
Alex Schroeder
c85e8b84b9 Don't return 404 for empty comment pages 2017-10-30 14:16:12 +01:00
Alex Schroeder
e4d159307b Add .gitattributes
GitHub uses Linguist to identify source code and .pl files are
sometimes classified as Prolog files. There are various ways to
override this. Using .gitattributes seems to be the easiest.
https://github.com/github/linguist#overrides

Similar issue:
https://github.com/github/linguist/issues/3230
2017-10-23 07:45:20 +02:00
Alex Schroeder
80a30a9102 ignore TAGS 2017-09-07 22:50:08 +02:00
Alex Schroeder
299b94243d ditaa and mermaid modules added 2017-09-07 22:27:47 +02:00
Alex Schroeder
b7ab45a3a7 wiki.css: only p > a.definition looks like h2 2017-08-29 16:49:54 +02:00
Alex Schroeder
9d3deaff0f permanent-anchors: fix dirty block return 2017-08-29 16:44:08 +02:00
Alex Schroeder
42a1e389a5 namespaces: sort the result of the namespace action 2017-08-29 15:39:08 +02:00
Alex Schroeder
9883a064f3 markdown-rule fixes for _foo_, *foo* and /foo/ 2017-08-28 11:42:02 +02:00
Alex Schroeder
52617b472d bbcode must come after markdown 2017-08-16 09:31:51 +02:00
Alex Schroeder
764c15e6c0 Fixed small bug in release file 2017-08-11 20:47:16 +02:00
Alex Schroeder
88b384c2b4 static-copy: suppress extra output when saving pages 2017-07-24 10:35:18 +02:00
Alex Schroeder
92e231b10c paste-image: new action includes javascript 2017-07-14 13:42:12 +02:00
Alex Schroeder
e9ce006444 Markdown: fixed number of tests 2017-07-07 23:19:31 +02:00
Alex Schroeder
bc5ee74ffd Markdown: one more test 2017-07-07 20:52:35 +02:00
Alex Schroeder
688cf9eea5 markdown-rule: support nested lists by indenting 2017-07-07 17:11:04 +02:00
Alex Schroeder
ad9a19d551 paste-image: step from 0.8 to 0.5
As it turns out, when I tried to paste an 1.5MB image, the old
settings didn't work. We need to shrink more agressively.
2017-06-16 20:01:11 +02:00
Alex Schroeder
7595e6db36 paste-image: fix name of option 2017-06-13 22:43:36 +02:00
Alex Schroeder
74fd5c569c paste-image: delete trailing whitespace 2017-06-13 22:32:30 +02:00
Alex Schroeder
e4376c178b paste-image: handle $QuestionaskerSecretKey 2017-06-13 22:18:11 +02:00
Alex Schroeder
9e46438534 Merge branch 'master' of github.com:kensanata/oddmuse 2017-06-13 22:11:46 +02:00
Alex Schroeder
4dd29bd4a7 paste-image: automatic resizing via Javascript 2017-06-13 22:06:39 +02:00
Alex Schroeder
90af54b7ba Add separate alt text for uploaded images 2017-06-13 12:55:52 +02:00
Alex Schroeder
cadcdde5f8 Fix how image names are determined 2017-06-12 23:22:31 +02:00
Alex Schroeder
4c77bc11de markdown-rule: merge with latest from server 2017-06-11 23:42:51 +02:00
Alex Schroeder
05988eb899 paste-image.pl is new 2017-06-11 23:27:16 +02:00
Alex Schroeder
040bd05333 Markdown rule fix for markup in table cells 2017-05-22 18:20:53 +02:00
Alex Schroeder
5f03238f60 Markdown rule: added tests for // and / 2017-05-22 18:00:59 +02:00
Alex Schroeder
4c6d91a101 Markdown rule: fix rules for __ and _ 2017-05-22 17:59:34 +02:00
Alex Schroeder
71b93887dc webdav: new tests using cadaver, when installed 2017-05-22 12:23:15 +02:00
Alex Schroeder
391049ef77 Qualify OddMuse::Modified in a different package 2017-05-22 12:23:15 +02:00
Alex Schroeder
3d5aec5651 For PUT and POST, CGI will read STDIN
You can get the content via the parameters POSTDATA and PUTDATA. For
other methods, however, this doesn't work and you still need to read
STDIN. One such method is PROPFIND.
2017-05-22 12:23:15 +02:00
Alex Schroeder
d976184e24 README: how to use server.pl 2017-05-22 12:23:15 +02:00
Alex Schroeder
5a45c1191a git.pl: failing to delete a file is not an error 2017-05-22 12:23:15 +02:00
Alex Schroeder
07f315ca12 markdown-rule.pl: improving the regexps 2017-05-22 12:23:15 +02:00
Aleks-Daniel Jakimenko-Aleksejev
be1cf0e876 Tiny indentation changes 2017-04-21 02:03:15 +03:00
greenfive
d4d0ed728f refactored into single outer if-branch (#7)
* refactored into one outer if branch, simplified output of div classes

(squashed to avoid the weird GPL version change)
2017-04-21 01:57:49 +03:00
Alex Schroeder
0f0f20b21c Merge pull request #6 from greenfive/titlelist
added support for <titlelist regexp> to search page titles only
2017-04-20 17:47:05 +02:00
Ralph Graulich
abdb9c973b added support for <titlelist regexp> to search page titles only 2017-04-20 13:19:59 +02:00
Aleks-Daniel Jakimenko-Aleksejev
4e0b287890 Variable %RuleOrder is not needed of course
Oops.
2017-04-15 03:56:48 +03:00
Aleks-Daniel Jakimenko-Aleksejev
00308f9ed6 New module: styled-pages.pl
A user on #oddmuse asked what would be the easiest way to have
different css styles on different pages. Turns out the easiest way is
to write a module.

Not sure if it will break html in some yet unknown edge cases, but for
most things this should work just fine.

greenfive++
2017-04-15 03:54:06 +03:00
Alex Schroeder
2488ccdb8c Makefile now looks for https instead of http 2017-04-11 12:50:09 +02:00
Alex Schroeder
cec2f3cc1b banned-regexps.t: new 2017-03-17 09:32:42 +01:00
Alex Schroeder
5a19773dfa meta.t: ban-contributors.pl may have package 2017-03-01 08:26:47 +01:00
Alex Schroeder
7c3bb0a0af ban-contributors: end with package OddMuse 2017-02-28 12:47:50 +01:00
Alex Schroeder
90d44bf863 Merge branch 'master' of github.com:kensanata/oddmuse 2017-02-13 20:48:34 +01:00
Alex Schroeder
9d0ff86a44 gotobar.pl: remove trailing whitespace 2017-01-09 22:37:08 +01:00
Alex Schroeder
d03bc9f40b Moved the elisp files to a different repo
You can find them here:
https://github.com/kensanata/emacs-setup/tree/master/lib
2017-01-09 22:36:23 +01:00
Alex Schroeder
863bda76dc Various elisp changes 2017-01-09 22:36:23 +01:00
Alex Schroeder
fcbe01bbfd campaignwiki/delete.sh: use --silent for curl 2016-12-30 14:00:08 +01:00
IngoBelka
6178c46aec gotobar.pl: Parameters for automatically set of HOME link and RC link or not 2016-12-02 14:34:44 +01:00
Alex Schroeder
87110eef08 Trying to improve SVG printing from Firefox 2016-11-11 19:34:44 +01:00
Aleks-Daniel Jakimenko-Aleksejev
1bfeac5035 Fix tests in history.t after commit 152188503e
Long story short: it was testing for string “rollback” which is now part
of the warning message. Just making it a bit more specific resolves the
problem.
2016-09-22 00:45:10 +03:00
Aleks-Daniel Jakimenko-Aleksejev
ef257b566f Fix git.t for newer git versions
More recent git versions say “working tree clean” instead of
saying “working directory clean”. Let's just accept both.
2016-09-21 23:54:45 +03:00
Alex Schroeder
0fce2edcf8 meta.t: test for GPL URL
This also catches the URL for Weakish Jiang's GPL v2 and a GPL with no
URL (implying the version with a snail mail address).

This is tes should close issue #4 on GitHub.
2016-09-21 17:06:54 +02:00
Alex Schroeder
152188503e Translations: updated
Two new strings which need to be translated.
2016-09-11 21:46:49 +02:00
Alex Schroeder
d804c16a1c Explain Rollback button on History pages 2016-09-10 23:51:07 +02:00
Alex Schroeder
cb7f2e4634 Explain Rollback button on Recent Changes 2016-09-10 23:15:35 +02:00
Alex Schroeder
b90695c7c8 ban-contributors.t: skip the last few tests
Alexine keeps failing those.
2016-08-31 14:20:50 +02:00
Alex Schroeder
e67c8bfda6 wiki.pl Switch oddmuse.org links to HTTPS 2016-08-31 14:14:47 +02:00
Alex Schroeder
90eb428787 calendar.pl: allow previous and next month
Stefan Kamphausen provided a reason for liking the deprecated cal3
extension: he likes cal3 because it also displays the next and
previous month as opposed to calendar.pl which only displays the
current month.

This commit allows users to get the same behaviour by setting
$CalendarOnEveryPage to values greater than 1: 1 shows the current
month on every page, but 2 shows the previous and the current month on
every page, and 3 shows the previous, the current and the next month
on every page.
2016-08-31 13:44:07 +02:00
Alex Schroeder
e3cacaa89f Merge branch 'master' of github.com:kensanata/oddmuse 2016-08-26 13:50:13 +02:00
Alex Schroeder
6167428ecf ban-contributors.t: commented last test
The last test has been failing for Alexine and we have contacted the
maintainer of the Net::Whois::Parser package. Until we hear back, I'm
going to skip this test.
2016-08-19 14:33:55 +02:00
Alex Schroeder
367f76b6f4 Removed old $Id$ line 2016-08-19 13:09:44 +02:00
Alex Schroeder
733b6dabb1 Fixed another one that had slipped through the cracks
Emacs keyboard macros, oops!
2016-08-16 18:08:34 +02:00
Alex Schroeder
72cd669bf0 Changed nearly remaining code from GPLv2 to GPLv3
There were some files that did not offer "or (at your option) any later
version" in their license and these had to be left alone. This should
solve the incorrect FSF address issue #4 on GitHub.
2016-08-16 18:01:26 +02:00
Alex Schroeder
84f630af4a README.creole: indicate ownership
Typo fixed and a chown command added as suggested by @mx4 in GitHub
issue #5.
2016-08-16 17:44:40 +02:00
Alex Schroeder
05df700140 Fixed erroneous edits from previous commit
The keyboard macro did not deal kindly with two files... This should
address comments by @m4z for the incorrect FSF address issue #4 on
GitHub.
2016-08-16 16:43:21 +02:00
Alex Schroeder
f230a64e7d Changed nearly all modules from GPLv2 to GPLv3
There were some modules that did not offer "or (at your option) any
later version" in their license and these had to be left alone.
This should solve the incorrect FSF address issue #4 on GitHub.
2016-08-16 15:04:47 +02:00
Alex Schroeder
1855c84cec namespaces.pl: more changes to get it working
Encoding of namespace and page name under Mojolicious is not OK and I
don't know why. I added some tests that try to at least prove that the
workaround in the config file is OK.
2016-08-11 17:14:14 +02:00
Alex Schroeder
3c982a6cd4 namespaces.t: added another test 2016-08-11 15:29:41 +02:00
Alex Schroeder
7053561f89 Revert "NamespacesInitVariables not decoding path_info"
This reverts commit 5fce7f4b63.

Same as the previous revert for wiki.pl.
2016-08-11 14:20:45 +02:00
Alex Schroeder
02fcabfdbc Revert "GetId no longer decodes path_info"
This reverts commit 1ee235c949.

Sadly, I discovered that my websites no longer correctly displayed pages
containing characters such as the EN DASH. Reverting this commit seems
to solve the problem.
2016-08-10 14:56:00 +02:00
Alex Schroeder
0c0efdd2c8 banned-regexps.pl: exclude urls 2016-08-08 11:31:06 +02:00
Alex Schroeder
9a93601a03 upload.pl: fix meta.t complaint 2016-08-08 11:30:27 +02:00
Alex Schroeder
b68f2b6cd6 ban-contributors.pl: rely on inetnum 2016-08-05 12:24:36 +02:00
Alex Schroeder
80d95e9225 tarballs.pl: handle missing files 2016-08-03 12:52:29 +02:00
Alex Schroeder
04288eda8c light.css: checkboxes are not 5em wide 2016-08-02 12:04:26 +02:00
Alex Schroeder
3a7f75cf30 translations: updated with new strings 2016-08-02 11:55:39 +02:00
Alex Schroeder
0ca64b2db0 german-utf8.pl: updated 2016-08-02 11:54:15 +02:00
Alex Schroeder
81aaf49463 sort.pl: delete trailing whitespace 2016-08-02 11:49:41 +02:00
Alex Schroeder
5c93616690 sort.pl: be more explicit about the sorting
Clearly print how the result is sorted right now.
2016-08-02 11:48:17 +02:00
Alex Schroeder
c1823bc59c sort.pl: Offer link to sort alphabetically
Don't show the link to the current sort order.
2016-08-02 11:43:08 +02:00
Alex Schroeder
1634859659 Skip pages that no longer exist 2016-08-02 11:38:44 +02:00
Alex Schroeder
684781423d creationdate.pl: fix typo 2016-08-02 11:26:02 +02:00
Alex Schroeder
1f2507fc00 creationdate.pl: now with admin menu to add dates
This is done by parsing rc.log files and adding the information to the
page database.
2016-08-02 11:21:38 +02:00
Alex Schroeder
0644b63b67 sort.pl: new module to sort search results 2016-08-02 10:58:37 +02:00
Alex Schroeder
64f6b267d9 Encode arguments to diff command 2016-07-27 17:35:10 +02:00
Alex Schroeder
528e9d8868 meta.t: remove -T from the syntax check
When testing it on my system, perl -c claims ban-contributors.pl is
good and perl -cT claims ban-contributors.pl bad because it can no
longer find Net/Whois/Parser.pm in @INC even though it's right there
as /home/alex/perl5/lib/perl5/Net/Whois/Parser.pm -- apparently taint
checking changes @INC.
<http://perldoc.perl.org/perlsec.html#Taint-mode-and-%40INC>.
2016-07-27 14:01:51 +02:00
Alex Schroeder
f618822f34 meta.t: suggest the use of perl -cT 2016-07-27 13:56:11 +02:00
Alex Schroeder
e9a5fcdc7c ban-contributors: switch to Net::Whois::Parser
This one is available in a Debian package.
2016-07-27 12:51:47 +02:00
Alex Schroeder
2a33e91167 ban-contributors: fixed failing meta.t tests 2016-07-26 09:37:20 +02:00
Alex Schroeder
77327ec06f ban-contributors: better regexp
Now able to handle the range 77.56.180.0 - 77.57.70.255.
2016-07-26 09:25:58 +02:00
Alex Schroeder
f530b25d74 Document the number range being banned 2016-07-26 09:10:22 +02:00
Alex Schroeder
8db81914b1 ban-contributors.pl now with Net::Whois::IP
We use a whois query to suggest a regular expression that bans the
entire network, not just a single IP.
2016-07-25 15:37:34 +02:00
Alex Schroeder
5fce7f4b63 NamespacesInitVariables not decoding path_info
On a new server with Debian Jessie (8), Apache 2.4, Perl 5.25.1 and CGI
4.28 I'm getting double-decoded namespaces. An Umlaut will thus turn
into an undisplayable character (a questionmark in a black diamond).
Decoding of path_info was necessary on my old server with Debian
Wheezy (7), Apache 2.2, Perl 5.14.2 and CGI 3.52.

If you're still in the unfortunate situation, you can copy the old
implementation of NamespacesInitVariables into your config file.
2016-07-25 09:03:33 +02:00
Alex Schroeder
1ee235c949 GetId no longer decodes path_info
On a new server with Debian Jessie (8), Apache 2.4, Perl 5.25.1 and
CGI 4.28 I'm getting double-decoded page names. An Umlaut will thus
turn into an undisplayable character (a questionmark in a black
diamond). Decoding of path_info was necessary on my old server with
Debian Wheezy (7), Apache 2.2, Perl 5.14.2 and CGI 3.52.

If you're still in the unfortunate situation, you can copy the old
implementation of GetId into your config file:

sub GetId {
  my $id = UnquoteHtml(GetParam('id', GetParam('title', ''))); # id=x or title=x -> x
  if (not $id and $q->keywords) {
    $id = decode_utf8(join('_', $q->keywords)); # script?p+q -> p_q
  }
  if ($UsePathInfo and $q->path_info) {
    my @path = map { decode_utf8($_) } split(/\//, $q->path_info);
    $id ||= pop(@path); # script/p/q -> q
    foreach my $p (@path) {
      SetParam($p, 1);    # script/p/q -> p=1
    }
  }
  return $id;
}
2016-07-21 12:49:01 +02:00
Alex Schroeder
be7d8d4460 translation-links.pl: test with locked wiki, too 2016-07-09 00:07:32 +02:00
Alex Schroeder
f134283bae translation-links.pl: prevent spam from saving
When using banned-regexps.pl, we want to ban certain pages from getting
created. This only works if we test source and target page for spam.
2016-07-09 00:03:18 +02:00
Alex Schroeder
38d5d01ea1 DoPost will also test $id for banned content
If using banned-regexps.pl, testing the page title can be important.
2016-07-06 18:18:28 +02:00
Alex Schroeder
8e3e186fab Fix make release target 2016-07-06 18:14:47 +02:00
Alex Schroeder
4b33b3afeb Get rid of -r 2016-06-27 12:05:37 +02:00
Alex Schroeder
9beca5895a tarballs.pl: decode utf8 2016-06-24 12:29:19 +02:00
Alex Schroeder
1afc03eee1 tarballs.pl: a frontend to serve released files
There is a target in our Makefile to make a new release. This stores a
tarball with the appropriate release information in
https://oddmuse.org/releases. tarballs.pl offers an interface to serve
these files, or their individual member files, with a naive cache of
50 elements.

This is a Mojolicious application and is available here:
https://odddmuse.org/download
2016-06-23 23:41:41 +02:00
Alex Schroeder
331b03f894 Script to serve tarballs 2016-06-23 18:33:42 +02:00
Alex Schroeder
1c9b180b3a Merge git.sv.gnu.org:/srv/git/oddmuse 2016-06-23 00:47:10 +02:00
Alex Schroeder
57a16e85f8 meta.t: improve by skipping comments 2016-06-23 00:44:06 +02:00
Alex Schroeder
c7cd5bcc36 meta.t: improve by skipping comments 2016-06-23 00:38:23 +02:00
Alex Schroeder
f571007516 Fix issues discovered by meta.t 2016-06-23 00:34:56 +02:00
Alex Schroeder
fac3f03f7b meta.t: enforce file access rules 2016-06-23 00:31:52 +02:00
Alex Schroeder
7d85dd6570 toc.pl: use ToString and don't double-decode
ToString now takes more arguments.
2016-06-22 16:24:07 +02:00
Alex Schroeder
a91ef8602f Moving modules from utf8::encode to encode_utf8 2016-06-22 15:37:04 +02:00
Alex Schroeder
1bc670617e test.pl: move to encode_utf8 as well 2016-06-22 14:54:52 +02:00
Alex Schroeder
74288ba3f3 Moving from utf8::encode to encode_utf8 2016-06-22 14:43:28 +02:00
Alex Schroeder
bf2856011d Changing $foo/$bar to "$foo/$bar"
Why did this not cause a syntax error?
2016-06-19 15:56:34 +02:00
Alex Schroeder
ca974a902d latex.pl: Globbing nil requires double quotes to work 2016-06-19 15:55:46 +02:00
Alex Schroeder
f992897e7a opendir also requires bytes 2016-06-19 15:55:03 +02:00
Alex Schroeder
c121607f61 All open and tie calls need utf8::encode 2016-06-19 13:51:11 +02:00
Alex Schroeder
032c7aea73 bsd_glob replaced with Glob 2016-06-19 11:55:58 +02:00
Alex Schroeder
f6c419746c tags.pl: Storable also needs bytes in filename 2016-06-19 00:10:39 +02:00
Alex Schroeder
83f13a9a1a Use helper functions for accessing the file system
As we derive a lot of filenames from strings in UTF-8 encoded files, we
need to make sure that any filename that might might be set by a user –
including all the filenames containing a directory deriving from
$DataDir – are passed through utf8::encode. That is, every character
gets replaced with a sequence of one or more characters that represent
the individual bytes of the character and the UTF8 flag is turned off.

In other words, -d $DataDir might not work if $DataDir contains a UTF-8
encoded string. The solution is to use the following replacements:

-f $name            IsFile($name)
-e $name            IsFile($name)
-d $name            IsDir($name)
(stat($name))[9]    Modified($name)
-M $name            $Now - Modified($name)
-z $name            ZeroSize($name)
unlink $name        Unlink($name)
mkdir $name         CreateDir($name)
rmdir $name         RemoveDir($name)

(Using IsFile for -e is probably not ideal?)

If you don’t, and Oddmuse gets used with Mojolicious, and you use the
Namespaces Extension, and a namespace contains non-ASCII characters such
as ä, ö, or ü, these characters will end up as part of $DataDir and
trigger the problem.

I also wonder whether we should be using some other Perl library.
2016-06-17 14:49:34 +02:00
Alex Schroeder
2111af2ec8 Fix regular expression in Makefile
Unescaped left brace in regex is illegal in regex.
2016-06-16 09:43:08 +02:00
Alex Schroeder
648e6eb9bc Skip pygmentize if the binary is not found 2016-06-15 15:07:15 +02:00
Alex Schroeder
994b4e8051 Tests rely on English output
Set environment variable to en_US.UTF-8.
2016-06-15 14:47:20 +02:00
Alex Schroeder
f2f464b1ca test.pl: no warning about killing the server 2016-06-15 10:32:58 +02:00
Alex Schroeder
119d11b405 Merge branch 'master' of github.com:kensanata/oddmuse 2016-06-15 10:31:06 +02:00
Alex Schroeder
d7031198cd Merge github.com:kensanata/oddmuse 2016-06-14 13:14:12 +02:00
Alex Schroeder
187d4020f5 Make server.pl compatible with Alexine 2016-06-14 13:07:29 +02:00
Alex Schroeder
0a77bd0b47 All access to the file system needs bytes!
All occurence of	tuns into
-f $name		IsFile($name)
-e $name		IsFile($name)
-d $name		IsDir($name)
(stat($name))[9]	Modified($name)
-M $name		$Now - Modified($name)
unlink $name		Unlink($name)
mkdir $name		CreateDir($name)
rmdir $name		RemoveDir($name)

This change is incomplete. All the modules also need to be changed.
The benefit of this change is that t/mojolicious-namespaces.t passes.
2016-06-13 22:28:52 +02:00
Alex Schroeder
cb00e7e969 Prevent warning by using 127.0.0.1
Using localhost leads to a warning on my Debian Wheezy system.
2016-06-12 22:29:49 +02:00
Alex Schroeder
1b2fe0d713 A test for Mojolicious + Namespaces
Currently this fails if the namespace contains non-ASCII characters.
This failing test has been wrapped in a TODO.
2016-06-12 22:24:23 +02:00
Alex Schroeder
8e73f6f0dd Use /wiki in $ScriptName for Mojolicious test 2016-06-12 21:26:18 +02:00
Alex Schroeder
d3c7b45ad9 Simplify Mojolicious server setup
Make sure the wiki log is written into the data directory.
2016-06-12 21:25:28 +02:00
Alex Schroeder
fee15fd880 Simplify namespaces.pl initialization 2016-06-12 21:24:43 +02:00
Alex Schroeder
196b960b47 Add test for Mojolicious server 2016-06-12 17:32:20 +02:00
Alex Schroeder
241a88ef48 Move server starting code from atom.t to test.pl 2016-06-11 20:08:04 +02:00
Alex Schroeder
fdf0c2711b Added a test for stuff/server.pl 2016-06-11 14:15:36 +02:00
Alex Schroeder
239a95e683 Fix typo: substring → substr 2016-06-05 18:00:01 +02:00
Alex Schroeder
d3205d2425 INS is italic, not red 2016-05-28 21:09:55 +02:00
Alex Schroeder
681ba8068c Add Spanish national days 2016-05-28 13:58:57 +02:00
Alex Schroeder
d5429d276f load-lang.pl: Fix code and add test
If you're accept-language settings included something for which no file
exists (such as "de-ch"), then the test for the file would
succeed (testing for the existence of "$LoadLanguageDir/") even though
no actual file will be loaded. This is fixed. Also: implemented actual
testing.
2016-05-28 09:30:59 +02:00
Alex Schroeder
746b10be81 Some fixes for Oddmuse Mode (Emacs) 2016-05-28 09:23:36 +02:00
Alex Schroeder
b9aa27e406 How to replace all your pictures from Flickr with local copies 2016-05-13 17:11:48 +02:00
Alex Schroeder
00cf277156 How to replace all your pictures from Flickr with local copies 2016-05-13 17:10:28 +02:00
Alex Schroeder
75ce7d745e expire-bans.pl is new 2016-03-03 15:04:48 +01:00
Alex Schroeder
ee1bbca5c9 Don't use both $wiki and $1 2016-02-16 17:39:24 +01:00
Alex Schroeder
0effc86620 added delete.sh
I've been using this to clear out wikis on campaignwiki.org
2016-02-16 16:42:37 +01:00
Aleks-Daniel Jakimenko-Aleksejev
8a36970b24 static-copy.pl: Fix non-ascii links
It seems like it is operating on url-encoded strings, so all we have to
do is to decode it. This, however, does not mean that we should print
decoded strings. ‘href’ attribute still has to be encoded (or so it seems).
2016-02-02 20:22:06 +02:00
Alex Schroeder
8be87ede99 light.css: change summory not bold 2016-01-29 14:16:11 +01:00
Alex Schroeder
d61dd71627 New CSS für alexschroeder.ch 2016-01-17 22:29:51 +01:00
Alex Schroeder
755f742088 sidebar.t: writing more tests
Trying to find the problem I have on one of the sites.
2016-01-02 12:21:54 +01:00
Aleks-Daniel Jakimenko-Aleksejev
0107e41123 load-lang.pl: Add Estonian translation 2015-12-30 15:45:41 +02:00
Ain Laidoja
e58c8c2192 Estonian translation 2015-12-30 15:11:57 +02:00
Alex Schroeder
ee4518da9e release: clean up and checkout master 2015-12-19 12:01:04 +01:00
Alex Schroeder
64e7183896 stuff/release is new 2015-12-19 11:54:19 +01:00
Alex Schroeder
bd2715a35e DoSearch: Add link to actually DO the replacement 2015-12-16 18:19:33 +01:00
Alex Schroeder
986e4fc65f Replace: no pagination
The old code would only call the the function provided
if pagination indicated that it was OK to do so. Thus,
only the first ten pages got replaced. This has been
fixed and tests have been added.
2015-12-16 15:50:35 +01:00
Alex Schroeder
908cecffb9 atom.t: fix warning 2015-12-16 10:04:56 +01:00
IngoBelka
07226ae7a1 typo 2015-11-29 10:25:15 +01:00
IngoBelka
c90258ef4b supplementing the German transltion 2015-11-29 10:10:47 +01:00
Aleks-Daniel Jakimenko-Aleksejev
f500092a6a Alexine IRC bot 2015-11-19 23:25:18 +02:00
Alex Schroeder
d1f1f65c9b green.css: no dashed line between sister sites 2015-11-18 09:58:20 +01:00
Alex Schroeder
aae0cb6379 light.css: no bold summary for recent changes 2015-11-15 21:58:58 +01:00
Alex Schroeder
2b0a0d9a14 word-count.pl: fix regular expression for dates 2015-11-15 21:58:58 +01:00
Aleks-Daniel Jakimenko-Aleksejev
69fcb9646b Fix tests for default stylesheet link
Also, get rid of redundant “www”.
2015-11-03 03:21:27 +02:00
Aleks-Daniel Jakimenko-Aleksejev
a0bf615960 Alexine: some successful commits are major
If previous commit had some failing tests then Alexine will announce that on
the wiki. When the problem is solved we probably don't want to see scary
messages in Recent Changes, so next successful commit should be announced (it
should not be a minor edit).
2015-11-03 03:03:13 +02:00
Aleks-Daniel Jakimenko-Aleksejev
c024f553fd Default css should be retrieved over secure connection
Everything on oddmuse.org now redirects to https, which means that every wiki
that is using default style sheet requires two requests to get the css file.
2015-11-02 20:57:49 +02:00
Aleks-Daniel Jakimenko-Aleksejev
c97d6a576f wiki.css: We are no longer using these fonts
There is no need to define fonts that we do not use anyway.
2015-11-02 20:50:52 +02:00
Alex Schroeder
c64095fd95 scripts: renamed two scripts 2015-10-31 15:15:36 +01:00
Aleks-Daniel Jakimenko-Aleksejev
542f552002 nosearch.pl: code style
It seems like oddtrans does not pick up the strings with double quotes?
It's weird, but it does not matter anyway, because we will switch to gettext
sooner or later.
2015-10-31 02:58:00 +02:00
Aleks-Daniel Jakimenko-Aleksejev
22017a24f2 Updates to Russian translation (70% → 85%) 2015-10-31 02:56:39 +02:00
Alex Schroeder
6ac7093e9f word-count.pl: new 2015-10-30 23:39:52 +01:00
Aleks-Daniel Jakimenko-Aleksejev
89a23a6ac5 Full support for arrayref in $StyleSheet 2015-10-26 01:03:42 +02:00
Aleks-Daniel Jakimenko-Aleksejev
ed17476aeb Fix the number of tests in css.t 2015-10-26 00:34:57 +02:00
Aleks-Daniel Jakimenko-Aleksejev
1b951c66f1 Allow multiple stylesheet files in $StyleSheet
Since $StyleSheet is a scalar, you can't pass multiple values, but you can
now set it to one array ref. For example:

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

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

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

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

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

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

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

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

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

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

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

Now we remove these locks automatically!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

A typical change from questionasker.pl:

push(@MyFormChanges, \&QuestionAddTo);

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

This commit als moves from &$foo to $foo->() based on a recommendation
in Modern Perl by Conway.
2015-08-18 11:11:13 +02:00
Alex Schroeder
7582aaaba1 askpage.pl: don't hook into GetCommentForm
When GetCommentForm is part of @MyFooters, changing it turns into a
problem. We're hooking into GetTextArea instead.
2015-08-18 11:07:51 +02:00
Alex Schroeder
58e9a1e240 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
bd39fe5d38 recaptcha.pl: same fix as questionasker.pl
We need to replace the old reference in @MyFooters with the new code
reference.
2015-08-18 09:44:43 +02:00
Alex Schroeder
1c776e1080 Undo the commit of version numbers 2015-08-17 16:54:07 +02:00
Alex Schroeder
d088887337 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-17 14:22:15 +02:00
Alex Schroeder
0ba76bafb2 oddmuse-2.2.6.pl: use $q->end_form
This silences the errors about $q->endform not existing in newer CGI
versions.
2015-08-17 14:20:25 +02:00
Aleks-Daniel Jakimenko
c7756a8861 Merge branch 'master' of git.sv.gnu.org:/srv/git/oddmuse 2015-08-17 15:12:20 +03:00
Aleks-Daniel Jakimenko
5462b215be Disallow minor comments when $EditAllowed is 3
Otherwise people can sneak some comments in
2015-08-17 15:11:18 +03:00
Alex Schroeder
f98374df9b PrintFooter relies on @MyFooters
We already called all the subs on @MyFooters and printed the result,
but this commit moves all the code from PrintFooters into subs and
puts those subs on @MyFooters. This allows us to write modules that
can better control where exactly their output should appear. In this
case the change was required in order to allow the Google +1 module to
coexist with code that maybe prints the comment form for all pages.

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

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

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

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

The Google +1 extension was also fixed to not triger the EFF's Privacy
Badger. This is OK because we're using a two step button: The user
needs to click a button before we're loading the script from Google.
2015-08-17 13:39:34 +02:00
Alex Schroeder
4614990e04 upgrade-files.t: wipe /tmp/mywikidb
If you're running this test on a system that did not get /tmp wiped in
a 30 days (as happens after a reboot on some systems), then this test
used to fail. The files from the last run will not be changed and
therefore they will not show up in Recent Changes. This commit wipes
$UseModWiki::DataDir before running the test.
2015-08-17 13:35:27 +02:00
Alex Schroeder
6658886b72 alex-2015.css: fix CSS errors 2015-08-17 11:17:04 +02:00
Alex Schroeder
5130a92f9c upgrade_files.pl: Get rid of a warning
Using $q->param in list context...
2015-08-16 09:55:36 +02:00
Alex Schroeder
a602bc0678 search.t: test grouping of search terms 2015-08-16 09:23:33 +02:00
Alex Schroeder
09efd911e6 silence warnings about $q->param
$q->param in list context can be problematic. At the same time, we don't
want to depend on $q->multi_param because it was only added in CGI 4.08
(2014). That's why we're setting $CGI::LIST_CONTEXT_WARN = 0 instead.
2015-08-15 22:48:12 +02:00
Alex Schroeder
958c118649 upgrade-files.t: upgrade-files.pl was moved 2015-08-15 21:54:06 +02:00
Alex Schroeder
c031898184 summary.t: XSS in summaries was fixed
Similar to the previous commit: there was a test that basically ensured
that XSS attacks were possible.
2015-08-15 21:45:17 +02:00
Alex Schroeder
d32ebaddc8 rss.t: XSS in summaries was fixed
Thus it is revealed that the old version of the test was making sure
that XSS was possible via the edit summary. Oh dear.
2015-08-15 21:22:05 +02:00
Alex Schroeder
9c90bba602 SearchHighlight unless raw
The recent reorganization of the search code always calls
SearchHighlight, even if the raw parameter is set. This causes a test in
namespace.t to fail.
2015-08-15 21:17:02 +02:00
Alex Schroeder
93cc1578d0 encoding.t: fix test
When we decided to no longer show changes to the cookie, we knew that we
would have to change some of the tests. This commit does that for
encoding.t. The tests that looked at the HTML document now look at the
footer of an edit.
2015-08-15 21:03:26 +02:00
Alex Schroeder
79610f7490 cookie.t: fix tests
When we decided to no longer show changes to the cookie, we knew that we
would have to change some of the tests. This commit does that for
cookie.t. All the tests that looked at the HTML document now look at the
HTTP response headers.
2015-08-15 16:05:16 +02:00
Alex Schroeder
be2b87635c big-brother.t: increase $VisitorTime to 10
We had decreased $VisitorTime to 5 back in commit 6bc9531...
"big-brother.t: reduce $VisitorTime to 5". As it turns out, under
certain circumstances, this time window is too short for my laptop, so
I'm increasing it again.
2015-08-15 15:55:12 +02:00
Alex Schroeder
8e38179b66 our $q
The recent change to $q->remote_addr() necessitated the addition of our
$q to a few modules.
2015-08-15 10:32:11 +02:00
Alex Schroeder
1300cfad52 Reintroducing Filtered
When the GrepFiltered sub was removed, we didn't check our modules. As
it turns out, tags.pl and mac.pl hooked into this sub to do their job. A
simple no-op Filtered sub was reintroduced for those modules.

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

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

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

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

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

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

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

: a
: b

Turned into:

[quote]
a
[/quote]

[quote]
b
[/quote]

And this script turns that back into:

[quote]
a

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

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.pl linguist-language=Perl

5
.gitignore vendored
View File

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

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';

163
Makefile
View File

@@ -1,5 +1,6 @@
# 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$)
@@ -16,150 +17,46 @@ prepare: build $(BUILD)
build:
mkdir -p build
clean:
rm -rf build
prove t/setup.pl
release:
perl stuff/release ~/oddmuse.org/releases 2.3.3
build/wiki.pl: wiki.pl
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" < $< > $@
perl -lne "s/(\\\$$q->a\(\{-href=>'https:\/\/www.oddmuse.org\/'\}, 'Oddmuse'\))/\\\$$q->a({-href=>'https:\/\/alexschroeder.ch\/cgit\/oddmuse\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
build/%-utf8.pl: modules/translations/%-utf8.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/national-%.pl: modules/translations/national-%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
build/month-names-%.pl: modules/translations/month-names-%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
# from: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
# to: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
build/%.pl: modules/%.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
modules/translations/new-utf8.pl: wiki.pl $(MODULES)
cp $@ $@-old
perl stuff/oddtrans -l $@-old wiki.pl $(MODULES) > $@
rm -f $@-old
translations: $(TRANSLATIONS)
for f in $^; do \
echo updating $$f...; \
perl oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
perl stuff/oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
done
# 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)
for f in $^; do \
scp $$f as@dl.sv.nongnu.org:/releases/oddmuse/; \
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
# Running four jobs in parallel, but clean up data directories without
# race conditions!
jobs ?= 4
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)
prove t/setup.pl
prove --jobs=$(jobs) --state=slow,save t

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.

197
README.creole Normal file
View File

@@ -0,0 +1,197 @@
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. You might also have to change its owner to
an appropriate user on your system.
{{{
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
sudo chown www-data.www-data /usr/lib/cgi-bin/wiki.pl
}}}
If you're on SUSE, the user might not be {{{www-data}}} but
{{{wwwrun}}} without appropriate group:
{{{
sudo chown wwwrun.root /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.
== Checking the Apache Setup
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 our 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
}}}
== Using just Perl
You can use Mojolicious as your web server. There is a simple
##server.pl## which you can use. Here's how you might start it:
{{{
mkdir ~/oddmuse
WikiDataDir=$HOME/oddmuse perl server.pl daemon
}}}
This makes the server available on {{{http://localhost:3000/wiki}}}.
Make sure you create the directory before starting the server!
If you don't, you'll get a strange error:
`STDERR: : No such file or directory at ... perl5/Mojolicious/Plugin/CGI.pm`.
If it works, feel free to upgrade to Hypnotoad.
{{{
WikiDataDir=$HOME/oddmuse hypnotoad server.pl
}}}
Note: Hypnotoad uses a different default port. The above makes the
server available on {{{http://localhost:8080/wiki}}}. Hypnotoad will
keep forking new processes. To stop it, use the {{{-s}}} flag.
{{{
hypnotoad -s server.pl
}}}
== 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

@@ -1,315 +0,0 @@
#! /usr/bin/perl
# 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
# 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/>.
package OddMuse;
use LWP::UserAgent;
use HTML::TreeBuilder;
use JSON::PP;
use utf8;
# load Oddmuse core
$RunCGI = 0;
do "wiki.pl";
# 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 toc {
# start with the homepage
my @values;
my %labels;
for my $id (GetPageContent($HomePage) =~ /\* \[\[(.*?)\]\]/g) {
push @values, $id;
for my $item (GetPageContent(FreeToNormal($id)) =~ /(\*+ [^][\n]*)$/mg) {
my $value = $item;
my $label = $item;
$value =~ s/\* *//g;
push @values, $value;
$label =~ s/\* *//g; # EM SPACE
$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++;
# handle blogspot domain munging
$item =~ s/blogspot(\.[a-z]+)+/blogspot.com/;
$blog{$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,
-linebreak=>'true');
}
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=>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") . ".)");
print html_toc();
print $q->submit('go', 'Add!');
print $q->end_form();
}
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', 'title');
$h = $tree->look_down('_tag', 'h1') unless $h;
$h = $h->as_text if $h;
return $h;
}
sub post_addition {
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, $summary, $url, GetParam('stars', '')) if $id eq $toc;
my $data = GetPageContent(FreeToNormal($id));
while ($data =~ /(\*+ ([^][\n]*))$/mg) {
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, $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\]$summary$stars/;
} else {
$data = "* [$url $name]$summary$stars\n" . $data;
}
my $ua = LWP::UserAgent->new;
my %params = (text => $data,
title => $id,
summary => $name,
username => GetParam('username'),
pwd => GetParam('pwd'));
# spam fighting modules
$params{$QuestionaskerSecretKey} = 1 if $QuestionaskerSecretKey;
$params{$HoneyPotOk} = time if $HoneyPotOk;
my $response = $ua->post($site, \%params);
if ($response->is_error) {
print $q->p("The submission failed!");
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; #
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'});
my $url = 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 or not $toc) {
default();
} elsif (not $confirm) {
confirm($url, $name, $toc);
} else {
post_addition($url, $name, $toc, $summary);
}
print_end_of_page();
}
}
__DATA__

View File

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

70
contrib/campaignwiki/add-link.pl Executable file → Normal file
View File

@@ -1,6 +1,6 @@
#! /usr/bin/perl
# Copyright (C) 20112014 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
@@ -25,11 +25,22 @@ use utf8;
$RunCGI = 0;
do "wiki.pl";
# globals
my $self = "http://campaignwiki.org/add-link";
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
@@ -37,6 +48,13 @@ my $stardata = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3e
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;
@@ -62,9 +80,7 @@ sub top {
for my $id (GetPageContent($HomePage) =~ /\* \[\[(.*?)\]\]/g) {
for my $item (GetPageContent(FreeToNormal($id)) =~ /^\*+\s+\[(https?:\/\/[^\/\n\t ]+)/mg) {
$n++;
# handle blogspot domain munging
$item =~ s/blogspot(\.[a-z]+)+/blogspot.com/;
$blog{$item}++;
$blog{canonical($item)}++;
}
}
print $q->p("Total links counted: $n.");
@@ -127,6 +143,32 @@ sub default {
print $q->end_form();
}
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]);
}
}
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 "
@@ -230,8 +272,7 @@ 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));
}
@@ -251,6 +292,7 @@ sub main {
Init(); # read config file (no modules!)
$ScriptName = $site; # undo setting in the config file
$FullUrl = $site; #
InitPageVariables(); # call again: $ScriptName was wrong
binmode(STDOUT,':utf8');
$q->charset('utf8');
if ($q->path_info eq '/source') {
@@ -286,13 +328,15 @@ sub main {
$UserGotoBar = $q->a({-href=>$q->url . '/source'}, 'Source');
print GetHeader('', 'Submit a new link');
print $q->start_div({-class=>'content index'});
my $url = 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 or not $toc) {
if (not $url) {
default();
} elsif (not $toc) {
default() if not is_duplicate($url);
} elsif (not $confirm) {
confirm($url, $name, $toc);
} else {

14
contrib/campaignwiki/delete.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
if test -z "$2" -o ! -z "$3"; then
echo "Usage: delete.sh USERNAME WIKI"
exit 1
fi
username=$1
wiki=$2
for p in $(curl --silent "https://campaignwiki.org/wiki/$wiki?action=index;raw=1"); do
echo "Deleting: $p"
curl -F frodo=1 -F "title=$p" -F text=DeletedPage -F summary=Deleted -F username="$username" "https://campaignwiki.org/wiki/$wiki"
sleep 5
done

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;

93
contrib/emacswiki/bootstrap.js vendored Normal file
View File

@@ -0,0 +1,93 @@
// Public Domain
// initial version by Alex Schroeder <alex@gnu.org>
// with many improvements by Evgkeni Sampelnikof
$(function(){
// add fancy classes
$('div.header' ).addClass('container');
$('div.wrapper').addClass('container');
$('div.footer' ).addClass('container');
$('div.footer > .navbar' ).remove();
$('.message > p' ).addClass('alert');
$('img.portrait').addClass('img-polaroid');
$('input:text').addClass('input-medium search-query');
$('textarea').addClass('span12');
$('input:submit').addClass('btn');
$('.download a').addClass('btn btn-success');
$('.footer .gotobar').remove();
$('.footer br').first().remove();
var $gotobar = $('.gotobar')
.after($('<div>').attr('class','navbar')
.append($('<div>').attr('class','navbar-inner')
.append($('<ul>').attr('class', 'nav'))));
var $id = $('h1 a').first().text();
var $list = $('.nav')
.append($('<li>')
.append($('<a>').attr('class', 'brand').attr('href', 'http://www.emacswiki.org/')
.append('Emacs Wiki')));
$('.gotobar a').each(function() {
var $item = $('<li>');
$(this).appendTo($item);
$item.appendTo($list);
if ($(this).text() == $id) {
$item.addClass('active');
}
});
$gotobar.remove();
// search without labels, without button, without language field
$('form.search input[type=submit]').remove();
$('form.search label').remove();
$('form.search input#searchlang').remove();
$('form.search')
.css({'float': 'right',
'margin-top': '10px'});
$('.navbar').append($('form.search'));
// add button style to some links
$('.edit.bar a').addClass('btn');
// add color to Talk button for a non-existing page
$('a.btn.comment.edit').addClass('btn-warning');
// move article link and talk link below title
var $link = $('a.original').add('a.comment');
if ($link) {
$('.header h1').after($('<p>').append($link));
}
// toc
if ($('title').text() == "EmacsWiki: Wikified Emacs Lisp List") {
$('.content').addClass('ell');
}
// tables
$('table').addClass('table');
// minor edit checkbox
$('input[type=checkbox]').addClass('checkbox');
$('input[type=checkbox]').parent().addClass('checkbox');
// clean up admin page
$('li a.clear').parent().remove();
$('li a.index').parent().remove();
$('a[href="http://creativecommons.org/licenses/GPL/2.0/"]')
.parent()
.css({'margin-right': '120px',
'opacity': 0.3,
'padding-top': '1em'});
$('.footer .bar')
.after('<hr />');
var footer_wrapper = $('<div/>')
.addClass('footer_wrapper');
var footer = $('.footer.container');
footer.after(footer_wrapper);
footer_wrapper.append(footer);
var logo_image = $('<img />')
.attr('src', 'http://emacswiki.org/ew_logo.png');
$('.header .navbar .brand').html(logo_image);
});

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)

View File

@@ -3,7 +3,7 @@
#
# 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
# 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,
@@ -12,10 +12,7 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use CGI;
use CGI::Carp qw(fatalsToBrowser);

131
contrib/no-flickr.pl Normal file
View File

@@ -0,0 +1,131 @@
#! /usr/bin/perl -w
# Copyright (C) 2005-2016 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 Modern::Perl;
use LWP::UserAgent;
use utf8;
binmode(STDOUT, ":utf8");
my $ua = LWP::UserAgent->new;
sub url_encode {
my $str = shift;
return '' unless $str;
utf8::encode($str); # turn to byte string
my @letters = split(//, $str);
my %safe = map {$_ => 1} ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '-', '_', '.', '!', '~', '*', "'", '(', ')', '#');
foreach my $letter (@letters) {
$letter = sprintf("%%%02x", ord($letter)) unless $safe{$letter};
}
return join('', @letters);
}
sub get_raw {
my $uri = shift;
my $response = $ua->get($uri);
return $response->content if $response->is_success;
}
sub get_wiki_page {
my ($wiki, $id, $password) = @_;
my $parameters = [
pwd => $password,
action => 'browse',
id => $id,
raw => 1,
];
my $response = $ua->post($wiki, $parameters);
return $response->decoded_content if $response->is_success;
die "Getting $id returned " . $response->status_line;
}
sub get_wiki_index {
my $wiki = shift;
my $parameters = [
search => "flickr.com",
context => 0,
raw => 1,
];
my $response = $ua->post($wiki, $parameters);
return $response->decoded_content if $response->is_success;
die "Getting the index returned " . $response->status_line;
}
sub post_wiki_page {
my ($wiki, $id, $username, $password, $text) = @_;
my $parameters = [
username => $username,
pwd => $password,
recent_edit => 'on',
text => $text,
title => $id,
];
my $response = $ua->post($wiki, $parameters);
die "Posting to $id returned " . $response->status_line unless $response->code == 302;
}
my %seen = ();
sub write_flickr {
my ($id, $flickr, $dir, $file) = @_;
say "Found $flickr";
warn "$file was seen before: " . $seen{$file} if $seen{$file};
die "$file contains unknown characters" if $file =~ /[^a-z0-9_.]/;
$seen{$file} = "$id used $flickr";
my $bytes = get_raw($flickr) or die("No data for $id");
open(my $fh, '>', "$dir/$file") or die "Cannot write $dir/$file";
binmode($fh);
print $fh $bytes;
close($fh);
}
sub convert_page {
my ($wiki, $pics, $dir, $username, $password, $id) = @_;
say $id;
my $text = get_wiki_page($wiki, $id, $password);
my $is_changed = 0;
while ($text =~ m!(https://[a-z0-9.]+.flickr.com/(?:[a-z0-9.]+/)?([a-z0-9_]+\.(?:jpg|png)))!) {
my $flickr = $1;
my $file = $2;
write_flickr($id, $flickr, $dir, $file);
$is_changed = 1;
my $re = quotemeta($flickr);
$text =~ s!$flickr!$pics/$file!g;
}
if ($is_changed) {
post_wiki_page($wiki, $id, $username, $password, $text);
} else {
# die "$id has no flickr matches?\n$text";
}
sleep(5);
}
sub convert_site {
my ($wiki, $pics, $dir, $username, $password) = @_;
my @ids = split(/\n/, get_wiki_index($wiki));
for my $id (@ids) {
convert_page($wiki, $pics, $dir, $username, $password, $id);
}
}
our $AdminPass;
do "/home/alex/password.pl";
convert_site('https://alexschroeder.ch/wiki',
'https://alexschroeder.ch/pics',
'/home/alex/alexschroeder.ch/pics',
'Alex Schroeder',
$AdminPass);

File diff suppressed because it is too large Load Diff

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

View File

@@ -1,168 +0,0 @@
;;; 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).

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

@@ -0,0 +1,539 @@
/* This file is in the public domain. */
body, rss {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, 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;
}

536
css/alex-2016.css Normal file
View File

@@ -0,0 +1,536 @@
/* This file is in the public domain. */
html{ text-align: center; }
body, rss {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-style: normal;
font-size: 14pt;
padding: 1em 3em;
max-width: 72ex;
display: inline-block;
text-align: left;
color: #000;
background-color: #fff;
}
@media print {
body {
font-size: 12pt;
}
/* 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 {
font-style: italic;
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 img { height: 50%; width: 50%; }
.face img { width: 200px; }
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; }
/* 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;
}

544
css/alex-2017.css Normal file
View File

@@ -0,0 +1,544 @@
/* This file is in the public domain. */
html{ text-align: center; }
body, rss {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-style: normal;
font-size: 14pt;
padding: 1em 3em;
max-width: 72ex;
display: inline-block;
text-align: left;
color: #000;
background-color: #fff;
}
@import url(file:///home/alex/alexschroeder.ch/css/alex-2017.css) print;
@media print {
body {
font-size: 12pt;
}
/* 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 {
font-style: italic;
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 {
border: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 1em;
margin: 1em 2em;
}
table tr td, table 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 img { height: 50%; width: 50%; }
.face img { width: 200px; }
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; }
/* mastodon */
div.mastodon { padding: 0 2em }
div.mastodon .status {padding-top: 1ex; border-bottom: 1px solid grey;}
div.mastodon .status:first-child {border-top: 1px solid grey;}
/* rss */
channel * { display: block; }
channel title {
margin-top: 30pt;
}
copyright {
font-size: 14pt;
margin-top: 1em;
}
channel:before {
font-size: 14pt;
display: block;
margin: 1em;
padding: 0.5em;
content: "This document is to be read in a feed reader. The item content is escaped HTML, which makes it hard to read for humans. Sorry!";
color: red;
border: 1px solid red;
}
license {
font-size: 11pt;
margin-bottom: 9pt;
}
contributor:before { content: "Last edited by "; }
contributor:after { content: "."; }
generator:before { content: "Feed generated by "; }
generator:after { content: "."; }
channel description {
font-weight: bold;
}
item description {
font-weight: normal;
margin-bottom: 1em;
}
link, managingEditor, webMaster, license, url,
docs, language,
pubDate, lastBuildDate, ttl, guid, category, comments,
docs, image title, image link,
status, version, diff, history, importance {
display: none;
}

615
css/alex-2018.css Normal file
View File

@@ -0,0 +1,615 @@
/* This file is in the public domain. */
html{ text-align: center; }
body, rss {
font-family: "DejaVu Serif", Palatino, serif;
font-style: normal;
font-size: 16pt;
padding: 1em 3em;
max-width: 72ex;
display: inline-block;
text-align: left;
color: #000;
background-color: #fff;
}
@media only screen and (max-device-width: 600px) {
body {
padding: 1ex;
}
textarea {
font-size: inherit;
}
}
/* code */
textarea, pre, code, tt {
font-family: "DejaVu Mono", "Andale Mono", Monaco, "Courier New", Courier, monospace;
}
pre, code, tt {
font-size: 12pt; /* fits 80ex */
}
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+ */
}
@import url(file:///home/alex/alexschroeder.ch/css/alex-2017.css) print;
@media print {
body {
font-size: 12pt;
}
/* 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;
}
.header input {
width: 10ex;
}
/* other form fields */
input[type="text"] {
padding: 0;
font-size: 80%;
line-height: 125%;
}
/* 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;
}
/* Recent Changes */
div.rc {
overflow: hidden;
}
div.rc li + li {
margin-top: 1em;
}
div.rc li strong, table.history strong, strong.description {
font-family: inherit;
font-weight: inherit;
}
.red {
background: red;
color: red;
}
.orange {
background: orange;
color: orange;
}
.yellow {
background: yellow;
color: yellow;
}
.green {
background: green;
color: green;
}
.blue {
background: blue;
color: blue;
}
.indigo {
background: indigo;
color: indigo;
}
.violet {
background: violet;
color: violet;
}
.white {
background: white;
color: white;
}
.ip-code {
border: 1px solid #666;
}
/* Diff */
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 {
font-style: italic;
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 {
border: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
padding: 1em;
margin: 1em 2em;
}
table tr td, table 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 img { height: 50%; width: 50%; }
.face img { width: 200px; }
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; }
/* mastodon */
div.mastodon { padding: 0 2em }
div.mastodon .status {padding-top: 1ex; border-bottom: 1px solid grey;}
div.mastodon .status:first-child {border-top: 1px solid grey;}
/* terminal "screenshots" */
.terminal {
width: 80%;
margin: 50px auto 100px auto;
padding: 5px;
font-size: 62%; /* fits 80ex */
border: 1px solid #999;
border-radius: 5px;
box-shadow: 0px 25px 50px #999;
}
/* rss */
channel * { display: block; }
channel title {
margin-top: 30pt;
}
copyright {
font-size: 14pt;
margin-top: 1em;
}
channel:before {
font-size: 14pt;
display: block;
margin: 1em;
padding: 0.5em;
content: "This document is to be read in a feed reader. The item content is escaped HTML, which makes it hard to read for humans. Sorry!";
color: red;
border: 1px solid red;
}
license {
font-size: 11pt;
margin-bottom: 9pt;
}
contributor:before { content: "Last edited by "; }
contributor:after { content: "."; }
generator:before { content: "Feed generated by "; }
generator:after { content: "."; }
channel description {
font-weight: bold;
}
item description {
font-weight: normal;
margin-bottom: 1em;
}
link, managingEditor, webMaster, license, url,
docs, language,
pubDate, lastBuildDate, ttl, guid, category, comments,
docs, image title, image link,
status, version, diff, history, importance {
display: none;
}

View File

@@ -321,7 +321,6 @@ div.sister {
float:left;
margin-right:1ex;
padding-right:1ex;
border-right:1px dashed;
}
div.sister p { padding:1ex; margin:0; }
div.sister hr { display:none; }

View File

@@ -8,110 +8,8 @@
@import url(https://fonts.googleapis.com/css?family=Noticia+Text:400,400italic,700italic,700&subset=latin,latin-ext); */
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
/* vietnamese */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 700;
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
font-family: 'Symbola';
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff');
}
body {
font-family: "Noticia Text", Symbola, serif;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 14pt;
color: #000;
background-color: #eed;
@@ -119,16 +17,20 @@ body {
}
textarea, pre, code, tt {
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
font-size: 80%;
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
font-size: 80%;
}
@media print {
body {
background-color: white;
background-color: white;
font-family: Times, serif;
font-size:10pt;
}
/* Printing from Firefox */
svg {
transform: translate(-1.5cm, -1cm);
}
}
/* iPhone */
@@ -149,9 +51,10 @@ textarea, pre, code, tt {
.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%; }
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form
.header input[type="submit"] { position: absolute; visibility: hidden; } */
.header input { width: 6em; font-size: 80%; }
.header input[type="checkbox"] { width: 1em; }
.footer { clear:both; font-size: 90%; }
.content input { font-size: 80%; line-height: 125%; }
@@ -175,9 +78,9 @@ input#mail, input#homepage, input#username {
/* titles */
h1 {
font-weight: bold;
font-size: 150%;
padding: 1em 0;
font-weight: bold;
font-size: 150%;
padding: 1em 0;
}
h1 a:link, h1 a:visited {
color: inherit;
@@ -217,7 +120,7 @@ a:active {
border: 1px solid #9d8;
border-radius: 5px;
box-shadow: 0px 1px 3px white inset,
0px 1px 3px black;
0px 1px 3px black;
}
.button a {
text-decoration: none;
@@ -231,48 +134,23 @@ a:active {
font-weight: normal;
}
a.edit, div.footer, form, span.gotobar, a.number span { display:none; }
a[class="url number"]:after, a[class="inter number"]:after {
content:"[" attr(href) "]";
}
a[class="local number"]:after { content:"[" attr(title) "]"; }
img[smiley] { line-height: inherit; }
}
/* edit paragraphs */
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;
}
}
table a.pencil {
position: absolute;
right: inherit;
}
/* edit paragraphs: no more */
a.pencil { display: none; }
/* table of contents */
.toc {
font-size: smaller;
border-left: 1em solid #886;
font-size: smaller;
border-left: 1em solid #886;
}
.toc ol {
list-style-type: none;
padding-left: 1em;
list-style-type: none;
padding-left: 1em;
}
.toc a {
font-weight: normal;
font-weight: normal;
}
/* images with links, captions, etc */
@@ -310,6 +188,8 @@ img.logo {
border: 1px solid black;
}
.hexmap a img { background: #fff; border: none; }
/* fancy bold underline */
em.underline { font-weight: bold; }
@@ -326,26 +206,28 @@ div.message {
}
table.history { border-style:none; }
td.history { border-style:none; }
div.history span.dash + strong { font-weight: normal; }
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; }
div.rc li strong { font-weight: normal; }
/* Tables */
table.user {
margin: 1em 0;
padding: 0 1em;
border-top: 1px solid black;
border-bottom: 1px solid black;
margin: 1em 0;
padding: 0 1em;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
div.aside table.user {
margin: 1em 0;
padding: 0;
margin: 1em 0;
padding: 0;
}
table.user td, table.user th {
border-style: none;
padding:5px 10px;
vertical-align: top;
border-style: none;
padding:5px 10px;
vertical-align: top;
}
table.user th { font-weight:bold; }
table.user td.r { text-align:right; }
@@ -356,7 +238,7 @@ table.user td.mark { background-color:yellow; }
tr:empty { display: block; height: 0.5em; }
@media print {
table {
font-size: 9pt;
font-size: 9pt;
margin: 0;
}
table.user td, table.user th {

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

@@ -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,281 @@
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;
}
.red {
background: red;
color: red;
}
.orange {
background: orange;
color: orange;
}
.yellow {
background: yellow;
color: yellow;
}
.green {
background: green;
color: green;
}
.blue {
background: blue;
color: blue;
}
.indigo {
background: indigo;
color: indigo;
}
.violet {
background: violet;
color: violet;
}
.white {
background: white;
color: white;
}
.ip-code {
border: 1px solid #666;
}
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;
}
/* for https://oddmuse.org/wiki/All_Modules */
.foo_list + .journal h1 {
font: inherit;
border: none;
display: list-item;
margin-top: 0;
margin-left: 1em;
}
.foo_list + .journal a {
font: inherit;
border: none;
text-decoration: none;
color: #a00;
}
/* 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

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

15
logo/falky/README.md Normal file
View File

@@ -0,0 +1,15 @@
Falky schreibt:
Zum Thema Rechte am Logo möchte ich erstmal sagen, dass es mir primär
darum ging den Auftritt von oddmuse.org aufzuhübschen. Also du/ihr
sollt durch das Logo unterstützt werden, nicht eingeschränkt.
Welche Lizenz das ab besten leisten, da hab ich keinen Schimmer.
Schön wäre, wenn irgendwo ein verweis auf "Falky [falky.de]"
auftaucht, der soll aber nicht bei jeder Verwendung auftauchen,
sondern irgendwo 'auffindbar' an 'zentraler' Stelle - halt irgendwo
auf der Homepage, dass ich darauf verweisen kann und dass niemand was
anderes behaupten kann. Das wäre es schon. Und ja, falls jemand das
logo für ein anderes Projekt verwenden möchte, kann man ja höflich
nochmal fragen oder so.

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-61 -1 177 62">
<rect fill="#FFF" x="-60" y="0" width="175" height="60"/>
<text style="font:400 6px Neris Black" fill="#000" x="2" y="18">powered by</text>
<text style="font:400 16px Neris Thin" fill="#000" x="2" y="34">Oddmuse<tspan style="font-family:Neris Black">.org</tspan></text>
<g id="new" transform="translate(-30,30) scale(.18,.18)" >
<circle fill="#FFF" stroke="#000" stroke-width="3" cx="0" cy="0" r="160.5"/>
<g id="new" transform="rotate(207.2)" >
<path fill="#000" d="m42 -77 q24 0 38 20 c14 -1 42 -18 52 -29 c-1 50 -26 68 -44 70 c0 90 -44 141 -88 141 c-44 0 -88 -51 -88 -141 c-18 -2 -43 -20 -44 -70 c10 11 38 28 52 29 q14 -20 38 -20z"/>
<path fill="#000" transform="translate(0,60) rotate(-14)" d="m -22 46q1 50 22 50q21 0 22 -50z"/>
<path stroke="#FFF" stroke-width="4" fill="#000" d="m0 17 c 30 0 36 -2 46 -2 c 18 0 32 16 32 51 c 0 34 -12 50 -32 50 c-16 0 -26 -5 -46 -5 c-20 0 -30 5 -46 5 c-20 0 -33 -18 -32 -50 c0 -36 16 -52 32 -51 c10 0 16 2 46 2z"/>
<circle fill="#FFF" cx="44" cy="49" r="12"/> <circle fill="#FFF" cx="-44" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#000" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g></g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
logo/falky/oddmuse.icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-100 -100 200 200" >
<rect fill="#D88" x="-100" y="-100" width="200" height="200"/>
<g id="new" transform="rotate(180) translate(0,-19)" >
<path fill="#A00" d="m42 -77 q18 0 33 14 q 12 -6 23 -16 q-2 25 -10 43 c0 110 -44 155 -88 155 c-44 0 -88 -44 -88 -155 q-8 -18 -10 -43 q11 10 23 16 q15 -14 33 -14z"/>
<path stroke="#FFF" stroke-width="6" fill="#A00" d="m0 16 c30 0 38 -2 48 -2 c17 0 33 16 33 52 c0 34 -12 52 -31 52 c-15 0 -30 -7 -50 -7 c-20 0 -35 7 -50 7 c-19 0 -31 -18 -31 -52 c0 -36 16 -52 33 -52 c10 0 18 2 48 2z"/>
<circle fill="#FFF" cx="45" cy="49" r="12"/> <circle fill="#FFF" cx="-45" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#666" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
logo/falky/oddmuse.logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-162 -162 324 324">
<circle fill="#FEE" stroke="#000" stroke-width="3" cx="0" cy="0" r="160.5"/>
<g id="new" transform="rotate(210)" >
<path fill="#A00" d="m42 -77 q24 0 38 20 c14 -1 42 -18 52 -29 c-1 50 -26 68 -44 70 c0 90 -44 141 -88 141 c-44 0 -88 -51 -88 -141 c-18 -2 -43 -20 -44 -70 c10 11 38 28 52 29 q14 -20 38 -20z"/>
<path fill="#A00" transform="translate(0,60) rotate(-14)" d="m -22 46q1 50 22 50q21 0 22 -50z"/>
<path stroke="#FFF" stroke-width="4" fill="#D88" d="m0 17 c 30 0 36 -2 46 -2 c 18 0 32 16 32 51 c 0 34 -12 50 -32 50 c-16 0 -26 -5 -46 -5 c-20 0 -30 5 -46 5 c-20 0 -33 -18 -32 -50 c0 -36 16 -52 32 -51 c10 0 16 2 46 2z"/>
<circle fill="#FFF" cx="44" cy="49" r="12"/> <circle fill="#FFF" cx="-44" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#666" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-162 -162 324 324">
<circle fill="#FFF" stroke="#000" stroke-width="3" cx="0" cy="0" r="160.5"/>
<text style="font:400 27px Neris Black" fill="#000" text-anchor="middle" x="-5" y="137">Oddmuse</text>
<g id="new" transform="rotate(210)" >
<path fill="#000" d="m42 -77 q24 0 38 20 c14 -1 42 -18 52 -29 c-1 50 -26 68 -44 70 c0 90 -44 141 -88 141 c-44 0 -88 -51 -88 -141 c-18 -2 -43 -20 -44 -70 c10 11 38 28 52 29 q14 -20 38 -20z"/>
<path fill="#000" transform="translate(0,60) rotate(-14)" d="m -22 46q1 50 22 50q21 0 22 -50z"/>
<path stroke="#FFF" stroke-width="4" fill="#000" d="m0 17 c 30 0 36 -2 46 -2 c 18 0 32 16 32 51 c 0 34 -12 50 -32 50 c-16 0 -26 -5 -46 -5 c-20 0 -30 5 -46 5 c-20 0 -33 -18 -32 -50 c0 -36 16 -52 32 -51 c10 0 16 2 46 2z"/>
<circle fill="#FFF" cx="44" cy="49" r="12"/> <circle fill="#FFF" cx="-44" cy="49" r="12"/>
<circle fill="#FFF" cx="42" cy="-31" r="40"/> <circle fill="#000" cx="42" cy="-31" r="20.5"/>
<circle fill="#FFF" cx="-42" cy="-31" r="40"/> <path fill="#000" transform="translate(-42,-31) rotate(55)" d="m-7 7 v20 q7 2 14 0 v-20 h20 q2 -7 0 -14 h-20 v-20 q -7 -2 -14 0 v20 h-20 q-2 7 0 14z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
logo/falky/testmonial.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

4
logo/murray/README.md Normal file
View File

@@ -0,0 +1,4 @@
The logo is licensed under the [GNU Free Documentation
License](http://www.emacswiki.org/FDL) as well as the [CC BY
2.0](http://creativecommons.org/licenses/by/2.0/) license. The author
is [Murray Altheim](http://www.altheim.com/murray/).

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="0.41"
sodipodi:docname="oddmuse-logo.svg"
sodipodi:docbase="/Users/alex/Pictures/Oddmuse"
height="1000pt"
width="1000pt"
sodipodi:version="0.32"
id="svg1">
<metadata
id="metadata32">
<rdf:RDF
id="RDF34">
<cc:Work
id="Work36"
rdf:about="">
<dc:format
id="format38">image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage"
id="type40" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3" />
<sodipodi:namedview
inkscape:current-layer="svg1"
inkscape:window-y="22"
inkscape:window-x="0"
inkscape:window-height="535"
inkscape:window-width="640"
inkscape:cy="625.00000"
inkscape:cx="625.00000"
inkscape:zoom="0.28960000"
id="base" />
<g
transform="translate(-155.7935,22.13440)"
id="g176">
<path
transform="matrix(1.021740,0.000000,0.000000,1.021740,-299.4160,85.75640)"
sodipodi:ry="148.93437"
sodipodi:rx="142.30524"
sodipodi:cy="475.27606"
sodipodi:cx="1066.8474"
d="M 1209.1526 475.27606 A 142.30524 148.93437 0 1 1 924.54218,475.27606 A 142.30524 148.93437 0 1 1 1209.1526 475.27606 z"
id="path166"
style="fill:#ffde00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:22.021299;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
<path
transform="matrix(0.591973,0.000000,0.000000,0.523224,159.0800,309.0390)"
sodipodi:ry="148.93437"
sodipodi:rx="142.30524"
sodipodi:cy="475.27606"
sodipodi:cx="1066.8474"
d="M 1209.1526 475.27606 A 142.30524 148.93437 0 1 1 924.54218,475.27606 A 142.30524 148.93437 0 1 1 1209.1526 475.27606 z"
id="path168"
style="fill:#ffde00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:38.609402;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
<rect
transform="translate(-1.416020,0.000000)"
y="561.16870"
x="694.39026"
height="88.691116"
width="195.30150"
id="rect170"
style="font-size:12.000000;fill:#ffde00;fill-opacity:1.0000000;fill-rule:evenodd;stroke-width:1.0000000pt" />
<g
id="g173">
<path
transform="translate(185.0000,-158.7500)"
sodipodi:ry="31.250000"
sodipodi:rx="25.000000"
sodipodi:cy="783.75000"
sodipodi:cx="565.00000"
d="M 590.00000 783.75000 A 25.000000 31.250000 0 1 1 540.00000,783.75000 A 25.000000 31.250000 0 1 1 590.00000 783.75000 z"
id="path171"
style="fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
<path
transform="translate(266.2500,-158.7500)"
sodipodi:ry="31.250000"
sodipodi:rx="25.000000"
sodipodi:cy="783.75000"
sodipodi:cx="565.00000"
d="M 590.00000 783.75000 A 25.000000 31.250000 0 1 1 540.00000,783.75000 A 25.000000 31.250000 0 1 1 590.00000 783.75000 z"
id="path172"
style="fill:#000000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
sodipodi:type="arc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -3,7 +3,7 @@
#
# 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
# 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,
@@ -12,10 +12,7 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
package OddMuse;
@@ -27,7 +24,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
AddModuleDescription('aawrapperdiv.pl', 'WrapperDiv Module');
*OldGetHeader = *GetHeader;
*GetHeader = *WrapperGetHeader;
sub WrapperGetHeader {
my ($id, $title, $oldId, $nocache, $status) = @_;
my $result = OldGetHeader ($id, $title, $oldId, $nocache, $status);
$result .= $q->start_div({-class=>'wrapper'});
}
*OldPrintFooter = *PrintFooter;
*PrintFooter = *WrapperPrintFooter;
sub WrapperPrintFooter {
my ($id, $rev, $comment) = @_;
print $q->start_div({-class=>'wrapper close'});
print $q->end_div(), $q->end_div();
OldPrintFooter($id, $rev, $comment);
}

View File

@@ -13,13 +13,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/>.
package OddMuse;
use strict;
use v5.10;
AddModuleDescription('accesskeys.pl', 'Links With AccessKeys Extension');
our (@MyRules, $FreeLinkPattern);
push(@MyRules, \&LinksWithAccessKeys);
sub LinksWithAccessKeys {
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cog) {
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cg) {
my ($id, $key) = ($2, $3);
Dirty($1);
$id = FreeToNormal($id);
@@ -32,5 +35,5 @@ sub LinksWithAccessKeys {
}
return ''; # this is a dirty rule that depends the definition of other pages
}
return undef; # the rule didn't match
return; # the rule didn't match
}

View File

@@ -2,7 +2,7 @@
#
# 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
# 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,
@@ -11,10 +11,12 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
our ($q, %Page, %Action, $IndexFile, $PageDir, $KeepDir, @MyAdminCode, $RefererDir);
AddModuleDescription('admin.pl', 'Admin Power Extension');
@@ -31,15 +33,15 @@ sub AdminPowerDelete {
OpenPage($id);
my $status = DeletePage($id);
if ($status) {
print $q->p(GetPageLink($id) . ' ' . T('not deleted: ')) . $status;
print $q->p(GetPageLink($id) . ' ' . T('not deleted:') . ' ' . $status);
} else {
print $q->p(GetPageLink($id) . ' ' . T('deleted'));
WriteRcLog($id, Ts('Deleted %s', $id), 0, $Page{revision},
GetParam('username', ''), GetRemoteHost(), $Page{languages},
GetParam('username', ''), $q->remote_addr(), $Page{languages},
GetCluster($Page{text}));
}
# Regenerate index on next request
unlink($IndexFile);
Unlink($IndexFile);
ReleaseLock();
print $q->p(T('Main lock released.'));
PrintFooter();
@@ -56,38 +58,38 @@ sub AdminPowerRename {
print $q->p(T('Main lock obtained.'));
# page file -- only check for existing or missing pages here
my $fname = GetPageFile($id);
ReportError(Ts('The page %s does not exist', $id), '400 BAD REQUEST') unless -f $fname;
ReportError(Ts('The page %s does not exist', $id), '400 BAD REQUEST') unless IsFile($fname);
my $newfname = GetPageFile($new);
ReportError(Ts('The page %s already exists', $new), '400 BAD REQUEST') if -f $newfname;
ReportError(Ts('The page %s already exists', $new), '400 BAD REQUEST') if IsFile($newfname);
# Regenerate index on next request -- remove this before errors can occur!
unlink($IndexFile);
Unlink($IndexFile);
# page file
CreateDir($PageDir); # It might not exist yet
rename($fname, $newfname)
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);
CreateDir($KeepDir); # It might not exist yet (only the parent directory!)
rename($kdir, $newkdir)
Rename($kdir, $newkdir)
or ReportError(Tss('Cannot rename %1 to %2', $kdir, $newkdir) . ": $!", '500 INTERNAL SERVER ERROR')
if -d $kdir;
if IsDir($kdir);
# refer file
if (defined(&GetRefererFile)) {
my $rdir = GetRefererFile($id);
my $newrdir = GetRefererFile($new);
CreateDir($RefererDir); # It might not exist yet
rename($rdir, $newrdir)
Rename($rdir, $newrdir)
or ReportError(Tss('Cannot rename %1 to %2', $rdir, $newrdir) . ": $!", '500 INTERNAL SERVER ERROR')
if -d $rdir;
if IsDir($rdir);
}
# 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/>.
use strict;
use v5.10;
AddModuleDescription('adsense.pl', 'AdSense Module');
use vars qw($AdSensePageName $AdSensePlace);
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

@@ -12,14 +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/>.
package OddMuse;
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;
*AdvancedUploadsOldGetTextArea = \&GetTextArea;
*GetTextArea = \&AdvancedUploadsNewGetTextArea;
sub AdvancedUploadsNewGetTextArea {
my ($name, $text, $rows) = @_;

View File

@@ -2,7 +2,7 @@
#
# 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
# 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,
@@ -11,14 +11,15 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('age.pl', 'Age Indication Extension');
use vars qw(%AgeEffect $AgeParameter);
our (%Page, $Now, $ScriptName);
our (%AgeEffect, $AgeParameter);
# map page age to theme
%AgeEffect = (60*60*24 => 'day',
@@ -31,8 +32,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 +47,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

@@ -2,7 +2,7 @@
#
# 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
# 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,
@@ -11,17 +11,19 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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 +63,7 @@ sub AggregateRule {
($_, pos) = ($old_, $oldpos); # restore \G (assignment order matters!)
return '';
}
return undef;
return;
}
$Action{aggregate} = \&DoAggregate;
@@ -121,8 +123,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 +133,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";

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

@@ -0,0 +1,116 @@
# 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 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;
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

@@ -2,7 +2,7 @@
#
# 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
# 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,
@@ -11,16 +11,18 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
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());
@@ -32,8 +34,8 @@ sub DoPrintAllPages {
PrintFooter();
}
*OldAllScriptLink = *ScriptLink;
*ScriptLink = *NewAllScriptLink;
*OldAllScriptLink = \&ScriptLink;
*ScriptLink = \&NewAllScriptLink;
sub NewAllScriptLink {
my ($action, $text, $class, $name, $title, $accesskey, $nofollow) = @_;
@@ -41,6 +43,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/>.
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(@_);
}

View File

@@ -2,7 +2,7 @@
#
# 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
# 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,
@@ -11,14 +11,15 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('antispam.pl', 'Antispam Module');
use vars qw($DoMaskEmail $CreateMailtoLinks);
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 +28,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 +63,5 @@ sub MaskEmailRule {
}
return $email;
}
return undef;
return;
}

View File

@@ -2,7 +2,7 @@
#
# 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
# 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,
@@ -11,15 +11,17 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('archive.pl', 'Archive Extension');
*OldArchiveGetHeader = *GetHeader;
*GetHeader = *NewArchiveGetHeader;
our ($q);
*OldArchiveGetHeader = \&GetHeader;
*GetHeader = \&NewArchiveGetHeader;
# this assumes that *all* calls to GetHeader will print!
sub NewArchiveGetHeader {
@@ -32,7 +34,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"),

View File

@@ -13,11 +13,15 @@
# 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);
use vars qw($AskPage $QuestionPage $NewQuestion);
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_';
@@ -25,7 +29,7 @@ $NewQuestion = 'Write your question here:';
sub IncrementInFile {
my $filename = shift;
sysopen my $fh, $filename, O_RDWR|O_CREAT or die "can't open $filename: $!";
sysopen my $fh, encode_utf8($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: $!";
@@ -35,8 +39,8 @@ sub IncrementInFile {
return $num;
}
*OldAskPageDoPost=*DoPost;
*DoPost=*NewAskPageDoPost;
*OldAskPageDoPost = \&DoPost;
*DoPost = \&NewAskPageDoPost;
sub NewAskPageDoPost {
my $id = FreeToNormal(shift);
if ($id eq $AskPage and not GetParam('text', undef)) { # comment, not a regular edit
@@ -47,16 +51,18 @@ sub NewAskPageDoPost {
OldAskPageDoPost($id, @_); # keep original functionality for regular edits
}
*OldAskPageGetCommentForm=*GetCommentForm;
*GetCommentForm=*NewAskPageGetCommentForm;
*OldAskPageGetCommentForm = \&GetCommentForm;
*GetCommentForm = \&NewAskPageGetCommentForm;
@MyFooters = map { $_ == \&OldAskPageGetCommentForm ? \&NewAskPageGetCommentForm : $_ } @MyFooters;
sub NewAskPageGetCommentForm {
my ($id, $rev, $comment) = @_;
$NewComment = $NewQuestion if $id eq $AskPage;
my ($id) = @_;
$Translate{'Add your comment here:'} = $NewQuestion if $id eq $AskPage;
OldAskPageGetCommentForm(@_);
}
*OldAskPageJournalSort=*JournalSort;
*JournalSort=NewAskPageJournalSort;
*OldAskPageJournalSort = \&JournalSort;
*JournalSort = \&NewAskPageJournalSort;
sub NewAskPageJournalSort {
return OldAskPageJournalSort() unless $a =~ m/^$QuestionPage\d+$/ and $b =~ m/^$QuestionPage\d+$/;
($b =~ m/$QuestionPage(\d+)/)[0] <=> ($a =~ m/$QuestionPage(\d+)/)[0];

View File

@@ -13,12 +13,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/>.
use strict;
use v5.10;
use XML::Atom;
use XML::Atom::Entry;
use XML::Atom::Link;
use XML::Atom::Person;
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);
sub 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,7 +150,7 @@ sub GetRcAtom {
# Based on DoPost
sub DoAtomSave {
my ($type, $oldid) = @_;
my $entry = AtomEntry();
my $entry = AtomEntry($type);
my $title = $entry->title();
my $author = $entry->author();
SetParam('username', $author->name) if $author; # Used in Save()
@@ -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,10 +26,10 @@ 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');
our (@MyInitVariables, $CommentsPrefix, $EditAllowed, $NoEditFile, %LockOnCreation);
# ....................{ CONFIGURATION }....................
=head1 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) = @_;
@@ -168,11 +171,11 @@ sub UserCanEditAutoLockFix {
return 0 if $id eq 'SampleUndefinedPage' or $id eq T('SampleUndefinedPage')
or $id eq 'Sample_Undefined_Page' or $id eq T('Sample_Undefined_Page');
return 1 if UserIsAdmin() || UserIsEditor();
return 0 if $id ne '' and -f GetLockedPageFile($id);
return 0 if $LockOnCreation{$id} and not -f GetPageFile($id); # new page
return 0 if !$EditAllowed or -f $NoEditFile;
return 0 if $id ne '' and IsFile(GetLockedPageFile($id));
return 0 if $LockOnCreation{$id} and not IsFile(GetPageFile($id)); # new page
return 0 if !$EditAllowed or IsFile($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;
@@ -203,18 +206,17 @@ except where noted.
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This 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 file is distributed in the hope that it will be useful,
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 file; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
along with this program. If not, see <http://www.gnu.org/licenses/>.
=cut

View File

@@ -2,7 +2,7 @@
#
# 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
# 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,
@@ -11,17 +11,20 @@
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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 );
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
@@ -38,8 +41,8 @@ sub BacklinksMenu {
$Action{buildback} = \&BuildBacklinkDatabase;
sub BuildBacklinkDatabase {
print GetHttpHeader('text/plain');
unlink $backfile; # Remove old database
tie my %backhash, 'MLDBM', $backfile or die "Cannot open file $backfile $!\n";
Unlink($backfile); # Remove old database
tie my %backhash, 'MLDBM', encode_utf8($backfile) or die "Cannot open file $backfile $!\n";
log1("Starting Database Store Process ... please wait\n\n");
foreach my $name (AllPagesList()) {
@@ -54,9 +57,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 +87,7 @@ sub BacklinkProcess {
if ($exists) {
push (@backlinks,$resolved) unless (($seen{$resolved}++) or ($resolved eq $name));
}
}
}
return @backlinks;
}
@@ -92,14 +95,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', encode_utf8($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);
}
@@ -111,14 +114,14 @@ sub GetBackLink {
foreach my $backlink (@backlinks) {
my ($class, $resolved, $title, $exists) = ResolveId($backlink);
if (($resolved ne $id) && ($resolved !~ /^($BacklinkBanned)$/)) {
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, T('Internal Page: ' . $resolved)));
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, Ts('Internal Page: %s', $resolved)));
}
}
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 . ", ");

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
use strict;
use v5.10;
AddModuleDescription('backlinks.pl', 'Backlinks Extension');
*OldGetSearchLink = *GetSearchLink;
*GetSearchLink = *NewGetSearchLink;
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

@@ -1,175 +0,0 @@
# Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2014 Aki Goto <tyatsumi@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/>.
=head1 Balanced Page Directories
B<WARNING: This module is 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.
The remaining info for this module is all deprecated.
=over
The ext2 inode specification allows for over 100 trillion files to
reside in a single directory, however because of the current
linked-list directory implementation, only about 10-15 thousand files
can realistically be stored in a single directory. L<haversian-ga on
09 Dec 2002 22:56
PST|http://answers.google.com/answers/threadview?id=122241>
=back
CAUTION: When this extension is installed, your data structure I<must>
change. Make sure you have a backup of your data directory somewhere.
=head2 Finding the right directory
On the command line, finding the right subdirectory can be a problem.
Here's how to use md5sum. Note that the -n option to echo prevents the
trailing newline. Its inclusion would change the checksum.
echo -n HomePage | md5sum | cut -c 1-2
c1
echo -n ホームページ | md5sum | cut -c 1-2
10
=head2 $BalancedPageDirectoriesSize
If you have more than 2560000 pages (w00t!) you might want to set
$BalancedPageDirectoriesSize to 3. This will give you 16× more
directories, which should let you have 40960000 pages. Also, please
let us know about your wiki. :)
=head2 Migration
Once you install the code, reload any page. This should trigger
migration. No output is produced during migration. Migration is
triggered whenever a page file isn't found but a page is found at the
default old location. If, for example, $PageDir/c1/HomePage.pg doesn't
exist but $PageDir/h/HomePage.pg does, and the wiki can be locked, the
wiki is locked and migration is started.
=cut
AddModuleDescription('balanced-page-directories.pl', 'Balanced Page Directories Extension');
use Digest::MD5 qw(md5_hex);
use File::Find qw(finddepth);
use vars qw($BalancedPageDirectoriesSize);
$BalancedPageDirectoriesSize = 2;
*OldBalancedPageDirectoriesGetPageDirectory = *GetPageDirectory;
*GetPageDirectory = *NewBalancedPageDirectoriesGetPageDirectory;
sub NewBalancedPageDirectoriesGetPageDirectory {
my $id = shift;
utf8::encode($id);
return substr(md5_hex($id), 0, $BalancedPageDirectoriesSize);
}
*OldBalancedPageDirectoriesOpenPage = *OpenPage;
*OpenPage = *NewBalancedPageDirectoriesOpenPage;
sub NewBalancedPageDirectoriesOpenPage {
my $id = shift;
if (! -f GetPageFile($id)) {
BalancedPageDirectoriesMigrate($id);
}
return OldBalancedPageDirectoriesOpenPage($id, @_);
}
sub BalancedPageDirectoriesMigrate {
my $id = shift;
# This code is called if the page file does not exist. Perhaps we
# need to migrate? Check if the old page file exists. If it does
# not, there is no point in migration.
*GetPageDirectory = *OldBalancedPageDirectoriesGetPageDirectory;
if (not -f GetPageFile($id)) {
*GetPageDirectory = *NewBalancedPageDirectoriesGetPageDirectory;
return;
}
# Make sure we can change the data structure now.
RequestLockOrError();
# Now we know that we need to migrate. The list of pages is scanned
# using globbing.
SetParam('refresh', 1);
for $id (AllPagesList()) {
*GetPageDirectory = *OldBalancedPageDirectoriesGetPageDirectory;
my $page_from = GetPageFile($id);
my $keep_from = GetKeepDir($id);
my $lock_from = GetLockedPageFile($id);
my $joiner_from = $JoinerDir . '/' . GetPageDirectory($username) if $JoinerDir;
my $joiner_email_from = $JoinerEmailDir . '/' . GetPageDirectory($username) if $JoinerEmailDir;
my $referrer_from = $RefererDir . '/' . GetPageDirectory($id) if $RefererDir;
*GetPageDirectory = *NewBalancedPageDirectoriesGetPageDirectory;
my $page_to = GetPageFile($id);
my $keep_to = GetKeepDir($id);
my $lock_to = GetLockedPageFile($id);
my $joiner_to = $JoinerDir . '/' . GetPageDirectory($username) if $JoinerDir;
my $joiner_email_to = $JoinerEmailDir . '/' . GetPageDirectory($username) if $JoinerEmailDir;
my $referrer_to = $RefererDir . '/' . GetPageDirectory($id) if $RefererDir;
# no clobbering
if (! -f $page_to) {
CreatePageDir($PageDir, $id);
rename $page_from, $page_to || ReportError("Cannot rename $page_from");
}
if (-f $lock_from and ! -f $lock_to) {
rename $lock_from, $lock_to || ReportError("Cannot rename $lock_from");
}
if (-d $keep_from and ! -d $keep_to) {
CreateKeepDir($KeepDir, $id);
rename $keep_from, $keep_to || ReportError("Cannot rename $keep_from");
}
if ($joiner_from and -d $joiner_from and ! -d $joiner_to) {
CreatePageDir($JoinerDir, $id);
rename $joiner_from, $joiner_to || ReportError("Cannot rename $joiner_from");
}
if ($joiner_email_from and -d $joiner_email_from and ! -d $joiner_email_to) {
CreatePageDir($JoinerEmailDir, $id);
rename $joiner_email_from, $joiner_email_to || ReportError("Cannot rename $joiner_email_from");
}
if ($referrer_from and -d $referrer_from and ! -d $referrer_to) {
CreateRefererDir($RefererDir, $id);
rename $referrer_from, $referrer_to || ReportError("Cannot rename $referrer_from");
}
}
# Delete empty subdirectories. Actually, attempt to delete all the
# directories, depth first. It will simply fail for the non-empty
# directories. http://www.perlmonks.org/?node_id=520791
for my $parent ($PageDir, $KeepDir, $JoinerDir, $JoinerEmailDir, $RefererDir) {
next unless $parent;
finddepth(sub { rmdir $_ if -d }, $parent);
}
ReleaseLock();
}

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2013 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2013-2016 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
@@ -21,9 +21,13 @@ compared to the list of regular expressions on the C<BannedHosts> page
(see C<$BannedHosts>). If the contributor is already banned, this is
mentioned. If the contributor is not banned, you'll see a button
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.
the IP will be added to the C<BannedHosts> page for you.
=cut
use strict;
use v5.10;
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
@@ -53,17 +57,18 @@ sub IsItBanned {
sub DoBanHosts {
my $id = shift;
my $content = GetParam('content', '');
my $host = GetParam('host', '');
my $range = GetParam('range', '');
my $regexp = GetParam('regexp', '');
if ($content) {
SetParam('text', GetPageContent($BannedContent)
. $content . " # " . CalcDay($Now) . " "
. NormalToFree($id) . "\n");
SetParam('summary', NormalToFree($id));
DoPost($BannedContent);
} elsif ($host) {
$host =~ s/\./\\./g;
} elsif ($regexp) {
SetParam('text', GetPageContent($BannedHosts)
. "^" . $host . " # " . CalcDay($Now) . " "
. $regexp . " # " . CalcDay($Now)
. " $range "
. NormalToFree($id) . "\n");
SetParam('summary', NormalToFree($id));
DoPost($BannedHosts);
@@ -91,10 +96,14 @@ sub DoBanHosts {
if (IsItBanned($_, \@regexps)) {
print $q->p(Ts("%s is banned", $name));
} else {
my ($start, $end) = BanContributors::get_range($_);
$range = "[$start - $end]";
$name .= " " . $range;
print GetFormStart(undef, 'get', 'ban'),
GetHiddenValue('action', 'ban'),
GetHiddenValue('id', $id),
GetHiddenValue('host', $_),
GetHiddenValue('range', $range),
GetHiddenValue('regexp', BanContributors::get_regexp_ip($start, $end)),
GetHiddenValue('recent_edit', 'on'),
$q->p($name, $q->submit(T('Ban!'))), $q->end_form();
}
@@ -112,8 +121,8 @@ that will be added to BannedHosts.
=cut
*OldBanContributorsWriteRcLog = *WriteRcLog;
*WriteRcLog = *NewBanContributorsWriteRcLog;
*OldBanContributorsWriteRcLog = \&WriteRcLog;
*WriteRcLog = \&NewBanContributorsWriteRcLog;
sub NewBanContributorsWriteRcLog {
my ($tag, $id, $to) = @_;
@@ -121,10 +130,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,8 +159,100 @@ sub NewBanContributorsWriteRcLog {
$q->submit(T('Ban!'))),
$q->end_form();
};
print $q->p(T("Consider banning the IP number as well: "),
print $q->p(T("Consider banning the IP number as well:"), ' ',
ScriptLink('action=ban;id=' . UrlEncode($id), T('Ban contributors')));
};
return OldBanContributorsWriteRcLog(@_);
}
package BanContributors;
use Net::Whois::Parser qw/parse_whois/;
sub get_range {
my $ip = shift;
my $response = parse_whois(domain => $ip);
my ($start, $end);
my $re = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}';
my ($start, $end) = $response->{inetnum} =~ /($re) *- *($re)/;
return $start, $end;
}
sub get_groups {
my ($from, $to) = @_;
my @groups;
if ($from < 10) {
my $to = $to >= 10 ? 9 : $to;
push(@groups, [$from, $to]);
$from = $to + 1;
}
while ($from < $to) {
my $to = int($from/100) < int($to/100) ? $from + 99 - $from % 100 : $to;
if ($from % 10) {
push(@groups, [$from, $from + 9 - $from % 10]);
$from += 10 - $from % 10;
}
if (int($from/10) < int($to/10)) {
if ($to % 10 == 9) {
push(@groups, [$from, $to]);
$from = 1 + $to;
} else {
push(@groups, [$from, $to - 1 - $to % 10]);
$from = $to - $to % 10;
}
} else {
push(@groups, [$from - $from % 10, $to]);
last;
}
if ($to % 10 != 9) {
push(@groups, [$from, $to]);
$from = 1 + $to; # jump from 99 to 100
}
}
return \@groups;
}
sub get_regexp_range {
my @chars;
for my $group (@{get_groups(@_)}) {
my ($from, $to) = @$group;
my $char;
for (my $i = length($from); $i >= 1; $i--) {
if (substr($from, - $i, 1) eq substr($to, - $i, 1)) {
$char .= substr($from, - $i, 1);
} else {
$char .= '[' . substr($from, - $i, 1) . '-' . substr($to, - $i, 1). ']';
}
}
push(@chars, $char);
}
return join('|', @chars);
}
sub get_regexp_ip {
my ($from, $to) = @_;
my @start = split(/\./, $from);
my @end = split(/\./, $to);
my $regexp = "^";
for my $i (0 .. 3) {
if ($start[$i] eq $end[$i]) {
$regexp .= $start[$i];
} elsif ($start[$i] eq '0' and $end[$i] eq '255') {
last;
} elsif ($start[$i + 1] > 0) {
$regexp .= '(' . $start[$i] . '\.('
. get_regexp_range($start[$i + 1], '255') . ')|'
. get_regexp_range($start[$i] + 1, $end[$i + 1]) . ')';
$regexp .= '\.';
last;
} else {
$regexp .= '(' . get_regexp_range($start[$i], $end[$i]) . ')$';
last;
}
$regexp .= '\.' if $i < 3;
}
return $regexp;
}
# this is required in case we concatenate other modules to this one
package OddMuse;

View File

@@ -0,0 +1,72 @@
# Copyright (C) 2018 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/>.
=encoding utf8
=head1 Mixed Scripts
This module disallows ordinary users from posting words that consist of multiple
scripts. Stuff like this: "It's diffіcult to find knowledgeable people on this
topic, but youu sound like you know wgat you're takіng аboսt!" Did you notice
the confusable characters? The sentence contains the following:
ARMENIAN SMALL LETTER SEH
CYRILLIC SMALL LETTER A
CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
SMALL ROMAN NUMERAL FIFTY
=cut
use strict;
use v5.10;
use Unicode::UCD qw(charprop);
AddModuleDescription('ban-mixed-scripts.pl', 'Ban Mixed Scripts Extension');
*OldBanMixedScriptsBannedContent = \&BannedContent;
*BannedContent = \&NewBanMixedScriptsBannedContent;
sub NewBanMixedScriptsBannedContent {
my $rule = OldBanMixedScriptsBannedContent(@_);
$rule ||= BanMixedScript(@_);
return $rule;
}
sub BanMixedScript {
my $str = shift;
my @words = $str =~ m/\w+/g;
my %seen;
my %prop;
for my $word (@words) {
next if $seen{$word};
$seen{$word} = 1;
my $script;
for my $char (split(//, $word)) {
my $s = $prop{$char};
if (not $s) {
$s = charprop(ord($char), "Script_Extensions");
if ($s eq 'Hiragana') {
$s = 'Han'; # this mixing is ok
}
$prop{$char} = $s;
}
next if $s eq "Common";
if (not $script) {
$script = $s;
} elsif ($script ne $s) {
return "Mixed scripts in $word ($script and $s, if not more)";
}
}
}
}

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.
use strict;
use v5.10;
AddModuleDescription('ban-quick-editors.pl', 'Banning Quick Editors');
*BanQuickOldUserIsBanned = *UserIsBanned;
*UserIsBanned = *BanQuickNewUserIsBanned;
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', GetRemoteHost());
my $name = GetParam('username', $q->remote_addr());
my @entries = @{$RecentVisitors{$name}};
# $entry[0] is $Now after AddRecentVisitor
my $ts = $entries[1];

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2012 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2012-2018 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,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;
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,9 @@ This extension works with logbannedcontent.pl.
=cut
use vars qw($BannedRegexps);
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile,
$FullUrlPattern);
our ($BannedRegexps);
$BannedRegexps = 'BannedRegexps';
@@ -52,15 +57,15 @@ 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;
# check whether Banned Content complains
my $rule = RegexpOldBannedContent($str, @_);
# remove URLs as they have been checked by $BannedContent
$str =~ s/$FullUrlPattern//g;
if (not $rule) {
foreach (split(/\n/, GetPageContent($BannedRegexps))) {
next unless m/^\s*([^#]+?)\s*(#\s*(\d\d\d\d-\d\d-\d\d\s*)?(.*))?$/;

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/>.
use strict;
use v5.10;
AddModuleDescription('bbcode.pl', 'bbCode Extension');
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
push(@MyRules, \&bbCodeRule);
$RuleOrder{\&bbCodeRule} = 300; # must come after PortraitSupportRule, MarkdownRule
$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
@@ -132,5 +135,5 @@ sub bbCodeRule {
elsif (/\G:(?:sad|frown):/cg) {
return '&#x1F61F;'; }
# no match
return undef;
return;
}

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