mirror of
https://github.com/kensanata/oddmuse.git
synced 2026-04-04 18:30:30 +09:00
Compare commits
501 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3cbd8db8b | ||
|
|
90e92c27b8 | ||
|
|
76b433c1da | ||
|
|
b116a0103e | ||
|
|
6a7a0dd24d | ||
|
|
c2366aa36f | ||
|
|
4da50ef125 | ||
|
|
2e0f293dcd | ||
|
|
d0095a36b5 | ||
|
|
1eae7852c4 | ||
|
|
da06278df8 | ||
|
|
bd8f914804 | ||
|
|
51b24309a7 | ||
|
|
60a4572087 | ||
|
|
248af821a7 | ||
|
|
c85e8b84b9 | ||
|
|
e4d159307b | ||
|
|
80a30a9102 | ||
|
|
299b94243d | ||
|
|
b7ab45a3a7 | ||
|
|
9d3deaff0f | ||
|
|
42a1e389a5 | ||
|
|
9883a064f3 | ||
|
|
52617b472d | ||
|
|
764c15e6c0 | ||
|
|
88b384c2b4 | ||
|
|
92e231b10c | ||
|
|
e9ce006444 | ||
|
|
bc5ee74ffd | ||
|
|
688cf9eea5 | ||
|
|
ad9a19d551 | ||
|
|
7595e6db36 | ||
|
|
74fd5c569c | ||
|
|
e4376c178b | ||
|
|
9e46438534 | ||
|
|
4dd29bd4a7 | ||
|
|
90af54b7ba | ||
|
|
cadcdde5f8 | ||
|
|
4c77bc11de | ||
|
|
05988eb899 | ||
|
|
040bd05333 | ||
|
|
5f03238f60 | ||
|
|
4c6d91a101 | ||
|
|
71b93887dc | ||
|
|
391049ef77 | ||
|
|
3d5aec5651 | ||
|
|
d976184e24 | ||
|
|
5a45c1191a | ||
|
|
07f315ca12 | ||
|
|
be1cf0e876 | ||
|
|
d4d0ed728f | ||
|
|
0f0f20b21c | ||
|
|
abdb9c973b | ||
|
|
4e0b287890 | ||
|
|
00308f9ed6 | ||
|
|
2488ccdb8c | ||
|
|
cec2f3cc1b | ||
|
|
5a19773dfa | ||
|
|
7c3bb0a0af | ||
|
|
90d44bf863 | ||
|
|
9d0ff86a44 | ||
|
|
d03bc9f40b | ||
|
|
863bda76dc | ||
|
|
fcbe01bbfd | ||
|
|
6178c46aec | ||
|
|
87110eef08 | ||
|
|
1bfeac5035 | ||
|
|
ef257b566f | ||
|
|
0fce2edcf8 | ||
|
|
152188503e | ||
|
|
d804c16a1c | ||
|
|
cb7f2e4634 | ||
|
|
b90695c7c8 | ||
|
|
e67c8bfda6 | ||
|
|
90eb428787 | ||
|
|
e3cacaa89f | ||
|
|
6167428ecf | ||
|
|
367f76b6f4 | ||
|
|
733b6dabb1 | ||
|
|
72cd669bf0 | ||
|
|
84f630af4a | ||
|
|
05df700140 | ||
|
|
f230a64e7d | ||
|
|
1855c84cec | ||
|
|
3c982a6cd4 | ||
|
|
7053561f89 | ||
|
|
02fcabfdbc | ||
|
|
0c0efdd2c8 | ||
|
|
9a93601a03 | ||
|
|
b68f2b6cd6 | ||
|
|
80d95e9225 | ||
|
|
04288eda8c | ||
|
|
3a7f75cf30 | ||
|
|
0ca64b2db0 | ||
|
|
81aaf49463 | ||
|
|
5c93616690 | ||
|
|
c1823bc59c | ||
|
|
1634859659 | ||
|
|
684781423d | ||
|
|
1f2507fc00 | ||
|
|
0644b63b67 | ||
|
|
64f6b267d9 | ||
|
|
528e9d8868 | ||
|
|
f618822f34 | ||
|
|
e9a5fcdc7c | ||
|
|
2a33e91167 | ||
|
|
77327ec06f | ||
|
|
f530b25d74 | ||
|
|
8db81914b1 | ||
|
|
5fce7f4b63 | ||
|
|
1ee235c949 | ||
|
|
be7d8d4460 | ||
|
|
f134283bae | ||
|
|
38d5d01ea1 | ||
|
|
8e3e186fab | ||
|
|
4b33b3afeb | ||
|
|
9beca5895a | ||
|
|
1afc03eee1 | ||
|
|
331b03f894 | ||
|
|
1c9b180b3a | ||
|
|
57a16e85f8 | ||
|
|
c7cd5bcc36 | ||
|
|
f571007516 | ||
|
|
fac3f03f7b | ||
|
|
7d85dd6570 | ||
|
|
a91ef8602f | ||
|
|
1bc670617e | ||
|
|
74288ba3f3 | ||
|
|
bf2856011d | ||
|
|
ca974a902d | ||
|
|
f992897e7a | ||
|
|
c121607f61 | ||
|
|
032c7aea73 | ||
|
|
f6c419746c | ||
|
|
83f13a9a1a | ||
|
|
2111af2ec8 | ||
|
|
648e6eb9bc | ||
|
|
994b4e8051 | ||
|
|
f2f464b1ca | ||
|
|
119d11b405 | ||
|
|
d7031198cd | ||
|
|
187d4020f5 | ||
|
|
0a77bd0b47 | ||
|
|
cb00e7e969 | ||
|
|
1b2fe0d713 | ||
|
|
8e73f6f0dd | ||
|
|
d3c7b45ad9 | ||
|
|
fee15fd880 | ||
|
|
196b960b47 | ||
|
|
241a88ef48 | ||
|
|
fdf0c2711b | ||
|
|
239a95e683 | ||
|
|
d3205d2425 | ||
|
|
681ba8068c | ||
|
|
d5429d276f | ||
|
|
746b10be81 | ||
|
|
b9aa27e406 | ||
|
|
00cf277156 | ||
|
|
75ce7d745e | ||
|
|
ee1bbca5c9 | ||
|
|
0effc86620 | ||
|
|
8a36970b24 | ||
|
|
8be87ede99 | ||
|
|
d61dd71627 | ||
|
|
755f742088 | ||
|
|
0107e41123 | ||
|
|
e58c8c2192 | ||
|
|
ee4518da9e | ||
|
|
64e7183896 | ||
|
|
bd2715a35e | ||
|
|
986e4fc65f | ||
|
|
908cecffb9 | ||
|
|
07226ae7a1 | ||
|
|
c90258ef4b | ||
|
|
f500092a6a | ||
|
|
d1f1f65c9b | ||
|
|
aae0cb6379 | ||
|
|
2b0a0d9a14 | ||
|
|
69fcb9646b | ||
|
|
a0bf615960 | ||
|
|
c024f553fd | ||
|
|
c97d6a576f | ||
|
|
c64095fd95 | ||
|
|
542f552002 | ||
|
|
22017a24f2 | ||
|
|
6ac7093e9f | ||
|
|
89a23a6ac5 | ||
|
|
ed17476aeb | ||
|
|
1b951c66f1 | ||
|
|
878d99a84c | ||
|
|
c5ec3d782c | ||
|
|
a28276b868 | ||
|
|
a8920bfec1 | ||
|
|
0e5f338b40 | ||
|
|
4a7e50e83e | ||
|
|
608440553b | ||
|
|
e493652e96 | ||
|
|
d286267d52 | ||
|
|
27c5c5fa79 | ||
|
|
9f7cd0bfc7 | ||
|
|
6a45d51189 | ||
|
|
5d99cb5874 | ||
|
|
7f0f8164bd | ||
|
|
236e6a4c85 | ||
|
|
669043e7a9 | ||
|
|
e57372692e | ||
|
|
512afd75a0 | ||
|
|
b5c51d19ba | ||
|
|
0955dcbc97 | ||
|
|
5ee3adf13f | ||
|
|
5a237d05f7 | ||
|
|
bd5d419472 | ||
|
|
cdb66e1ed4 | ||
|
|
d5cd6cbd65 | ||
|
|
e85ddcc9b9 | ||
|
|
ac4948ca5d | ||
|
|
6bffdc8149 | ||
|
|
db814c627a | ||
|
|
b156e08d85 | ||
|
|
cad08ee17c | ||
|
|
7c04ee83e5 | ||
|
|
844d984526 | ||
|
|
e91797fcba | ||
|
|
8ad1c60817 | ||
|
|
e24f853bef | ||
|
|
cfceb84cc6 | ||
|
|
e81234d81f | ||
|
|
5a647e6042 | ||
|
|
a53f3e390f | ||
|
|
d9d213b6b3 | ||
|
|
09c5351a11 | ||
|
|
f0fc2f2f29 | ||
|
|
7d6138107f | ||
|
|
446f587a49 | ||
|
|
0872ee501e | ||
|
|
e4f7500340 | ||
|
|
a429bb6a4b | ||
|
|
ce2a39d8f1 | ||
|
|
81a4dbcdcd | ||
|
|
33a3f515a3 | ||
|
|
6372907c4b | ||
|
|
a8b7b67efe | ||
|
|
b0f9722857 | ||
|
|
d5fda299b0 | ||
|
|
725e121731 | ||
|
|
ad299b6b1d | ||
|
|
8439566b01 | ||
|
|
ef4263cf03 | ||
|
|
464a6e9af1 | ||
|
|
7152fa0a54 | ||
|
|
da5c5a8275 | ||
|
|
ee52a25ebf | ||
|
|
e831c10cd3 | ||
|
|
9a6da39aaf | ||
|
|
99b819dd68 | ||
|
|
0b42ed0508 | ||
|
|
3b6d891dc7 | ||
|
|
e77abbc09f | ||
|
|
61a2238d9a | ||
|
|
0322deaf82 | ||
|
|
044a6ad835 | ||
|
|
86fe0193b7 | ||
|
|
2517928c1e | ||
|
|
971f4b1579 | ||
|
|
c0f0b970a6 | ||
|
|
fa493d7360 | ||
|
|
831de74800 | ||
|
|
755010f619 | ||
|
|
44c7102dd5 | ||
|
|
e731c16214 | ||
|
|
b3b6eeb2bd | ||
|
|
fc8c0e66a7 | ||
|
|
6207434f19 | ||
|
|
9ecfe306cb | ||
|
|
a4dd2b8b0a | ||
|
|
0868f3a98e | ||
|
|
316471b145 | ||
|
|
586972c71d | ||
|
|
f6954c4a2e | ||
|
|
3b0d8c9bd6 | ||
|
|
3e60aa8e1b | ||
|
|
b3f865a4ab | ||
|
|
64568025c9 | ||
|
|
9472a279ea | ||
|
|
e0fdeffc94 | ||
|
|
d1d70be583 | ||
|
|
6260033669 | ||
|
|
57a4132512 | ||
|
|
3e16b45dbb | ||
|
|
21392f2f1b | ||
|
|
0fd86ee60d | ||
|
|
fd42ebf9c3 | ||
|
|
3180e5b02a | ||
|
|
26d3852f30 | ||
|
|
ad54fda317 | ||
|
|
dca0c75e34 | ||
|
|
ca0f12697b | ||
|
|
b8ae7e0817 | ||
|
|
3e91bdc75e | ||
|
|
e25a621e6e | ||
|
|
de6a3f1d0c | ||
|
|
bf00a9ea04 | ||
|
|
f8ac7a2818 | ||
|
|
1cd33b691c | ||
|
|
9d7e5b43c0 | ||
|
|
ceca41d85c | ||
|
|
1c4e082755 | ||
|
|
aec340b401 | ||
|
|
3ea87c007d | ||
|
|
4d8b028e2d | ||
|
|
31c02d6e95 | ||
|
|
26bf8a3043 | ||
|
|
ac21a8e6a4 | ||
|
|
a000937768 | ||
|
|
4eef4d2d76 | ||
|
|
92410a1f5c | ||
|
|
aa89d08e08 | ||
|
|
244ddb5157 | ||
|
|
9c3456c963 | ||
|
|
ad9afbf5ba | ||
|
|
bc079133f7 | ||
|
|
69a0f3ed23 | ||
|
|
1fc3600329 | ||
|
|
c1141cd610 | ||
|
|
300d86b2cd | ||
|
|
d609a857c0 | ||
|
|
8e98298777 | ||
|
|
0642fad8f8 | ||
|
|
d10d76c475 | ||
|
|
8aa2f04995 | ||
|
|
b3a1f199c1 | ||
|
|
9fbf8a6f39 | ||
|
|
c96b9bb71c | ||
|
|
71ff0f7de3 | ||
|
|
89fa22d1c9 | ||
|
|
7582aaaba1 | ||
|
|
58e9a1e240 | ||
|
|
bd39fe5d38 | ||
|
|
1c776e1080 | ||
|
|
d088887337 | ||
|
|
0ba76bafb2 | ||
|
|
c7756a8861 | ||
|
|
5462b215be | ||
|
|
f98374df9b | ||
|
|
4614990e04 | ||
|
|
6658886b72 | ||
|
|
5130a92f9c | ||
|
|
a602bc0678 | ||
|
|
09efd911e6 | ||
|
|
958c118649 | ||
|
|
c031898184 | ||
|
|
d32ebaddc8 | ||
|
|
9c90bba602 | ||
|
|
93cc1578d0 | ||
|
|
79610f7490 | ||
|
|
be2b87635c | ||
|
|
8e38179b66 | ||
|
|
1300cfad52 | ||
|
|
bc6ae67a9a | ||
|
|
c989bdab1d | ||
|
|
3d339a2bf5 | ||
|
|
ac7d68d134 | ||
|
|
a50c2da042 | ||
|
|
6ccf5b7c14 | ||
|
|
7a54eff9b1 | ||
|
|
3c2ff5577b | ||
|
|
d721704a1f | ||
|
|
2ba67e1d8b | ||
|
|
eb0a4b6416 | ||
|
|
7f9b23a704 | ||
|
|
1576c80c9f | ||
|
|
894748b6b8 | ||
|
|
a70618c3be | ||
|
|
7e92227414 | ||
|
|
57788b375a | ||
|
|
b363cb535f | ||
|
|
e31662cda6 | ||
|
|
ec84200a0b | ||
|
|
6f5a4f974c | ||
|
|
7d7383de7f | ||
|
|
892d462e53 | ||
|
|
4e26f0ea37 | ||
|
|
ca0a429027 | ||
|
|
d72ee44c3d | ||
|
|
5b8caecee9 | ||
|
|
9e58992459 | ||
|
|
408df36c0b | ||
|
|
46183d0246 | ||
|
|
3e6de210f8 | ||
|
|
f50b617b76 | ||
|
|
2c4df27922 | ||
|
|
823f518615 | ||
|
|
2a2987ac79 | ||
|
|
dfd97d4958 | ||
|
|
826d1cd6ef | ||
|
|
642cec5e7d | ||
|
|
dfa71cb2e3 | ||
|
|
5ed32a6d3f | ||
|
|
06c7fedec0 | ||
|
|
b29ce6c44d | ||
|
|
ef6d9172f5 | ||
|
|
eaf4433505 | ||
|
|
259dc5c27d | ||
|
|
e606016ece | ||
|
|
c7692fad5b | ||
|
|
3206947b6b | ||
|
|
1eb5bb06a5 | ||
|
|
0b4007ff5a | ||
|
|
92c64bbba9 | ||
|
|
f7d5430451 | ||
|
|
22bf1e8df3 | ||
|
|
9ec075c1c0 | ||
|
|
a767bb5c94 | ||
|
|
6d62283927 | ||
|
|
445e80cefc | ||
|
|
6589e84d10 | ||
|
|
59e79d2b17 | ||
|
|
ea426db112 | ||
|
|
b3759296e2 | ||
|
|
00388009f7 | ||
|
|
c50fb63c36 | ||
|
|
9f49cf49ea | ||
|
|
1c240033d8 | ||
|
|
c04743d6e1 | ||
|
|
f740251bbb | ||
|
|
4e90046b66 | ||
|
|
d1f9c401cd | ||
|
|
4027e142bc | ||
|
|
76b26df765 | ||
|
|
b054fa463d | ||
|
|
538dac4d3f | ||
|
|
1a2d690487 | ||
|
|
b7ff38b8a8 | ||
|
|
c0c79cfbf2 | ||
|
|
80ef71f3e4 | ||
|
|
846ddce24e | ||
|
|
4ec48bb963 | ||
|
|
70c7d154a3 | ||
|
|
eb0738dedc | ||
|
|
f993903c8c | ||
|
|
a5ecd94393 | ||
|
|
2c823013e7 | ||
|
|
e8b7ad4b67 | ||
|
|
3c84add52a | ||
|
|
e0c38a6fe6 | ||
|
|
f0588fa299 | ||
|
|
2942b9427d | ||
|
|
7acb6cf516 | ||
|
|
2a433a7513 | ||
|
|
62d6dc4bd4 | ||
|
|
9b35704a57 | ||
|
|
77fd49544c | ||
|
|
b3fa76bfb6 | ||
|
|
1ab2aa9427 | ||
|
|
57c2413b51 | ||
|
|
aa8dcd54fa | ||
|
|
81721e29de | ||
|
|
9d3b5e25ee | ||
|
|
2ca2d43068 | ||
|
|
697c320d52 | ||
|
|
de1b4c3a3b | ||
|
|
c6f00323fc | ||
|
|
300d8e9ad3 | ||
|
|
f78f0ad7e8 | ||
|
|
afb21a02d4 | ||
|
|
98af7703d7 | ||
|
|
b4b82e8050 | ||
|
|
9636fe2e0a | ||
|
|
cda31ad0aa | ||
|
|
5e35d0aa79 | ||
|
|
66ea19a686 | ||
|
|
b302e1f8d4 | ||
|
|
874586f27d | ||
|
|
5566297f91 | ||
|
|
295d64e34f | ||
|
|
8e3d36610e | ||
|
|
e1781c0651 | ||
|
|
c53f9c7954 | ||
|
|
a8ca3b6b95 | ||
|
|
02d90f1fc2 | ||
|
|
2ddd13eea5 | ||
|
|
ff069557f5 | ||
|
|
51f85d9581 | ||
|
|
9e6f63c0e8 | ||
|
|
4689452d8e | ||
|
|
90829ca433 | ||
|
|
eb3071d0db | ||
|
|
c4671a8909 | ||
|
|
aa759e5c04 | ||
|
|
7e27af5998 | ||
|
|
3c25fcb9ba | ||
|
|
7aa86d29fe | ||
|
|
7a8ffb8e64 | ||
|
|
f1f2ed71a5 | ||
|
|
4f4ad14850 | ||
|
|
7ad2d0ed38 | ||
|
|
9589c42a6a | ||
|
|
8d4c15e948 | ||
|
|
c7274a267b | ||
|
|
fafb051632 | ||
|
|
cb8c7a1234 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.pl linguist-language=Perl
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,8 +1,11 @@
|
||||
*~
|
||||
/build/
|
||||
\#*\#
|
||||
/test-data
|
||||
/test-data*
|
||||
/Mac/pkg/
|
||||
*.dmg
|
||||
*.pkg
|
||||
.DS_Store
|
||||
wiki.log
|
||||
.prove
|
||||
TAGS
|
||||
|
||||
16
BUGS
16
BUGS
@@ -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.
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
package OddMuse;
|
||||
$DataDir = '/Library/WebServer/Oddmuse';
|
||||
do 'current';
|
||||
@@ -1 +0,0 @@
|
||||
$AdminPass = '';
|
||||
@@ -1 +0,0 @@
|
||||
$AdminPass = '';
|
||||
4
Mac/wiki
4
Mac/wiki
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
package OddMuse;
|
||||
$DataDir = '/Library/WebServer/Oddmuse';
|
||||
do 'current';
|
||||
158
Makefile
158
Makefile
@@ -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]*.pl$)
|
||||
TRANSLATIONS=$(wildcard modules/translations/[a-z]*-utf8.pl$)
|
||||
MODULES=$(wildcard modules/*.pl)
|
||||
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
|
||||
|
||||
@@ -18,9 +19,13 @@ build:
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
prove t/setup.pl
|
||||
|
||||
release:
|
||||
perl stuff/release ~/oddmuse.org/releases 2.3.3
|
||||
|
||||
build/wiki.pl: wiki.pl
|
||||
perl -lne "s/(\\\$$q->a\({-href=>'http:\/\/www.oddmuse.org\/'}, 'Oddmuse'\))/\\\$$q->a({-href=>'http:\/\/git.savannah.gnu.org\/cgit\/oddmuse.git\/tag\/?id=$(VERSION_NO)'}, 'wiki.pl') . ' ($(VERSION_NO)), see ' . \$$1/; print" < $< > $@
|
||||
perl -lne "s/(\\\$$q->a\(\{-href=>'https:\/\/www.oddmuse.org\/'\}, 'Oddmuse'\))/\\\$$q->a({-href=>'https:\/\/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" < $< > $@
|
||||
@@ -31,144 +36,27 @@ build/national-%.pl: modules/translations/national-%.pl
|
||||
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
|
||||
# from: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
|
||||
# to: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
|
||||
|
||||
build/%.pl: modules/%.pl
|
||||
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
|
||||
|
||||
modules/translations/new-utf8.pl: wiki.pl $(MODULES)
|
||||
cp $@ $@-old
|
||||
perl stuff/oddtrans -l $@-old wiki.pl $(MODULES) > $@
|
||||
rm -f $@-old
|
||||
|
||||
translations: $(TRANSLATIONS)
|
||||
for f in $^; do \
|
||||
echo updating $$f...; \
|
||||
perl oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
|
||||
perl stuff/oddtrans -l $$f wiki.pl $(MODULES) > $$f-new && mv $$f-new $$f; \
|
||||
done
|
||||
|
||||
# Running four jobs in parallel, but clean up data directories without
|
||||
# race conditions!
|
||||
|
||||
jobs ?= 4
|
||||
test:
|
||||
prove t
|
||||
|
||||
# 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
|
||||
|
||||
package-upload: debian-$(VERSION).tar.gz debian-$(VERSION).tar.gz.sig
|
||||
curl -T "{debian-$(VERSION).tar.gz,debian-$(VERSION).tar.gz.sig}" \
|
||||
ftp://savannah.gnu.org/incoming/savannah/oddmuse/
|
||||
|
||||
package: debian-$(VERSION).tar.gz
|
||||
gpg --ascii --encrypt $<
|
||||
|
||||
debian-$(VERSION).tar.gz:
|
||||
rm -rf $(VERSION)
|
||||
mkdir $(VERSION)
|
||||
cp README FDL GPL wiki.pl $(VERSION)
|
||||
tar czf $@ $(VERSION)
|
||||
prove t/setup.pl
|
||||
prove --jobs=$(jobs) --state=slow,save t
|
||||
|
||||
37
OddMuse.pm
37
OddMuse.pm
@@ -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
48
README
@@ -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.
|
||||
194
README.creole
Normal file
194
README.creole
Normal file
@@ -0,0 +1,194 @@
|
||||
This is the README file distributed together with the
|
||||
[[https://oddmuse.org/|Oddmuse]] script.
|
||||
|
||||
== Installing Oddmuse on a Debian System running Apache
|
||||
|
||||
The following instructions require a number of tools. You can make sure
|
||||
they're all installed by issuing the following command as {{{root}}}:
|
||||
|
||||
{{{
|
||||
apt-get install coreutils apache2 sudo wget w3m perl \
|
||||
libwww-perl libxml-rss-perl diffutils
|
||||
}}}
|
||||
|
||||
You probably created an account for yourself. You might have to add this
|
||||
user to the {{{sudo}}} group. Here's how I created my own user as
|
||||
{{{root}}}:
|
||||
|
||||
{{{
|
||||
adduser alex
|
||||
usermod -a -G sudo alex
|
||||
}}}
|
||||
|
||||
Now you can login as {{{alex}}} and do everything else using {{{sudo}}}.
|
||||
|
||||
You need to copy wiki.pl into your cgi-bin directory, and you need to
|
||||
make the script executable. You might also have to change its owner to
|
||||
an appropriate user on your system.
|
||||
|
||||
{{{
|
||||
sudo wget -O /usr/lib/cgi-bin/wiki.pl \
|
||||
http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
|
||||
sudo chmod +x /usr/lib/cgi-bin/wiki.pl
|
||||
sudo chown www-data.www-data /usr/lib/cgi-bin/wiki.pl
|
||||
}}}
|
||||
|
||||
If you're on SUSE, the user might not be {{{www-data}}} but
|
||||
{{{wwwrun}}} without appropriate group:
|
||||
|
||||
{{{
|
||||
sudo chown wwwrun.root /usr/lib/cgi-bin/wiki.pl
|
||||
}}}
|
||||
|
||||
You should be able to test it right now! Visit
|
||||
{{{http://localhost/cgi-bin/wiki.pl}}}. If your site is available from
|
||||
the outside, you will be able to use a normal browser. If don't have a
|
||||
domain name yet, you'll probably have to use a text browser like
|
||||
{{{w3m}}}.
|
||||
|
||||
{{{
|
||||
w3m http://localhost/cgi-bin/wiki.pl
|
||||
}}}
|
||||
|
||||
If you create pages in this wiki, these will get stored in a temporary
|
||||
directory. You need change the data directory from {{{"/tmp/oddmuse"}}}
|
||||
to like {{{"/var/local/oddmuse"}}}. The best way to do this without
|
||||
changing {{{wiki.pl}}} is by editing
|
||||
{{{/etc/apache2/sites-available/default}}}. Add the following line:
|
||||
|
||||
{{{
|
||||
SetEnv WikiDataDir /var/local/oddmuse
|
||||
}}}
|
||||
|
||||
Enable the default site by calling the following command:
|
||||
|
||||
{{{
|
||||
sudo a2ensite default
|
||||
}}}
|
||||
|
||||
Reload the Apache configuration by calling the following command:
|
||||
|
||||
{{{
|
||||
sudo service apache2 reload
|
||||
}}}
|
||||
|
||||
You need to create the new data directory. You webserver runs CGI
|
||||
scripts as {{{www-data}}}. Thus, you need to change the owner and group
|
||||
of the directory to {{{www-data}}}.
|
||||
|
||||
{{{
|
||||
sudo mkdir -p /var/local/oddmuse
|
||||
sudo chown www-data.www-data /var/local/oddmuse
|
||||
}}}
|
||||
|
||||
Done! Visit your wiki and start editing. Click on the edit link (the
|
||||
first link below the navigation bar, at the bottom of the page). This
|
||||
will allow you to enter some text for this page. Click the Save button
|
||||
and you are done.
|
||||
|
||||
To add new pages, edit the homepage and add links to new pages by
|
||||
putting their names in {{{[[double square brackets]]}}}.
|
||||
|
||||
Enjoy your wiki experience.
|
||||
|
||||
Visit https://www.oddmuse.org/ to learn more about the translation
|
||||
files and modules that are part of this package.
|
||||
|
||||
== Checking the Apache Setup
|
||||
|
||||
If you think this information doesn't work for you, here are some things
|
||||
to check.
|
||||
|
||||
Apache's config directory is {{{/etc/apache2/apache2.conf}}}. This is
|
||||
where we get the {{{www-data}}} username from. It says:
|
||||
|
||||
{{{
|
||||
# These need to be set in /etc/apache2/envvars
|
||||
User ${APACHE_RUN_USER}
|
||||
Group ${APACHE_RUN_GROUP}
|
||||
}}}
|
||||
|
||||
Checking {{{/etc/apache2/envvars}}} we see the following:
|
||||
|
||||
{{{
|
||||
export APACHE_RUN_USER=www-data
|
||||
export APACHE_RUN_GROUP=www-data
|
||||
}}}
|
||||
|
||||
So that's what we're using in the {{{chown}}} command in our
|
||||
instructions above.
|
||||
|
||||
The default site is configured in
|
||||
{{{/etc/apache2/sites-available/default}}}. In order for it to be
|
||||
//enabled//, there must be a symlink from a file in
|
||||
{{{/etc/apache2/sites-enabled}}} to the file in
|
||||
{{{sites-available}}}. You can enable it using the following command:
|
||||
|
||||
{{{
|
||||
sudo a2ensite default
|
||||
}}}
|
||||
|
||||
This file also lists the directories we've used in our instructions
|
||||
above.
|
||||
|
||||
{{{
|
||||
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
||||
}}}
|
||||
|
||||
This means that {{{http://localhost/cgi-bin/wiki.pl}}} will call
|
||||
{{{/usr/lib/cgi-bin/wiki.pl}}}
|
||||
|
||||
Don't forget to reload the Apache configuration as shown above, or
|
||||
simply restart it all:
|
||||
|
||||
{{{
|
||||
sudo service apache2 graceful
|
||||
}}}
|
||||
|
||||
== Using just Perl
|
||||
|
||||
You can use Mojolicious as your web server. There is a simple
|
||||
##server.pl## which you can use. Here's how you might start it:
|
||||
|
||||
{{{
|
||||
mkdir ~/oddmuse
|
||||
WikiDataDir=$HOME/oddmuse perl server.pl daemon
|
||||
}}}
|
||||
|
||||
This makes the server available on {{{http://localhost:3000/wiki}}}.
|
||||
|
||||
If it works for you, feel free to upgrade to Hypnotoad.
|
||||
|
||||
{{{
|
||||
WikiDataDir=$HOME/oddmuse hypnotoad server.pl
|
||||
}}}
|
||||
|
||||
Note: Hypnotoad uses a different default port. The above makes the
|
||||
server available on {{{http://localhost:8080/wiki}}}. Hypnotoad will
|
||||
keep forking new processes. To stop it, use the {{{-s}}} flag.
|
||||
|
||||
{{{
|
||||
hypnotoad -s server.pl
|
||||
}}}
|
||||
|
||||
== License
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or (at
|
||||
your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
Both the GNU Free Documentation License, and the GNU General Public
|
||||
License are distributed together with this script. See the files
|
||||
[[https://github.com/kensanata/oddmuse/blob/master/FDL|FDL]] and
|
||||
[[https://github.com/kensanata/oddmuse/blob/master/GPL|GPL]],
|
||||
respectively.
|
||||
@@ -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
|
||||
@@ -1,172 +0,0 @@
|
||||
Name: Oddmuse
|
||||
Version: 2007.12.31
|
||||
Release: 1suse
|
||||
Group: Applications/Productivity
|
||||
License: /opt/oddmuse/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.oddmuse.org/
|
||||
|
||||
BuildRoot: /var/tmp/rpm-oddmusewiki-root
|
||||
BuildArch: noarch
|
||||
Prefix: /opt/oddmuse
|
||||
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
|
||||
Oddmuse 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.
|
||||
|
||||
Oddmuse 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/oddmuse/cgi-bin
|
||||
mkdir -p "$RPM_BUILD_ROOT"/opt/oddmuse/doc
|
||||
mkdir -p "$RPM_BUILD_ROOT"/opt/oddmuse/etc
|
||||
mkdir -p "$RPM_BUILD_ROOT"/opt/oddmuse/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/oddmuse/cgi-bin
|
||||
install cgi-bin/wiki.pl "$RPM_BUILD_ROOT"/srv/www/cgi-bin
|
||||
install doc/COPYING "$RPM_BUILD_ROOT"/opt/oddmuse/doc
|
||||
install etc/oddmusewiki.conf "$RPM_BUILD_ROOT"/opt/oddmuse/etc
|
||||
install libperl/current libperl/*.pl "$RPM_BUILD_ROOT"/opt/oddmuse/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/oddmuse:'"$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/oddmuse
|
||||
%config /opt/oddmuse/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
|
||||
@@ -1,4 +1,4 @@
|
||||
The files in this directory are used to run http://campaignwiki.org/
|
||||
The files in this directory are used to run https://campaignwiki.org/
|
||||
|
||||
add-link.pl
|
||||
===========
|
||||
@@ -8,7 +8,7 @@ bookmark site: A few pages make up a big unordered list of links in
|
||||
wiki format. add-link is a tool to help users contribute new links to
|
||||
the list.
|
||||
|
||||
http://campaignwiki.org/wiki/LinksToWisdom/HomePage
|
||||
https://campaignwiki.org/wiki/LinksToWisdom/HomePage
|
||||
|
||||
copy.pl
|
||||
=======
|
||||
@@ -17,7 +17,7 @@ This is used to copy the text from a web page to a wiki page. The idea
|
||||
was to keep archive copies of cool pages somewhere. The Blog Archive
|
||||
never got used, though.
|
||||
|
||||
http://campaignwiki.org/wiki/BlogArchive/HomePage
|
||||
https://campaignwiki.org/wiki/BlogArchive/HomePage
|
||||
|
||||
monster-tag.pl
|
||||
==============
|
||||
@@ -25,7 +25,7 @@ monster-tag.pl
|
||||
This is used to quickly tag many pages in the Monsters wiki. The
|
||||
Monsters wiki hasn't been used in a long time, though.
|
||||
|
||||
http://campaignwiki.org/wiki/Monsters/HomePage
|
||||
https://campaignwiki.org/wiki/Monsters/HomePage
|
||||
|
||||
submit.pl
|
||||
=========
|
||||
@@ -34,4 +34,4 @@ This used to be used to add sites to the Old School RPG Planet. The
|
||||
aggregator was configured via a wiki page on the Planet wiki. It's now
|
||||
abandoned.
|
||||
|
||||
http://campaignwiki.org/wiki/Planet/HomePage
|
||||
https://campaignwiki.org/wiki/Planet/HomePage
|
||||
|
||||
@@ -292,6 +292,7 @@ sub main {
|
||||
Init(); # read config file (no modules!)
|
||||
$ScriptName = $site; # undo setting in the config file
|
||||
$FullUrl = $site; #
|
||||
InitPageVariables(); # call again: $ScriptName was wrong
|
||||
binmode(STDOUT,':utf8');
|
||||
$q->charset('utf8');
|
||||
if ($q->path_info eq '/source') {
|
||||
|
||||
14
contrib/campaignwiki/delete.sh
Executable file
14
contrib/campaignwiki/delete.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
if test -z "$2" -o ! -z "$3"; then
|
||||
echo "Usage: delete.sh USERNAME WIKI"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
username=$1
|
||||
wiki=$2
|
||||
|
||||
for p in $(curl --silent "https://campaignwiki.org/wiki/$wiki?action=index;raw=1"); do
|
||||
echo "Deleting: $p"
|
||||
curl -F frodo=1 -F "title=$p" -F text=DeletedPage -F summary=Deleted -F username="$username" "https://campaignwiki.org/wiki/$wiki"
|
||||
sleep 5
|
||||
done
|
||||
@@ -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
122
contrib/fix-copyright-years
Executable 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)
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use CGI;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
131
contrib/no-flickr.pl
Normal file
131
contrib/no-flickr.pl
Normal file
@@ -0,0 +1,131 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2005-2016 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use Modern::Perl;
|
||||
use LWP::UserAgent;
|
||||
use utf8;
|
||||
binmode(STDOUT, ":utf8");
|
||||
|
||||
my $ua = LWP::UserAgent->new;
|
||||
|
||||
sub url_encode {
|
||||
my $str = shift;
|
||||
return '' unless $str;
|
||||
utf8::encode($str); # turn to byte string
|
||||
my @letters = split(//, $str);
|
||||
my %safe = map {$_ => 1} ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '-', '_', '.', '!', '~', '*', "'", '(', ')', '#');
|
||||
foreach my $letter (@letters) {
|
||||
$letter = sprintf("%%%02x", ord($letter)) unless $safe{$letter};
|
||||
}
|
||||
return join('', @letters);
|
||||
}
|
||||
|
||||
sub get_raw {
|
||||
my $uri = shift;
|
||||
my $response = $ua->get($uri);
|
||||
return $response->content if $response->is_success;
|
||||
}
|
||||
|
||||
sub get_wiki_page {
|
||||
my ($wiki, $id, $password) = @_;
|
||||
my $parameters = [
|
||||
pwd => $password,
|
||||
action => 'browse',
|
||||
id => $id,
|
||||
raw => 1,
|
||||
];
|
||||
my $response = $ua->post($wiki, $parameters);
|
||||
return $response->decoded_content if $response->is_success;
|
||||
die "Getting $id returned " . $response->status_line;
|
||||
}
|
||||
|
||||
sub get_wiki_index {
|
||||
my $wiki = shift;
|
||||
my $parameters = [
|
||||
search => "flickr.com",
|
||||
context => 0,
|
||||
raw => 1,
|
||||
];
|
||||
my $response = $ua->post($wiki, $parameters);
|
||||
return $response->decoded_content if $response->is_success;
|
||||
die "Getting the index returned " . $response->status_line;
|
||||
}
|
||||
|
||||
sub post_wiki_page {
|
||||
my ($wiki, $id, $username, $password, $text) = @_;
|
||||
my $parameters = [
|
||||
username => $username,
|
||||
pwd => $password,
|
||||
recent_edit => 'on',
|
||||
text => $text,
|
||||
title => $id,
|
||||
];
|
||||
my $response = $ua->post($wiki, $parameters);
|
||||
die "Posting to $id returned " . $response->status_line unless $response->code == 302;
|
||||
}
|
||||
|
||||
my %seen = ();
|
||||
|
||||
sub write_flickr {
|
||||
my ($id, $flickr, $dir, $file) = @_;
|
||||
say "Found $flickr";
|
||||
warn "$file was seen before: " . $seen{$file} if $seen{$file};
|
||||
die "$file contains unknown characters" if $file =~ /[^a-z0-9_.]/;
|
||||
$seen{$file} = "$id used $flickr";
|
||||
my $bytes = get_raw($flickr) or die("No data for $id");
|
||||
open(my $fh, '>', "$dir/$file") or die "Cannot write $dir/$file";
|
||||
binmode($fh);
|
||||
print $fh $bytes;
|
||||
close($fh);
|
||||
}
|
||||
|
||||
sub convert_page {
|
||||
my ($wiki, $pics, $dir, $username, $password, $id) = @_;
|
||||
say $id;
|
||||
my $text = get_wiki_page($wiki, $id, $password);
|
||||
my $is_changed = 0;
|
||||
while ($text =~ m!(https://[a-z0-9.]+.flickr.com/(?:[a-z0-9.]+/)?([a-z0-9_]+\.(?:jpg|png)))!) {
|
||||
my $flickr = $1;
|
||||
my $file = $2;
|
||||
write_flickr($id, $flickr, $dir, $file);
|
||||
$is_changed = 1;
|
||||
my $re = quotemeta($flickr);
|
||||
$text =~ s!$flickr!$pics/$file!g;
|
||||
}
|
||||
if ($is_changed) {
|
||||
post_wiki_page($wiki, $id, $username, $password, $text);
|
||||
} else {
|
||||
# die "$id has no flickr matches?\n$text";
|
||||
}
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
sub convert_site {
|
||||
my ($wiki, $pics, $dir, $username, $password) = @_;
|
||||
my @ids = split(/\n/, get_wiki_index($wiki));
|
||||
for my $id (@ids) {
|
||||
convert_page($wiki, $pics, $dir, $username, $password, $id);
|
||||
}
|
||||
}
|
||||
|
||||
our $AdminPass;
|
||||
do "/home/alex/password.pl";
|
||||
convert_site('https://alexschroeder.ch/wiki',
|
||||
'https://alexschroeder.ch/pics',
|
||||
'/home/alex/alexschroeder.ch/pics',
|
||||
'Alex Schroeder',
|
||||
$AdminPass);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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() {
|
||||
@@ -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>
|
||||
@@ -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 $^ $@
|
||||
@@ -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.
|
||||
@@ -1,2 +0,0 @@
|
||||
# Where to find diff(1) and grep(1)
|
||||
$ENV{PATH} = '/usr/bin:/bin';
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# This wrapper does nothing but tell Oddmuse to use the current
|
||||
# directory as its data directory.
|
||||
package OddMuse;
|
||||
$DataDir = '.';
|
||||
|
||||
# You need to get the latest copy of this script from
|
||||
# http://emacswiki.org/scripts/current.pl
|
||||
do 'current.pl';
|
||||
114
contrib/undo-double-quotes.pl
Executable file
114
contrib/undo-double-quotes.pl
Executable file
@@ -0,0 +1,114 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2015 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
undef $/; # slurp
|
||||
|
||||
my %index = ();
|
||||
my $verbose = '';
|
||||
|
||||
sub write_file {
|
||||
my ($file, $data) = @_;
|
||||
return unless $data;
|
||||
open(my $fh, '>:utf8', $file) or die "Cannot write $file: $!";
|
||||
print $fh $data;
|
||||
close($fh);
|
||||
}
|
||||
|
||||
sub replacement_block {
|
||||
my ($block, $pos, @no_go) = @_;
|
||||
|
||||
while (@no_go) {
|
||||
my $first = shift @no_go;
|
||||
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
|
||||
return $block if $pos >= $first->[0] and $pos <= $first->[1];
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
sub translate_file {
|
||||
my ($data) = @_;
|
||||
my @no_go = ();
|
||||
|
||||
while ($data =~ /( <nowiki>.*?<\/nowiki>
|
||||
| <code>.*?<\/code>
|
||||
| ^ <pre> (.*\n)+ <\/pre>
|
||||
| ^ {{{ (.*\n)+ }}} )/gmx) {
|
||||
push @no_go, [pos($data) - length $1, pos($data)];
|
||||
print "no go from " . $no_go[-1]->[0] . ".." . $no_go[-1]->[1] . " for $1\n" if $verbose;
|
||||
}
|
||||
|
||||
# The problem is that these replacements don't adjust @no_go! Perhaps it is good enough?
|
||||
my $subs = '';
|
||||
$subs = $subs || $data =~ s/ ( \[\/quote\] \n \n \[quote\] ) /replacement_block($1, pos($data), @no_go)/gex;
|
||||
return $data if $subs;
|
||||
}
|
||||
|
||||
sub read_file {
|
||||
my $file = shift;
|
||||
open(my $fh, '<:utf8', $file) or die "Cannot read $file: $!";
|
||||
my $data = <$fh>;
|
||||
close($fh);
|
||||
return $data;
|
||||
}
|
||||
|
||||
sub main {
|
||||
my ($dir) = @_;
|
||||
mkdir($dir . '-new') or die "Cannot create $dir-new: $!";
|
||||
print "Indexing files\n";
|
||||
foreach my $file (glob("$dir/.* $dir/*")) {
|
||||
next unless $file =~ /$dir\/(.+)/;
|
||||
my $id = $1;
|
||||
next if $id eq ".";
|
||||
next if $id eq "..";
|
||||
$index{$id} = 1;
|
||||
}
|
||||
print "Converting files\n";
|
||||
foreach my $id (sort keys %index) {
|
||||
# this is where you debug a particular page
|
||||
# $verbose = $id eq '2014-12-18_Emacs_Wiki_Migration';
|
||||
write_file("$dir-new/$id", translate_file(read_file("$dir/$id")));
|
||||
}
|
||||
}
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
my $dir = 'raw';
|
||||
my $help = '';
|
||||
|
||||
GetOptions ("dir=s" => \$dir,
|
||||
"help" => \$help);
|
||||
|
||||
if ($help) {
|
||||
print qq{
|
||||
Usage: $0 [--dir=DIR]
|
||||
|
||||
You need to use the raw.pl script to create a directory full of raw
|
||||
wiki text files.
|
||||
|
||||
--dir=DIR is where the raw wiki text files are. Default: raw. The
|
||||
converted files will be stored in DIR-new, ie. in raw-new by
|
||||
default.
|
||||
|
||||
Example: $0 --dir=~/alexschroeder/raw
|
||||
}
|
||||
} else {
|
||||
main ($dir);
|
||||
}
|
||||
170
contrib/undo-local-names.pl
Executable file
170
contrib/undo-local-names.pl
Executable file
@@ -0,0 +1,170 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2015 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
undef $/; # slurp
|
||||
|
||||
my %index = ();
|
||||
my $verbose = '';
|
||||
|
||||
my $LinkPattern = '(\p{Uppercase}+\p{Lowercase}+\p{Uppercase}\p{Alphabetic}*)';
|
||||
my $FreeLinkPattern = "([-,.()'%&?;<> _1-9A-Za-z\x{0080}-\x{fffd}]|[-,.()'%&?;<> _0-9A-Za-z\x{0080}-\x{fffd}][-,.()'%&?;<> _0-9A-Za-z\x{0080}-\x{fffd}]+)";
|
||||
my $UrlProtocols = 'http|https|ftp|afs|news|nntp|mid|cid|mailto|wais|prospero|telnet|gopher|irc|feed';
|
||||
my $UrlChars = '[-a-zA-Z0-9/@=+$_~*.,;:?!\'"()&#%]'; # see RFC 2396
|
||||
my $FullUrlPattern="((?:$UrlProtocols):$UrlChars+)"; # when used in square brackets
|
||||
|
||||
# either a single letter, or a string that begins with a single letter and ends with a non-space
|
||||
my $words = '([A-Za-z\x{0080}-\x{fffd}](?:[-%.,:;\'"!?0-9 A-Za-z\x{0080}-\x{fffd}]*?[-%.,:;\'"!?0-9A-Za-z\x{0080}-\x{fffd}])?)';
|
||||
# zero-width assertion to prevent km/h from counting
|
||||
my $nowordstart = '(?:(?<=[^-0-9A-Za-z\x{0080}-\x{fffd}])|^)';
|
||||
# zero-width look-ahead assertion to prevent km/h from counting
|
||||
my $nowordend = '(?=[^-0-9A-Za-z\x{0080}-\x{fffd}]|$)';
|
||||
|
||||
my $IrcNickRegexp = qr{[]a-zA-Z^[;\\`_{}|][]^[;\\`_{}|a-zA-Z0-9-]*};
|
||||
|
||||
sub FreeToNormal { # trim all spaces and convert them to underlines
|
||||
my $id = shift;
|
||||
return '' unless $id;
|
||||
$id =~ s/ /_/g;
|
||||
$id =~ s/__+/_/g;
|
||||
$id =~ s/^_//;
|
||||
$id =~ s/_$//;
|
||||
return $id;
|
||||
}
|
||||
|
||||
sub parse_local_names {
|
||||
my $filename = shift;
|
||||
print "Reading $filename\n";
|
||||
open(my $fh, '<:utf8', $filename) or die "Cannot read $filename: $!";
|
||||
my $data = <$fh>;
|
||||
close($fh);
|
||||
print "Parsing $filename\n";
|
||||
my %names = ();
|
||||
while ($data =~ m/\[$FullUrlPattern\s+([^\]]+?)\]/g) {
|
||||
my ($page, $url) = ($2, $1);
|
||||
my $id = FreeToNormal($page);
|
||||
$names{$id} = $url;
|
||||
}
|
||||
return \%names;
|
||||
}
|
||||
|
||||
sub write_file {
|
||||
my ($file, $data) = @_;
|
||||
return unless $data;
|
||||
open(my $fh, '>:utf8', $file) or die "Cannot write $file: $!";
|
||||
print $fh $data;
|
||||
close($fh);
|
||||
}
|
||||
|
||||
sub replacement {
|
||||
my ($names, $id, $pos, @no_go) = @_;
|
||||
|
||||
while (@no_go) {
|
||||
my $first = shift @no_go;
|
||||
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
|
||||
return $id if $pos >= $first->[0] and $pos <= $first->[1];
|
||||
}
|
||||
|
||||
return "[[$id]]" if exists $index{$id}; # local page exists
|
||||
return $id unless $names->{$id};
|
||||
return '[' . $names->{$id} . ' ' . $id . ']';
|
||||
}
|
||||
|
||||
sub translate_file {
|
||||
my ($names, $data) = @_;
|
||||
my @no_go = ();
|
||||
|
||||
while ($data =~ /( <nowiki>.*?<\/nowiki>
|
||||
| <code>.*?<\/code>
|
||||
| ^ <pre> (.*\n)+ <\/pre>
|
||||
| ^ {{{ (.*\n)+ }}}
|
||||
| ${nowordstart} \* ${words} \* ${nowordend}
|
||||
| ${nowordstart} \/ ${words} \/ ${nowordend}
|
||||
| ${nowordstart} \_ ${words} \_ ${nowordend}
|
||||
| ${nowordstart} \! ${words} \! ${nowordend}
|
||||
| \[\[ $FreeLinkPattern .*? \]\]
|
||||
| \[ $FullUrlPattern \s+ [^\]]+? \]
|
||||
| ^( \h+.+\n )+
|
||||
| ^(?: \[? \d\d?:\d\d (?:am|pm)? \]? )? \s* < $IrcNickRegexp > )/gmx) {
|
||||
push @no_go, [pos($data) - length $1, pos($data)];
|
||||
print "no go from " . $no_go[-1]->[0] . ".." . $no_go[-1]->[1] . " for $1\n" if $verbose;
|
||||
}
|
||||
|
||||
my $subs = $data =~ s/(?<![:![])\b$LinkPattern(?![:])/replacement($names, $1, pos($data), @no_go)/ge;
|
||||
return $data if $subs;
|
||||
}
|
||||
|
||||
sub read_file {
|
||||
my $file = shift;
|
||||
open(my $fh, '<:utf8', $file) or die "Cannot read $file: $!";
|
||||
my $data = <$fh>;
|
||||
close($fh);
|
||||
return $data;
|
||||
}
|
||||
|
||||
sub main {
|
||||
my ($dir, $local_names) = @_;
|
||||
mkdir($dir . '-new') or die "Cannot create $dir-new: $!";
|
||||
my $names = parse_local_names("$dir/$local_names");
|
||||
print "Indexing files\n";
|
||||
foreach my $file (glob("$dir/.* $dir/*")) {
|
||||
next unless $file =~ /$dir\/(.+)/;
|
||||
my $id = $1;
|
||||
next if $id eq ".";
|
||||
next if $id eq "..";
|
||||
next if $id eq "$local_names";
|
||||
$index{$id} = 1;
|
||||
}
|
||||
print "Converting files\n";
|
||||
foreach my $id (sort keys %index) {
|
||||
# this is where you debug a particular page
|
||||
# $verbose = $id eq '2014-12-18_Emacs_Wiki_Migration';
|
||||
write_file("$dir-new/$id", translate_file($names, read_file("$dir/$id")));
|
||||
}
|
||||
}
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
my $names = 'LocalNames';
|
||||
my $dir = 'raw';
|
||||
my $help = '';
|
||||
|
||||
GetOptions ("names=s" => \$names,
|
||||
"dir=s" => \$dir,
|
||||
"help" => \$help);
|
||||
|
||||
if ($help) {
|
||||
print qq{
|
||||
Usage: $0 [--dir=DIR] [--names=LocalNames]
|
||||
|
||||
You need to use the raw.pl script to create a directory full of raw
|
||||
wiki text files.
|
||||
|
||||
--dir=DIR is where the raw wiki text files are. Default: raw. The
|
||||
converted files will be stored in DIR-new, ie. in raw-new by
|
||||
default.
|
||||
|
||||
--names=LocalNames is the page name with all the local names on
|
||||
it. Default: LocalNames
|
||||
|
||||
Example: $0 --dir=~/alexschroeder/raw --names=Names
|
||||
}
|
||||
} else {
|
||||
main ($dir, $names);
|
||||
}
|
||||
128
contrib/undo-usemod.pl
Executable file
128
contrib/undo-usemod.pl
Executable file
@@ -0,0 +1,128 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2015 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
undef $/; # slurp
|
||||
|
||||
my %index = ();
|
||||
my $verbose = '';
|
||||
|
||||
sub write_file {
|
||||
my ($file, $data) = @_;
|
||||
return unless $data;
|
||||
open(my $fh, '>:utf8', $file) or die "Cannot write $file: $!";
|
||||
print $fh $data;
|
||||
close($fh);
|
||||
}
|
||||
|
||||
sub replacement_block {
|
||||
my ($block, $pos, @no_go) = @_;
|
||||
|
||||
while (@no_go) {
|
||||
my $first = shift @no_go;
|
||||
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
|
||||
return $block if $pos >= $first->[0] and $pos <= $first->[1];
|
||||
}
|
||||
|
||||
return "[quote]\n" . join("\n", split(/ \n :+ \h? /x, $block)) . "[/quote]\n";
|
||||
}
|
||||
|
||||
sub replacement {
|
||||
my ($block, $tag, $pos, @no_go) = @_;
|
||||
|
||||
while (@no_go) {
|
||||
my $first = shift @no_go;
|
||||
print "Is $pos between " . $first->[0] . " and " . $first->[1] . "?\n" if $verbose;
|
||||
return $block if $pos >= $first->[0] and $pos <= $first->[1];
|
||||
}
|
||||
|
||||
return $tag . $block . $tag;
|
||||
}
|
||||
|
||||
sub translate_file {
|
||||
my ($data) = @_;
|
||||
my @no_go = ();
|
||||
|
||||
while ($data =~ /( <nowiki>.*?<\/nowiki>
|
||||
| <code>.*?<\/code>
|
||||
| ^ <pre> (.*\n)+ <\/pre>
|
||||
| ^ {{{ (.*\n)+ }}} )/gmx) {
|
||||
push @no_go, [pos($data) - length $1, pos($data)];
|
||||
print "no go from " . $no_go[-1]->[0] . ".." . $no_go[-1]->[1] . " for $1\n" if $verbose;
|
||||
}
|
||||
|
||||
# The problem is that these replacements don't adjust @no_go! Perhaps it is good enough?
|
||||
my $subs = '';
|
||||
$subs = $subs || $data =~ s/ ''' (.*?) ''' /replacement($1, '**', pos($data), @no_go)/gxe;
|
||||
$subs = $subs || $data =~ s/ '' (.*?) '' /replacement($1, '\/\/', pos($data), @no_go)/gxe;
|
||||
$subs = $data =~ s/ ^ :+ \h? ( .* \n (?: .+ \n ) * ) /replacement_block($1, pos($data), @no_go)/gmxe;
|
||||
return $data if $subs;
|
||||
}
|
||||
|
||||
sub read_file {
|
||||
my $file = shift;
|
||||
open(my $fh, '<:utf8', $file) or die "Cannot read $file: $!";
|
||||
my $data = <$fh>;
|
||||
close($fh);
|
||||
return $data;
|
||||
}
|
||||
|
||||
sub main {
|
||||
my ($dir) = @_;
|
||||
mkdir($dir . '-new') or die "Cannot create $dir-new: $!";
|
||||
print "Indexing files\n";
|
||||
foreach my $file (glob("$dir/.* $dir/*")) {
|
||||
next unless $file =~ /$dir\/(.+)/;
|
||||
my $id = $1;
|
||||
next if $id eq ".";
|
||||
next if $id eq "..";
|
||||
$index{$id} = 1;
|
||||
}
|
||||
print "Converting files\n";
|
||||
foreach my $id (sort keys %index) {
|
||||
# this is where you debug a particular page
|
||||
# $verbose = $id eq '2014-12-18_Emacs_Wiki_Migration';
|
||||
write_file("$dir-new/$id", translate_file(read_file("$dir/$id")));
|
||||
}
|
||||
}
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
my $dir = 'raw';
|
||||
my $help = '';
|
||||
|
||||
GetOptions ("dir=s" => \$dir,
|
||||
"help" => \$help);
|
||||
|
||||
if ($help) {
|
||||
print qq{
|
||||
Usage: $0 [--dir=DIR]
|
||||
|
||||
You need to use the raw.pl script to create a directory full of raw
|
||||
wiki text files.
|
||||
|
||||
--dir=DIR is where the raw wiki text files are. Default: raw. The
|
||||
converted files will be stored in DIR-new, ie. in raw-new by
|
||||
default.
|
||||
|
||||
Example: $0 --dir=~/alexschroeder/raw
|
||||
}
|
||||
} else {
|
||||
main ($dir);
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
;;; vc-oddmuse.el -- add VC support to oddmuse-curl
|
||||
;;
|
||||
;; Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
|
||||
;;
|
||||
;; Latest version:
|
||||
;; http://git.savannah.gnu.org/cgit/oddmuse.git/plain/contrib/vc-oddmuse.el
|
||||
;; Discussion, feedback:
|
||||
;; http://www.emacswiki.org/cgi-bin/wiki/OddmuseCurl
|
||||
;;
|
||||
;; This program is free software: you can redistribute it and/or modify it
|
||||
;; under the terms of the GNU General Public License as published by the Free
|
||||
;; Software Foundation, either version 3 of the License, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
;; more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License along
|
||||
;; with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Add the following to your init file:
|
||||
;;
|
||||
;; (add-to-list 'vc-handled-backends 'oddmuse)
|
||||
|
||||
(add-to-list 'vc-handled-backends 'oddmuse)
|
||||
|
||||
(require 'oddmuse-curl)
|
||||
(require 'diff)
|
||||
|
||||
(defun vc-oddmuse-revision-granularity () 'file)
|
||||
|
||||
(defun vc-oddmuse-registered (file)
|
||||
"Handle files in `oddmuse-directory'."
|
||||
(string-match (concat "^" (expand-file-name oddmuse-directory))
|
||||
(file-name-directory file)))
|
||||
|
||||
(defun vc-oddmuse-state (file)
|
||||
"Return the current version control state of FILE.
|
||||
For a list of possible values, see `vc-state'."
|
||||
;; Avoid downloading the current version from the wiki and comparing
|
||||
;; the text: Too much traffic!
|
||||
'edited)
|
||||
|
||||
(defun vc-oddmuse-working-revision (file)
|
||||
"The current revision based on `oddmuse-revisions'."
|
||||
(oddmuse-revision-get oddmuse-wiki oddmuse-page-name))
|
||||
|
||||
(defun vc-oddmuse-checkout-model (files)
|
||||
"No locking."
|
||||
'implicit)
|
||||
|
||||
(defun vc-oddmuse-create-repo (file)
|
||||
(error "You cannot create Oddmuse wikis using Emacs."))
|
||||
|
||||
(defun vc-oddmuse-register (files &optional rev comment)
|
||||
"This always works.")
|
||||
|
||||
(defun vc-oddmuse-revert (file &optional contents-done)
|
||||
"No idea"
|
||||
nil)
|
||||
|
||||
(defvar vc-oddmuse-log-command
|
||||
(concat "curl --silent %w"
|
||||
" --form action=rc"
|
||||
" --form showedit=1"
|
||||
" --form all=1"
|
||||
" --form from=1"
|
||||
" --form raw=1"
|
||||
" --form match='%r'")
|
||||
"Command to use for publishing index pages.
|
||||
It must print the page to stdout.
|
||||
|
||||
See `oddmuse-format-command' for the formatting options.")
|
||||
|
||||
(defun vc-oddmuse-print-log (files buffer &optional shortlog start-revision limit)
|
||||
"Load complete recent changes for the files."
|
||||
;; Derive `oddmuse-wiki' from the first file
|
||||
(with-oddmuse-file (car files)
|
||||
;; The wiki expects a Perl regular expression!
|
||||
(let ((regexp (concat "^(" (mapconcat 'file-name-nondirectory files "|") ")$")))
|
||||
(oddmuse-run "Getting recent changes" vc-oddmuse-log-command nil nil buffer)))
|
||||
(with-current-buffer buffer
|
||||
(oddmuse-render-rss3))
|
||||
'limit-unsupported)
|
||||
|
||||
(defun vc-oddmuse-log-outgoing ()
|
||||
(error "This is not supported."))
|
||||
|
||||
(defun vc-oddmuse-log-incoming ()
|
||||
(error "This is not supported."))
|
||||
|
||||
(defvar vc-oddmuse-get-revision-command
|
||||
(concat "curl --silent"
|
||||
" --form action=browse"
|
||||
" --form id=%t"
|
||||
" --form revision=%v"
|
||||
" --form raw=1"
|
||||
" '%w'")
|
||||
"Command to use to get older revisions of a page.
|
||||
It must print the page to stdout.
|
||||
|
||||
%? '?' character
|
||||
%w URL of the wiki as provided by `oddmuse-wikis'
|
||||
%t Page title as provided by `oddmuse-page-name'
|
||||
%v Revision to retrieve as provided by `oddmuse-revision'")
|
||||
|
||||
(defun oddmuse-revision-filename (rev)
|
||||
"Return filename for revision REV.
|
||||
This uses `oddmuse-directory', `wiki' and `pagename' as bound by
|
||||
`with-oddmuse-file'."
|
||||
(concat oddmuse-directory
|
||||
"/" wiki
|
||||
"/" pagename
|
||||
".~" rev "~"))
|
||||
|
||||
(defun vc-oddmuse-diff (files &optional rev1 rev2 buffer)
|
||||
"Report the differences for FILES."
|
||||
(setq buffer (or buffer (get-buffer-create "*vc-diff*")))
|
||||
(dolist (file files)
|
||||
(with-oddmuse-file file
|
||||
(setq rev1 (or rev1 (oddmuse-get-latest-revision wiki pagename)))
|
||||
(dolist (rev (list rev1 rev2))
|
||||
(when (and rev (not (file-readable-p (oddmuse-revision-filename rev))))
|
||||
(let* ((oddmuse-revision rev)
|
||||
(command vc-oddmuse-get-revision-command)
|
||||
(filename (oddmuse-revision-filename rev)))
|
||||
(with-temp-buffer
|
||||
(oddmuse-run
|
||||
(concat "Downloading revision " rev)
|
||||
command wiki pagename)
|
||||
(write-file filename)))))
|
||||
(diff-no-select
|
||||
(if rev1 (oddmuse-revision-filename rev1) file)
|
||||
(if rev2 (oddmuse-revision-filename rev2) file)
|
||||
nil
|
||||
(vc-switches 'oddmuse 'diff)
|
||||
buffer))))
|
||||
|
||||
(defun vc-oddmuse-revert (file &optional contents-done)
|
||||
"Revert FILE back to the wiki revision.
|
||||
If optional arg CONTENTS-DONE is non-nil, then nothing needs to
|
||||
be done, as the contents of FILE have already been reverted from
|
||||
a version backup."
|
||||
(unless contents-done
|
||||
(with-oddmuse-file file
|
||||
(let ((command (oddmuse-format-command vc-oddmuse-get-revision-command)))
|
||||
(with-temp-buffer
|
||||
(oddmuse-run "Loading" command)
|
||||
(write-file file))))))
|
||||
|
||||
(defun vc-oddmuse-checkin (files rev comment)
|
||||
"Commit changes in FILES to this backend.
|
||||
REV is a historical artifact and should be ignored. COMMENT is
|
||||
used as a check-in comment."
|
||||
(dolist (file files)
|
||||
(with-oddmuse-file file
|
||||
(let* ((summary comment)
|
||||
(command (oddmuse-format-command oddmuse-post-command))
|
||||
(buf (get-buffer-create " *oddmuse-response*")))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(oddmuse-run "Posting" command wiki pagename buf t 302))))))
|
||||
|
||||
(provide 'vc-oddmuse)
|
||||
14
control
14
control
@@ -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).
|
||||
@@ -1,110 +1,7 @@
|
||||
/* This file is in the public domain. */
|
||||
|
||||
/* @import url(https://fonts.googleapis.com/css?family=Noticia+Text:400,400italic,700italic,700&subset=latin,latin-ext); */
|
||||
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Symbola';
|
||||
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff') url('/fonts/Symbola.ttf') format('truetype');
|
||||
}
|
||||
|
||||
body, rss {
|
||||
font-family: "Noticia Text", Symbola, serif;
|
||||
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
||||
font-style: normal;
|
||||
font-size: 14pt;
|
||||
margin: 1em 3em;
|
||||
@@ -271,7 +168,7 @@ label[for="searchlang"], #searchlang, .header input[type="submit"] {
|
||||
visibility: hidden; position: absolute;
|
||||
}
|
||||
/* wrap on the iphone */
|
||||
@media media only screen and (max-device-width: 480px) {
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
}
|
||||
|
||||
.header input {
|
||||
|
||||
536
css/alex-2016.css
Normal file
536
css/alex-2016.css
Normal file
@@ -0,0 +1,536 @@
|
||||
/* This file is in the public domain. */
|
||||
html{ text-align: center; }
|
||||
|
||||
body, rss {
|
||||
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
||||
font-style: normal;
|
||||
font-size: 14pt;
|
||||
padding: 1em 3em;
|
||||
max-width: 72ex;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
/* hide all the crap */
|
||||
div.diff, div.diff+hr, div.refer, div.near, div.definition, div.sister,
|
||||
div.cal, div.footer, span.specialdays, span.gotobar, a.edit, a.number span,
|
||||
div.rc form, form.tiny, p.comment, p#plus1, div.g-plusone, div.content a.feed {
|
||||
display:none;
|
||||
}
|
||||
div.content a.book,
|
||||
div.content a.movie {
|
||||
text-decoration: none;
|
||||
}
|
||||
a cite {
|
||||
font-style: italic;
|
||||
}
|
||||
img[alt="RSS"] { display: none }
|
||||
a.rss { font-size: 8pt }
|
||||
}
|
||||
|
||||
/* headings: we can use larger sizes if we use a lighter color.
|
||||
we cannot inherit the font-family because header and footer use a narrow font. */
|
||||
|
||||
h1, h2, h3, title {
|
||||
font-family: inherit;
|
||||
font-weight: normal;
|
||||
}
|
||||
h1, channel title {
|
||||
font-size: 32pt;
|
||||
margin: 1em 0 0.5em 0;
|
||||
padding: 0.4em 0;
|
||||
}
|
||||
h2 {
|
||||
font-size: 18pt;
|
||||
margin: 2em 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
h3 {
|
||||
font-size: inherit;
|
||||
font-weight: bold;
|
||||
padding: 0;
|
||||
margin: 1em 0 0 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* headers in the journal are smaller */
|
||||
|
||||
div.journal h1, item title {
|
||||
font-size: inherit;
|
||||
padding: 0;
|
||||
clear: both;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
div.journal h2 {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
div.journal h3 {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
font-style: italic;
|
||||
}
|
||||
div.journal hr {
|
||||
visibility: hidden;
|
||||
}
|
||||
p.more {
|
||||
margin-top: 3em;
|
||||
}
|
||||
/* Links in headings appear on journal pages. */
|
||||
|
||||
h1 a, h2 a, h3 a {
|
||||
color:inherit;
|
||||
text-decoration:none;
|
||||
font-weight: normal;
|
||||
}
|
||||
h1 a:visited, h2 a:visited, h3 a:visited {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
/* for download buttons and the like */
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
font-size: 120%;
|
||||
cursor: pointer;
|
||||
padding: 0.4em 0.6em;
|
||||
text-shadow: 0px -1px 0px #ccc;
|
||||
background-color: #cfa;
|
||||
border: 1px solid #9d8;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0px 1px 3px white inset, 0px 1px 3px black;
|
||||
}
|
||||
|
||||
.button .icon {
|
||||
color: #363;
|
||||
text-shadow: 0px -1px 1px white, 0px 1px 3px #666;
|
||||
}
|
||||
|
||||
.button a {
|
||||
text-decoration: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* links */
|
||||
|
||||
a.pencil {
|
||||
padding-left: 1ex;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
visibility: hidden;
|
||||
transition: visibility 0s 1s, opacity 1s linear;
|
||||
opacity: 0;
|
||||
}
|
||||
*:hover > a.pencil {
|
||||
visibility: visible;
|
||||
transition: opacity .5s linear;
|
||||
opacity: 1;
|
||||
}
|
||||
@media print {
|
||||
a.pencil {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
a.number {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* stop floating content from flowing over the footer */
|
||||
|
||||
hr {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* the distance between links in the navigation bars */
|
||||
|
||||
span.bar a {
|
||||
margin-right: 1ex;
|
||||
}
|
||||
|
||||
a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* search box in the top bar */
|
||||
|
||||
.header form, .header p {
|
||||
display: inline;
|
||||
white-space: nowrap;
|
||||
}
|
||||
label[for="searchlang"], #searchlang, .header input[type="submit"] {
|
||||
/* don't use display: none! http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
|
||||
visibility: hidden; position: absolute;
|
||||
}
|
||||
/* wrap on the iphone */
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
}
|
||||
|
||||
.header input {
|
||||
width: 10ex;
|
||||
}
|
||||
|
||||
/* other form fields */
|
||||
|
||||
input[type="text"] {
|
||||
padding: 0;
|
||||
font-size: 80%;
|
||||
line-height: 125%;
|
||||
}
|
||||
|
||||
/* code */
|
||||
|
||||
textarea, pre, code, tt {
|
||||
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, "Symbola";
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
pre {
|
||||
overflow:hidden;
|
||||
white-space: pre-wrap; /* CSS 3 */
|
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
||||
/* styling for divs that will be invisible when printing
|
||||
when printing. */
|
||||
|
||||
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
|
||||
|
||||
font-size: 14pt;
|
||||
}
|
||||
@media print {
|
||||
div.header, div.footer, div.near, div.definition, p.comment, a.tag {
|
||||
font-size: 8pt;
|
||||
}
|
||||
}
|
||||
|
||||
div.footer form.search {
|
||||
display: none;
|
||||
}
|
||||
div.rc li + li {
|
||||
margin-top: 1em;
|
||||
}
|
||||
div.rc li strong, table.history strong, strong.description {
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
div.diff {
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
font-size: 12pt;
|
||||
color: #000;
|
||||
|
||||
}
|
||||
div.old {
|
||||
background-color: #ffffaf;
|
||||
}
|
||||
div.new {
|
||||
background-color: #cfffcf;
|
||||
}
|
||||
|
||||
div.refer {
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
div.message {
|
||||
background-color:#fee;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
img.xml {
|
||||
border:none;
|
||||
padding:1px;
|
||||
}
|
||||
a.small img {
|
||||
max-width:300px;
|
||||
}
|
||||
a.large img {
|
||||
max-width:600px;
|
||||
}
|
||||
div.sister {
|
||||
margin-right:1ex;
|
||||
background-color:inherit;
|
||||
}
|
||||
div.sister p {
|
||||
margin-top:0;
|
||||
}
|
||||
div.sister hr {
|
||||
display:none;
|
||||
}
|
||||
div.sister img {
|
||||
border:none;
|
||||
}
|
||||
|
||||
div.near, div.definition {
|
||||
background-color:#efe;
|
||||
}
|
||||
|
||||
div.sidebar {
|
||||
float:right;
|
||||
border:1px dotted #000;
|
||||
padding:0 1em;
|
||||
}
|
||||
div.sidebar ul {
|
||||
padding-left:1em;
|
||||
}
|
||||
|
||||
/* replacements, features */
|
||||
|
||||
ins {
|
||||
font-style: italic;
|
||||
text-decoration: none;
|
||||
}
|
||||
acronym, abbr {
|
||||
letter-spacing:0.1em;
|
||||
font-variant:small-caps;
|
||||
}
|
||||
|
||||
/* Interlink prefix not shown */
|
||||
a .site, a .separator {
|
||||
display: none;
|
||||
}
|
||||
a cite { font:inherit; }
|
||||
/* browser borkage */
|
||||
textarea[name="text"] { width:97%; height:80%; }
|
||||
textarea[name="summary"] { width:97%; height:3em; }
|
||||
/* comments */
|
||||
textarea[name="aftertext"] { width:97%; height:10em; }
|
||||
div.commentshown {
|
||||
font-size: 12pt;
|
||||
padding: 2em 0;
|
||||
}
|
||||
div.commenthidden {
|
||||
display:none;
|
||||
}
|
||||
div.commentshown {
|
||||
display:block;
|
||||
}
|
||||
p.comment {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
div.comment {
|
||||
font-size: 14pt;
|
||||
}
|
||||
div.comment h2 {
|
||||
margin-top: 5em;
|
||||
}
|
||||
/* comment pages with username, homepage, and email subscription */
|
||||
.comment form span { display: block; }
|
||||
.comment form span label { display: inline-block; width: 10em; }
|
||||
/* IE sucks */
|
||||
.comment input#username,
|
||||
.comment input#homepage,
|
||||
.comment input#mail { width: 20em; }
|
||||
|
||||
/* cal */
|
||||
div.month { padding:0; margin:0 2ex; }
|
||||
body > div.month {
|
||||
float:right;
|
||||
background-color: inherit;
|
||||
border:solid thin;
|
||||
padding:0 1ex;
|
||||
}
|
||||
.year > .month {
|
||||
float:left;
|
||||
}
|
||||
.footer {
|
||||
clear:both;
|
||||
}
|
||||
.month .title a.local {
|
||||
background-color: inherit;
|
||||
}
|
||||
.month a.local {
|
||||
background-color: #ddf;
|
||||
}
|
||||
.month a.today {
|
||||
background-color: #fdd;
|
||||
}
|
||||
.month a {
|
||||
color:inherit;
|
||||
font-weight:inherit;
|
||||
text-decoration: none;
|
||||
background-color: #eee;
|
||||
}
|
||||
/* history tables and other tables */
|
||||
table.history {
|
||||
border: none;
|
||||
}
|
||||
td.history {
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.user {
|
||||
border: none;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 1em;
|
||||
margin: 1em 2em;
|
||||
}
|
||||
table.user tr td, table.user tr th {
|
||||
border: none;
|
||||
padding: 0.2em 0.5em;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.arab tr th {
|
||||
font-weight:normal;
|
||||
text-align:left;
|
||||
vertical-align:top;
|
||||
}
|
||||
table.arab, table.arab tr th, table.arab tr td {
|
||||
border:none;
|
||||
}
|
||||
th.nobreak {
|
||||
white-space:nowrap;
|
||||
}
|
||||
table.full { width:99%; margin-left:1px; }
|
||||
table.j td, table.j th, table tr td.j, table tr th.j, .j { text-align:justify; }
|
||||
table.l td, table.l th, table tr td.l, table tr th.l, .l { text-align:left; }
|
||||
table.r td, table.r th, table tr td.r, table tr th.r, .r { text-align:right; }
|
||||
table.c td, table.c th, table tr td.c, table tr th.c, .c { text-align:center; }
|
||||
table.t td { vertical-align: top; }
|
||||
td.half { width:50%; }
|
||||
td.third { width:33%; }
|
||||
|
||||
form table td { padding:5px; }
|
||||
|
||||
/* lists */
|
||||
dd { padding-bottom:0.5ex; }
|
||||
dl.inside dt { float:left; }
|
||||
/* search */
|
||||
div.search span.result { font-size:larger; }
|
||||
div.search span.info { font-size:smaller; font-style:italic; }
|
||||
div.search p.result { display:none; }
|
||||
|
||||
img.logo {
|
||||
float: right;
|
||||
margin: 0 0 0 1ex;
|
||||
padding: 0;
|
||||
border: 1px solid #000;
|
||||
opacity: 0.3;
|
||||
background-color:#ffe;
|
||||
}
|
||||
|
||||
/* images */
|
||||
|
||||
div.content a.feed img, div.journal a.feed img,
|
||||
div.content a img.smiley, div.journal a img.smiley, img.smiley,
|
||||
div.content a.inline img, div.journal a.inline img,
|
||||
div.content li a.image img, div.journal li a.image img {
|
||||
margin: 0; padding: 0; border: none;
|
||||
}
|
||||
div.image a img {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
div.image span.caption {
|
||||
margin: 0 1em;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.left { float:left; margin-right: 1em; }
|
||||
.right { float:right; margin-left: 1em; }
|
||||
.half img { height: 50%; width: 50%; }
|
||||
.face img { width: 200px; }
|
||||
div.left .left, div.right .right {
|
||||
float:none;
|
||||
}
|
||||
.center { text-align:center; }
|
||||
table.aside {
|
||||
float:right;
|
||||
width:40%;
|
||||
margin-left: 1em;
|
||||
padding: 1ex;
|
||||
border: 1px dotted #666;
|
||||
}
|
||||
table.aside td {
|
||||
text-align:left;
|
||||
}
|
||||
div.sidebar {
|
||||
float:right; width: 250px;
|
||||
text-align: right;
|
||||
border: none;
|
||||
margin: 1ex;
|
||||
}
|
||||
|
||||
.bigsidebar {
|
||||
float:right;
|
||||
width: 500px;
|
||||
border: none;
|
||||
margin-left: 1ex;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
dl.irc dt { width:20ex; float:left; text-align:right; clear:left; }
|
||||
dl.irc dt span.time { float:left; }
|
||||
dl.irc dd { margin-left:22ex; }
|
||||
|
||||
/* portrait */
|
||||
|
||||
div.footer, div.comment, hr { clear: both; }
|
||||
.portrait { float: left; font-size: small; margin-right: 1em; }
|
||||
.portrait a { color: #999; }
|
||||
|
||||
div.left { float:left; margin:1em; padding: 0.5em; }
|
||||
div.left p { display:table-cell; }
|
||||
div.left p + p { display:table-caption; caption-side:bottom; }
|
||||
|
||||
p.table a { float:left; width:20ex; }
|
||||
p.table + p { clear:both; }
|
||||
|
||||
/* rss */
|
||||
|
||||
channel * { display: block; }
|
||||
|
||||
channel title {
|
||||
margin-top: 30pt;
|
||||
}
|
||||
copyright {
|
||||
font-size: 14pt;
|
||||
margin-top: 1em;
|
||||
}
|
||||
channel > link:before {
|
||||
font-size: 18pt;
|
||||
display: block;
|
||||
margin: 1em;
|
||||
padding: 0.5em;
|
||||
content: "This is an RSS feed, designed to be read in a feed reader.";
|
||||
color: red;
|
||||
border: 1px solid red;
|
||||
}
|
||||
link, license {
|
||||
font-size: 11pt;
|
||||
margin-bottom: 9pt;
|
||||
}
|
||||
username:before { content: "Last edited by "; }
|
||||
username:after { content: "."; }
|
||||
generator:before { content: "Feed generated by "; }
|
||||
generator:after { content: "."; }
|
||||
channel description {
|
||||
font-weight: bold;
|
||||
}
|
||||
item description {
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
docs, language,
|
||||
pubDate, lastBuildDate, ttl, guid, category, comments,
|
||||
docs, image title, image link,
|
||||
status, version, diff, history, importance {
|
||||
display: none;
|
||||
}
|
||||
@@ -321,7 +321,6 @@ div.sister {
|
||||
float:left;
|
||||
margin-right:1ex;
|
||||
padding-right:1ex;
|
||||
border-right:1px dashed;
|
||||
}
|
||||
div.sister p { padding:1ex; margin:0; }
|
||||
div.sister hr { display:none; }
|
||||
|
||||
165
css/light.css
165
css/light.css
@@ -8,110 +8,8 @@
|
||||
|
||||
@import url(https://fonts.googleapis.com/css?family=Noticia+Text:400,400italic,700italic,700&subset=latin,latin-ext); */
|
||||
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text'), local('NoticiaText-Regular)'), url('/fonts/NoticiaText-Regular.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold'), local('NoticiaText-Bold)'), url('/fonts/NoticiaText-Bold.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Noticia Text Italic'), local('NoticiaText-Italic)'), url('/fonts/NoticiaText-Italic.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
/* vietnamese */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
|
||||
unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
|
||||
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Noticia Text';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Noticia Text Bold Italic'), local('NoticiaText-BoldItalic)'), url('/fonts/NoticiaText-BoldItalic.woff') format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Symbola';
|
||||
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff');
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Noticia Text", Symbola, serif;
|
||||
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
||||
font-size: 14pt;
|
||||
color: #000;
|
||||
background-color: #eed;
|
||||
@@ -119,16 +17,20 @@ body {
|
||||
}
|
||||
|
||||
textarea, pre, code, tt {
|
||||
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
|
||||
font-size: 80%;
|
||||
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
background-color: white;
|
||||
background-color: white;
|
||||
font-family: Times, serif;
|
||||
font-size:10pt;
|
||||
}
|
||||
/* Printing from Firefox */
|
||||
svg {
|
||||
transform: translate(-1.5cm, -1cm);
|
||||
}
|
||||
}
|
||||
|
||||
/* iPhone */
|
||||
@@ -149,9 +51,10 @@ textarea, pre, code, tt {
|
||||
.browse { min-height: 3em; }
|
||||
.header form, .header p { margin: 0; }
|
||||
/* hide the buttons but don't use display:none because of
|
||||
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
|
||||
.header input[type="submit"] { position: absolute; visibility: hidden; }
|
||||
.header input { width: 5em; font-size: 80%; }
|
||||
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form
|
||||
.header input[type="submit"] { position: absolute; visibility: hidden; } */
|
||||
.header input { width: 6em; font-size: 80%; }
|
||||
.header input[type="checkbox"] { width: 1em; }
|
||||
.footer { clear:both; font-size: 90%; }
|
||||
.content input { font-size: 80%; line-height: 125%; }
|
||||
|
||||
@@ -175,9 +78,9 @@ input#mail, input#homepage, input#username {
|
||||
|
||||
/* titles */
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
font-size: 150%;
|
||||
padding: 1em 0;
|
||||
font-weight: bold;
|
||||
font-size: 150%;
|
||||
padding: 1em 0;
|
||||
}
|
||||
h1 a:link, h1 a:visited {
|
||||
color: inherit;
|
||||
@@ -217,7 +120,7 @@ a:active {
|
||||
border: 1px solid #9d8;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0px 1px 3px white inset,
|
||||
0px 1px 3px black;
|
||||
0px 1px 3px black;
|
||||
}
|
||||
.button a {
|
||||
text-decoration: none;
|
||||
@@ -231,10 +134,6 @@ a:active {
|
||||
font-weight: normal;
|
||||
}
|
||||
a.edit, div.footer, form, span.gotobar, a.number span { display:none; }
|
||||
a[class="url number"]:after, a[class="inter number"]:after {
|
||||
content:"[" attr(href) "]";
|
||||
}
|
||||
a[class="local number"]:after { content:"[" attr(title) "]"; }
|
||||
img[smiley] { line-height: inherit; }
|
||||
}
|
||||
|
||||
@@ -243,15 +142,15 @@ a.pencil { display: none; }
|
||||
|
||||
/* table of contents */
|
||||
.toc {
|
||||
font-size: smaller;
|
||||
border-left: 1em solid #886;
|
||||
font-size: smaller;
|
||||
border-left: 1em solid #886;
|
||||
}
|
||||
.toc ol {
|
||||
list-style-type: none;
|
||||
padding-left: 1em;
|
||||
list-style-type: none;
|
||||
padding-left: 1em;
|
||||
}
|
||||
.toc a {
|
||||
font-weight: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* images with links, captions, etc */
|
||||
@@ -307,26 +206,28 @@ div.message {
|
||||
}
|
||||
table.history { border-style:none; }
|
||||
td.history { border-style:none; }
|
||||
div.history span.dash + strong { font-weight: normal; }
|
||||
span.result { font-size:larger; }
|
||||
span.info { font-size:smaller; font-style:italic; }
|
||||
div.rc hr { display: none; }
|
||||
div.rc li { padding-bottom: 0.5em; }
|
||||
div.rc li strong { font-weight: normal; }
|
||||
|
||||
/* Tables */
|
||||
table.user {
|
||||
margin: 1em 0;
|
||||
padding: 0 1em;
|
||||
border-top: 1px solid black;
|
||||
border-bottom: 1px solid black;
|
||||
margin: 1em 0;
|
||||
padding: 0 1em;
|
||||
border-top: 1px solid black;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
div.aside table.user {
|
||||
margin: 1em 0;
|
||||
padding: 0;
|
||||
margin: 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
table.user td, table.user th {
|
||||
border-style: none;
|
||||
padding:5px 10px;
|
||||
vertical-align: top;
|
||||
border-style: none;
|
||||
padding:5px 10px;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.user th { font-weight:bold; }
|
||||
table.user td.r { text-align:right; }
|
||||
@@ -337,7 +238,7 @@ table.user td.mark { background-color:yellow; }
|
||||
tr:empty { display: block; height: 0.5em; }
|
||||
@media print {
|
||||
table {
|
||||
font-size: 9pt;
|
||||
font-size: 9pt;
|
||||
margin: 0;
|
||||
}
|
||||
table.user td, table.user th {
|
||||
|
||||
54
css/wiki.css
54
css/wiki.css
@@ -51,13 +51,13 @@ a.image:hover img {
|
||||
}
|
||||
|
||||
/* a.definition soll aussehen wie h2 */
|
||||
h2, p a.definition {
|
||||
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 {
|
||||
h1, h2, h3, h4, h1 a, h1 a:visited, p > a.definition {
|
||||
color: #666;
|
||||
font-size: 30pt;
|
||||
font-weight: normal;
|
||||
@@ -188,7 +188,7 @@ div.footer hr {
|
||||
|
||||
div.content > div.comment {
|
||||
border-top: none;
|
||||
padding-top: none;
|
||||
padding-top: 0;
|
||||
border-left: 1ex solid #bbb;
|
||||
padding-left: 1ex;
|
||||
}
|
||||
@@ -213,51 +213,9 @@ pre {
|
||||
|
||||
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');
|
||||
code {
|
||||
background: #eee;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package OddMuse;
|
||||
|
||||
@@ -27,7 +24,7 @@ my @path = split(/\//, $ENV{REDIRECT_URL});
|
||||
my $file = $path[$#path];
|
||||
|
||||
# for dynamic pages
|
||||
use vars qw($NotFoundHandlerExceptionsPage);
|
||||
our ($NotFoundHandlerExceptionsPage);
|
||||
$NotFoundHandlerExceptionsPage = 'NoCachePages';
|
||||
$RunCGI = 0;
|
||||
do $script;
|
||||
@@ -1,42 +0,0 @@
|
||||
# Copyright (C) 2004, 2005 Fletcher T. Penney <fletcher@freeshell.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
|
||||
use strict;
|
||||
|
||||
AddModuleDescription('aawrapperdiv.pl', 'WrapperDiv Module');
|
||||
|
||||
our ($q);
|
||||
|
||||
*OldGetHeader = \&GetHeader;
|
||||
*GetHeader = \&WrapperGetHeader;
|
||||
|
||||
sub WrapperGetHeader {
|
||||
my ($id, $title, $oldId, $nocache, $status) = @_;
|
||||
my $result = OldGetHeader ($id, $title, $oldId, $nocache, $status);
|
||||
$result .= $q->start_div({-class=>'wrapper'});
|
||||
}
|
||||
|
||||
*OldPrintFooter = \&PrintFooter;
|
||||
*PrintFooter = \&WrapperPrintFooter;
|
||||
|
||||
sub WrapperPrintFooter {
|
||||
my ($id, $rev, $comment) = @_;
|
||||
print $q->start_div({-class=>'wrapper close'});
|
||||
print $q->end_div(), $q->end_div();
|
||||
OldPrintFooter($id, $rev, $comment);
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('accesskeys.pl', 'Links With AccessKeys Extension');
|
||||
|
||||
@@ -21,7 +22,7 @@ our (@MyRules, $FreeLinkPattern);
|
||||
|
||||
push(@MyRules, \&LinksWithAccessKeys);
|
||||
sub LinksWithAccessKeys {
|
||||
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cog) {
|
||||
if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cg) {
|
||||
my ($id, $key) = ($2, $3);
|
||||
Dirty($1);
|
||||
$id = FreeToNormal($id);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
our ($q, %Page, %Action, $IndexFile, $PageDir, $KeepDir, @MyAdminCode, $RefererDir);
|
||||
|
||||
@@ -35,15 +33,15 @@ sub AdminPowerDelete {
|
||||
OpenPage($id);
|
||||
my $status = DeletePage($id);
|
||||
if ($status) {
|
||||
print $q->p(GetPageLink($id) . ' ' . T('not deleted: ')) . $status;
|
||||
print $q->p(GetPageLink($id) . ' ' . T('not deleted:') . ' ' . $status);
|
||||
} else {
|
||||
print $q->p(GetPageLink($id) . ' ' . T('deleted'));
|
||||
WriteRcLog($id, Ts('Deleted %s', $id), 0, $Page{revision},
|
||||
GetParam('username', ''), GetRemoteHost(), $Page{languages},
|
||||
GetParam('username', ''), $q->remote_addr(), $Page{languages},
|
||||
GetCluster($Page{text}));
|
||||
}
|
||||
# Regenerate index on next request
|
||||
unlink($IndexFile);
|
||||
Unlink($IndexFile);
|
||||
ReleaseLock();
|
||||
print $q->p(T('Main lock released.'));
|
||||
PrintFooter();
|
||||
@@ -60,38 +58,38 @@ sub AdminPowerRename {
|
||||
print $q->p(T('Main lock obtained.'));
|
||||
# page file -- only check for existing or missing pages here
|
||||
my $fname = GetPageFile($id);
|
||||
ReportError(Ts('The page %s does not exist', $id), '400 BAD REQUEST') unless -f $fname;
|
||||
ReportError(Ts('The page %s does not exist', $id), '400 BAD REQUEST') unless IsFile($fname);
|
||||
my $newfname = GetPageFile($new);
|
||||
ReportError(Ts('The page %s already exists', $new), '400 BAD REQUEST') if -f $newfname;
|
||||
ReportError(Ts('The page %s already exists', $new), '400 BAD REQUEST') if IsFile($newfname);
|
||||
# Regenerate index on next request -- remove this before errors can occur!
|
||||
unlink($IndexFile);
|
||||
Unlink($IndexFile);
|
||||
# page file
|
||||
CreateDir($PageDir); # It might not exist yet
|
||||
rename($fname, $newfname)
|
||||
Rename($fname, $newfname)
|
||||
or ReportError(Tss('Cannot rename %1 to %2', $fname, $newfname) . ": $!", '500 INTERNAL SERVER ERROR');
|
||||
# keep directory
|
||||
my $kdir = GetKeepDir($id);
|
||||
my $newkdir = GetKeepDir($new);
|
||||
CreateDir($KeepDir); # It might not exist yet (only the parent directory!)
|
||||
rename($kdir, $newkdir)
|
||||
Rename($kdir, $newkdir)
|
||||
or ReportError(Tss('Cannot rename %1 to %2', $kdir, $newkdir) . ": $!", '500 INTERNAL SERVER ERROR')
|
||||
if -d $kdir;
|
||||
if IsDir($kdir);
|
||||
# refer file
|
||||
if (defined(&GetRefererFile)) {
|
||||
my $rdir = GetRefererFile($id);
|
||||
my $newrdir = GetRefererFile($new);
|
||||
CreateDir($RefererDir); # It might not exist yet
|
||||
rename($rdir, $newrdir)
|
||||
Rename($rdir, $newrdir)
|
||||
or ReportError(Tss('Cannot rename %1 to %2', $rdir, $newrdir) . ": $!", '500 INTERNAL SERVER ERROR')
|
||||
if -d $rdir;
|
||||
if IsDir($rdir);
|
||||
}
|
||||
# RecentChanges
|
||||
OpenPage($new);
|
||||
WriteRcLog($id, Ts('Renamed to %s', $new), 0, $Page{revision},
|
||||
GetParam('username', ''), GetRemoteHost(), $Page{languages},
|
||||
GetParam('username', ''), $q->remote_addr(), $Page{languages},
|
||||
GetCluster($Page{text}));
|
||||
WriteRcLog($new, Ts('Renamed from %s', $id), 0, $Page{revision},
|
||||
GetParam('username', ''), GetRemoteHost(), $Page{languages},
|
||||
GetParam('username', ''), $q->remote_addr(), $Page{languages},
|
||||
GetCluster($Page{text}));
|
||||
print $q->p(Tss('Renamed %1 to %2.', GetPageLink($id), GetPageLink($new)));
|
||||
ReleaseLock();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('adsense.pl', 'AdSense Module');
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('advanced-uploads.pl', 'Advanced File Upload Extension');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('age.pl', 'Age Indication Extension');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('aggregate.pl', 'Front Page Extension');
|
||||
|
||||
@@ -25,7 +23,7 @@ our ($q, $bol, %Action, %Page, $OpenPageName, $UseDiff, $UsePathInfo, $RssStyleS
|
||||
push(@MyRules, \&AggregateRule);
|
||||
|
||||
sub AggregateRule {
|
||||
if ($bol && m/\G(<aggregate\s+((("[^\"&]+",?\s*)+)|(sort\s+)?search\s+(.+?))>)/gc) {
|
||||
if ($bol && m/\G(<aggregate\s+((("[^\"&]+",?\s*)+)|(sort\s+)?search\s+(.+?))>)/cg) {
|
||||
Clean(CloseHtmlEnvironments());
|
||||
Dirty($1);
|
||||
my ($oldpos, $old_, $str, $sort, $search) = ((pos), $_, $3, $5, $6);
|
||||
@@ -125,8 +123,8 @@ sub DoAggregate {
|
||||
}
|
||||
}
|
||||
foreach my $id (@pages) {
|
||||
my %data = ParseData(ReadFileOrDie(GetPageFile(FreeToNormal($id))));
|
||||
my $page = $data{text};
|
||||
my $data = ParseData(ReadFileOrDie(GetPageFile(FreeToNormal($id))));
|
||||
my $page = $data->{text};
|
||||
my $size = length($page);
|
||||
my $i = index($page, "\n=");
|
||||
my $j = index($page, "\n----");
|
||||
@@ -135,15 +133,15 @@ sub DoAggregate {
|
||||
$page =~ s/^=.*\n//; # if it starts with a header
|
||||
my $name = $id;
|
||||
$name =~ s/_/ /g;
|
||||
my $date = TimeToRFC822($data{ts});
|
||||
my $host = $data{host};
|
||||
my $username = $data{username};
|
||||
my $date = TimeToRFC822($data->{ts});
|
||||
my $host = $data->{host};
|
||||
my $username = $data->{username};
|
||||
$username = QuoteHtml($username);
|
||||
$username = $host unless $username;
|
||||
my $minor = $data{minor};
|
||||
my $revision = $data{revision};
|
||||
my $minor = $data->{minor};
|
||||
my $revision = $data->{revision};
|
||||
my $cluster = GetCluster($page);
|
||||
my $description = ToString sub { ApplyRules(QuoteHtml($page), 1, 0, undef, 'p') };
|
||||
my $description = ToString(sub { ApplyRules(QuoteHtml($page), 1, 0, undef, 'p') });
|
||||
$description .= $q->p(GetPageLink($id, T('Learn more...')))
|
||||
if length($page) < $size;
|
||||
$rss .= "\n<item>\n";
|
||||
|
||||
116
modules/agree-disagree.pl
Normal file
116
modules/agree-disagree.pl
Normal file
@@ -0,0 +1,116 @@
|
||||
# Copyright (C) 2005 Bayle Shanks http://purl.net/net/bshanks
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
our ($Now, @MyMacros, @MyRules, $DefaultStyleSheet, $q, $bol);
|
||||
|
||||
AddModuleDescription('agree-disagree.pl', 'AgreeDisagreePlugin');
|
||||
|
||||
push(@MyRules, \&AgreeDisagreeSupportRule);
|
||||
|
||||
push(@MyMacros, sub{ s/\[\+\]/"[+:" . GetParam('username', T('Anonymous'))
|
||||
. ':' . TimeToText($Now) . "]"/eg });
|
||||
push(@MyMacros, sub{ s/\[\+(:[^]:]+)\]/"[+$1:" . TimeToText($Now) . "]"/eg });
|
||||
push(@MyMacros, sub{ s/\[\-\]/"[-:" . GetParam('username', T('Anonymous'))
|
||||
. ':' . TimeToText($Now) . "]"/eg });
|
||||
push(@MyMacros, sub{ s/\[\-(:[^]:]+)\]/"[-$1:" . TimeToText($Now) . "]"/eg });
|
||||
|
||||
|
||||
$DefaultStyleSheet .= <<'EOT' unless $DefaultStyleSheet =~ /div\.agree/; # mod_perl?
|
||||
div.agreeCount {
|
||||
float: left;
|
||||
clear: left;
|
||||
background-color: Green;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
padding-top: .5em;
|
||||
padding-bottom: .5em;
|
||||
}
|
||||
div.disagreeCount {
|
||||
float: left;
|
||||
clear: right;
|
||||
background-color: Red;
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
padding-top: .5em;
|
||||
padding-bottom: .5em;
|
||||
}
|
||||
|
||||
div.agreeNames {
|
||||
float: left;
|
||||
background-color: Green;
|
||||
font-size: xx-small;
|
||||
display: none;
|
||||
}
|
||||
div.disagreeNames {
|
||||
float: left;
|
||||
background-color: Red;
|
||||
font-size: xx-small;
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
EOT
|
||||
|
||||
|
||||
|
||||
|
||||
my %AgreePortraits = ();
|
||||
|
||||
|
||||
sub AgreeDisagreeSupportRule {
|
||||
if ($bol) {
|
||||
if ($bol && m/(\G(\s*\[\+(.*?)\]|\s*\[-(.*?)\])+)/cgs) {
|
||||
|
||||
my $votes = $1;
|
||||
my @ayes = ();
|
||||
my @nayes = ();
|
||||
while ($votes =~ m/\G.*?\[\+(.*?)\]/cgs) {
|
||||
my ($ignore, $name, $time) = split(/:/, $1, 3);
|
||||
push(@ayes, $name);
|
||||
}
|
||||
my $votes2 = $votes;
|
||||
while ($votes2 =~ m/\G.*?\[-(.*?)\]/cgs) {
|
||||
my ($ignore, $name, $time) = split(/:/, $1, 3);
|
||||
push(@nayes, $name);
|
||||
}
|
||||
|
||||
my $html = CloseHtmlEnvironments() ;
|
||||
$html .= $q->div({-class=>'agreeCount'}) . ($#ayes+1) . ' ' . '</div>' ;
|
||||
|
||||
$html .= $q->div({-class=>'agreeNames'}) . printNames(@ayes) . '</div>' ;
|
||||
$html .= $q->div({-class=>'disagreeCount'}) . ' ' . ($#nayes+1) . '</div>' ;
|
||||
$html .= $q->div({-class=>'disagreeNames'}) . printNames(@nayes) . '</div>' ;
|
||||
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
sub printNames {
|
||||
my @names = @_;
|
||||
|
||||
my $html = '';
|
||||
foreach my $name (@names) {
|
||||
$html .= "$name<br>";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('all.pl', 'All Action');
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('anchors.pl', 'Local Anchor Extension');
|
||||
|
||||
@@ -20,13 +21,13 @@ our ($q, %Page, $FootnoteNumber, $FreeLinkPattern, @MyRules, $BracketWiki);
|
||||
push(@MyRules, \&AnchorsRule);
|
||||
|
||||
sub AnchorsRule {
|
||||
if (m/\G\[\[\#$FreeLinkPattern\]\]/gc) {
|
||||
if (m/\G\[\[\#$FreeLinkPattern\]\]/cg) {
|
||||
return $q->a({-href=>'#' . FreeToNormal($1), -class=>'local anchor'}, $1);
|
||||
} elsif ($BracketWiki && m/\G\[\[\#$FreeLinkPattern\|([^\]]+)\]\]/gc) {
|
||||
} elsif ($BracketWiki && m/\G\[\[\#$FreeLinkPattern\|([^\]]+)\]\]/cg) {
|
||||
return $q->a({-href=>'#' . FreeToNormal($1), -class=>'local anchor'}, $2);
|
||||
} elsif ($BracketWiki && m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\|([^\]]+)\]\])/cog
|
||||
or m/\G(\[\[\[$FreeLinkPattern\#$FreeLinkPattern\]\]\])/cog
|
||||
or m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\]\])/cog) {
|
||||
} elsif ($BracketWiki && m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\|([^\]]+)\]\])/cg
|
||||
or m/\G(\[\[\[$FreeLinkPattern\#$FreeLinkPattern\]\]\])/cg
|
||||
or m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\]\])/cg) {
|
||||
# This one is not a dirty rule because the output is always a page
|
||||
# link, never an edit link (unlike normal free links).
|
||||
my $bracket = (substr($1, 0, 3) eq '[[[');
|
||||
@@ -46,7 +47,7 @@ sub AnchorsRule {
|
||||
$text = $id unless $text;
|
||||
$text =~ s/_/ /g;
|
||||
return ScriptLink(UrlEncode($id), $text, $class, undef, $title);
|
||||
} elsif (m/\G\[\:$FreeLinkPattern\]/gc) {
|
||||
} elsif (m/\G\[\:$FreeLinkPattern\]/cg) {
|
||||
return $q->a({-name=>FreeToNormal($1), -class=>'anchor'}, '');
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('antispam.pl', 'Antispam Module');
|
||||
|
||||
@@ -33,7 +31,7 @@ push(@MyRules, \&MaskEmailRule);
|
||||
|
||||
sub MaskEmailRule {
|
||||
# Allow [email@foo.bar Email Me] links
|
||||
if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/igc) {
|
||||
if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/cgi) {
|
||||
my $chunk = $1;
|
||||
$chunk =~ s/($EmailRegExp)//i;
|
||||
my $email = $1;
|
||||
@@ -50,7 +48,7 @@ sub MaskEmailRule {
|
||||
return "<a href=\"mailto:$email\">$chunk</a>";
|
||||
}
|
||||
|
||||
if (m/\G($EmailRegExp)/igc) {
|
||||
if (m/\G($EmailRegExp)/cgi) {
|
||||
my $email = $1;
|
||||
if ($DoMaskEmail) {
|
||||
my $masked="";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('archive.pl', 'Archive Extension');
|
||||
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('askpage.pl', 'Ask Page Extension');
|
||||
|
||||
use Fcntl qw(:DEFAULT :flock);
|
||||
|
||||
our ($DataDir, $NewComment);
|
||||
our ($DataDir, %Translate, @MyFooters);
|
||||
our ($AskPage, $QuestionPage, $NewQuestion);
|
||||
# Don't forget to set your $CommentsPattern to include both $AskPage and $QuestionPage
|
||||
$AskPage = 'Ask';
|
||||
@@ -28,7 +29,7 @@ $NewQuestion = 'Write your question here:';
|
||||
|
||||
sub IncrementInFile {
|
||||
my $filename = shift;
|
||||
sysopen my $fh, $filename, O_RDWR|O_CREAT or die "can't open $filename: $!";
|
||||
sysopen my $fh, encode_utf8($filename), O_RDWR|O_CREAT or die "can't open $filename: $!";
|
||||
flock $fh, LOCK_EX or die "can't flock $filename: $!";
|
||||
my $num = <$fh> || 1;
|
||||
seek $fh, 0, 0 or die "can't rewind $filename: $!";
|
||||
@@ -38,8 +39,8 @@ sub IncrementInFile {
|
||||
return $num;
|
||||
}
|
||||
|
||||
*OldAskPageDoPost=\&DoPost;
|
||||
*DoPost=\&NewAskPageDoPost;
|
||||
*OldAskPageDoPost = \&DoPost;
|
||||
*DoPost = \&NewAskPageDoPost;
|
||||
sub NewAskPageDoPost {
|
||||
my $id = FreeToNormal(shift);
|
||||
if ($id eq $AskPage and not GetParam('text', undef)) { # comment, not a regular edit
|
||||
@@ -50,16 +51,18 @@ sub NewAskPageDoPost {
|
||||
OldAskPageDoPost($id, @_); # keep original functionality for regular edits
|
||||
}
|
||||
|
||||
*OldAskPageGetCommentForm=\&GetCommentForm;
|
||||
*GetCommentForm=\&NewAskPageGetCommentForm;
|
||||
*OldAskPageGetCommentForm = \&GetCommentForm;
|
||||
*GetCommentForm = \&NewAskPageGetCommentForm;
|
||||
@MyFooters = map { $_ == \&OldAskPageGetCommentForm ? \&NewAskPageGetCommentForm : $_ } @MyFooters;
|
||||
|
||||
sub NewAskPageGetCommentForm {
|
||||
my ($id, $rev, $comment) = @_;
|
||||
$NewComment = $NewQuestion if $id eq $AskPage;
|
||||
my ($id) = @_;
|
||||
$Translate{'Add your comment here:'} = $NewQuestion if $id eq $AskPage;
|
||||
OldAskPageGetCommentForm(@_);
|
||||
}
|
||||
|
||||
*OldAskPageJournalSort=\&JournalSort;
|
||||
*JournalSort=\&NewAskPageJournalSort;
|
||||
*OldAskPageJournalSort = \&JournalSort;
|
||||
*JournalSort = \&NewAskPageJournalSort;
|
||||
sub NewAskPageJournalSort {
|
||||
return OldAskPageJournalSort() unless $a =~ m/^$QuestionPage\d+$/ and $b =~ m/^$QuestionPage\d+$/;
|
||||
($b =~ m/$QuestionPage(\d+)/)[0] <=> ($a =~ m/$QuestionPage(\d+)/)[0];
|
||||
|
||||
@@ -14,14 +14,16 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
use XML::Atom;
|
||||
use XML::Atom::Entry;
|
||||
use XML::Atom::Link;
|
||||
use XML::Atom::Person;
|
||||
|
||||
AddModuleDescription('atom.pl', 'Atom Extension');
|
||||
|
||||
our ($q, %Page, %Action, $CommentsPrefix, $ScriptName, $SiteName, $MaxPost, $UseDiff, $NewText, $DeletedPage, @MyInitVariables, @MyMacros, $FS, $BannedContent, $RssStyleSheet, $RssRights, $RssLicense, $RssImageUrl, $RssExclude, $RCName, @UploadTypes, $UploadAllowed, $UsePathInfo, $SiteDescription, $LastUpdate, $InterWikiMoniker);
|
||||
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);
|
||||
|
||||
@@ -148,7 +150,7 @@ sub GetRcAtom {
|
||||
# Based on DoPost
|
||||
sub DoAtomSave {
|
||||
my ($type, $oldid) = @_;
|
||||
my $entry = AtomEntry();
|
||||
my $entry = AtomEntry($type);
|
||||
my $title = $entry->title();
|
||||
my $author = $entry->author();
|
||||
SetParam('username', $author->name) if $author; # Used in Save()
|
||||
@@ -185,7 +187,7 @@ sub DoAtomSave {
|
||||
my $oldrev = $Page{revision};
|
||||
if ($old eq $string and $oldid eq $id) {
|
||||
ReportError(T('No changes to be saved.'), '200 OK'); # an update without consequence
|
||||
} elsif ($oldrev == 0 and ($string eq $NewText or $string eq "\n")) {
|
||||
} elsif ($oldrev == 0 and $string eq "\n") {
|
||||
ReportError(T('No changes to be saved.'), '400 BAD REQUEST'); # don't fake page creation because of webdav
|
||||
} else {
|
||||
# My providing a different title, the entry is automatically renamed
|
||||
@@ -229,15 +231,8 @@ sub DoAtomGet {
|
||||
}
|
||||
|
||||
sub AtomEntry {
|
||||
my $data = $q->param('POSTDATA');
|
||||
if (not $data) {
|
||||
# CGI provides POSTDATA for POST requests, not for PUT requests.
|
||||
# The following code is based on the CGI->init code.
|
||||
my $content_length = defined($ENV{'CONTENT_LENGTH'}) ? $ENV{'CONTENT_LENGTH'} : 0;
|
||||
if ($content_length > 0 and $content_length < $MaxPost) {
|
||||
$q->read_from_client(\$data, $content_length, 0);
|
||||
}
|
||||
}
|
||||
my $type = shift || 'POST';
|
||||
my $data = $q->param($type . 'DATA'); # PUTDATA or POSTDATA
|
||||
my $entry = XML::Atom::Entry->new(\$data);
|
||||
return $entry;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
# ====================[ autolock.pl ]====================
|
||||
|
||||
@@ -170,11 +171,11 @@ sub UserCanEditAutoLockFix {
|
||||
return 0 if $id eq 'SampleUndefinedPage' or $id eq T('SampleUndefinedPage')
|
||||
or $id eq 'Sample_Undefined_Page' or $id eq T('Sample_Undefined_Page');
|
||||
return 1 if UserIsAdmin() || UserIsEditor();
|
||||
return 0 if $id ne '' and -f GetLockedPageFile($id);
|
||||
return 0 if $LockOnCreation{$id} and not -f GetPageFile($id); # new page
|
||||
return 0 if !$EditAllowed or -f $NoEditFile;
|
||||
return 0 if $id ne '' and IsFile(GetLockedPageFile($id));
|
||||
return 0 if $LockOnCreation{$id} and not IsFile(GetPageFile($id)); # new page
|
||||
return 0 if !$EditAllowed or IsFile($NoEditFile);
|
||||
return 0 if $editing and UserIsBanned(); # this call is more expensive
|
||||
return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/o);
|
||||
return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/);
|
||||
return 1 if $EditAllowed >= 3 and ($comment or (GetParam('aftertext', '') and not GetParam('text', '')));
|
||||
return 0 if $EditAllowed >= 3;
|
||||
return 1;
|
||||
@@ -205,18 +206,17 @@ except where noted.
|
||||
|
||||
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
|
||||
|
||||
This file is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this file; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,15 +11,13 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Grab MLDBM at http://search.cpan.org/dist/MLDBM/lib/MLDBM.pm
|
||||
# ie: http://search.cpan.org/CPAN/authors/id/C/CH/CHAMAS/MLDBM-2.01.tar.gz
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
use Fcntl;
|
||||
use MLDBM qw( DB_File Storable );
|
||||
@@ -43,8 +41,8 @@ sub BacklinksMenu {
|
||||
$Action{buildback} = \&BuildBacklinkDatabase;
|
||||
sub BuildBacklinkDatabase {
|
||||
print GetHttpHeader('text/plain');
|
||||
unlink $backfile; # Remove old database
|
||||
tie my %backhash, 'MLDBM', $backfile or die "Cannot open file $backfile $!\n";
|
||||
Unlink($backfile); # Remove old database
|
||||
tie my %backhash, 'MLDBM', encode_utf8($backfile) or die "Cannot open file $backfile $!\n";
|
||||
log1("Starting Database Store Process ... please wait\n\n");
|
||||
|
||||
foreach my $name (AllPagesList()) {
|
||||
@@ -100,7 +98,7 @@ sub GetBackLink {
|
||||
|
||||
our ($BacklinkBanned);
|
||||
$BacklinkBanned = "HomePage|ScratchPad" if !$BacklinkBanned;
|
||||
tie my %backhash, 'MLDBM', $backfile, O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
|
||||
tie my %backhash, 'MLDBM', encode_utf8($backfile), O_CREAT|O_RDWR, oct(644) or die "Cannot open file $backfile $!\n";
|
||||
|
||||
# Search database for matches
|
||||
while ( my ($source, $hashes) = each %backhash ) {
|
||||
@@ -116,7 +114,7 @@ sub GetBackLink {
|
||||
foreach my $backlink (@backlinks) {
|
||||
my ($class, $resolved, $title, $exists) = ResolveId($backlink);
|
||||
if (($resolved ne $id) && ($resolved !~ /^($BacklinkBanned)$/)) {
|
||||
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, T('Internal Page: ' . $resolved)));
|
||||
push(@unpopped, ScriptLink(UrlEncode($resolved), $resolved, $class . ' backlink', undef, Ts('Internal Page: %s', $resolved)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
# http://www.oddmuse.org/cgi-bin/oddmuse/Backlinks_Extension
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('backlinks.pl', 'Backlinks Extension');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2013 Alex Schroeder <alex@gnu.org>
|
||||
# Copyright (C) 2013-2016 Alex Schroeder <alex@gnu.org>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
@@ -21,10 +21,12 @@ compared to the list of regular expressions on the C<BannedHosts> page
|
||||
(see C<$BannedHosts>). If the contributor is already banned, this is
|
||||
mentioned. If the contributor is not banned, you'll see a button
|
||||
allowing you to ban him or her immediately. If you click the button,
|
||||
the IP or hostname will be added to the C<BannedHosts> page for you.
|
||||
the IP will be added to the C<BannedHosts> page for you.
|
||||
|
||||
=cut
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
|
||||
|
||||
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
|
||||
@@ -55,17 +57,18 @@ sub IsItBanned {
|
||||
sub DoBanHosts {
|
||||
my $id = shift;
|
||||
my $content = GetParam('content', '');
|
||||
my $host = GetParam('host', '');
|
||||
my $range = GetParam('range', '');
|
||||
my $regexp = GetParam('regexp', '');
|
||||
if ($content) {
|
||||
SetParam('text', GetPageContent($BannedContent)
|
||||
. $content . " # " . CalcDay($Now) . " "
|
||||
. NormalToFree($id) . "\n");
|
||||
SetParam('summary', NormalToFree($id));
|
||||
DoPost($BannedContent);
|
||||
} elsif ($host) {
|
||||
$host =~ s/\./\\./g;
|
||||
} elsif ($regexp) {
|
||||
SetParam('text', GetPageContent($BannedHosts)
|
||||
. "^" . $host . " # " . CalcDay($Now) . " "
|
||||
. $regexp . " # " . CalcDay($Now)
|
||||
. " $range "
|
||||
. NormalToFree($id) . "\n");
|
||||
SetParam('summary', NormalToFree($id));
|
||||
DoPost($BannedHosts);
|
||||
@@ -93,10 +96,14 @@ sub DoBanHosts {
|
||||
if (IsItBanned($_, \@regexps)) {
|
||||
print $q->p(Ts("%s is banned", $name));
|
||||
} else {
|
||||
my ($start, $end) = BanContributors::get_range($_);
|
||||
$range = "[$start - $end]";
|
||||
$name .= " " . $range;
|
||||
print GetFormStart(undef, 'get', 'ban'),
|
||||
GetHiddenValue('action', 'ban'),
|
||||
GetHiddenValue('id', $id),
|
||||
GetHiddenValue('host', $_),
|
||||
GetHiddenValue('range', $range),
|
||||
GetHiddenValue('regexp', BanContributors::get_regexp_ip($start, $end)),
|
||||
GetHiddenValue('recent_edit', 'on'),
|
||||
$q->p($name, $q->submit(T('Ban!'))), $q->end_form();
|
||||
}
|
||||
@@ -123,10 +130,10 @@ sub NewBanContributorsWriteRcLog {
|
||||
and $OpenPageName eq $id and UserIsAdmin()) {
|
||||
# we currently have the clean page loaded, so we need to reload
|
||||
# the spammed revision (there is a possible race condition here)
|
||||
my ($old) = GetTextRevision($Page{revision}-1, 1);
|
||||
my %urls = map {$_ => 1 } $old =~ /$UrlPattern/og;
|
||||
my $old = GetTextRevision($Page{revision} - 1, 1)->{text};
|
||||
my %urls = map {$_ => 1 } $old =~ /$UrlPattern/g;
|
||||
# we open the file again to force a load of the despammed page
|
||||
foreach my $url ($Page{text} =~ /$UrlPattern/og) {
|
||||
foreach my $url ($Page{text} =~ /$UrlPattern/g) {
|
||||
delete($urls{$url});
|
||||
}
|
||||
# we also remove any candidates that are already banned
|
||||
@@ -152,8 +159,100 @@ sub NewBanContributorsWriteRcLog {
|
||||
$q->submit(T('Ban!'))),
|
||||
$q->end_form();
|
||||
};
|
||||
print $q->p(T("Consider banning the IP number as well: "),
|
||||
print $q->p(T("Consider banning the IP number as well:"), ' ',
|
||||
ScriptLink('action=ban;id=' . UrlEncode($id), T('Ban contributors')));
|
||||
};
|
||||
return OldBanContributorsWriteRcLog(@_);
|
||||
}
|
||||
|
||||
package BanContributors;
|
||||
use Net::Whois::Parser qw/parse_whois/;
|
||||
|
||||
sub get_range {
|
||||
my $ip = shift;
|
||||
my $response = parse_whois(domain => $ip);
|
||||
my ($start, $end);
|
||||
my $re = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}';
|
||||
my ($start, $end) = $response->{inetnum} =~ /($re) *- *($re)/;
|
||||
return $start, $end;
|
||||
}
|
||||
|
||||
sub get_groups {
|
||||
my ($from, $to) = @_;
|
||||
my @groups;
|
||||
if ($from < 10) {
|
||||
my $to = $to >= 10 ? 9 : $to;
|
||||
push(@groups, [$from, $to]);
|
||||
$from = $to + 1;
|
||||
}
|
||||
while ($from < $to) {
|
||||
my $to = int($from/100) < int($to/100) ? $from + 99 - $from % 100 : $to;
|
||||
if ($from % 10) {
|
||||
push(@groups, [$from, $from + 9 - $from % 10]);
|
||||
$from += 10 - $from % 10;
|
||||
}
|
||||
if (int($from/10) < int($to/10)) {
|
||||
if ($to % 10 == 9) {
|
||||
push(@groups, [$from, $to]);
|
||||
$from = 1 + $to;
|
||||
} else {
|
||||
push(@groups, [$from, $to - 1 - $to % 10]);
|
||||
$from = $to - $to % 10;
|
||||
}
|
||||
} else {
|
||||
push(@groups, [$from - $from % 10, $to]);
|
||||
last;
|
||||
}
|
||||
if ($to % 10 != 9) {
|
||||
push(@groups, [$from, $to]);
|
||||
$from = 1 + $to; # jump from 99 to 100
|
||||
}
|
||||
}
|
||||
return \@groups;
|
||||
}
|
||||
|
||||
sub get_regexp_range {
|
||||
my @chars;
|
||||
for my $group (@{get_groups(@_)}) {
|
||||
my ($from, $to) = @$group;
|
||||
my $char;
|
||||
for (my $i = length($from); $i >= 1; $i--) {
|
||||
if (substr($from, - $i, 1) eq substr($to, - $i, 1)) {
|
||||
$char .= substr($from, - $i, 1);
|
||||
} else {
|
||||
$char .= '[' . substr($from, - $i, 1) . '-' . substr($to, - $i, 1). ']';
|
||||
}
|
||||
}
|
||||
push(@chars, $char);
|
||||
}
|
||||
return join('|', @chars);
|
||||
}
|
||||
|
||||
sub get_regexp_ip {
|
||||
my ($from, $to) = @_;
|
||||
my @start = split(/\./, $from);
|
||||
my @end = split(/\./, $to);
|
||||
my $regexp = "^";
|
||||
for my $i (0 .. 3) {
|
||||
if ($start[$i] eq $end[$i]) {
|
||||
$regexp .= $start[$i];
|
||||
} elsif ($start[$i] eq '0' and $end[$i] eq '255') {
|
||||
last;
|
||||
} elsif ($start[$i + 1] > 0) {
|
||||
$regexp .= '(' . $start[$i] . '\.('
|
||||
. get_regexp_range($start[$i + 1], '255') . ')|'
|
||||
. get_regexp_range($start[$i] + 1, $end[$i + 1]) . ')';
|
||||
$regexp .= '\.';
|
||||
last;
|
||||
} else {
|
||||
$regexp .= '(' . get_regexp_range($start[$i], $end[$i]) . ')$';
|
||||
last;
|
||||
}
|
||||
$regexp .= '\.' if $i < 3;
|
||||
}
|
||||
return $regexp;
|
||||
}
|
||||
|
||||
# this is required in case we concatenate other modules to this one
|
||||
package OddMuse;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2013 Alex Schroeder <alex@gnu.org>
|
||||
# Copyright (C) 2013–2015 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
@@ -16,10 +16,11 @@
|
||||
# editors will be logged.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('ban-quick-editors.pl', 'Banning Quick Editors');
|
||||
|
||||
our ($Now, %RecentVisitors, $SurgeProtection);
|
||||
our ($q, $Now, %RecentVisitors, $SurgeProtection);
|
||||
|
||||
*BanQuickOldUserIsBanned = \&UserIsBanned;
|
||||
*UserIsBanned = \&BanQuickNewUserIsBanned;
|
||||
@@ -29,7 +30,7 @@ sub BanQuickNewUserIsBanned {
|
||||
if (not $rule
|
||||
and $SurgeProtection # need surge protection
|
||||
and GetParam('title')) {
|
||||
my $name = GetParam('username', GetRemoteHost());
|
||||
my $name = GetParam('username', $q->remote_addr());
|
||||
my @entries = @{$RecentVisitors{$name}};
|
||||
# $entry[0] is $Now after AddRecentVisitor
|
||||
my $ts = $entries[1];
|
||||
|
||||
@@ -13,14 +13,17 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('banned-regexps.pl', 'Banning Regular Expressions');
|
||||
|
||||
=h1 Compatibility
|
||||
=encoding utf8
|
||||
|
||||
=head1 Compatibility
|
||||
|
||||
This extension works with logbannedcontent.pl.
|
||||
|
||||
=h1 Example content for the BannedRegexps page:
|
||||
=head1 Example content for the BannedRegexps page:
|
||||
|
||||
# This page lists regular expressions that prevent the saving of a page.
|
||||
# The regexps are matched against any page or comment submitted.
|
||||
@@ -42,7 +45,8 @@ This extension works with logbannedcontent.pl.
|
||||
|
||||
=cut
|
||||
|
||||
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile);
|
||||
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile,
|
||||
$FullUrlPattern);
|
||||
our ($BannedRegexps);
|
||||
|
||||
$BannedRegexps = 'BannedRegexps';
|
||||
@@ -58,6 +62,8 @@ push(@MyInitVariables, sub {
|
||||
|
||||
sub RegexpNewBannedContent {
|
||||
my $str = shift;
|
||||
# remove URLs as they are controlled by $BannedContent
|
||||
$str =~ s/$FullUrlPattern//g;
|
||||
my $rule = RegexpOldBannedContent($str, @_);
|
||||
if (not $rule) {
|
||||
foreach (split(/\n/, GetPageContent($BannedRegexps))) {
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('bbcode.pl', 'bbCode Extension');
|
||||
|
||||
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
|
||||
push(@MyRules, \&bbCodeRule);
|
||||
$RuleOrder{\&bbCodeRule} = 100; # must come after PortraitSupportRule
|
||||
$RuleOrder{\&bbCodeRule} = 300; # must come after PortraitSupportRule, MarkdownRule
|
||||
|
||||
our ($bbBlock);
|
||||
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);
|
||||
@@ -60,12 +61,12 @@ sub bbCodeRule {
|
||||
return AddHtmlEnvironment('strong', qq{class="highlight"}); }
|
||||
elsif ($tag eq 'url') {
|
||||
if ($option) {
|
||||
$option =~ /^($UrlProtocols)/o;
|
||||
$option =~ /^($UrlProtocols)/;
|
||||
my $class = "url $1";
|
||||
return AddHtmlEnvironment('a', qq{href="$option" class="$class"}); }
|
||||
elsif (/\G$FullUrlPattern\s*\[\/url\]/cogi) {
|
||||
elsif (/\G$FullUrlPattern\s*\[\/url\]/cgi) {
|
||||
return GetUrl($1); }}
|
||||
elsif ($tag eq 'img' and /\G$FullUrlPattern\s*\[\/img\]/cogi) {
|
||||
elsif ($tag eq 'img' and /\G$FullUrlPattern\s*\[\/img\]/cgi) {
|
||||
return GetUrl($1, undef, undef, 1); } # force image
|
||||
elsif ($tag eq 'quote') {
|
||||
my $html = CloseHtmlEnvironments();
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('big-brother.pl', 'Big Brother Extension');
|
||||
|
||||
@@ -59,7 +60,6 @@ sub AddRecentVisitor {
|
||||
my $url = ScriptUrl(join(';', "action=$action;id=" . UrlEncode($id),
|
||||
map { $_ . '=' . UrlEncode(GetParam($_)) }
|
||||
keys %params));
|
||||
my $url = $q->url(-path_info=>1,-query=>1);
|
||||
my $download = GetParam('action', 'browse') eq 'download'
|
||||
|| GetParam('download', 0)
|
||||
|| $q->path_info() =~ m/\/download\//;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('blockquote.pl', 'Comments on Text Formatting Rules');
|
||||
|
||||
@@ -27,10 +25,10 @@ push(@MyRules, \&BlockQuoteRule);
|
||||
sub BlockQuoteRule {
|
||||
# indented text using : with the option of spanning multiple text
|
||||
# paragraphs (but not lists etc).
|
||||
if (InElement('blockquote') && m/\G(\s*\n)+:[ \t]*/cog) {
|
||||
if (InElement('blockquote') && m/\G(\s*\n)+:[ \t]*/cg) {
|
||||
return CloseHtmlEnvironmentUntil('blockquote')
|
||||
. AddHtmlEnvironment('p');
|
||||
} elsif ($bol && m/\G(\s*\n)*:[ \t]*/cog) {
|
||||
} elsif ($bol && m/\G(\s*\n)*:[ \t]*/cg) {
|
||||
return CloseHtmlEnvironments()
|
||||
. AddHtmlEnvironment('blockquote')
|
||||
. AddHtmlEnvironment('p');
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,12 +12,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('calendar.pl', 'Calendar Extension');
|
||||
|
||||
@@ -25,6 +23,7 @@ our ($q, %Page, %Action, $Now, $OpenPageName, $CollectingJournal, $FreeLinkPatte
|
||||
our ($CalendarOnEveryPage, $CalAsTable, $CalStartMonday);
|
||||
|
||||
$CalendarOnEveryPage = 0; # 1=on every page is a month-div situated in the header, use css to control
|
||||
# 2=this month and the previous month; 3=this, previous and next month
|
||||
$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
|
||||
|
||||
@@ -36,8 +35,22 @@ sub NewCalendarGetHeader {
|
||||
return $header unless $CalendarOnEveryPage;
|
||||
my $action = GetParam('action', 'browse');
|
||||
return $header if grep(/^$action$/, ('calendar', 'edit'));
|
||||
my $cal = Cal();
|
||||
$header =~ s/<div class="header">/$cal<div class="header">/;
|
||||
my $cal;
|
||||
my ($sec, $min, $hour, $mday, $mon, $year) = localtime($Now);
|
||||
$year += 1900;
|
||||
# $mon is 0 based and thus good for previous month
|
||||
if ($mon < 1) { $year -= 1; $mon += 12; };
|
||||
$cal .= Cal($year, $mon) if $CalendarOnEveryPage > 1;
|
||||
# the current month
|
||||
$mon += 1;
|
||||
if ($mon > 12) { $year += 1; $mon -= 12; };
|
||||
$cal .= Cal($year, $mon) if $CalendarOnEveryPage;
|
||||
# the next month
|
||||
$mon += 1;
|
||||
if ($mon > 12) { $year += 1; $mon -= 12; };
|
||||
$cal .= Cal($year, $mon) if $CalendarOnEveryPage > 2;
|
||||
# insert calendars before header div
|
||||
$header =~ s!<div class="header">!<div class="cal">$cal</div><div class="header">!;
|
||||
return $header;
|
||||
}
|
||||
|
||||
@@ -73,7 +86,7 @@ sub Cal {
|
||||
$link .= ScriptLink('action=collect;match=' . UrlEncode($re), $day, 'local collection' . $class);
|
||||
}
|
||||
$link;
|
||||
}}ge;
|
||||
}}eg;
|
||||
$cal =~ s{(\S+) (\d\d\d\d)}{{
|
||||
my ($month_text, $year_text) = ($1, $2);
|
||||
my $date = sprintf("%d-%02d", $year, $mon);
|
||||
@@ -87,7 +100,7 @@ sub Cal {
|
||||
$year_text, 'local collection year'));
|
||||
}
|
||||
}}e;
|
||||
return "<div class=\"cal month\"><pre>$cal</pre></div>";
|
||||
return "<div class=\"month\"><pre>$cal</pre></div>";
|
||||
}
|
||||
|
||||
$Action{collect} = \&DoCollect;
|
||||
@@ -117,22 +130,22 @@ sub DoCollect {
|
||||
push(@MyRules, \&CalendarRule);
|
||||
|
||||
sub CalendarRule {
|
||||
if (/\G(calendar:(\d\d\d\d))/gc) {
|
||||
if (/\G(calendar:(\d\d\d\d))/cg) {
|
||||
my $oldpos = pos;
|
||||
Clean(CloseHtmlEnvironments());
|
||||
Dirty($1);
|
||||
PrintYearCalendar($2);
|
||||
pos = $oldpos;
|
||||
return AddHtmlEnvironment('p');
|
||||
} elsif (/\G(month:(\d\d\d\d)-(\d\d))/gc) {
|
||||
} elsif (/\G(month:(\d\d\d\d)-(\d\d))/cg) {
|
||||
my $oldpos = pos;
|
||||
Clean(CloseHtmlEnvironments());
|
||||
Dirty($1);
|
||||
print Cal($2, $3);
|
||||
print $q->div({-class => 'cal'}, Cal($2, $3));
|
||||
pos = $oldpos;
|
||||
return AddHtmlEnvironment('p');
|
||||
} elsif (/\G(month:([+-]\d\d?))/gc
|
||||
or /\G(\[\[month:([+-]\d\d?) $FreeLinkPattern\]\])/gc) {
|
||||
} elsif (/\G(month:([+-]\d\d?))/cg
|
||||
or /\G(\[\[month:([+-]\d\d?) $FreeLinkPattern\]\])/cg) {
|
||||
my $oldpos = pos;
|
||||
Clean(CloseHtmlEnvironments());
|
||||
Dirty($1);
|
||||
@@ -143,7 +156,7 @@ sub CalendarRule {
|
||||
$mon += 1 + $delta;
|
||||
while ($mon < 1) { $year -= 1; $mon += 12; };
|
||||
while ($mon > 12) { $year += 1; $mon -= 12; };
|
||||
print Cal($year, $mon, undef, $id);
|
||||
print $q->div({-class => 'cal'}, Cal($year, $mon, undef, $id));
|
||||
pos = $oldpos;
|
||||
return AddHtmlEnvironment('p');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('canonical.pl', 'Canonical Names');
|
||||
|
||||
|
||||
178
modules/cart.pl
Normal file
178
modules/cart.pl
Normal file
@@ -0,0 +1,178 @@
|
||||
# Copyright (C) 2008 Eric Hsu <apricotan@gmail.com>
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
use utf8;
|
||||
|
||||
AddModuleDescription('cart.pl', 'Cart Extension');
|
||||
|
||||
our ($q, %Action, $UserGotoBar, $CookieName);
|
||||
our ($CartPic, $CartName, %Cart, $ShowCart, @CartOrdered);
|
||||
my $LOADED_CART_JS;
|
||||
|
||||
# ============
|
||||
# = cart-bfc =
|
||||
# ============
|
||||
|
||||
# This is a simple shopping cart for pages!
|
||||
# Requires searchpaged-bfc.pl.
|
||||
|
||||
# We make a checkbox that onChange, uses Yahoo! UI Cookie 2.6 (note we need 2.6!) routines to set a subcookie.
|
||||
# We have the cookie "$CartName" (by default $Cookiename . "Cart")
|
||||
# which holds the actual cart and is managed almost entirely
|
||||
# in client-side javascript. That means the checkboxes directly control the cookie.
|
||||
|
||||
# If you want a little picture of a cart, you can set the URL at $CartPic.
|
||||
|
||||
# InitCart loads the cookie values into %Cart. $Cart->{$pagename}=1 if it's in the cart.
|
||||
# In theory cookies are capped at 4K. Our page names are capped around 90ish chars. That leaves room for 40 maximal names in the cart. Probably enough.
|
||||
|
||||
# We'll need the cookie values for
|
||||
# action=cart;subaction=show; along with other future subactions (download in latex, bibtex)
|
||||
# we'll feed this display to a variant of search display.
|
||||
# I'll have to check oddmuse.pl.
|
||||
|
||||
# load Yahoo UI code bit to manage subcookies.
|
||||
|
||||
$Action{cart} = \&DoCart;
|
||||
|
||||
sub DoCart {
|
||||
# foreach $key (keys %Cart) {
|
||||
# push @cart, $key if ($Cart{"$key"});
|
||||
# }
|
||||
DoSearch(\@CartOrdered);
|
||||
}
|
||||
|
||||
$UserGotoBar .= '<a href="?action=cart;cache=0">View Cart</a>';
|
||||
|
||||
# Manage Cart Routines
|
||||
|
||||
#push @MyPrintSearchResultsPrefix, \&PrintCheckboxTableStart;
|
||||
#push @MyPrintSearchResultsSuffix, \&PrintCheckboxTableEnd;
|
||||
|
||||
# I can't hack into Init, so let's tap into InitCookie.
|
||||
# We also tap into Cookie() to arrange writing out our cleaned up Cart.
|
||||
|
||||
*OldInitCookie = *InitCookie;
|
||||
*InitCookie = *InitCookieAndCart;
|
||||
|
||||
# To get a checkbox in the titles of pages, we patch GetHeader.
|
||||
*OldGetHeader = *GetHeader;
|
||||
*GetHeader = *GetHeaderAndCart;
|
||||
|
||||
sub InitCookieAndCart {
|
||||
OldInitCookie();
|
||||
InitCart();
|
||||
}
|
||||
|
||||
sub GetHeaderAndCart {
|
||||
my ($id, $title, $oldId, $nocache, $status) = @_;
|
||||
my $result = OldGetHeader(@_);
|
||||
|
||||
return ($result) unless ($id);
|
||||
|
||||
my $checkbox = MakeCheckbox($id);
|
||||
$checkbox = qq(<span class="cart-checkbox" style="float:right">$checkbox</span>);
|
||||
|
||||
$result =~ s/(<\/h1>)/$checkbox$1/;
|
||||
|
||||
return ($result);
|
||||
}
|
||||
|
||||
|
||||
# We load the contents of our Cart cookie into the global %Cart and @CartOrdered
|
||||
sub InitCart {
|
||||
$CartName = $CookieName . "Cart" unless (defined ($CartName) );
|
||||
my @pairs;
|
||||
|
||||
%Cart = ();
|
||||
@CartOrdered = ();
|
||||
|
||||
if ($q->cookie($CartName)) {
|
||||
# @pairs = split(/&/, $q->cookie($CartName));
|
||||
@pairs = $q->cookie($CartName);
|
||||
foreach my $pair (@pairs) {
|
||||
# my $encodedequals = UrlEncode("=");
|
||||
my ($name, $val)= split(/\=/, $pair);
|
||||
$Cart{"$name"}=$val;
|
||||
push @CartOrdered, $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub PrintCheckboxTableStart {
|
||||
my ($name, $regex, $text, $type) = @_;
|
||||
my $html;
|
||||
|
||||
$html .= "<table><tr>";
|
||||
my $checkbox = MakeCheckbox(@_);
|
||||
$html .= qq(<td valign=top>$checkbox</td>);
|
||||
$html .= "<td valign=top>";
|
||||
print $html;
|
||||
}
|
||||
|
||||
sub PrintCheckboxTableEnd {
|
||||
my ($name, $regex, $text, $type) = @_;
|
||||
my $html;
|
||||
|
||||
$html .= "</td>";
|
||||
$html .= "</tr></table>";
|
||||
|
||||
print $html;
|
||||
}
|
||||
|
||||
|
||||
sub MakeCheckbox {
|
||||
my ($name, $regex, $text, $type) = @_;
|
||||
my $html;
|
||||
|
||||
return unless ($ShowCart);
|
||||
unless ($LOADED_CART_JS) {
|
||||
$html .= '<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.7.0/build/yahoo/yahoo-min.js&2.7.0/build/cookie/cookie-min.js&2.7.0/build/event/event-min.js"></script>';
|
||||
$LOADED_CART_JS=1;
|
||||
}
|
||||
|
||||
my $selected = qq(checked="yes") if ($Cart{"$name"});
|
||||
|
||||
$html .=<<HTMLEND;
|
||||
$CartPic<input type="checkbox" value="cart" id="$name-set" title="Add To Cart" $selected/> <br>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
YAHOO.util.Event.on("$name-set", "change", function(){
|
||||
var value = YAHOO.util.Cookie.getSub("$CartName", "$name");
|
||||
if (value == 1 ) { YAHOO.util.Cookie.removeSub("$CartName", "$name"); }
|
||||
else { YAHOO.util.Cookie.setSub("$CartName", "$name", 1 ); }
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
HTMLEND
|
||||
|
||||
return $html unless ($q->param('action') eq 'edit' || $q->param('Preview'));
|
||||
# no checkboxes for edit pages.
|
||||
return;
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
=
|
||||
(0.7) Load JS libraries on first checkbox (so won't load if we are editing).
|
||||
(0.6) Changed the JS source to be Yahoo's CDN.
|
||||
(0.51) Use CSS class cart-checkbox for the cart checkbox! That way, we can remove them for printouts, for instance.
|
||||
(0.5) Our hack of cookies was not working cross-platform. We have a mismatch because our attempts to send out a cookie from oddmuse were getting the contents encoded and unreadable for the YUI routines. Instead,we will use removeSub to avoid ever having to send the cookie back from our server!
|
||||
(0.4) Now every page title has a checkbox floated to the right, which controls the cart status.
|
||||
(0.3) Allow cart editing from cart display. Currently, doesn't seem to affect the cart.
|
||||
(0.2) Cart now displays.
|
||||
(0.1) Cart is now persistent and is edited by the checkboxes.
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('checkbox.pl', 'Checklist Extension');
|
||||
|
||||
@@ -76,7 +74,7 @@ sub DoCheckBox{
|
||||
$summary{$3} = 0 if $2 eq 'x' or $2 eq 'X';
|
||||
"${1}[[ :${3}]]";
|
||||
}
|
||||
}eig;
|
||||
}egi;
|
||||
SetParam('text', $text);
|
||||
SetParam('summary', join(', ', map {
|
||||
if ($summary{$_}) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('clustermap.pl', 'ClusterMap Module');
|
||||
|
||||
@@ -61,7 +59,7 @@ foreach (@ClusterMapAdminPages){
|
||||
}
|
||||
|
||||
sub ClusterMapRule {
|
||||
if (/\G^([\n\r]*\<\s*clustermap\s*\>\s*)$/mgc) {
|
||||
if (/\G^([\n\r]*\<\s*clustermap\s*\>\s*)$/cgm) {
|
||||
Dirty($1);
|
||||
my $oldpos = pos;
|
||||
my $oldstr = $_;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('comment-div-wrapper.pl', 'Comment Div Wrapper Extension');
|
||||
|
||||
@@ -29,7 +30,7 @@ sub CommentDivWrapper {
|
||||
return $q->start_div({-class=>'userComment'});
|
||||
}
|
||||
}
|
||||
if ($OpenPageName =~ /$CommentsPattern/o) {
|
||||
if ($OpenPageName =~ /$CommentsPattern/) {
|
||||
if ($bol and m/\G(\s*\n)*----+[ \t]*\n?/cg) {
|
||||
my $html = CloseHtmlEnvironments()
|
||||
. ($CommentDiv++ > 0 ? $q->end_div() : $q->h2({-class=>'commentsHeading'}, T('Comments:'))) . $q->start_div({-class=>'userComment'})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('commentcount.pl', 'Comment Count Extension');
|
||||
|
||||
@@ -51,15 +49,15 @@ sub NewCommentcountScriptLink {
|
||||
if ($CommentsPrefix && $action =~ /^$CommentsPrefix(.*)/) { # TODO use $CommentsPattern ?
|
||||
# Add the number of comments here
|
||||
my $id = $action;
|
||||
$id =~ s/%([0-9a-f][0-9a-f])/chr(hex($1))/ge; # undo urlencode
|
||||
$id =~ s/%([0-9a-f][0-9a-f])/chr(hex($1))/eg; # undo urlencode
|
||||
my $comments = GetPageContent($id);
|
||||
my $num = 0;
|
||||
if($comments =~ /=== (\d+) Comments?\. ===/) {
|
||||
$num = $1;
|
||||
}
|
||||
# Fix plurals
|
||||
my $plural = T('Comments on ');
|
||||
my $singular = T('Comment on ');
|
||||
my $plural = T('Comments on');
|
||||
my $singular = T('Comment on');
|
||||
$text =~ s/$plural/$singular/ if($num == 1);
|
||||
$text = $num . ' ' . $text;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('compilation.pl', 'Compilation Extension');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -14,6 +14,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('context.pl', 'Calendar Extension');
|
||||
|
||||
|
||||
@@ -1,33 +1,35 @@
|
||||
# Copyright (C) 2005 Fletcher T. Penney <fletcher@freeshell.org>
|
||||
# Copyright (C) 2016 Alex Schroeder <alex@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 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
|
||||
#
|
||||
# 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
|
||||
# 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 Creation Date Extension
|
||||
|
||||
This module stores additional information about a page when it is first created:
|
||||
|
||||
=over
|
||||
=item C<created> is the date the page is first saved
|
||||
=item C<originalAuthor> is the username that first created a page
|
||||
=back
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('creationdate.pl', 'CreationDate Module');
|
||||
|
||||
our (%Page, $Now);
|
||||
our (%Page, $Now, @MyAdminCode, %Action, $q, $FS, $RcOldFile, $RcFile);
|
||||
|
||||
*CreationDateOldOpenPage = \&OpenPage;
|
||||
*OpenPage = \&CreationDateOpenPage;
|
||||
@@ -38,3 +40,45 @@ sub CreationDateOpenPage{
|
||||
$Page{originalAuthor} = GetParam('username','') unless $Page{originalAuthor}
|
||||
or $Page{revision};
|
||||
}
|
||||
|
||||
# Allow administrators to add the 'created' item to page files, based on rc log
|
||||
# files.
|
||||
|
||||
push(@MyAdminCode, \&CreationDateMenu);
|
||||
|
||||
sub CreationDateMenu {
|
||||
my ($id, $menuref, $restref) = @_;
|
||||
push(@$menuref,
|
||||
ScriptLink('action=add-creation-date',
|
||||
T('Add creation date to page files'),
|
||||
'creationdate')) if UserIsAdmin();
|
||||
}
|
||||
|
||||
$Action{'add-creation-date'} = \&AddCreationDate;
|
||||
|
||||
sub AddCreationDate {
|
||||
print GetHeader('', T('Add creation date to page files'));
|
||||
print $q->start_div({-class=>'creationdate'});
|
||||
print '<ul>';
|
||||
RequestLockOrError();
|
||||
for my $file ($RcOldFile, $RcFile) {
|
||||
open(my $F, '<:encoding(UTF-8)', encode_utf8($file)) or next;
|
||||
while (my $line = <$F>) {
|
||||
chomp($line);
|
||||
my ($ts, $id, $minor, $summary, $host, $username, $revision)
|
||||
= split(/$FS/, $line);
|
||||
next unless $revision == 1;
|
||||
print $q->li(NormalToFree($id));
|
||||
OpenPage($id);
|
||||
next unless $Page{revision}; # skip if page no longer exists
|
||||
next if $Page{created} and $Page{originalAuthor};
|
||||
$Page{created} = $ts unless $Page{created};
|
||||
$Page{originalAuthor} = $username unless $Page{originalAuthor};
|
||||
SavePage();
|
||||
}
|
||||
}
|
||||
ReleaseLock();
|
||||
print '</ul>';
|
||||
print $q->end_div();
|
||||
PrintFooter();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
# ====================[ creole.pl ]====================
|
||||
|
||||
@@ -217,7 +218,7 @@ sub CreoleRule {
|
||||
}
|
||||
# escape next char (and prevent // in URLs from enabling italics)
|
||||
# ~
|
||||
elsif (m/\G(~($FullUrlPattern|\S))/cgo) {
|
||||
elsif (m/\G(~($FullUrlPattern|\S))/cg) {
|
||||
return
|
||||
($CreoleTildeAlternative and
|
||||
index( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
@@ -233,12 +234,12 @@ sub CreoleRule {
|
||||
# {{{preformatted code}}}
|
||||
elsif (m/\G\{\{\{(.*?}*)\}\}\}/cg) { return $q->code($1); }
|
||||
# download: {{pic}} and {{pic|text}}
|
||||
elsif (m/\G(\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\})/cgos) {
|
||||
elsif (m/\G(\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\})/cgs) {
|
||||
my $text = $4 || $2;
|
||||
return GetCreoleLinkHtml($1, GetDownloadLink(FreeToNormal($2), 1, undef, $text), $text);
|
||||
}
|
||||
# image link: {{url}} and {{url|text}}
|
||||
elsif (m/\G\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}/cgos) {
|
||||
elsif (m/\G\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}/cgs) {
|
||||
return GetCreoleImageHtml(
|
||||
$q->a({-href=> UnquoteHtml($1),
|
||||
-class=> 'image outside'},
|
||||
@@ -249,7 +250,7 @@ sub CreoleRule {
|
||||
}
|
||||
# image link: [[link|{{pic}}]] and [[link|{{pic|text}}]]
|
||||
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern
|
||||
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) {
|
||||
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) {
|
||||
my $text = $5 || $2;
|
||||
return GetCreoleLinkHtml($1, GetCreoleImageHtml(
|
||||
ScriptLink(UrlEncode(FreeToNormal($2)),
|
||||
@@ -260,7 +261,7 @@ sub CreoleRule {
|
||||
}
|
||||
# image link: [[link|{{url}}]] and [[link|{{url|text}}]]
|
||||
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern
|
||||
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) {
|
||||
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) {
|
||||
my $text = $5 || $2;
|
||||
return GetCreoleLinkHtml($1, GetCreoleImageHtml(
|
||||
ScriptLink(UrlEncode(FreeToNormal($2)),
|
||||
@@ -271,7 +272,7 @@ sub CreoleRule {
|
||||
}
|
||||
# image link: [[url|{{pic}}]] and [[url|{{pic|text}}]]
|
||||
elsif (m/\G(\[\[$FullUrlPattern$CreoleLinkPipePattern
|
||||
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) {
|
||||
\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) {
|
||||
my $text = $5 || $2;
|
||||
return GetCreoleLinkHtml($1, GetCreoleImageHtml(
|
||||
$q->a({-href=> UnquoteHtml($2), -class=> 'image outside'},
|
||||
@@ -282,7 +283,7 @@ sub CreoleRule {
|
||||
}
|
||||
# image link: [[url|{{url}}]] and [[url|{{url|text}}]]
|
||||
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkPipePattern
|
||||
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\]/cgosx) {
|
||||
\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\]/cgsx) {
|
||||
return GetCreoleImageHtml(
|
||||
$q->a({-href=> UnquoteHtml($1), -class=> 'image outside'},
|
||||
$q->img({-src=> UnquoteHtml($2),
|
||||
@@ -291,7 +292,7 @@ sub CreoleRule {
|
||||
-class=> 'url outside'})));
|
||||
}
|
||||
# link: [[url]] and [[url|text]]
|
||||
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkTextPattern\]\]/cgos) {
|
||||
elsif (m/\G\[\[$FullUrlPattern$CreoleLinkTextPattern\]\]/cgs) {
|
||||
# Permit embedding of Creole syntax within link text. (Rather complicated,
|
||||
# but it does the job remarkably.)
|
||||
my $link_url = $1;
|
||||
@@ -304,7 +305,7 @@ sub CreoleRule {
|
||||
return GetUrl($link_url, $link_text, 1);
|
||||
}
|
||||
# link: [[page]] and [[page|text]]
|
||||
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkTextPattern\]\])/cgos) {
|
||||
elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkTextPattern\]\])/cgs) {
|
||||
my $markup = $1;
|
||||
my $page_name = $2;
|
||||
my $link_text = $4 ? CreoleRuleRecursive($4, @_) : $page_name;
|
||||
@@ -314,7 +315,7 @@ sub CreoleRule {
|
||||
}
|
||||
# interlink: [[Wiki:page]] and [[Wiki:page|text]]
|
||||
elsif ($is_interlinking and
|
||||
m/\G(\[\[$FreeInterLinkPattern$CreoleLinkTextPattern\]\])/cgos) {
|
||||
m/\G(\[\[$FreeInterLinkPattern$CreoleLinkTextPattern\]\])/cgs) {
|
||||
my $markup = $1;
|
||||
my $interlink = $2;
|
||||
my $interlink_text = $4;
|
||||
@@ -404,8 +405,7 @@ sub CreoleRule {
|
||||
if ($is_left_justified and
|
||||
$is_right_justified) { $attributes .= 'align="center"' }
|
||||
elsif ($is_right_justified) { $attributes .= 'align="right"' }
|
||||
# this is the default:
|
||||
# elsif ($is_left_justified) { $attributes .= 'align="left"' }
|
||||
elsif ($is_left_justified) { $attributes .= 'align="left"' }
|
||||
|
||||
return
|
||||
(InElement('td') || InElement('th') ? CloseHtmlEnvironmentUntil('tr') : '')
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
# ====================[ creoleaddition.pl ]====================
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
# ====================[ crossbar.pl ]====================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('crumbs.pl', 'List Parent Pages Extension');
|
||||
|
||||
@@ -27,8 +25,8 @@ $RuleOrder{\&CrumbsRule} = -10; # run before default rules!
|
||||
|
||||
sub CrumbsRule {
|
||||
if (not (pos) # first!
|
||||
and (($WikiLinks && /\G($LinkPattern\n)/cgo)
|
||||
or ($FreeLinks && /\G(\[\[$FreeLinkPattern\]\]\n)/cgo))) {
|
||||
and (($WikiLinks && /\G($LinkPattern\n)/cg)
|
||||
or ($FreeLinks && /\G(\[\[$FreeLinkPattern\]\]\n)/cg))) {
|
||||
my $oldpos = pos; # will be trashed below
|
||||
my $cluster = FreeToNormal($2);
|
||||
my %seen = ($cluster => 1);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('csv.pl', 'Comments on Long Table Markup Extension');
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('dates.pl', 'Dates Extension');
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('delete-all.pl');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
our ($q, $Now, %IndexHash, %Action, %Page, $OpenPageName, $FS, $BannedContent, $RcFile, $RcDefault, @MyAdminCode, $FullUrlPattern, $DeletedPage, $StrangeBannedContent);
|
||||
|
||||
@@ -132,14 +130,14 @@ sub DespamPage {
|
||||
# from DoHistory()
|
||||
my @revisions = sort {$b <=> $a} map { m|/([0-9]+).kp$|; $1; } GetKeepFiles($OpenPageName);
|
||||
foreach my $revision (@revisions) {
|
||||
my ($text, $rev) = GetTextRevision($revision, 1); # quiet
|
||||
my ($revisionPage, $rev) = GetTextRevision($revision, 1); # quiet
|
||||
if (not $rev) {
|
||||
print ': ' . Ts('Cannot find revision %s.', $revision);
|
||||
return;
|
||||
} elsif (not DespamBannedContent($text)) {
|
||||
} elsif (not DespamBannedContent($revisionPage->{text})) {
|
||||
my $summary = Tss('Revert to revision %1: %2', $revision, $rule);
|
||||
print ': ' . $summary;
|
||||
Save($OpenPageName, $text, $summary) unless GetParam('debug', 0);
|
||||
Save($OpenPageName, $revisionPage->{text}, $summary) unless GetParam('debug', 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('diff.pl', 'Diff Action Extension');
|
||||
|
||||
@@ -76,8 +77,7 @@ sub DoUnifiedDiff { # copied from DoDiff
|
||||
RequestLockDir('diff') or return '';
|
||||
WriteStringToFile($oldName, $_[0]);
|
||||
WriteStringToFile($newName, $_[1]);
|
||||
my $diff_out = `diff -U 99999 -- \Q$oldName\E \Q$newName\E | tail -n +7`; # should be +4, but we always add extra line # TODO that workaround is ugly, fix it!
|
||||
utf8::decode($diff_out); # needs decoding
|
||||
my $diff_out = decode_utf8(`diff -U 99999 -- \Q$oldName\E \Q$newName\E | tail -n +7`); # should be +4, but we always add extra line # TODO that workaround is ugly, fix it!
|
||||
$diff_out =~ s/\n\K\\ No newline.*\n//g; # Get rid of common complaint.
|
||||
ReleaseLockDir('diff');
|
||||
# No need to unlink temp files--next diff will just overwrite.
|
||||
|
||||
49
modules/ditaa.pl
Normal file
49
modules/ditaa.pl
Normal file
@@ -0,0 +1,49 @@
|
||||
#! /usr/bin/perl
|
||||
# Copyright (C) 2015–2017 Alex Schroeder <alex@gnu.org>
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, either version 3 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('ditaa.pl', 'Ditaa for Diagrams');
|
||||
|
||||
our ($q, $bol, @MyRules, @KnownLocks, $TempDir);
|
||||
|
||||
push (@MyRules, \&DitaaRule);
|
||||
push(@KnownLocks, 'diagram');
|
||||
|
||||
sub DitaaRule {
|
||||
if ($bol && m/\G<diagram(\s+style=".*")?>\n((.*\n)+)<\/diagram>/cg) {
|
||||
return "MIME::Base64 not installed" unless eval { require MIME::Base64; };
|
||||
my $style = $1;
|
||||
my $map = UnquoteHtml($2);
|
||||
RequestLockDir('diagram', undef, undef, 1);
|
||||
WriteStringToFile("$TempDir/diagram.txt", $map);
|
||||
$ENV{LANG}='en_US.UTF-8'; # Java needs Locale to match as well!
|
||||
my $output = `ditaa "$TempDir/diagram.txt" "$TempDir/diagram.png"`;
|
||||
my $image = '';
|
||||
# not UTF-8 layer!
|
||||
if (open(IN, '<', "$TempDir/diagram.png")) {
|
||||
local $/ = undef; # Read complete files
|
||||
$image = <IN>;
|
||||
close IN;
|
||||
}
|
||||
ReleaseLockDir('diagram');
|
||||
my $data = MIME::Base64::encode_base64($image);
|
||||
my $url = "data:image/png;base64,$data";
|
||||
return CloseHtmlEnvironments()
|
||||
. "<div$style>" . $q->img({-src=>$url, -alt=>$map}) . "</div>";
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
@@ -13,16 +13,21 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
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 \< ([a-z_-][a-z0-9 _-]+[a-z0-9_-]) \> \s*\n /cgx) {
|
||||
return CloseHtmlEnvironment('p') . AddHtmlEnvironment('div', 'class="' . join(' ', map {"$DivFooPrefix$_"} split /\s+/, $1) . '"');
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('dojo.pl', 'Using Dojo Instead Of Wiki Markup');
|
||||
|
||||
@@ -29,7 +30,7 @@ $DojoTheme = 'tundra';
|
||||
push (@MyRules, \&WysiwygRule);
|
||||
|
||||
sub WysiwygRule {
|
||||
if (m/\G(<.*?>)/gc) {
|
||||
if (m/\G(<.*?>)/cg) {
|
||||
return $1 if substr($1,5,6) eq 'script'
|
||||
or substr($1,4,6) eq 'script';
|
||||
return UnquoteHtml($1);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,16 +12,14 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This module offers the user the additional possibility to
|
||||
# edit a page by double-clicking on it. The user must have
|
||||
# JavaScript enabled for this to work.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('doubleclick.pl', 'Doubleclick Extension');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,12 +11,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('download.pl', 'Download Extension');
|
||||
|
||||
@@ -27,8 +25,8 @@ push( @MyRules, \&DownloadSupportRule );
|
||||
# [[download:page name|alternate title]]
|
||||
|
||||
sub DownloadSupportRule {
|
||||
if (m/\G(\[\[download:$FreeLinkPattern\|([^\]]+)\]\])/cog
|
||||
or m!\G(\[\[download:$FreeLinkPattern\]\])!cog) {
|
||||
if (m/\G(\[\[download:$FreeLinkPattern\|([^\]]+)\]\])/cg
|
||||
or m!\G(\[\[download:$FreeLinkPattern\]\])!cg) {
|
||||
Dirty($1);
|
||||
print GetDownloadLink($2, undef, undef, $3);
|
||||
return '';
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
use File::Glob ':glob';
|
||||
our ($DraftDir);
|
||||
@@ -28,7 +29,7 @@ push(@MyInitVariables, \&DraftInit);
|
||||
sub DraftInit {
|
||||
if (GetParam('Draft', '')) {
|
||||
SetParam('action', 'draft') ; # Draft button used
|
||||
} elsif (-f "$DraftDir/" . GetParam('username', GetRemoteHost()) # draft exists
|
||||
} elsif (IsFile("$DraftDir/" . GetParam('username', $q->remote_addr())) # draft exists
|
||||
and $FooterNote !~ /action=draft/) { # take care of mod_perl persistence
|
||||
$FooterNote = $q->p(ScriptLink('action=draft', T('Recover Draft'))) . $FooterNote;
|
||||
}
|
||||
@@ -38,7 +39,7 @@ $Action{draft} = \&DoDraft;
|
||||
|
||||
sub DoDraft {
|
||||
my $id = shift;
|
||||
my $draft = $DraftDir . '/' . GetParam('username', GetRemoteHost());
|
||||
my $draft = $DraftDir . '/' . GetParam('username', $q->remote_addr());
|
||||
if ($id) {
|
||||
my $text = GetParam('text', '');
|
||||
ReportError(T('No text to save'), '400 BAD REQUEST') unless $text;
|
||||
@@ -46,11 +47,11 @@ sub DoDraft {
|
||||
WriteStringToFile($draft, EncodePage(text=>$text, id=>$id));
|
||||
SetParam('msg', T('Draft saved')); # invalidate cache
|
||||
print GetHttpHeader('', T('Draft saved'), '204 NO CONTENT');
|
||||
} elsif (-f $draft) {
|
||||
my %data = ParseData(ReadFileOrDie($draft));
|
||||
unlink ($draft);
|
||||
} elsif (IsFile($draft)) {
|
||||
my $data = ParseData(ReadFileOrDie($draft));
|
||||
Unlink($draft);
|
||||
$Message .= $q->p(T('Draft recovered'));
|
||||
DoEdit($data{id}, $data{text}, 1);
|
||||
DoEdit($data->{id}, $data->{text}, 1);
|
||||
} else {
|
||||
ReportError(T('No draft available to recover'), '404 NOT FOUND');
|
||||
}
|
||||
@@ -75,22 +76,19 @@ push(@MyMaintenance, \&DraftCleanup);
|
||||
|
||||
sub DraftFiles {
|
||||
return map {
|
||||
my $x = $_;
|
||||
$x = substr($x, length($DraftDir) + 1);
|
||||
utf8::decode($x);
|
||||
$x;
|
||||
} bsd_glob("$DraftDir/*"), bsd_glob("$DraftDir/.*");
|
||||
substr($_, length($DraftDir) + 1);
|
||||
} Glob("$DraftDir/*"), Glob("$DraftDir/.*");
|
||||
}
|
||||
|
||||
sub DraftCleanup {
|
||||
print '<p>' . T('Draft Cleanup');
|
||||
foreach my $draft (DraftFiles()) {
|
||||
next if $draft eq '.' or $draft eq '..';
|
||||
my $ts = (stat("$DraftDir/$draft"))[9];
|
||||
my $ts = Modified("$DraftDir/$draft");
|
||||
if ($Now - $ts < 1209600) { # 14*24*60*60
|
||||
print $q->br(), Tss("%1 was last modified %2 and was kept",
|
||||
$draft, CalcTimeSince($Now - $ts));
|
||||
} elsif (unlink("$DraftDir/$draft")) {
|
||||
} elsif (Unlink("$DraftDir/$draft")) {
|
||||
print $q->br(), Tss("%1 was last modified %2 and was deleted",
|
||||
$draft, CalcTimeSince($Now - $ts));
|
||||
} else {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('duckduckgo-search.pl', 'Use DuckDuckGo For Searches');
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('dynamic-comments.pl', 'Dynamic Comments Extension');
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -11,10 +11,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Makes the wiki logo depend on the current date.
|
||||
#
|
||||
@@ -28,6 +25,7 @@
|
||||
#
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('dynlogo.pl', 'Dynamic Logo');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -9,12 +9,10 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('edit-assist.pl', 'Edit Assist Extension');
|
||||
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('edit-cluster.pl', 'Edit Cluster Extension');
|
||||
|
||||
our ($q, $FS, $RcDefault, @RcDays, $RecentTop, $LastUpdate);
|
||||
our ($q, $FS, $RcDefault, @RcDays, $RecentTop, $LastUpdate, $ShowAll);
|
||||
|
||||
our $EditCluster = 'EditCluster';
|
||||
|
||||
@@ -33,7 +34,7 @@ sub GetRc {
|
||||
$changetime{$pagename} = $ts;
|
||||
}
|
||||
my $date = '';
|
||||
my $all = GetParam('all', 0);
|
||||
my $all = GetParam('all', $ShowAll);
|
||||
my ($idOnly, $userOnly, $hostOnly, $clusterOnly, $filterOnly, $match, $lang) =
|
||||
map { GetParam($_, ''); }
|
||||
('rcidonly', 'rcuseronly', 'rchostonly', 'rcclusteronly',
|
||||
@@ -49,7 +50,7 @@ sub GetRc {
|
||||
}
|
||||
}
|
||||
$wanted_clusters{$clusterOnly} = $clusterOnly;
|
||||
@outrc = reverse @outrc if GetParam('newtop', $RecentTop);
|
||||
@outrc = reverse @outrc;
|
||||
my @filters;
|
||||
@filters = SearchTitleAndBody($filterOnly) if $filterOnly;
|
||||
foreach my $rcline (@outrc) {
|
||||
@@ -127,7 +128,7 @@ sub EditClusterNewRcHeader {
|
||||
$action = "action=rc$action";
|
||||
}
|
||||
my $days = GetParam('days', $RcDefault);
|
||||
my $all = GetParam('all', 0);
|
||||
my $all = GetParam('all', $ShowAll);
|
||||
my @menu;
|
||||
if ($all) {
|
||||
push(@menu, ScriptLink("$action;days=$days;all=0",
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('edit-paragraphs.pl', 'Edit Paragraphs Extension');
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
# http://www.oddmuse.org/cgi-bin/oddmuse/Email_Quote_Extension
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('emailquote.pl', 'Email Quote Extension');
|
||||
|
||||
@@ -20,14 +21,14 @@ push(@MyRules, \&EmailQuoteRule);
|
||||
|
||||
sub EmailQuoteRule {
|
||||
# > on a line of its own should work
|
||||
if ($bol && m/\G(\s*\n)*((\>))+\n/cog) {
|
||||
if ($bol && m/\G(\s*\n)*((\>))+\n/cg) {
|
||||
return $q->p();
|
||||
}
|
||||
# > hi, you mentioned that:
|
||||
# >> I don't like Oddmuse.
|
||||
# > in last letter.
|
||||
elsif ($bol && m/\G(\s*\n)*((\>)+)[ \t]/cog
|
||||
or InElement('dd') && m/\G(\s*\n)+((\>)+)[ \t]/cog) {
|
||||
elsif ($bol && m/\G(\s*\n)*((\>)+)[ \t]/cg
|
||||
or InElement('dd') && m/\G(\s*\n)+((\>)+)[ \t]/cg) {
|
||||
my $leng = length($2) / 4;
|
||||
return CloseHtmlEnvironmentUntil('dd') . OpenHtmlEnvironment('dl',$leng, 'quote')
|
||||
. $q->dt() . AddHtmlEnvironment('dd');
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('emoji.pl', 'Smilies');
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('enclosure.pl', 'Podcasting');
|
||||
|
||||
@@ -27,7 +28,7 @@ push(@MyRules, \&EnclosureRule);
|
||||
# [[enclosure:url|size in bytes|mime type]]
|
||||
|
||||
sub EnclosureRule {
|
||||
if (m!\G\[\[enclosure:\s*$FreeLinkPattern(\|([^\]]+))?\]\]!ogci) {
|
||||
if (m!\G\[\[enclosure:\s*$FreeLinkPattern(\|([^\]]+))?\]\]!cgi) {
|
||||
my $id = FreeToNormal($1);
|
||||
# Make sure we don't add duplicates; we will add non-existing
|
||||
# enclosures as well. We test for existence only when the RSS feed
|
||||
@@ -55,8 +56,8 @@ sub NewEnclosureRssItem {
|
||||
my $id = shift;
|
||||
my $rss = OldEnclosureRssItem($id, @_);
|
||||
require MIME::Base64;
|
||||
my %data = ParseData(ReadFileOrDie(GetPageFile($id)));
|
||||
my @enclosures = split(' ', $data{enclosures});
|
||||
my $data = ParseData(ReadFileOrDie(GetPageFile($id)));
|
||||
my @enclosures = split(' ', $data->{enclosures});
|
||||
my $enclosures = '';
|
||||
foreach my $enclosure (@enclosures) {
|
||||
# Don't add the enclosure if the page has been deleted in the mean
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
@@ -12,10 +12,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330
|
||||
# Boston, MA 02111-1307 USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This module creates a list of all questions on the page, e.g.
|
||||
# for a faq. It does so by recognizing all lines that begin with
|
||||
@@ -24,6 +21,7 @@
|
||||
# the css classes div.question and div.answer.
|
||||
|
||||
use strict;
|
||||
use v5.10;
|
||||
|
||||
AddModuleDescription('faq.pl', 'FAQ Extension');
|
||||
|
||||
@@ -37,10 +35,10 @@ $FaqAnswerText = "Answer: " unless $FaqAnswerText;
|
||||
push(@MyRules, \&FaqRule);
|
||||
|
||||
sub FaqRule {
|
||||
if ($bol && m/\GQ: (.+)/gc) {
|
||||
if ($bol && m/\GQ: (.+)/cg) {
|
||||
return $q->a({name=>'FAQ_' . UrlEncode($1)},'')
|
||||
. $q->div({class=>'question'}, $FaqQuestionText . $1);
|
||||
} elsif ($bol && m/\GA:[ \t]*/gc) {
|
||||
} elsif ($bol && m/\GA:[ \t]*/cg) {
|
||||
return CloseHtmlEnvironments()
|
||||
. AddHtmlEnvironment('div', "class='answer'") . $FaqAnswerText;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user