Compare commits

...

449 Commits

Author SHA1 Message Date
Aleks-Daniel Jakimenko
eb0f3e9908 We should not be relying on real time at all.
Here are some attempts to go into that direction
2015-07-22 14:07:50 +03:00
Alex Schroeder
3626593fad lock-expiration.t: test fake time 2015-07-22 09:51:54 +02:00
Alex Schroeder
4a1e1a5529 Fake time to speed up tests
Fake time requires changes to wiki.pl. We created a test-wiki.pl with a
preamble that changes how the time and sleep builtins work. This is used
in lock-expiration.t as a proof of concept.
2015-07-22 09:33:09 +02:00
Alex Schroeder
22bf1e8df3 static-copy.t skips a test without HTTPS support
The static.css file is copied from https://oddmuse.org/ -- so if
LWP::Protocol::https is not installed, this cannot work.
2015-07-21 12:42:06 +02:00
Alex Schroeder
9ec075c1c0 referrer-tracking.t switching to HTTPS 2015-07-21 12:31:13 +02:00
Alex Schroeder
a767bb5c94 static-copy.pl use HTTPS to access oddmuse.org 2015-07-21 12:22:39 +02:00
Alex Schroeder
6d62283927 referrer-tracking.t with new copyright year 2015-07-21 12:17:12 +02:00
Alex Schroeder
445e80cefc referrer-tracking.t skips test without HTTPS
As oddmuse.org now uses HTTPS, this test requires LWP::Protocol::https
to be installed.
2015-07-21 12:16:17 +02:00
Alex Schroeder
6589e84d10 near-links.t fix test for empty page 2015-07-21 11:32:55 +02:00
Alex Schroeder
59e79d2b17 Summary: Fix bug in NewText
If $CommentsPrefix was not set, all the pages were being treated like
comment pages.
2015-07-21 10:15:55 +02:00
Alex Schroeder
ea426db112 Fix bug in NewText
If $CommentsPrefix was not set, all the pages were being treated like
comment pages.
2015-07-21 10:14:34 +02:00
Alex Schroeder
b3759296e2 fcgi.pl deleted
As part of the big cleanup, files that haven't been used have been
deleted. The necessary info can still be found on the Oddmuse site:
https://oddmuse.org/wiki/Using_mod_fastcgi
2015-07-21 09:44:35 +02:00
Alex Schroeder
00388009f7 README.creole typo fixed 2015-07-21 09:41:18 +02:00
Alex Schroeder
c50fb63c36 Moved 404handler.pl to modules 2015-07-21 09:34:17 +02:00
Alex Schroeder
9f49cf49ea Deleted some more cruft
debian-packages, test.mime and test.png have been deleted.
2015-07-21 09:29:24 +02:00
Alex Schroeder
1c240033d8 localnames-server.pl moved to contrib 2015-07-21 09:28:15 +02:00
Alex Schroeder
c04743d6e1 mimedecode.pl moved to scripts 2015-07-21 09:25:49 +02:00
Alex Schroeder
f740251bbb templates subdirectory now with README 2015-07-21 09:25:06 +02:00
Alex Schroeder
4e90046b66 Moved rc2mail.pl into contrib 2015-07-21 09:23:51 +02:00
Alex Schroeder
d1f9c401cd Makefile stripped of untested junk
The Mac subdirectory and all the instructions of how to build and
install Oddmuse on a Mac using the OSX tools have been deleted.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

$BannedContent = $StrangeOldBannedContent;

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

my $StrangeOldBannedContent; # use strict

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

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

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

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

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

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

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

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

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

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

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

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

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

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

143
Makefile
View File

@@ -1,8 +1,9 @@
# The Makefile is only for developpers wanting to prepare the tarball.
# Make sure the CVS keywords for the sed command on the next line are not expanded.
# In order to build a copy of Oddmuse with all the version numbers, use:
# make build. This creates modified copies of the files in the build
# subdirectory.
VERSION_NO=$(shell git describe --tags)
TRANSLATIONS=$(wildcard modules/translations/[a-z]*-utf8.pl$)
TRANSLATIONS=$(wildcard modules/translations/[a-z]*.pl$)
MODULES=$(wildcard modules/*.pl)
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
@@ -16,12 +17,21 @@ prepare: build $(BUILD)
build:
mkdir -p build
clean:
rm -rf build
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" < $< > $@
build/%-utf8.pl: modules/translations/%-utf8.pl
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
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: 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
@@ -34,132 +44,5 @@ translations: $(TRANSLATIONS)
perl 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
test:
prove t
package-upload: debian-$(VERSION).tar.gz debian-$(VERSION).tar.gz.sig
curl -T "{debian-$(VERSION).tar.gz,debian-$(VERSION).tar.gz.sig}" \
ftp://savannah.gnu.org/incoming/savannah/oddmuse/
package: debian-$(VERSION).tar.gz
gpg --ascii --encrypt $<
debian-$(VERSION).tar.gz:
rm -rf $(VERSION)
mkdir $(VERSION)
cp README FDL GPL wiki.pl $(VERSION)
tar czf $@ $(VERSION)

View File

@@ -1,37 +0,0 @@
# Copyright (C) 2005 Alex Schroeder <alex@emacswiki.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => qw(OK);
package OddMuse;
$RunCGI = 0;
require 'wiki.pl';
sub handler {
my $r = shift;
for my $var (qw{DataDir UseConfig ConfigFile ModuleDir ConfigPage
AdminPass EditPass ScriptName FullUrl}) {
no strict "refs";
$$var = $ENV{"Wiki$var"} if exists $ENV{"Wiki$var"}; # symbolic references
}
DoWikiRequest();
return Apache2::Const::OK;
}

48
README
View File

@@ -1,48 +0,0 @@
This is the README file distributed together with the Oddmuse script.
To install the script, copy wiki.pl into your cgi-bin directory. This
will store the pages in a temporary directory for you. In order to
make this permanent, change the $DataDir option in the script from
'/tmp/oddmuse' to 'oddmuse'. This will save the pages in a
subdirectory of your cgi-bin directory.
In order to start your wiki, click on the edit link (the first link
below the navigation bar, at the bottom of the page). This will allow
you to enter some text for this page. Click the Save button and you
are done.
To add new pages, edit the homepage and add links to new pages. Links
are traditionally formed by ConcatenatingCapitalizedWords. This kind
of link pattern is called a wiki word.
Alternatively, put links in [[double square brackets]]. This kind of
link pattern is called a free link.
As long as the new pages don't exist, links to these pages are
followed by a clickable question mark. Click on the question mark to
create the new page.
Enjoy your wiki experience.
Visit http://www.oddmuse.org/ to learn more about the translation
files and modules that are part of this package.
----------------------------------------------------------------------
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Both the GNU Free Documentation License, and the GNU General Public
License are distributed together with this script. See the files FDL
and GPL, respectively.

157
README.creole Normal file
View File

@@ -0,0 +1,157 @@
This is the README file distributed together with the
[[http://oddmuse.org/|Oddmuse]] script.
== Installing Oddmuse on a Debian System running Apache
The following instructions require a number of tools. You can make sure
they're all installed by issuing the following command as {{{root}}}:
{{{
apt-get install coreutils apache2 sudo wget w3m perl \
libwww-perl libxml-rss-perl diffutils
}}}
You probably created an account for yourself. You might have to add this
user to the {{{sudo}}} group. Here's how I created my own user as
{{{root}}}:
{{{
adduser alex
usermod -a -G sudo alex
}}}
Now you can login as {{{alex}}} and do everything else using {{{sudo}}}.
You need to copy wiki.pl into your cgi-bin directory, and you need to
make the script executable.
{{{
sudo wget -O /usr/lib/cgi-bin/wiki.pl \
http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
sudo chmod +x /usr/lib/cgi-bin/wiki.pl
}}}
You should be able to test it right now! Visit
{{{http://localhost/cgi-bin/wiki.pl}}}. If your site is available from
the outside, you will be able to use a normal browser. If don't have a
domain name yet, you'll probably have to use a text browser like
{{{w3m}}}.
{{{
w3m http://localhost/cgi-bin/wiki.pl
}}}
If you create pages in this wiki, these will get stored in a temporary
directory. You need change the data directory from {{{"/tmp/oddmuse"}}}
to like {{{"/var/local/oddmuse"}}}. The best way to do this without
changing {{{wiki.pl}}} is by editing
{{{/etc/apache2/sites-available/default}}}. Add the following line:
{{{
SetEnv WikiDataDir /var/local/oddmuse
}}}
Enable the default site by calling the following command:
{{{
sudo a2ensite default
}}}
Reload the Apache configuration by calling the following command:
{{{
sudo service apache2 reload
}}}
You need to create the new data directory. You webserver runs CGI
scripts as {{{www-data}}}. Thus, you need to change the owner and group
of the directory to {{{www-data}}}.
{{{
sudo mkdir -p /var/local/oddmuse
sudo chown www-data.www-data /var/local/oddmuse
}}}
Done! Visit your wiki and start editing. Click on the edit link (the
first link below the navigation bar, at the bottom of the page). This
will allow you to enter some text for this page. Click the Save button
and you are done.
To add new pages, edit the homepage and add links to new pages by
putting their names in {{{[[double square brackets]]}}}.
Enjoy your wiki experience.
Visit http://www.oddmuse.org/ to learn more about the translation
files and modules that are part of this package.
== Apache
If you think this information doesn't work for you, here are some things
to check.
Apache's config directory is {{{/etc/apache2/apache2.conf}}}. This is
where we get the {{{www-data}}} username from. It says:
{{{
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
}}}
Checking {{{/etc/apache2/envvars}}} we see the following:
{{{
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
}}}
So that's what we're using in the {{{chown}}} command in our
instructions above.
The default site is configured in
{{{/etc/apache2/sites-available/default}}}. In order for it to be
//enabled//, there must be a symlink from a file in
{{{/etc/apache2/sites-enabled}}} to the file in
{{{sites-available}}}. You can enable it using the following command:
{{{
sudo a2ensite default
}}}
This file also lists the directories we've used in out instructions
above.
{{{
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
}}}
This means that {{{http://localhost/cgi-bin/wiki.pl}}} will call
{{{/usr/lib/cgi-bin/wiki.pl}}}
Don't forget to reload the Apache configuration as shown above, or
simply restart it all:
{{{
sudo service apache2 graceful
}}}
----------------------------------------------------------------------
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,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.

69
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));
}
@@ -286,13 +327,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 {

View File

@@ -1,26 +1,20 @@
#!/usr/bin/perl
# -*- coding: utf-8 -*-
# Copyright (C) 2004 Alex Schroeder <alex@emacswiki.org>
# Copyright (C) 2004 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2007 Vinicius José Latorre <viniciusjl at ig.com.br>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# $Id: ell-to-wiki.pl,v 1.5 2007/02/15 22:00:26 as Exp $
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use LWP::UserAgent;
use XML::Parser;

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

@@ -0,0 +1,122 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2006 Free Software Foundation, Inc.
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
# This file is based on code from GNU Radio.
# https://github.com/balister/GNU-Radio/blob/master/dtools/bin/fix-copyright-years
import re
import datetime
import subprocess
import multiprocessing
def command(*args): return subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
def is_free_software(lines):
for line in lines[:50]:
if 'This program is free software' in line: return True
return False
def get_copyright_lines(lines):
start = -1
end = -1
for i, line in enumerate(lines[:20]):
if line.startswith('# Copyright'):
if start == -1: start = i
end = i
if start == -1: raise Exception
return start, end
def copyright_line(author, years):
from_year = years.pop()
to_year = from_year
for year in years:
if year > to_year: to_year = year
elif year < from_year: from_year = year
if from_year == to_year:
return '# Copyright (C) %d %s\n' % (from_year, author)
else:
return '# Copyright (C) %d%d %s\n' % (from_year, to_year, author)
author_re = re.compile('\nAuthor: (.*)\nDate:.* (\d\d\d\d) ')
def fix_co_years(files):
for file in files:
print file
years = {}
changed = False
lines = open(file).readlines()
if not is_free_software(lines):
print ' is not Free Software'
continue
# extract authors and years from git log
log = command('git', 'log', file)
it = re.finditer(author_re, log)
for match in it:
author, year = match.groups()
if author in years:
years[author].add(int(year))
else:
years[author] = set([int(year)])
# extract copyright beginning and end from
try:
start, end = get_copyright_lines(lines)
except:
print ' copyright lines not found'
continue
# only update or add existing authors, don't touch authors not in git log
for author in years.keys():
found = False
for i in range(start, end + 1):
if author in lines[i]:
line = copyright_line(author, years[author])
if line != lines[i]:
lines[i] = line
changed = True
found = True
continue
if not found:
lines.insert(end, copyright_line(author, years[author]))
changed = True
# write file
if changed:
# print ''.join(lines[:30])
# print '------------------------------------------------------------------------'
open(file, 'w').write(''.join(lines))
if __name__ == "__main__":
# get recursive list of files in the repo
files = command('git', 'ls-tree', '--name-only', 'HEAD', '-r').splitlines()
# files = ['contrib/campaignwiki/add-link.pl']
# start n+1 processes to handle the files
num_procs = multiprocessing.cpu_count()
# num_procs = 1
procs = [multiprocessing.Process(
target=lambda *files: fix_co_years(files),
args=files[num::num_procs],
) for num in range(num_procs)]
map(multiprocessing.Process.start, procs)
map(multiprocessing.Process.join, procs)

View File

@@ -1,6 +1,6 @@
;;; oddmuse-curl.el -- edit pages on an Oddmuse wiki using curl
;;
;; Copyright (C) 20062014 Alex Schroeder <alex@gnu.org>
;; Copyright (C) 20062015 Alex Schroeder <alex@gnu.org>
;; (C) 2007 rubikitch <rubikitch@ruby-lang.org>
;;
;; Latest version:
@@ -233,10 +233,10 @@ calling `oddmuse-post' on an ordinary file that's not in Oddmuse
Mode."
(when (or (not oddmuse-wiki) arg)
(set (make-local-variable 'oddmuse-wiki)
(completing-read "Wiki: " oddmuse-wikis nil t)))
(oddmuse-read-wiki)))
(when (not oddmuse-page-name)
(set (make-local-variable 'oddmuse-page-name)
(read-from-minibuffer "Pagename: " (buffer-name)))))
(oddmuse-read-pagename oddmuse-wiki t (buffer-name)))))
(defvar oddmuse-minor nil
"Is this edit a minor change?")
@@ -304,6 +304,9 @@ Example:
(url-hexify-string pagename))
(error nil)))
(defvar oddmuse-pagename-history nil
"History of Oddmuse pages edited.")
(defun oddmuse-read-pagename (wiki &optional require default)
"Read a pagename of WIKI with completion.
Optional arguments REQUIRE and DEFAULT are passed on to `completing-read'.
@@ -313,7 +316,45 @@ Typically you would use t and a `oddmuse-page-name', if that makes sense."
(concat "Pagename [" default "]: ")
"Pagename: ")
(oddmuse-make-completion-table wiki)
nil require nil nil default)))
nil require nil
'oddmuse-pagename-history default)))
(defvar oddmuse-wiki-history nil
"History of Oddmuse Wikis edited.
This is a list referring to `oddmuse-wikis'.")
(defun oddmuse-read-wiki (&optional require default)
"Read wiki name with completion.
Optional arguments REQUIRE and DEFAULT are passed on to `completing-read'.
Typically you would use t and the current wiki, `oddmuse-wiki'.
If you want to use the current wiki unless the function was
called with C-u. This is what you want for functions that end
users call and that you might want to run on a different wiki
such as searching.
\(let* ((wiki (or (and (not current-prefix-arg) oddmuse-wiki)
(oddmuse-read-wiki))))
...)
...)
If you want to ask only when there is no current wiki:
\(let* ((wiki (or oddmuse-wiki (oddmuse-read-wiki)))
...)
...)
If you want to ask for a wiki and provide the current one as
default:
\(oddmuse-read-wiki t oddmuse-wiki)"
(let ((completion-ignore-case t))
(completing-read (if default
(concat "Wiki [" default "]: ")
"Wiki: ")
oddmuse-wikis
nil require nil
'oddmuse-wiki-history default)))
(defun oddmuse-pagename (&optional arg)
"Return the wiki and pagename the user wants to edit or follow.
@@ -327,7 +368,7 @@ Use this function when following links in regular wiki buffers,
in Recent Changes, History Buffers, and also in text files and
the like."
(let* ((wiki (or (and (not arg) oddmuse-wiki)
(completing-read "Wiki: " oddmuse-wikis nil t)))
(oddmuse-read-wiki)))
(pagename (or (and arg (oddmuse-read-pagename wiki))
(oddmuse-pagename-at-point)
(oddmuse-read-pagename wiki nil (word-at-point)))))
@@ -464,8 +505,8 @@ code on stdout, so usually we want to provide either 302 or 200
as EXPECTED-CODE.
In addition to that, we check the HTML in the buffer for
indications of an error. If we find any, that willget reported as
well."
indications of an error. If we find any, that will get reported
as well."
(let* ((max-mini-window-height 1)
(wiki (or wiki oddmuse-wiki))
(pagename (or pagename oddmuse-page-name))
@@ -508,7 +549,7 @@ If available, return precomputed one."
This command is used to reflect new pages to `oddmuse-pages-hash'."
(interactive)
(let* ((wiki (or wiki-arg
(completing-read "Wiki: " oddmuse-wikis nil t oddmuse-wiki)))
(oddmuse-read-wiki t oddmuse-wiki)))
(url (cadr (assoc wiki oddmuse-wikis)))
(command (oddmuse-format-command oddmuse-get-index-command))
table)
@@ -797,21 +838,35 @@ Requires all the variables to be bound for
(defun oddmuse-edit (wiki pagename)
"Edit a page on a wiki.
WIKI is the name of the wiki as defined in `oddmuse-wikis',
PAGENAME is the pagename of the page you want to edit.
Use a prefix argument to force a reload of the page."
PAGENAME is the pagename of the page you want to edit. If the
page is already in a buffer, pop to that buffer instead of
loading the page Use a prefix argument to force a reload of the
page."
(interactive (oddmuse-pagename))
(make-directory (concat oddmuse-directory "/" wiki) t)
(let ((name (concat wiki ":" pagename)))
(if (and (get-buffer name)
(not current-prefix-arg))
(pop-to-buffer (get-buffer name))
(set-buffer (find-file-noselect (concat oddmuse-directory "/" wiki "/" pagename)))
(erase-buffer)
;; insert page content from the wiki
(set-buffer (get-buffer-create name))
(erase-buffer); in case of current-prefix-arg
(oddmuse-run "Loading" oddmuse-get-command wiki pagename)
(oddmuse-revision-put wiki pagename (oddmuse-get-latest-revision wiki pagename))
;; fix it for VC in the new buffer because this is not a vc-checkout
;; fix mode-line for VC in the new buffer because this is not a vc-checkout
(setq buffer-file-name (concat oddmuse-directory "/" wiki "/" pagename))
(vc-mode-line buffer-file-name 'oddmuse)
(pop-to-buffer (current-buffer))
;; check for a diff (this ends with display-buffer) and bury the
;; buffer if there are no hunks
(when (file-exists-p buffer-file-name)
(diff-buffer-with-file)
(with-current-buffer (get-buffer "*Diff*")
(unless (next-property-change (point-min))
(kill-buffer))))
;; this also changes the buffer name
(basic-save-buffer)
;; this makes sure that the buffer name is set correctly
(oddmuse-mode))))
(defalias 'oddmuse-go 'oddmuse-edit)
@@ -822,8 +877,8 @@ Use a prefix argument to force a reload of the page."
WIKI is the name of the wiki as defined in `oddmuse-wikis'.
The pagename begins with the current date."
(interactive
(list (or oddmuse-wiki
(completing-read "Wiki: " oddmuse-wikis nil t oddmuse-wiki))
(list (or (and (not current-prefix-arg) oddmuse-wiki)
(oddmuse-read-wiki))
(replace-regexp-in-string
" +" "_"
(read-from-minibuffer "Pagename: "
@@ -851,7 +906,9 @@ Use a prefix argument to override this."
(puthash oddmuse-wiki (cons oddmuse-page-name list) oddmuse-pages-hash)))
(and buffer-file-name (basic-save-buffer))
(oddmuse-run "Posting" oddmuse-post-command nil nil
(get-buffer-create " *oddmuse-response*") t 302))
(get-buffer-create " *oddmuse-response*") t 302)
(oddmuse-revision-put oddmuse-wiki oddmuse-page-name
(oddmuse-get-latest-revision oddmuse-wiki oddmuse-page-name)))
;;;###autoload
(defun oddmuse-preview (&optional arg)
@@ -908,7 +965,7 @@ wiki (ie. it must use Perl syntax).
Use a prefix argument to search a different wiki."
(interactive "sSearch term: ")
(let* ((wiki (or (and (not current-prefix-arg) oddmuse-wiki)
(completing-read "Wiki: " oddmuse-wikis nil t)))
(oddmuse-read-wiki)))
(name (concat "*" wiki ": search for '" regexp "'*")))
(if (and (get-buffer name)
(not current-prefix-arg))
@@ -929,7 +986,7 @@ wiki (ie. it must use Perl syntax).
Use a prefix argument to search a different wiki."
(interactive "sPages matching: ")
(let* ((wiki (or (and (not current-prefix-arg) oddmuse-wiki)
(completing-read "Wiki: " oddmuse-wikis nil t)))
(oddmuse-read-wiki)))
(name (concat "*" wiki ": matches for '" regexp "'*")))
(if (and (get-buffer name)
(not current-prefix-arg))
@@ -942,15 +999,16 @@ Use a prefix argument to search a different wiki."
(dolist (line lines)
(insert "[[" (replace-regexp-in-string "_" " " line) "]]\n")))
(oddmuse-mode)
(set (make-local-variable 'oddmuse-wiki) wiki))))
(set (make-local-variable 'oddmuse-wiki) wiki)
(display-buffer (current-buffer)))))
;;;###autoload
(defun oddmuse-rc (&optional include-minor-edits)
"Show Recent Changes.
With universal argument, reload."
(interactive "P")
(let* ((wiki (or oddmuse-wiki
(completing-read "Wiki: " oddmuse-wikis nil t)))
(let* ((wiki (or (and (not current-prefix-arg) oddmuse-wiki)
(oddmuse-read-wiki)))
(name (concat "*" wiki ": recent changes*")))
(if (and (get-buffer name) (not current-prefix-arg))
(pop-to-buffer (get-buffer name))
@@ -993,6 +1051,21 @@ With universal argument, reload."
(goto-char (point-min))
(oddmuse-mode)))
(defun oddmuse-history (wiki pagename)
"Show the history for PAGENAME on WIKI.
Compared to `vc-oddmuse-print-log' this only prints the revisions
that can actually be retrieved (for diff and rollback)."
(interactive (oddmuse-pagename-if-missing))
(let ((name (concat "*" wiki ": history for " pagename "*")))
(if (and (get-buffer name)
(not current-prefix-arg))
(pop-to-buffer (get-buffer name))
(set-buffer (get-buffer-create name))
(erase-buffer)
(oddmuse-run "History" oddmuse-get-history-command wiki pagename)
(oddmuse-mode)
(set (make-local-variable 'oddmuse-wiki) wiki))))
;;;###autoload
(defun emacswiki-post (&optional pagename summary)
"Post the current buffer to the EmacsWiki.
@@ -1031,6 +1104,6 @@ PAGENAME is the pagename of the page you want to browse."
(interactive)
(kill-new (oddmuse-url oddmuse-wiki oddmuse-page-name)))
(provide 'oddmuse)
(provide 'oddmuse-curl)
;;; oddmuse-curl.el ends here

108
contrib/oddmuse_stats Executable file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -28,7 +28,7 @@
(add-to-list 'vc-handled-backends 'oddmuse)
(require 'oddmuse)
(require 'oddmuse-curl)
(require 'diff)
(defun vc-oddmuse-revision-granularity () 'file)
@@ -110,11 +110,11 @@ It must print the page to stdout.
(defun oddmuse-revision-filename (rev)
"Return filename for revision REV.
This uses `oddmuse-directory', `oddmuse-wiki' and
`oddmuse-page-name'."
This uses `oddmuse-directory', `wiki' and `pagename' as bound by
`with-oddmuse-file'."
(concat oddmuse-directory
"/" oddmuse-wiki
"/" oddmuse-page-name
"/" wiki
"/" pagename
".~" rev "~"))
(defun vc-oddmuse-diff (files &optional rev1 rev2 buffer)
@@ -126,13 +126,12 @@ This uses `oddmuse-directory', `oddmuse-wiki' and
(dolist (rev (list rev1 rev2))
(when (and rev (not (file-readable-p (oddmuse-revision-filename rev))))
(let* ((oddmuse-revision rev)
(command (oddmuse-format-command
vc-oddmuse-get-revision-command))
(command vc-oddmuse-get-revision-command)
(filename (oddmuse-revision-filename rev)))
(with-temp-buffer
(oddmuse-run
(concat "Downloading revision " rev)
command wiki)
command wiki pagename)
(write-file filename)))))
(diff-no-select
(if rev1 (oddmuse-revision-filename rev1) file)

14
control
View File

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

View File

@@ -100,6 +100,25 @@ h1 a:visited, h2 a:visited, h3 a:visited {
/* links */
a.pencil {
padding-left: 1ex;
text-decoration: none;
color: inherit;
visible: hidden;
transition: visibility 0s 1s, opacity 1s linear;
opacity: 0;
}
*:hover > a.pencil {
visible: visible;
transition: opacity .5s linear;
opacity: 1;
}
@media print {
a.pencil {
display: none;
}
}
a.number {
text-decoration: none;
}
@@ -140,6 +159,15 @@ pre, code, tt {
line-height: 110%;
}
pre {
overflow:hidden;
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
/* styling for divs that will be invisible when printing
when printing. */
@@ -366,6 +394,10 @@ div.image span.caption {
margin: 0 1em;
}
img {
max-width: 100%;
}
.left { float:left; margin-right: 1em; }
.right { float:right; margin-left: 1em; }
.half a img { height: 50%; width: 50%; }

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

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

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

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

347
css/bootstrap.css vendored Normal file
View File

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

View File

@@ -115,6 +115,7 @@ div.toc h2 {
/* get rid of useless "10 results found" when using indexed search. */
div.search p.result { display:none; }
label[for="searchlang"], input#searchlang { display: none; }
form.tiny, form.tiny p {
display:inline;

365
css/light.css Normal file
View File

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

88
css/minimal.css Normal file
View File

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

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

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

View File

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

View File

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

View File

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

25
fcgi.pl
View File

@@ -1,25 +0,0 @@
# Copyright (C) 2006 Alex Schroeder <alex@emacswiki.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use CGI::Fast;
package OddMuse;
$RunCGI = 0;
do 'wiki.pl';
while ($q = new CGI::Fast) {
DoWikiRequest();
}

202
info-ref
View File

@@ -1,202 +0,0 @@
#!/usr/bin/perl
# Copyright (C) 2005 Alex Schroeder <alex@emacswiki.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
use warnings;
use CGI;
use LWP::UserAgent;
use XML::LibXML;
use URI;
my @indexes = qw(
http://www.gnu.org/software/emacs/manual/html_node/Command-Index.html
http://www.gnu.org/software/emacs/manual/html_node/Variable-Index.html
http://www.gnu.org/software/emacs/manual/html_node/Concept-Index.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_728.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_729.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_730.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_731.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_732.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_733.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_734.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_735.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_736.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_737.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_738.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_739.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_740.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_741.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_742.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_743.html
http://www.gnu.org/software/emacs/elisp-manual/html_node/elisp_744.html
);
my $db = '/org/org.emacswiki/htdocs/emacs/info-ref.dat';
my $nl = "\n";
my $fs = "\023";
my $gs = "\024";
my $rs = "\025";
my $q = new CGI;
ProcessRequest();
sub ProcessRequest {
if ($q->param('init')) {
Initialize();
} elsif ($q->param('find')) {
Find($q->param('find'));
} else {
ShowForm();
}
}
sub ShowForm {
print $q->header, $q->start_html,
$q->start_form, "Index entry: ", $q->textfield('find'), $q->submit, $q->end_form,
$q->p('$Id: info-ref,v 1.6 2005/08/31 14:01:17 as Exp $'),
$q->end_html;
}
sub Find {
my $str = shift;
my %map = ();
my $data = ReadFileOrDie($db);
foreach my $line (split(/$nl/, $data)) {
my ($key, $rest) = split(/$fs/, $line);
$map{$key} = ();
foreach my $a (split(/$gs/, $rest)) {
my ($link, $label) = split(/$rs/, $a);
$map{$key}{$link} = $label;
}
}
my @links = keys %{$map{$str}};
if ($#links < 0) {
ReportError("No matches found for '$str'", '404 Not Found');
} elsif ($#links == 0) {
print $q->redirect($links[0]);
} else {
my @list = map { $q->a({-href=>$_}, $map{$str}{$_}) } @links;
print $q->header, $q->h1($str), $q->ol($q->li(\@list));
}
}
sub Initialize {
my %map = ();
print $q->header, $q->start_html;
foreach my $url (@indexes) {
print $q->p($url);;
# determine base URI
my $base = URI->new($url);
# fetch and parse data
my $data = GetRaw($url);
# some markup fixes for the elisp manual
$data =~ s/&([<"])/&amp;$1/g;
$data =~ s/<([<"])/&lt;$1/g;
$data =~ s/="fn_"">/="fn_&quot;">/;
$data =~ s/<!DOCTYPE.*?>//;
$data =~ s'</?font.*?>''gi;
$data =~ s'</table><br></P>'</table><br>';
my $parser = XML::LibXML->new();
my $doc;
eval { $doc = $parser->parse_html_string($data); };
print $q->p($@) if $@;
next if $@;
# emacs manual
my @nodelist = $doc->findnodes('/html/body/ul/li');
foreach my $node (@nodelist) {
my $text = $node->textContent;
my ($key) = split(/: /, $text);
my $a = $node->findnodes('descendant::a')->[0];
my $label = $a->textContent;
my $link = $a->getAttribute('href');
my $l = URI->new_abs($link, $base);
# print "$key -> $label $l\n";
$map{$key} = () unless $map{$key};
$map{$key}{$l->canonical} = $label;
}
# elisp manual
@nodelist = $doc->findnodes('descendant::table[position()=3]/descendant::tr');
foreach my $node (@nodelist) {
my ($item, $section) = $node->findnodes('td/a');
next unless $item and $section;
my $key = $item->textContent;
my $label = $section->textContent;
my $link = $item->getAttribute('href');
my $l = URI->new_abs($link, $base);
# print "$key -> $label $l\n";
$map{$key} = () unless $map{$key};
$map{$key}{$l->canonical} = $label;
}
}
my $data = join($nl, map {
my $key = $_;
$key . $fs . join($gs, map {
my $link = $_;
join($rs, $link, $map{$key}{$link});
} keys %{$map{$_}})
} keys %map);
WriteStringToFile($db, $data);
print $q->p('Database initialized'), $q->end_html;
}
sub GetRaw {
my $uri = shift;
return unless eval { require LWP::UserAgent; };
my $ua = LWP::UserAgent->new;
my $response = $ua->get($uri);
return $response->content;
}
sub ReadFile {
my ($filename) = @_;
my ($data);
local $/ = undef; # Read complete files
if (open(IN, "<$filename")) {
$data=<IN>;
close IN;
return (1, $data);
}
return (0, '');
}
sub ReadFileOrDie {
my ($filename) = @_;
my ($status, $data);
($status, $data) = ReadFile($filename);
if (!$status) {
ReportError("Cannot open $filename: $!", '500 Internal Server Error');
}
return $data;
}
sub WriteStringToFile {
my ($file, $string) = @_;
open(OUT, ">$file")
or ReportError("Cannot write $file: $!", '500 Internal Server Error');
print OUT $string;
close(OUT);
}
sub ReportError { # fatal!
my ($errmsg, $status, $log) = @_;
print $q->header(-status => $status);
print $q->start_html, $q->h2($errmsg), $q->end_html;
exit (1);
}

View File

@@ -16,27 +16,27 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('aawrapperdiv.pl', 'WrapperDiv Module');
our ($q);
*OldGetHeader = *GetHeader;
*GetHeader = *WrapperGetHeader;
*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'});
my ($id, $title, $oldId, $nocache, $status) = @_;
my $result = OldGetHeader ($id, $title, $oldId, $nocache, $status);
$result .= $q->start_div({-class=>'wrapper'});
}
*OldPrintFooter = *PrintFooter;
*PrintFooter = *WrapperPrintFooter;
*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);
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,10 +13,12 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
package OddMuse;
use strict;
AddModuleDescription('accesskeys.pl', 'Links With AccessKeys Extension');
our (@MyRules, $FreeLinkPattern);
push(@MyRules, \&LinksWithAccessKeys);
sub LinksWithAccessKeys {
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cog) {
@@ -32,5 +34,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

@@ -16,6 +16,10 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
our ($q, %Page, %Action, $IndexFile, $PageDir, $KeepDir, @MyAdminCode, $RefererDir);
AddModuleDescription('admin.pl', 'Admin Power Extension');
$Action{delete} = \&AdminPowerDelete;

View File

@@ -14,20 +14,23 @@
# 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;
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 +43,3 @@ sub AdSenseNewGetHtmlHeader {
sub GetAdSense {
return GetPageContent($AdSensePageName) if GetParam('action', 'browse') eq 'browse';
}

View File

@@ -12,14 +12,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/>.
package OddMuse;
use strict;
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

@@ -16,9 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
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 +34,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 +49,7 @@ sub NewAgeGetHeader {
}
}
return $header unless $theme;
$oldtheme = GetParam('theme', $ScriptName);
my $oldtheme = GetParam('theme', $ScriptName);
$header =~ s/class="$oldtheme"/class="$theme"/; # touch as little as possible
return $header;
}

View File

@@ -16,8 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
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 {
@@ -61,7 +65,7 @@ sub AggregateRule {
($_, pos) = ($old_, $oldpos); # restore \G (assignment order matters!)
return '';
}
return undef;
return;
}
$Action{aggregate} = \&DoAggregate;
@@ -139,12 +143,7 @@ sub DoAggregate {
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";

View File

@@ -16,11 +16,15 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
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 +36,8 @@ sub DoPrintAllPages {
PrintFooter();
}
*OldAllScriptLink = *ScriptLink;
*ScriptLink = *NewAllScriptLink;
*OldAllScriptLink = \&ScriptLink;
*ScriptLink = \&NewAllScriptLink;
sub NewAllScriptLink {
my ($action, $text, $class, $name, $title, $accesskey, $nofollow) = @_;
@@ -41,6 +45,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,8 +12,11 @@
# 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;
AddModuleDescription('anchors.pl', 'Local Anchor Extension');
our ($q, %Page, $FootnoteNumber, $FreeLinkPattern, @MyRules, $BracketWiki);
push(@MyRules, \&AnchorsRule);
sub AnchorsRule {
@@ -35,8 +38,10 @@ 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;
@@ -44,5 +49,19 @@ sub AnchorsRule {
} elsif (m/\G\[\:$FreeLinkPattern\]/gc) {
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

@@ -16,9 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
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 +30,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;
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;
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 +65,5 @@ sub MaskEmailRule {
}
return $email;
}
return undef;
return;
}

View File

@@ -16,10 +16,14 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
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 +36,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,14 @@
# 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;
AddModuleDescription('askpage.pl', 'Ask Page Extension');
use Fcntl qw(:DEFAULT :flock);
use vars qw($AskPage $QuestionPage $NewQuestion);
our ($DataDir);
our ($AskPage, $QuestionPage, $NewQuestion);
# Don't forget to set your $CommentsPattern to include both $AskPage and $QuestionPage
$AskPage = 'Ask';
$QuestionPage = 'Question_';
@@ -35,8 +38,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 +50,16 @@ sub NewAskPageDoPost {
OldAskPageDoPost($id, @_); # keep original functionality for regular edits
}
*OldAskPageGetCommentForm=*GetCommentForm;
*GetCommentForm=*NewAskPageGetCommentForm;
*OldAskPageGetCommentForm=\&GetCommentForm;
*GetCommentForm=\&NewAskPageGetCommentForm;
sub NewAskPageGetCommentForm {
my ($id, $rev, $comment) = @_;
$NewComment = $NewQuestion if $id eq $AskPage;
$comment = $NewQuestion if not $comment and $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,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 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 +102,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 +123,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.')))
@@ -173,7 +185,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

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env perl
use strict;
# ====================[ autolock.pl ]====================
=head1 NAME
@@ -23,10 +25,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 +37,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 +135,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) = @_;

View File

@@ -19,9 +19,14 @@
# Grab MLDBM at http://search.cpan.org/dist/MLDBM/lib/MLDBM.pm
# ie: http://search.cpan.org/CPAN/authors/id/C/CH/CHAMAS/MLDBM-2.01.tar.gz
use strict;
use 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
@@ -54,9 +59,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 +89,7 @@ sub BacklinkProcess {
if ($exists) {
push (@backlinks,$resolved) unless (($seen{$resolved}++) or ($resolved eq $name));
}
}
}
return @backlinks;
}
@@ -92,14 +97,14 @@ sub BacklinkProcess {
sub GetBackLink {
my (@backlinks, @unpopped, @alldone);
my $id = $_[0];
use vars qw($BacklinkBanned);
our ($BacklinkBanned);
$BacklinkBanned = "HomePage|ScratchPad" if !$BacklinkBanned;
tie my %backhash, 'MLDBM', $backfile, O_CREAT|O_RDWR, 0644 or die "Cannot open file $backfile $!\n";
tie my %backhash, 'MLDBM', $backfile, O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
# Search database for matches
while ( ($source, $hashes) = each %backhash ) {
while ( ($key, $value) = each %$hashes ) {
while ( my ($source, $hashes) = each %backhash ) {
while ( my ($key, $value) = each %$hashes ) {
if ($id =~ /$value/) {
push (@backlinks, $source);
}
@@ -114,11 +119,11 @@ sub GetBackLink {
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, T('Internal Page: ' . $resolved)));
}
}
my $arraycount = @unpopped;
return if !$arraycount; # Dont bother with the rest if empty results
# Pop and Push data to make it look good (no trailing commas)
# Pop and Push data to make it look good (no trailing commas)
my $temp = pop(@unpopped);
foreach my $backlink (@unpopped) {
push(@alldone, $backlink . ", ");

View File

@@ -1,19 +1,23 @@
# 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;
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 +34,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 +50,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

@@ -24,6 +24,8 @@ allowing you to ban him or her immediately. If you click the button,
the IP or hostname will be added to the C<BannedHosts> page for you.
=cut
use strict;
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
@@ -112,8 +114,8 @@ that will be added to BannedHosts.
=cut
*OldBanContributorsWriteRcLog = *WriteRcLog;
*WriteRcLog = *NewBanContributorsWriteRcLog;
*OldBanContributorsWriteRcLog = \&WriteRcLog;
*WriteRcLog = \&NewBanContributorsWriteRcLog;
sub NewBanContributorsWriteRcLog {
my ($tag, $id, $to) = @_;

View File

@@ -15,10 +15,14 @@
# This file must load before logbannedcontent.pl such that quick
# editors will be logged.
use strict;
AddModuleDescription('ban-quick-editors.pl', 'Banning Quick Editors');
*BanQuickOldUserIsBanned = *UserIsBanned;
*UserIsBanned = *BanQuickNewUserIsBanned;
our ($Now, %RecentVisitors, $SurgeProtection);
*BanQuickOldUserIsBanned = \&UserIsBanned;
*UserIsBanned = \&BanQuickNewUserIsBanned;
sub BanQuickNewUserIsBanned {
my $rule = BanQuickOldUserIsBanned(@_);

View File

@@ -12,7 +12,7 @@
# 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;
AddModuleDescription('banned-regexps.pl', 'Banning Regular Expressions');
@@ -42,7 +42,8 @@ This extension works with logbannedcontent.pl.
=cut
use vars qw($BannedRegexps);
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile);
our ($BannedRegexps);
$BannedRegexps = 'BannedRegexps';
@@ -52,11 +53,8 @@ push(@MyInitVariables, sub {
$PlainTextPages{$BannedRegexps} = 1;
});
*RegexpOldBannedContent = *BannedContent;
*BannedContent = *RegexpNewBannedContent;
# the above also changes the mapping for the variable!
$BannedContent = $RegexpOldBannedContent;
*RegexpOldBannedContent = \&BannedContent;
*BannedContent = \&RegexpNewBannedContent;
sub RegexpNewBannedContent {
my $str = shift;

View File

@@ -12,13 +12,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;
AddModuleDescription('bbcode.pl', 'bbCode Extension');
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
push(@MyRules, \&bbCodeRule);
$RuleOrder{\&bbCodeRule} = 100; # must come after PortraitSupportRule
use vars qw($bbBlock);
our ($bbBlock);
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);
# This code does not allow the nesting of block elements such as quote
@@ -100,7 +102,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 +134,5 @@ sub bbCodeRule {
elsif (/\G:(?:sad|frown):/cg) {
return '&#x1F61F;'; }
# no match
return undef;
return;
}

View File

@@ -1,50 +0,0 @@
# Copyright (C) 2004 Xavier Maillard
# Copyright (C) 2004 Alex Schroeder <alex@emacswiki.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
AddModuleDescription('beautify.pl', 'Source Code Beautification Extension');
use Beautifier::Core;
use Output::HTML;
push(@MyRules, \&BeautificationRule);
sub BeautificationRule {
if ($bol and m/\G&lt;source\s+([a-zA-Z0-9]+)\s*&gt;\n?(.*?\n)&lt;\/source&gt;[ \t]*\n?/cgs) {
my $old_ = $_;
my $oldpos = pos;
my $lang = $1;
my $source= $2;
my $result = $source;
eval { $result = Beautify($lang, $source); };
$result = $@ if $@;
$_ = $old_;
pos = $oldpos;
return CloseHtmlEnvironments() . $q->div({-class=>'beauty'}, $result) . AddHtmlEnvironment('p');
}
return undef;
}
sub Beautify {
my ($lang, $source) = @_;
eval "use HFile::HFile_$lang";
my $Hfile = eval "new HFile::HFile_$lang";
return $q->strong(Ts('Cannot highlight the language %s.', $lang)) . "\n\n" . $source if $@;
my $highlighter = new Beautifier::Core($Hfile, new Output::HTML);
return $highlighter->highlight_text(UnquoteHtml($source));
}

View File

@@ -13,16 +13,21 @@
# 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;
AddModuleDescription('big-brother.pl', 'Big Brother Extension');
use vars qw($VisitorTime);
our ($q, $Now, %Action, $SurgeProtectionViews, $SurgeProtectionTime, @MyAdminCode, $RCName, $VisitorFile, $FS);
our ($VisitorTime, @BigBrotherSecretParameters);
my $US = "\x1f";
$VisitorTime = 7200; # keep visitor data arround for 2 hours.
# normal password parameter from wiki.pl
# password parameters from login.pl
@BigBrotherSecretParameters = qw(pwd pwd1 pwd2 oldpwd);
push(@MyAdminCode, \&BigBrotherVisitors);
sub BigBrotherVisitors {
@@ -47,6 +52,13 @@ sub AddRecentVisitor {
$ts++ while $entries{$ts};
my $action = GetParam('action', 'browse');
my $id = GetId(); # script/p/q -> q
my %params = map { $_ => 1 } $q->param;
for my $bad (@BigBrotherSecretParameters) {
delete $params{$bad};
}
my $url = ScriptUrl(join(';', "action=$action;id=" . UrlEncode($id),
map { $_ . '=' . UrlEncode(GetParam($_)) }
keys %params));
my $url = $q->url(-path_info=>1,-query=>1);
my $download = GetParam('action', 'browse') eq 'download'
|| GetParam('download', 0)

View File

@@ -16,8 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('blockquote.pl', 'Comments on Text Formatting Rules');
our ($bol, @MyRules);
push(@MyRules, \&BlockQuoteRule);
sub BlockQuoteRule {
@@ -31,5 +35,5 @@ sub BlockQuoteRule {
. AddHtmlEnvironment('blockquote')
. AddHtmlEnvironment('p');
}
return undef;
return;
}

View File

@@ -1,89 +0,0 @@
# Copyright (C) 2004 Alex Schroeder <alex@emacswiki.org>
# 2004 Tilmann Holst <spam@tholst.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
# You may need to set $calcmd below.
# Without the cal program (shipped with almost every unix) this extension
# is useless. This extension will not work under Windows/IIS unless cal
# is installed.
AddModuleDescription('cal3.pl', 'Cal3 Extension');
*OldCalendarGetHeader = *GetHeader;
*GetHeader = *NewCalendarGetHeader;
sub NewCalendarGetHeader {
my ($csec, $cmin, $chour, $cmday, $cmon, $cyear) = gmtime();
$cyear += 1900;
$cmon += 1;
my qw($cal $prevmon $prevyear $nextmon $nextyear);
# check if previous month is in previous year
if ($cmon == 1){
$prevmon = "12";
$prevyear = ($cyear - 1);
} else {
$prevmon = ($cmon - 1);
$prevyear = $cyear;
}
# check if next month is in next year
if ($cmon == "12") {
$nextmon = "1";
$nextyear = ($cyear + 1);
} else {
$nextmon = ($cmon + 1);
$nextyear = $cyear;
}
my $header = OldCalendarGetHeader(@_);
# commenting out the last line of this paragraph makes cal3 a cal2
# extension.
$cal = Cal($nextmon,$nextyear);
$cal .= Cal($cmon,$cyear);
$cal .= Cal($prevmon,$prevyear);
$header =~ s/<div class="header">/$cal<div class="header">/;
return $header;
}
sub Cal {
my ($month,$year) = @_;
# set $calcmd to an appropriate value
my $calcmd = 'cal'; # week starts with sunday
# my $calcmd = 'cal -m'; # week starts with monday
# my $calcmd = 'export LC_ALL=de_DE.UTF-8;/insert/path/here/cal -m'; # example with different path to cal and different locale
my $cal = `$calcmd $month $year`;
return unless $cal;
my ($sec, $min, $hour, $mday, $mon, $myyear) = gmtime($Now);
$cal =~ s|\b( ?\d?\d)\b|{
my $day = $1;
my $date = sprintf("%d-%02d-%02d", $year, $month, $day);
my $class;
if ($month == ($mon + 1)) {
$class = ($day == $mday) ? 'today'
: ($IndexHash{$date} ? 'exists' : 'wanted');
} else {
$class = ($IndexHash{$date} ? 'exists' : 'wanted');
}
"<a class=\"$class\" href=\"$ScriptName/$date\">$day</a>";
}|ge;
return "<div class=\"cal\"><pre>$cal</pre></div>";
}

View File

@@ -17,16 +17,19 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('calendar.pl', 'Calendar Extension');
use vars qw($CalendarOnEveryPage $CalAsTable $CalStartMonday);
our ($q, %Page, %Action, $Now, $OpenPageName, $CollectingJournal, $FreeLinkPattern, @MyRules);
our ($CalendarOnEveryPage, $CalAsTable, $CalStartMonday);
$CalendarOnEveryPage = 0; # 1=on every page is a month-div situated in the header, use css to control
$CalAsTable = 0; # 0=every month-div is "free", 1=every month-div is caught in a table, use css to control
$CalStartMonday = 0; # 0=week starts with Su, 1=week starts with Mo
*OldCalendarGetHeader = *GetHeader;
*GetHeader = *NewCalendarGetHeader;
*OldCalendarGetHeader = \&GetHeader;
*GetHeader = \&NewCalendarGetHeader;
sub NewCalendarGetHeader {
my $header = OldCalendarGetHeader(@_);
@@ -51,7 +54,7 @@ sub Cal {
}
my @pages = AllPagesList();
my $cal = draw_month($mon, $year);
$cal =~ s{( {1,2}\d{1,2})\b}{{
$cal =~ s{ ( ?\d{1,2})\b}{{
my $day = $1;
my $date = sprintf("%d-%02d-%02d", $year, $mon, $day);
my $re = "^$date";
@@ -61,13 +64,13 @@ sub Cal {
my $class = '';
$class .= ' today' if $day == $mday_now and $mon == $mon_now and $year == $year_now;
my @matches = grep(/$re/, @pages);
my $link;
my $link = ' ';
if (@matches == 0) { # not using GetEditLink because of $class
$link = ScriptLink('action=edit;id=' . UrlEncode($page), $day, 'edit' . $class);
$link .= ScriptLink('action=edit;id=' . UrlEncode($page), $day, 'edit' . $class);
} elsif (@matches == 1) { # not using GetPageLink because of $class
$link = ScriptLink($matches[0], $day, 'local exact' . $class);
$link .= ScriptLink($matches[0], $day, 'local exact' . $class);
} else {
$link = ScriptLink('action=collect;match=' . UrlEncode($re), $day, 'local collection' . $class);
$link .= ScriptLink('action=collect;match=' . UrlEncode($re), $day, 'local collection' . $class);
}
$link;
}}ge;
@@ -144,26 +147,26 @@ sub CalendarRule {
pos = $oldpos;
return AddHtmlEnvironment('p');
}
return undef;
return;
}
sub PrintYearCalendar {
my $year = shift;
print $q->p({-class=>nav},
print $q->p({-class=>'nav'},
ScriptLink('action=calendar;year=' . ($year-1), T('Previous')),
'|',
ScriptLink('action=calendar;year=' . ($year+1), T('Next')));
if ($CalAsTable) {
print '<table><tr>';
for $mon ((1..12)) {
for my $mon (1..12) {
print '<td>'.Cal($year, $mon, 1).'</td>';
if (($mon==3) or ($mon==6) or ($mon==9)) {
if ($mon == 3 or $mon == 6 or $mon == 9) {
print '</tr><tr>';
}
}
print '</tr></table>';
} else {
for $mon ((1..12)) {
for my $mon (1..12) {
print Cal($year, $mon, 1);
}
}
@@ -234,7 +237,7 @@ sub draw_month {
}
# formula of Zeller (Julius Christian Johannes Zeller * 1822, + 1899) for countig the day of week
# only works for all years greater then 0 and can handle 1582 the year Pope Gregor has changed the
# only works for all years greater then 0 and can handle 1582 the year Pope Gregor has changed the
# calculation of times from the Julian calendar to the Gregorian calendar
sub zeller {
my $t = shift;

View File

@@ -16,12 +16,14 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('canonical.pl', 'Canonical Names');
use utf8;
*OldCanonicalResolveId = *ResolveId;
*ResolveId = *NewCanonicalResolveId;
*OldCanonicalResolveId = \&ResolveId;
*ResolveId = \&NewCanonicalResolveId;
my %CanonicalName = ();

View File

@@ -16,8 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('checkbox.pl', 'Checklist Extension');
our ($q, $bol, @HtmlStack, %Action, %Page, $OpenPageName, @MyRules);
# [[ : To do]]
# [[X: Done]]
# [[save: Save]]
@@ -53,7 +57,7 @@ sub CheckBoxRule {
return $1;
}
}
return undef;
return;
}
$Action{checkbox} = \&DoCheckBox;

View File

@@ -16,9 +16,14 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('clustermap.pl', 'ClusterMap Module');
use vars qw($ClusterMapPage $ClusterMapTOC $FilterUnclusteredRegExp @ClusterMapAdminPages);
our ($q, %Action, %Page, $OpenPageName, @MyRules, @MyAdminCode, $HomePage, $DeletedPage, $RCName, $InterMap, $BannedContent, $BannedHosts, %AdminPages, $RssExclude, @AdminPages, $NearMap);
our ($ClusterMapPage, %ClusterMap, $ClusterMapTOC, $FilterUnclusteredRegExp, @ClusterMapAdminPages, $PrintTOCAnchor);
my %Unclustered = ();
$ClusterMapPage = "Site_Map" unless defined $ClusterMapPage;
@@ -32,16 +37,16 @@ $FilterUnclusteredRegExp = '\d\d\d\d-\d\d-\d\d|\d* *Comments on .*'
# They are also added to the Important Pages list on the administration page
@ClusterMapAdminPages = ( $HomePage, $DeletedPage, $BannedContent,
$BannedHosts, $InterMap, $NearMap, $RCName, $RssExclude)
unless defined @ClusterMapAdminPages;
unless @ClusterMapAdminPages;
$ClusterMapTOC = 1 unless defined $ClusterMapTOC;
$PrintTOCAnchor = 0;
%ClusterMap = ();
*OldPrintRcHtml = *PrintRcHtml;
*PrintRcHtml = *ClusterMapPrintRcHtml;
*OldPrintRcHtml = \&PrintRcHtml;
*PrintRcHtml = \&ClusterMapPrintRcHtml;
push(@MyAdminCode, \&ClusterMapAdminRule);
@@ -59,7 +64,7 @@ sub ClusterMapRule {
if (/\G^([\n\r]*\<\s*clustermap\s*\>\s*)$/mgc) {
Dirty($1);
my $oldpos = pos;
$oldstr = $_;
my $oldstr = $_;
CreateClusterMap();
print "</p>"; # Needed to clean up, but could cause problems
# if <clustermap> isn't put into a new paragraph
@@ -69,8 +74,7 @@ sub ClusterMapRule {
$_ = $oldstr;
return '';
}
return undef;
return;
}
@@ -79,7 +83,7 @@ sub DoClusterMap {
# For each cluster, get list of all pages in that cluster
# Create map, using body of cluster pages, followed by titles of pages
# within that cluster
print GetHeader('',$ClusterMapPage,'');
CreateClusterMap();
@@ -94,21 +98,20 @@ sub DoClusterMap {
print '</ol></div>';
$PrintTOCAnchor = 1;
}
print '<div class="content">';
PrintClusterMap();
print '<div class="content">';
PrintClusterMap();
print '</div>';
PrintFooter();
}
sub DoUnclustered {
print GetHeader('','Pages without a Cluster','');
print '<div class="content">';
CreateClusterMap();
PrintUnclusteredMap();
print '</div>';
PrintFooter();
}
@@ -122,7 +125,7 @@ sub PrintClusterMap {
$free =~ s/_/ /g;
OpenPage($cluster);
if ( FreeToNormal(GetCluster($Page{text})) eq $cluster ) {
# Don't display the page name twice if the cluster page is also
# a member of the cluster
@@ -137,7 +140,7 @@ sub PrintClusterMap {
print $q->h1(GetPageOrEditLink($free, $free));
}
PrintWikiToHTML($Page{text}, 0);
print "<ul>";
foreach my $page (sort keys %{$ClusterMap{$cluster}}) {
my $title = $page;
@@ -150,28 +153,28 @@ sub PrintClusterMap {
sub CreateClusterMap {
my @pages = AllPagesList();
local %Page;
local $OpenPageName='';
foreach my $page ( @pages) {
OpenPage($page);
my $cluster = FreeToNormal(GetCluster($Page{text}));
next if ($cluster eq $DeletedPage); # Don't map Deleted Pages
next if (TextIsFile($Page{text})); # Don't map files
if ($cluster eq "") { # Grab Unclustered Pages
$Unclustered{$page} = 1;
next;
}
if ($cluster ne FreeToNormal($page)) { # Create Cluster Map
$ClusterMap{$cluster}{$page} = 1;
}
}
# Strip out Admin Pages
foreach my $page (@AdminPages) {
delete($Unclustered{$page});
@@ -180,27 +183,26 @@ sub CreateClusterMap {
sub ClusterMapPrintRcHtml {
my ( @options ) = @_;
my $page = "";
my $cluster = GetParam(rcclusteronly);
my $cluster = GetParam('rcclusteronly');
if ($cluster ne "") {
CreateClusterMap();
print "Pages in this cluster:";
print "<ul>";
foreach $page (sort keys %{$ClusterMap{$cluster}}) {
foreach my $page (sort keys %{$ClusterMap{$cluster}}) {
my $title = $page;
$title =~ s/_/ /g;
print "<li>" . ScriptLink($page, $title, 'local') . "</li>";
}
print "</ul>";
}
OldPrintRcHtml(@options);
}
sub PrintUnclusteredMap {
print "<ul>";
foreach $page (sort keys %Unclustered) {
foreach my $page (sort keys %Unclustered) {
my $title = $page;
$title =~ s/_/ /g;
if ($title !~ /^($FilterUnclusteredRegExp)$/) {
@@ -208,18 +210,17 @@ sub PrintUnclusteredMap {
}
}
print "</ul>";
}
sub ClusterMapAdminRule {
($id, $menuref, *restref) = @_;
my ($id, $menuref) = @_;
push(@$menuref, ScriptLink('action=clustermap', T('Clustermap'), 'clustermap'));
push(@$menuref, ScriptLink('action=unclustered', T('Pages without a Cluster'), 'unclustered'));
}
*OldBrowseResolvedPage = *BrowseResolvedPage;
*BrowseResolvedPage = *ClusterMapBrowseResolvedPage;
*OldBrowseResolvedPage = \&BrowseResolvedPage;
*BrowseResolvedPage = \&ClusterMapBrowseResolvedPage;
sub ClusterMapBrowseResolvedPage {
my $title = shift;
@@ -228,7 +229,7 @@ sub ClusterMapBrowseResolvedPage {
if ($id eq $ClusterMapPage) {
CreateClusterMap();
print GetHeader('',$title,'');
print '<div class="content">';
print '<div class="content">';
if ($ClusterMapTOC) {
my $TOCCount = 0;
print '<div class="toc"><h2>Categories</h2><ol>';
@@ -241,15 +242,15 @@ sub ClusterMapBrowseResolvedPage {
$PrintTOCAnchor = 1;
}
PrintClusterMap();
print '</div>';
print '</div>';
PrintFooter();
} else {
OldBrowseResolvedPage($id);
}
}
*OldPrintWikiToHTML = *PrintWikiToHTML;
*PrintWikiToHTML = *ClusterMapPrintWikiToHTML;
*OldPrintWikiToHTML = \&PrintWikiToHTML;
*PrintWikiToHTML = \&ClusterMapPrintWikiToHTML;
sub ClusterMapPrintWikiToHTML {
my ($pageText, $savecache, $revision, $islocked) = @_;
@@ -260,7 +261,7 @@ sub ClusterMapPrintWikiToHTML {
&& ($pageText =~ /^\s*$/s)){
SetParam('rcclusteronly',0);
CreateClusterMap();
print '<div class="content">';
print '<div class="content">';
if ($ClusterMapTOC) {
my $TOCCount = 0;
print '<div class="toc"><h2>Contents</h2><ol>';
@@ -272,7 +273,7 @@ sub ClusterMapPrintWikiToHTML {
$PrintTOCAnchor = 1;
}
PrintClusterMap();
print '</div>';
print '</div>';
}
OldPrintWikiToHTML(@_);
}

View File

@@ -13,10 +13,11 @@
# 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;
AddModuleDescription('comment-div-wrapper.pl', 'Comment Div Wrapper Extension');
our ($q, $bol, $OpenPageName, @MyRules, %RuleOrder, $CommentsPrefix, $CommentsPattern, $FS);
my $CommentDiv = 0;
push(@MyRules, \&CommentDivWrapper);
$RuleOrder{\&CommentDivWrapper} = -50;
@@ -36,12 +37,12 @@ sub CommentDivWrapper {
return $html;
}
}
return undef;
return;
}
# close final div
*OldCommentDivApplyRules = *ApplyRules;
*ApplyRules = *NewCommentDivApplyRules;
*OldCommentDivApplyRules = \&ApplyRules;
*ApplyRules = \&NewCommentDivApplyRules;
sub NewCommentDivApplyRules {
my ($blocks, $flags) = OldCommentDivApplyRules(@_);

View File

@@ -16,10 +16,14 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('commentcount.pl', 'Comment Count Extension');
*OldCommentcountAddComment = *AddComment;
*AddComment = *NewCommentcountAddComment;
our ($CommentsPrefix);
*OldCommentcountAddComment = \&AddComment;
*AddComment = \&NewCommentcountAddComment;
sub NewCommentcountAddComment {
my ($old, $comment) = @_;
@@ -39,12 +43,12 @@ sub NewCommentcountAddComment {
return $new;
}
*OldCommentcountScriptLink = *ScriptLink;
*ScriptLink = *NewCommentcountScriptLink;
*OldCommentcountScriptLink = \&ScriptLink;
*ScriptLink = \&NewCommentcountScriptLink;
sub NewCommentcountScriptLink {
my ($action, $text, @rest) = @_;
if ($CommentsPrefix && $action =~ /^$CommentsPrefix(.*)/) {
if ($CommentsPrefix && $action =~ /^$CommentsPrefix(.*)/) { # TODO use $CommentsPattern ?
# Add the number of comments here
my $id = $action;
$id =~ s/%([0-9a-f][0-9a-f])/chr(hex($1))/ge; # undo urlencode

View File

@@ -16,8 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('compilation.pl', 'Compilation Extension');
our ($q, $bol, %Action, %Page, $OpenPageName, $CollectingJournal, @MyRules);
$Action{compilation} = \&DoCompilation;
sub DoCompilation {
@@ -67,5 +71,5 @@ sub CompilationRule {
pos = $oldpos; # restore \G after call to ApplyRules
return AddHtmlEnvironment('p');
}
return undef;
return;
}

View File

@@ -1,104 +0,0 @@
# Copyright (C) 2006 Alex Schroeder <alex@emacswiki.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
AddModuleDescription('config.pl', 'Plans');
$Action{config} = \&DoConfig;
$Action{clone} = \&DoClone;
sub DoConfig {
print GetHttpHeader('text/plain') . qq{# Wiki Config
# Source Wiki: $SiteName <$ScriptName>
# } . TimeToText($Now) . qq{
\$AdminPass = "";
\$EditPass = "";
};
my $source = GetRaw('http://www.emacswiki.org/scripts/current');
foreach my $var qw($HomePage $MaxPost $StyleSheet $StyleSheetPage $NotFoundPg
$NewText $NewComment $EditAllowed $BannedHosts
$BannedCanRead $BannedContent $WikiLinks $FreeLinks
$BracketText $BracketWiki $NetworkFile $AllNetworkFiles
$PermanentAnchors $InterMap $NearMap $RssInterwikiTranslate
$SurgeProtection $SurgeProtectionTime $SurgeProtectionViews
$DeletedPage $RCName @RcDays $RcDefault $KeepDays
$KeepMajor $SummaryHours $SummaryDefaultLength $ShowEdits
$RecentTop $RecentLink $PageCluster
$InterWikiMoniker $SiteDescription $RssImageUrl $RssRights
$RssExclude $RssCacheHours $RssStyleSheet $UploadAllowed
@UploadTypes $EmbedWiki $FooterNote $EditNote $TopLinkBar
@UserGotoBarPages $UserGotoBar $ValidatorLink
$CommentsPrefix $HtmlHeaders $IndentLimit $LanguageLimit
$JournalLimit $SisterSiteLogoUrl %SpecialDays %Smilies
%Languages) {
my $default = undef;
my $re = quotemeta($var);
if ($source =~ m!\n$re\s*=\s*(\d+(\s*[*+-/]\s*\d+)*|'[^']*'|"[^"]*"|\(.*?\)|qw\(.*?\))\s*;!) {
$default = $1;
}
$type = substr($var, 0, 1);
if ($type eq '$') {
my $val = eval($var);
print "$var = " . ConfigStr($val) . "; # default: $default\n"
if $val ne eval($default);
} elsif ($type eq '@') {
my @list = eval($var);
my @default = eval($default);
print "$var = (", join(', ', map { ConfigStr($_) } @list)
. "); # default: $default\n"
unless ConfigListEqual(\@list, \@default);
} elsif ($type eq '%') {
my %hash = eval($var);
my @default = eval($default);
print "$var = (", join(', ', map { ConfigStr($_)
. ' => ' . ConfigStr($hash{$_})}
keys %hash) . "); # default: $default\n"
unless ConfigHashEqual(\%hash, \%default);;
}
}
print "# Done!\n";
}
sub ConfigStr {
$_ = shift;
if (m/^\d+$/) {
$_;
} elsif (m/'/) {
"q{$_}";
} else {
"'$_'";
}
}
sub ConfigListEqual {
my ($a, $b) = @_;
return 0 if @$a != @$b;
for ($i = 0; $i < @$a; $i++) {
return 0 unless @$a[$i] eq @$b[$i];
}
return 1;
}
sub ConfigHashEqual {
my ($a, $b) = @_;
return 0 unless ConfigListEqual([keys %$a], [keys %$b]);
foreach my $key (keys %$a) {
next if $$a{$key} eq $$b{$key};
return 0;
}
return 1;
}

View File

@@ -13,8 +13,11 @@
# 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;
AddModuleDescription('context.pl', 'Calendar Extension');
our ($q, @Debugging, $UserGotoBar, @MyInitVariables);
push (@MyInitVariables, \&ContextMenuItem);
sub ContextMenuItem {

View File

@@ -16,17 +16,21 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
#
# This module stores additional information about a page when it is
# This module stores additional information about a page when it is
# first created:
# created = the date the page is FIRST saved
# originalAuthor = the username that first created a page
#
# Of course, you can customize this to store more information
use strict;
AddModuleDescription('creationdate.pl', 'CreationDate Module');
*CreationDateOldOpenPage = *OpenPage;
*OpenPage = CreationDateOpenPage;
our (%Page, $Now);
*CreationDateOldOpenPage = \&OpenPage;
*OpenPage = \&CreationDateOpenPage;
sub CreationDateOpenPage{
CreationDateOldOpenPage(@_);

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env perl
use strict;
# ====================[ creole.pl ]====================
=head1 NAME
@@ -12,10 +14,10 @@ creole is easily installable; move this file into the B<wiki/modules/>
directory for your Oddmuse Wiki.
=cut
package OddMuse;
AddModuleDescription('creole.pl', 'Creole Markup Extension');
our ($q, $bol, %InterSite, $FullUrlPattern, $FreeLinkPattern, $FreeInterLinkPattern, $InterSitePattern, @MyRules, %RuleOrder, @MyInitVariables, @HtmlStack, @HtmlAttrStack);
# ....................{ CONFIGURATION }....................
=head1 CONFIGURATION
@@ -24,9 +26,9 @@ creole is easily configurable; set these variables in the B<wiki/config.pl>
file for your Oddmuse Wiki.
=cut
use vars qw($CreoleLineBreaks
$CreoleTildeAlternative
$CreoleTableCellsContainBlockLevelElements
our ($CreoleLineBreaks,
$CreoleTildeAlternative,
$CreoleTableCellsContainBlockLevelElements,
$CreoleDashStyleUnorderedLists);
=head2 $CreoleLineBreaks
@@ -421,7 +423,7 @@ sub CreoleRule {
return OpenHtmlEnvironment('table', 1, 'user').AddHtmlEnvironment('tr');
}
return undef;
return;
}
sub CreoleHeadingRule {
@@ -454,7 +456,7 @@ sub CreoleHeadingRule {
return $header_html;
}
return undef;
return;
}
sub CreoleListAndNewLineRule {
@@ -463,7 +465,7 @@ sub CreoleListAndNewLineRule {
# # numbered list
# * bullet list (nestable; needs space when nested to disambiguate from bold)
if (($bol and m/\G[ \t]*([#*])[ \t]*/cg) or
($is_in_list_item and m/\G[ \t]*\n+[ \t]*(#+)[ \t]*/cg) or
($is_in_list_item and m/\G[ \t]*\n+[ \t]*(#+)[ \t]*/cg) or
($is_in_list_item and m/\G[ \t]*\n+[ \t]*(\*+)[ \t]+/cg)) {
# Note: the first line of this return statement is --not-- equivalent to:
# "return CloseHtmlEnvironmentUntil('li')", as that line does not permit
@@ -492,7 +494,7 @@ sub CreoleListAndNewLineRule {
return $q->br();
}
return undef;
return;
}
# ....................{ HTML }....................
@@ -559,8 +561,8 @@ sub GetCreoleLinkHtml {
}
# ....................{ FUNCTIONS }....................
*RunMyRulesCreoleOld = *RunMyRules;
*RunMyRules = *RunMyRulesCreole;
*RunMyRulesCreoleOld = \&RunMyRules;
*RunMyRules = \&RunMyRulesCreole;
=head2 RunMyRulesCreole
@@ -590,11 +592,14 @@ C<CreoleRule>. This function ensures, among other safeties, that the
C<CreoleRule> function is not recursed into more than once.
=cut
our $CreoleRuleRecursing; # must have a variable to localize below
sub CreoleRuleRecursive {
my $markup = shift;
return $markup if $CreoleRuleRecursing; # avoid infinite loops
local $CreoleRuleRecursing = 1;
local $bol = 0; # prevent block level element handling
local $CreoleRuleRecursing = 1; # use local for the mod_perl case
local $bol = 0; # prevent block level element handling
# Preserve global variables.
my ($oldpos, $old_) = (pos, $_);

View File

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

View File

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

View File

@@ -16,8 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('crumbs.pl', 'List Parent Pages Extension');
our ($q, %RuleOrder, @MyRules, $LinkPattern, $FreeLinks, $FreeLinkPattern, $WikiLinks);
push(@MyRules, \&CrumbsRule);
$RuleOrder{\&CrumbsRule} = -10; # run before default rules!
@@ -44,5 +48,5 @@ sub CrumbsRule {
pos = $oldpos; # set after $_ is set!
return $result; # clean rule, will be cached!
}
return undef;
return;
}

View File

@@ -1,3 +1,5 @@
use strict;
=head1 NAME
css-install - an Oddmuse module that allows users to change the site CSS
@@ -25,9 +27,8 @@ C<@CssList> contains a list of all the recommended CSS URLs.
=cut
package OddMuse;
use vars qw(@CssList);
our ($q, %Action, @MyAdminCode, $StyleSheet, $StyleSheetPage);
our (@CssList);
# List of Oddmuse CSS URLs

View File

@@ -16,8 +16,12 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('csv.pl', 'Comments on Long Table Markup Extension');
our ($bol, @MyRules);
push(@MyRules, \&CsvRule);
my $RowCount;
@@ -40,5 +44,5 @@ sub CsvRule {
return "</td><td>";
}
# an empty line will end the table automatically; no closing tag is required
return undef;
return;
}

View File

@@ -13,8 +13,11 @@
# 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;
AddModuleDescription('dates.pl', 'Dates Extension');
our ($q, %Action, @MyAdminCode);
push(@MyAdminCode, \&DatesMenu);
sub DatesMenu {
@@ -39,8 +42,8 @@ sub DoDates {
my %date_collection;
my $date_page;
*OldDatesSearchString = *SearchString;
*SearchString = *NewDatesSearchString;
*OldDatesSearchString = \&SearchString;
*SearchString = \&NewDatesSearchString;
sub NewDatesSearchString {
$date_page = $_[1]; # save the page text!

View File

@@ -1,33 +0,0 @@
#! /usr/bin/perl
# Copyright (C) 2009 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;
AddModuleDescription('debug.pl');
@Debugging = (\&DebugInterLinks);
sub DebugInterLinks {
print $q->h2(T('Inter links:')) . $q->p(join(', ', sort keys %InterSite))
if %InterSite;
}
*OldPrintFooter = *PrintFooter;
*PrintFooter = *NewPrintFooter;
sub NewPrintFooter {
OldPrintFooter(@_);
print "Debug Info: $DebugInfo";
}

View File

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

View File

@@ -16,6 +16,10 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
our ($q, $Now, %IndexHash, %Action, %Page, $OpenPageName, $FS, $BannedContent, $RcFile, $RcDefault, @MyAdminCode, $FullUrlPattern, $DeletedPage, $StrangeBannedContent);
AddModuleDescription('despam.pl', 'Despam Extension');
push(@MyAdminCode, \&DespamMenu);
@@ -127,7 +131,7 @@ sub DespamPage {
my $rule = shift;
# from DoHistory()
my @revisions = sort {$b <=> $a} map { m|/([0-9]+).kp$|; $1; } GetKeepFiles($OpenPageName);
foreach my $revision (@revisions) { # remember the last revision checked
foreach my $revision (@revisions) {
my ($text, $rev) = GetTextRevision($revision, 1); # quiet
if (not $rev) {
print ': ' . Ts('Cannot find revision %s.', $revision);
@@ -144,6 +148,6 @@ sub DespamPage {
print ': ' . $summary;
Save($OpenPageName, $DeletedPage, $summary) unless GetParam('debug', 0);
} else {
print ': ' . T('Cannot find unspammed revision.'. $revision);
print ': ' . T('Cannot find unspammed revision.');
}
}

View File

@@ -13,16 +13,17 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
package OddMuse;
use strict;
AddModuleDescription('diff.pl', 'Diff Action Extension');
our ($q, %Action, @IndexList, @MyRules, $TempDir);
push(@MyRules, \&DiffActionRule);
$Action{pagediff} = \&DoDiffAction;
sub DiffActionRule {
return PrintDiffActionChooser($3) if (m/\G(&lt;diff( (.*))&gt;)/cgi);
return undef; # the rule didn't match
return; # the rule didn't match
}
sub DoDiffAction {

View File

@@ -12,24 +12,34 @@
# 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;
AddModuleDescription('div-foo.pl', 'Div Foo Extension');
our (@MyRules);
our ($DivFooPrefix);
our (%RuleOrder);
$DivFooPrefix = 'foo_';
push(@MyRules, \&DivFooRule);
# conflicts with <nowiki> and other such rules by usemod.pl
$RuleOrder{\&DivFooRule} = 200;
sub DivFooRule {
if (m/\G\&lt;([\w ]+)\&gt;\s*\n/cg) {
return CloseHtmlEnvironment('p') . AddHtmlEnvironment('div', qq{class="$1"});
if (m/\G \&lt; ([a-z_-][a-z0-9 _-]+[a-z0-9_-]) \&gt; \s*\n /cgx) {
return CloseHtmlEnvironment('p') . AddHtmlEnvironment('div', 'class="' . join(' ', map {"$DivFooPrefix$_"} split /\s+/, $1) . '"');
}
if (m/\G\&lt;([\w ]+)\&gt;/cg) {
return AddHtmlEnvironment('span', qq{class="$1"});
if (m/\G \&lt; ([a-z_-][a-z0-9 _-]+[a-z0-9_-]) (\?(.*?(?=\&gt;)))? \&gt; /cgx) {
my $title = $3 ? ' title="' . QuoteHtml($3) . '"' : '';
return AddHtmlEnvironment('span', 'class="' . join(' ', map {"$DivFooPrefix$_"} split /\s+/, $1) . '"' . $title);
}
if (m/\G\&lt;\/\/\&gt;/cg) {
if (m/\G \&lt; \/ \/ \&gt; /cgx) {
return CloseHtmlEnvironment('div') . (InElement('div') ? '' : AddHtmlEnvironment('p'));
}
if (m/\G\&lt;\/\&gt;/cg) {
if (m/\G \&lt; \/ \&gt; /cgx) {
return CloseHtmlEnvironment('span');
}
return undef;
return;
}

View File

@@ -13,9 +13,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
AddModuleDescription('dojo.pl', 'Using Dojo Instead Of Wiki Markup');
use vars qw(@DojoPlugins $DojoTheme);
our ($q, $HtmlHeaders, @MyRules, @MyInitVariables, %CookieParameters);
our (@DojoPlugins, $DojoTheme);
$DojoTheme = 'tundra';
@@ -31,7 +34,7 @@ sub WysiwygRule {
or substr($1,4,6) eq 'script';
return UnquoteHtml($1);
}
return undef;
return;
}
# Add the dojo script to edit pages.
@@ -61,8 +64,8 @@ sub WysiwygScript {
SetParam('theme', $DojoTheme);
}
*OldWysiwygGetTextArea = *GetTextArea;
*GetTextArea = *NewWysiwygGetTextArea;
*OldWysiwygGetTextArea = \&GetTextArea;
*GetTextArea = \&NewWysiwygGetTextArea;
sub NewWysiwygGetTextArea {
my ($name, $text, $rows) = @_;
@@ -82,8 +85,8 @@ sub NewWysiwygGetTextArea {
}
}
*OldWysiwygImproveDiff = *ImproveDiff;
*ImproveDiff = *NewWysiwygImproveDiff;
*OldWysiwygImproveDiff = \&ImproveDiff;
*ImproveDiff = \&NewWysiwygImproveDiff;
sub NewWysiwygImproveDiff {
my $old = OldWysiwygImproveDiff(@_);

View File

@@ -21,10 +21,14 @@
# edit a page by double-clicking on it. The user must have
# JavaScript enabled for this to work.
use strict;
AddModuleDescription('doubleclick.pl', 'Doubleclick Extension');
*OldDoubleclickGetHeader = *GetHeader;
*GetHeader = NewDoubleclickGetHeader;
our ($ScriptName);
*OldDoubleclickGetHeader = \&GetHeader;
*GetHeader = \&NewDoubleclickGetHeader;
sub NewDoubleclickGetHeader {
my $id = shift;

View File

@@ -16,8 +16,11 @@
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
use strict;
AddModuleDescription('download.pl', 'Download Extension');
our (@MyRules, $FreeLinkPattern);
push( @MyRules, \&DownloadSupportRule );
# [[download:page name]]
@@ -30,5 +33,5 @@ sub DownloadSupportRule {
print GetDownloadLink($2, undef, undef, $3);
return '';
}
return undef;
return;
}

View File

@@ -12,10 +12,14 @@
# 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 File::Glob ':glob';
use vars qw($DraftDir);
use strict;
AddModuleDescription('drafts.pl');
use File::Glob ':glob';
our ($DraftDir);
AddModuleDescription('drafts.pl', 'Draft Extension');
our ($q, $Message, $Now, %Action, $DataDir, @MyInitVariables, @MyMaintenance, $FooterNote);
$DraftDir = $DataDir."/draft"; # directory for drafts
@@ -54,8 +58,8 @@ sub DoDraft {
# add preview button to edit page (but not to GetCommentForm!)
*DraftOldGetEditForm = *GetEditForm;
*GetEditForm = *DraftNewGetEditForm;
*DraftOldGetEditForm = \&GetEditForm;
*GetEditForm = \&DraftNewGetEditForm;
sub DraftNewGetEditForm {
my $html = DraftOldGetEditForm(@_);
@@ -71,9 +75,10 @@ push(@MyMaintenance, \&DraftCleanup);
sub DraftFiles {
return map {
$_ = substr($_, length($DraftDir) + 1);
utf8::decode($_);
$_;
my $x = $_;
$x = substr($x, length($DraftDir) + 1);
utf8::decode($x);
$x;
} bsd_glob("$DraftDir/*"), bsd_glob("$DraftDir/.*");
}

View File

@@ -12,9 +12,12 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
AddModuleDescription('duckduckgo-search.pl', 'Use DuckDuckGo For Searches');
use vars qw($DuckDuckGoSearchDomain);
our ($q, %Action, $ScriptName, @MyInitVariables);
our ($DuckDuckGoSearchDomain);
$DuckDuckGoSearchDomain = undef;

View File

@@ -12,8 +12,12 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
AddModuleDescription('dynamic-comments.pl', 'Dynamic Comments Extension');
our ($q, $CollectingJournal, $CommentsPrefix, @MyInitVariables, $HtmlHeaders);
push(@MyInitVariables, \&DynamicCommentsAddScript);
sub DynamicCommentsAddScript {
@@ -34,8 +38,8 @@ function togglecomments (id) {
my $num = 0;
*DynamicCommentsOldGetPageLink = *GetPageLink;
*GetPageLink = *DynamicCommentsNewGetPageLink;
*DynamicCommentsOldGetPageLink = \&GetPageLink;
*GetPageLink = \&DynamicCommentsNewGetPageLink;
sub DynamicCommentsNewGetPageLink {
my ($id, @rest) = @_;

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