forked from github/kensanata.oddmuse
Compare commits
306 Commits
return-obj
...
2.3.9
| 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 | ||
|
|
ceca41d85c | ||
|
|
aec340b401 | ||
|
|
3ea87c007d | ||
|
|
4d8b028e2d |
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/
|
/build/
|
||||||
\#*\#
|
\#*\#
|
||||||
/test-data
|
/test-data*
|
||||||
/Mac/pkg/
|
/Mac/pkg/
|
||||||
*.dmg
|
*.dmg
|
||||||
*.pkg
|
*.pkg
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
wiki.log
|
||||||
|
.prove
|
||||||
|
TAGS
|
||||||
|
|||||||
26
Makefile
26
Makefile
@@ -3,7 +3,7 @@
|
|||||||
# subdirectory.
|
# subdirectory.
|
||||||
|
|
||||||
VERSION_NO=$(shell git describe --tags)
|
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)
|
MODULES=$(wildcard modules/*.pl)
|
||||||
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
|
BUILD=build/wiki.pl $(foreach file, $(notdir $(MODULES)) $(notdir $(TRANSLATIONS)), build/$(file))
|
||||||
|
|
||||||
@@ -19,9 +19,13 @@ build:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
prove t/setup.pl
|
||||||
|
|
||||||
|
release:
|
||||||
|
perl stuff/release ~/oddmuse.org/releases 2.3.3
|
||||||
|
|
||||||
build/wiki.pl: wiki.pl
|
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
|
build/%-utf8.pl: modules/translations/%-utf8.pl
|
||||||
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
||||||
@@ -32,17 +36,27 @@ build/national-%.pl: modules/translations/national-%.pl
|
|||||||
build/month-names-%.pl: modules/translations/month-names-%.pl
|
build/month-names-%.pl: modules/translations/month-names-%.pl
|
||||||
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, 'translations\/', '$(VERSION_NO)')/; print" < $< > $@
|
||||||
|
|
||||||
# from: http://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl
|
# from: https://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
|
# to: https://git.savannah.gnu.org/cgit/oddmuse.git/tree/modules/namespaces.pl?id=2.1-11-gd4f1e27
|
||||||
|
|
||||||
build/%.pl: modules/%.pl
|
build/%.pl: modules/%.pl
|
||||||
perl -lne "s/(AddModuleDescription\('[^']+', '[^']+')\)/\$$1, undef, '$(VERSION_NO)')/; print" < $< > $@
|
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)
|
translations: $(TRANSLATIONS)
|
||||||
for f in $^; do \
|
for f in $^; do \
|
||||||
echo updating $$f...; \
|
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
|
done
|
||||||
|
|
||||||
|
# Running four jobs in parallel, but clean up data directories without
|
||||||
|
# race conditions!
|
||||||
|
|
||||||
|
jobs ?= 4
|
||||||
test:
|
test:
|
||||||
prove t
|
prove t/setup.pl
|
||||||
|
prove --jobs=$(jobs) --state=slow,save t
|
||||||
|
|||||||
@@ -23,12 +23,21 @@ usermod -a -G sudo alex
|
|||||||
Now you can login as {{{alex}}} and do everything else using {{{sudo}}}.
|
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
|
You need to copy wiki.pl into your cgi-bin directory, and you need to
|
||||||
make the script executable.
|
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 \
|
sudo wget -O /usr/lib/cgi-bin/wiki.pl \
|
||||||
http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
|
http://git.savannah.gnu.org/cgit/oddmuse.git/plain/wiki.pl
|
||||||
sudo chmod +x /usr/lib/cgi-bin/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
|
You should be able to test it right now! Visit
|
||||||
@@ -85,7 +94,7 @@ Enjoy your wiki experience.
|
|||||||
Visit https://www.oddmuse.org/ to learn more about the translation
|
Visit https://www.oddmuse.org/ to learn more about the translation
|
||||||
files and modules that are part of this package.
|
files and modules that are part of this package.
|
||||||
|
|
||||||
== Apache
|
== Checking the Apache Setup
|
||||||
|
|
||||||
If you think this information doesn't work for you, here are some things
|
If you think this information doesn't work for you, here are some things
|
||||||
to check.
|
to check.
|
||||||
@@ -119,7 +128,7 @@ The default site is configured in
|
|||||||
sudo a2ensite default
|
sudo a2ensite default
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
This file also lists the directories we've used in out instructions
|
This file also lists the directories we've used in our instructions
|
||||||
above.
|
above.
|
||||||
|
|
||||||
{{{
|
{{{
|
||||||
@@ -136,7 +145,33 @@ simply restart it all:
|
|||||||
sudo service apache2 graceful
|
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
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||||
@@ -153,5 +188,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|||||||
General Public License for more details.
|
General Public License for more details.
|
||||||
|
|
||||||
Both the GNU Free Documentation License, and the GNU General Public
|
Both the GNU Free Documentation License, and the GNU General Public
|
||||||
License are distributed together with this script. See the files FDL
|
License are distributed together with this script. See the files
|
||||||
and GPL, respectively.
|
[[https://github.com/kensanata/oddmuse/blob/master/FDL|FDL]] and
|
||||||
|
[[https://github.com/kensanata/oddmuse/blob/master/GPL|GPL]],
|
||||||
|
respectively.
|
||||||
|
|||||||
@@ -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
|
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
|
wiki format. add-link is a tool to help users contribute new links to
|
||||||
the list.
|
the list.
|
||||||
|
|
||||||
http://campaignwiki.org/wiki/LinksToWisdom/HomePage
|
https://campaignwiki.org/wiki/LinksToWisdom/HomePage
|
||||||
|
|
||||||
copy.pl
|
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
|
was to keep archive copies of cool pages somewhere. The Blog Archive
|
||||||
never got used, though.
|
never got used, though.
|
||||||
|
|
||||||
http://campaignwiki.org/wiki/BlogArchive/HomePage
|
https://campaignwiki.org/wiki/BlogArchive/HomePage
|
||||||
|
|
||||||
monster-tag.pl
|
monster-tag.pl
|
||||||
==============
|
==============
|
||||||
@@ -25,7 +25,7 @@ monster-tag.pl
|
|||||||
This is used to quickly tag many pages in the Monsters wiki. The
|
This is used to quickly tag many pages in the Monsters wiki. The
|
||||||
Monsters wiki hasn't been used in a long time, though.
|
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
|
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
|
aggregator was configured via a wiki page on the Planet wiki. It's now
|
||||||
abandoned.
|
abandoned.
|
||||||
|
|
||||||
http://campaignwiki.org/wiki/Planet/HomePage
|
https://campaignwiki.org/wiki/Planet/HomePage
|
||||||
|
|||||||
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
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -12,10 +12,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use CGI;
|
use CGI;
|
||||||
use CGI::Carp qw(fatalsToBrowser);
|
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,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)
|
|
||||||
@@ -1,110 +1,7 @@
|
|||||||
/* This file is in the public domain. */
|
/* 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 {
|
body, rss {
|
||||||
font-family: "Noticia Text", Symbola, serif;
|
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
margin: 1em 3em;
|
margin: 1em 3em;
|
||||||
|
|||||||
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;
|
float:left;
|
||||||
margin-right:1ex;
|
margin-right:1ex;
|
||||||
padding-right:1ex;
|
padding-right:1ex;
|
||||||
border-right:1px dashed;
|
|
||||||
}
|
}
|
||||||
div.sister p { padding:1ex; margin:0; }
|
div.sister p { padding:1ex; margin:0; }
|
||||||
div.sister hr { display:none; }
|
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); */
|
@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 {
|
body {
|
||||||
font-family: "Noticia Text", Symbola, serif;
|
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
|
||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
color: #000;
|
color: #000;
|
||||||
background-color: #eed;
|
background-color: #eed;
|
||||||
@@ -119,16 +17,20 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
textarea, pre, code, tt {
|
textarea, pre, code, tt {
|
||||||
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
|
font-family: "Andale Mono", Monaco, "Courier New", Courier, monospace, Symbola;
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
body {
|
body {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
font-family: Times, serif;
|
font-family: Times, serif;
|
||||||
font-size:10pt;
|
font-size:10pt;
|
||||||
}
|
}
|
||||||
|
/* Printing from Firefox */
|
||||||
|
svg {
|
||||||
|
transform: translate(-1.5cm, -1cm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* iPhone */
|
/* iPhone */
|
||||||
@@ -149,9 +51,10 @@ textarea, pre, code, tt {
|
|||||||
.browse { min-height: 3em; }
|
.browse { min-height: 3em; }
|
||||||
.header form, .header p { margin: 0; }
|
.header form, .header p { margin: 0; }
|
||||||
/* hide the buttons but don't use display:none because of
|
/* hide the buttons but don't use display:none because of
|
||||||
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form */
|
http://stackoverflow.com/questions/5665203/getting-iphone-go-button-to-submit-form
|
||||||
.header input[type="submit"] { position: absolute; visibility: hidden; }
|
.header input[type="submit"] { position: absolute; visibility: hidden; } */
|
||||||
.header input { width: 5em; font-size: 80%; }
|
.header input { width: 6em; font-size: 80%; }
|
||||||
|
.header input[type="checkbox"] { width: 1em; }
|
||||||
.footer { clear:both; font-size: 90%; }
|
.footer { clear:both; font-size: 90%; }
|
||||||
.content input { font-size: 80%; line-height: 125%; }
|
.content input { font-size: 80%; line-height: 125%; }
|
||||||
|
|
||||||
@@ -175,9 +78,9 @@ input#mail, input#homepage, input#username {
|
|||||||
|
|
||||||
/* titles */
|
/* titles */
|
||||||
h1 {
|
h1 {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 150%;
|
font-size: 150%;
|
||||||
padding: 1em 0;
|
padding: 1em 0;
|
||||||
}
|
}
|
||||||
h1 a:link, h1 a:visited {
|
h1 a:link, h1 a:visited {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@@ -217,7 +120,7 @@ a:active {
|
|||||||
border: 1px solid #9d8;
|
border: 1px solid #9d8;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow: 0px 1px 3px white inset,
|
box-shadow: 0px 1px 3px white inset,
|
||||||
0px 1px 3px black;
|
0px 1px 3px black;
|
||||||
}
|
}
|
||||||
.button a {
|
.button a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -231,10 +134,6 @@ a:active {
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
a.edit, div.footer, form, span.gotobar, a.number span { display:none; }
|
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; }
|
img[smiley] { line-height: inherit; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,15 +142,15 @@ a.pencil { display: none; }
|
|||||||
|
|
||||||
/* table of contents */
|
/* table of contents */
|
||||||
.toc {
|
.toc {
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
border-left: 1em solid #886;
|
border-left: 1em solid #886;
|
||||||
}
|
}
|
||||||
.toc ol {
|
.toc ol {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
}
|
}
|
||||||
.toc a {
|
.toc a {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* images with links, captions, etc */
|
/* images with links, captions, etc */
|
||||||
@@ -307,26 +206,28 @@ div.message {
|
|||||||
}
|
}
|
||||||
table.history { border-style:none; }
|
table.history { border-style:none; }
|
||||||
td.history { border-style:none; }
|
td.history { border-style:none; }
|
||||||
|
div.history span.dash + strong { font-weight: normal; }
|
||||||
span.result { font-size:larger; }
|
span.result { font-size:larger; }
|
||||||
span.info { font-size:smaller; font-style:italic; }
|
span.info { font-size:smaller; font-style:italic; }
|
||||||
div.rc hr { display: none; }
|
div.rc hr { display: none; }
|
||||||
div.rc li { padding-bottom: 0.5em; }
|
div.rc li { padding-bottom: 0.5em; }
|
||||||
|
div.rc li strong { font-weight: normal; }
|
||||||
|
|
||||||
/* Tables */
|
/* Tables */
|
||||||
table.user {
|
table.user {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
padding: 0 1em;
|
padding: 0 1em;
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
div.aside table.user {
|
div.aside table.user {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
table.user td, table.user th {
|
table.user td, table.user th {
|
||||||
border-style: none;
|
border-style: none;
|
||||||
padding:5px 10px;
|
padding:5px 10px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
table.user th { font-weight:bold; }
|
table.user th { font-weight:bold; }
|
||||||
table.user td.r { text-align:right; }
|
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; }
|
tr:empty { display: block; height: 0.5em; }
|
||||||
@media print {
|
@media print {
|
||||||
table {
|
table {
|
||||||
font-size: 9pt;
|
font-size: 9pt;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
table.user td, table.user th {
|
table.user td, table.user th {
|
||||||
|
|||||||
51
css/wiki.css
51
css/wiki.css
@@ -51,13 +51,13 @@ a.image:hover img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* a.definition soll aussehen wie h2 */
|
/* a.definition soll aussehen wie h2 */
|
||||||
h2, p a.definition {
|
h2, p > a.definition {
|
||||||
display: block;
|
display: block;
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Such Link im h1 soll nicht auffallen. */
|
/* 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;
|
color: #666;
|
||||||
font-size: 30pt;
|
font-size: 30pt;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@@ -219,50 +219,3 @@ code {
|
|||||||
background: #eee;
|
background: #eee;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Gentium Basic';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 700;
|
|
||||||
src: local('Gentium Basic Bold'), local('GentiumBasic-Bold'), url(/fonts/GenBasB.woff) format('woff');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Gentium Basic';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Gentium Basic Italic'), local('GentiumBasic-Italic'), url(/fonts/GenBasI.woff) format('woff');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Gentium Basic';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 700;
|
|
||||||
src: local('Gentium Basic Bold Italic'), local('GentiumBasic-BoldItalic'), url(/fonts/GenBasBI.woff) format('woff');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Gentium Basic';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Gentium Basic'), local('GentiumBasic'), url(/fonts/GenBasR.woff) format('woff');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Gentium Plus';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Gentium Plus'), local('GentiumPlus'), url(/fonts/GentiumPlus-R.woff) format('woff');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Gentium Plus';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Gentium Plus Italic'), local('GentiumPlus-Italic'), url(/fonts/GentiumPlus-I.woff) format('woff');
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Symbola';
|
|
||||||
src: local('Symbola'), url('/fonts/Symbola.woff') format('woff') url('/fonts/Symbola.ttf') format('truetype');
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -12,10 +12,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
package OddMuse;
|
package OddMuse;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
|
||||||
use v5.10;
|
|
||||||
|
|
||||||
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 {
|
|
||||||
print $q->start_div({-class=>'wrapper close'});
|
|
||||||
print $q->end_div(), $q->end_div();
|
|
||||||
OldPrintFooter(@_);
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
@@ -36,7 +33,7 @@ sub AdminPowerDelete {
|
|||||||
OpenPage($id);
|
OpenPage($id);
|
||||||
my $status = DeletePage($id);
|
my $status = DeletePage($id);
|
||||||
if ($status) {
|
if ($status) {
|
||||||
print $q->p(GetPageLink($id) . ' ' . T('not deleted: ')) . $status;
|
print $q->p(GetPageLink($id) . ' ' . T('not deleted:') . ' ' . $status);
|
||||||
} else {
|
} else {
|
||||||
print $q->p(GetPageLink($id) . ' ' . T('deleted'));
|
print $q->p(GetPageLink($id) . ' ' . T('deleted'));
|
||||||
WriteRcLog($id, Ts('Deleted %s', $id), 0, $Page{revision},
|
WriteRcLog($id, Ts('Deleted %s', $id), 0, $Page{revision},
|
||||||
@@ -44,7 +41,7 @@ sub AdminPowerDelete {
|
|||||||
GetCluster($Page{text}));
|
GetCluster($Page{text}));
|
||||||
}
|
}
|
||||||
# Regenerate index on next request
|
# Regenerate index on next request
|
||||||
unlink($IndexFile);
|
Unlink($IndexFile);
|
||||||
ReleaseLock();
|
ReleaseLock();
|
||||||
print $q->p(T('Main lock released.'));
|
print $q->p(T('Main lock released.'));
|
||||||
PrintFooter();
|
PrintFooter();
|
||||||
@@ -61,30 +58,30 @@ sub AdminPowerRename {
|
|||||||
print $q->p(T('Main lock obtained.'));
|
print $q->p(T('Main lock obtained.'));
|
||||||
# page file -- only check for existing or missing pages here
|
# page file -- only check for existing or missing pages here
|
||||||
my $fname = GetPageFile($id);
|
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);
|
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!
|
# Regenerate index on next request -- remove this before errors can occur!
|
||||||
unlink($IndexFile);
|
Unlink($IndexFile);
|
||||||
# page file
|
# page file
|
||||||
CreateDir($PageDir); # It might not exist yet
|
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');
|
or ReportError(Tss('Cannot rename %1 to %2', $fname, $newfname) . ": $!", '500 INTERNAL SERVER ERROR');
|
||||||
# keep directory
|
# keep directory
|
||||||
my $kdir = GetKeepDir($id);
|
my $kdir = GetKeepDir($id);
|
||||||
my $newkdir = GetKeepDir($new);
|
my $newkdir = GetKeepDir($new);
|
||||||
CreateDir($KeepDir); # It might not exist yet (only the parent directory!)
|
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')
|
or ReportError(Tss('Cannot rename %1 to %2', $kdir, $newkdir) . ": $!", '500 INTERNAL SERVER ERROR')
|
||||||
if -d $kdir;
|
if IsDir($kdir);
|
||||||
# refer file
|
# refer file
|
||||||
if (defined(&GetRefererFile)) {
|
if (defined(&GetRefererFile)) {
|
||||||
my $rdir = GetRefererFile($id);
|
my $rdir = GetRefererFile($id);
|
||||||
my $newrdir = GetRefererFile($new);
|
my $newrdir = GetRefererFile($new);
|
||||||
CreateDir($RefererDir); # It might not exist yet
|
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')
|
or ReportError(Tss('Cannot rename %1 to %2', $rdir, $newrdir) . ": $!", '500 INTERNAL SERVER ERROR')
|
||||||
if -d $rdir;
|
if IsDir($rdir);
|
||||||
}
|
}
|
||||||
# RecentChanges
|
# RecentChanges
|
||||||
OpenPage($new);
|
OpenPage($new);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ AddModuleDescription('askpage.pl', 'Ask Page Extension');
|
|||||||
|
|
||||||
use Fcntl qw(:DEFAULT :flock);
|
use Fcntl qw(:DEFAULT :flock);
|
||||||
|
|
||||||
our ($DataDir);
|
our ($DataDir, %Translate, @MyFooters);
|
||||||
our ($AskPage, $QuestionPage, $NewQuestion);
|
our ($AskPage, $QuestionPage, $NewQuestion);
|
||||||
# Don't forget to set your $CommentsPattern to include both $AskPage and $QuestionPage
|
# Don't forget to set your $CommentsPattern to include both $AskPage and $QuestionPage
|
||||||
$AskPage = 'Ask';
|
$AskPage = 'Ask';
|
||||||
@@ -29,7 +29,7 @@ $NewQuestion = 'Write your question here:';
|
|||||||
|
|
||||||
sub IncrementInFile {
|
sub IncrementInFile {
|
||||||
my $filename = shift;
|
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: $!";
|
flock $fh, LOCK_EX or die "can't flock $filename: $!";
|
||||||
my $num = <$fh> || 1;
|
my $num = <$fh> || 1;
|
||||||
seek $fh, 0, 0 or die "can't rewind $filename: $!";
|
seek $fh, 0, 0 or die "can't rewind $filename: $!";
|
||||||
@@ -39,8 +39,8 @@ sub IncrementInFile {
|
|||||||
return $num;
|
return $num;
|
||||||
}
|
}
|
||||||
|
|
||||||
*OldAskPageDoPost=\&DoPost;
|
*OldAskPageDoPost = \&DoPost;
|
||||||
*DoPost=\&NewAskPageDoPost;
|
*DoPost = \&NewAskPageDoPost;
|
||||||
sub NewAskPageDoPost {
|
sub NewAskPageDoPost {
|
||||||
my $id = FreeToNormal(shift);
|
my $id = FreeToNormal(shift);
|
||||||
if ($id eq $AskPage and not GetParam('text', undef)) { # comment, not a regular edit
|
if ($id eq $AskPage and not GetParam('text', undef)) { # comment, not a regular edit
|
||||||
@@ -51,18 +51,18 @@ sub NewAskPageDoPost {
|
|||||||
OldAskPageDoPost($id, @_); # keep original functionality for regular edits
|
OldAskPageDoPost($id, @_); # keep original functionality for regular edits
|
||||||
}
|
}
|
||||||
|
|
||||||
*OldAskPageGetTextArea=\&GetTextArea;
|
*OldAskPageGetCommentForm = \&GetCommentForm;
|
||||||
*GetTextArea=\&NewAskPageGetTextArea;
|
*GetCommentForm = \&NewAskPageGetCommentForm;
|
||||||
sub NewAskPageGetTextArea {
|
@MyFooters = map { $_ == \&OldAskPageGetCommentForm ? \&NewAskPageGetCommentForm : $_ } @MyFooters;
|
||||||
my ($name, $text, @rest) = @_;
|
|
||||||
if ($name eq 'aftertext' and not $text and GetId() eq $AskPage) {
|
sub NewAskPageGetCommentForm {
|
||||||
$text = $NewQuestion;
|
my ($id) = @_;
|
||||||
}
|
$Translate{'Add your comment here:'} = $NewQuestion if $id eq $AskPage;
|
||||||
OldAskPageGetTextArea($name, $text, @rest);
|
OldAskPageGetCommentForm(@_);
|
||||||
}
|
}
|
||||||
|
|
||||||
*OldAskPageJournalSort=\&JournalSort;
|
*OldAskPageJournalSort = \&JournalSort;
|
||||||
*JournalSort=\&NewAskPageJournalSort;
|
*JournalSort = \&NewAskPageJournalSort;
|
||||||
sub NewAskPageJournalSort {
|
sub NewAskPageJournalSort {
|
||||||
return OldAskPageJournalSort() unless $a =~ m/^$QuestionPage\d+$/ and $b =~ m/^$QuestionPage\d+$/;
|
return OldAskPageJournalSort() unless $a =~ m/^$QuestionPage\d+$/ and $b =~ m/^$QuestionPage\d+$/;
|
||||||
($b =~ m/$QuestionPage(\d+)/)[0] <=> ($a =~ m/$QuestionPage(\d+)/)[0];
|
($b =~ m/$QuestionPage(\d+)/)[0] <=> ($a =~ m/$QuestionPage(\d+)/)[0];
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ sub GetRcAtom {
|
|||||||
# Based on DoPost
|
# Based on DoPost
|
||||||
sub DoAtomSave {
|
sub DoAtomSave {
|
||||||
my ($type, $oldid) = @_;
|
my ($type, $oldid) = @_;
|
||||||
my $entry = AtomEntry();
|
my $entry = AtomEntry($type);
|
||||||
my $title = $entry->title();
|
my $title = $entry->title();
|
||||||
my $author = $entry->author();
|
my $author = $entry->author();
|
||||||
SetParam('username', $author->name) if $author; # Used in Save()
|
SetParam('username', $author->name) if $author; # Used in Save()
|
||||||
@@ -231,15 +231,8 @@ sub DoAtomGet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub AtomEntry {
|
sub AtomEntry {
|
||||||
my $data = $q->param('POSTDATA');
|
my $type = shift || 'POST';
|
||||||
if (not $data) {
|
my $data = $q->param($type . 'DATA'); # PUTDATA or POSTDATA
|
||||||
# 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 $entry = XML::Atom::Entry->new(\$data);
|
my $entry = XML::Atom::Entry->new(\$data);
|
||||||
return $entry;
|
return $entry;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,9 +171,9 @@ sub UserCanEditAutoLockFix {
|
|||||||
return 0 if $id eq 'SampleUndefinedPage' or $id eq T('SampleUndefinedPage')
|
return 0 if $id eq 'SampleUndefinedPage' or $id eq T('SampleUndefinedPage')
|
||||||
or $id eq 'Sample_Undefined_Page' or $id eq T('Sample_Undefined_Page');
|
or $id eq 'Sample_Undefined_Page' or $id eq T('Sample_Undefined_Page');
|
||||||
return 1 if UserIsAdmin() || UserIsEditor();
|
return 1 if UserIsAdmin() || UserIsEditor();
|
||||||
return 0 if $id ne '' and -f GetLockedPageFile($id);
|
return 0 if $id ne '' and IsFile(GetLockedPageFile($id));
|
||||||
return 0 if $LockOnCreation{$id} and not -f GetPageFile($id); # new page
|
return 0 if $LockOnCreation{$id} and not IsFile(GetPageFile($id)); # new page
|
||||||
return 0 if !$EditAllowed or -f $NoEditFile;
|
return 0 if !$EditAllowed or IsFile($NoEditFile);
|
||||||
return 0 if $editing and UserIsBanned(); # this call is more expensive
|
return 0 if $editing and UserIsBanned(); # this call is more expensive
|
||||||
return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/);
|
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 1 if $EditAllowed >= 3 and ($comment or (GetParam('aftertext', '') and not GetParam('text', '')));
|
||||||
@@ -206,18 +206,17 @@ except where noted.
|
|||||||
|
|
||||||
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
|
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
|
||||||
|
|
||||||
This file is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or modify
|
||||||
modify it under the terms of the GNU General Public License
|
it under the terms of the GNU General Public License as published by
|
||||||
as published by the Free Software Foundation; either version 2
|
the Free Software Foundation; either version 3 of the License, or
|
||||||
of the License, or (at your option) any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this file; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
# Grab MLDBM at http://search.cpan.org/dist/MLDBM/lib/MLDBM.pm
|
# 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
|
# ie: http://search.cpan.org/CPAN/authors/id/C/CH/CHAMAS/MLDBM-2.01.tar.gz
|
||||||
@@ -44,8 +41,8 @@ sub BacklinksMenu {
|
|||||||
$Action{buildback} = \&BuildBacklinkDatabase;
|
$Action{buildback} = \&BuildBacklinkDatabase;
|
||||||
sub BuildBacklinkDatabase {
|
sub BuildBacklinkDatabase {
|
||||||
print GetHttpHeader('text/plain');
|
print GetHttpHeader('text/plain');
|
||||||
unlink $backfile; # Remove old database
|
Unlink($backfile); # Remove old database
|
||||||
tie my %backhash, 'MLDBM', $backfile or die "Cannot open file $backfile $!\n";
|
tie my %backhash, 'MLDBM', encode_utf8($backfile) or die "Cannot open file $backfile $!\n";
|
||||||
log1("Starting Database Store Process ... please wait\n\n");
|
log1("Starting Database Store Process ... please wait\n\n");
|
||||||
|
|
||||||
foreach my $name (AllPagesList()) {
|
foreach my $name (AllPagesList()) {
|
||||||
@@ -101,7 +98,7 @@ sub GetBackLink {
|
|||||||
|
|
||||||
our ($BacklinkBanned);
|
our ($BacklinkBanned);
|
||||||
$BacklinkBanned = "HomePage|ScratchPad" if !$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
|
# Search database for matches
|
||||||
while ( my ($source, $hashes) = each %backhash ) {
|
while ( my ($source, $hashes) = each %backhash ) {
|
||||||
@@ -117,7 +114,7 @@ sub GetBackLink {
|
|||||||
foreach my $backlink (@backlinks) {
|
foreach my $backlink (@backlinks) {
|
||||||
my ($class, $resolved, $title, $exists) = ResolveId($backlink);
|
my ($class, $resolved, $title, $exists) = ResolveId($backlink);
|
||||||
if (($resolved ne $id) && ($resolved !~ /^($BacklinkBanned)$/)) {
|
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
# 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
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -21,11 +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
|
(see C<$BannedHosts>). If the contributor is already banned, this is
|
||||||
mentioned. If the contributor is not banned, you'll see a button
|
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,
|
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
|
=cut
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|
||||||
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
|
our ($q, $Now, %Page, $OpenPageName, %Action, $UrlPattern, $BannedContent, $BannedHosts, @MyAdminCode);
|
||||||
|
|
||||||
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
|
AddModuleDescription('ban-contributors.pl', 'Ban Contributors Extension');
|
||||||
@@ -56,17 +57,18 @@ sub IsItBanned {
|
|||||||
sub DoBanHosts {
|
sub DoBanHosts {
|
||||||
my $id = shift;
|
my $id = shift;
|
||||||
my $content = GetParam('content', '');
|
my $content = GetParam('content', '');
|
||||||
my $host = GetParam('host', '');
|
my $range = GetParam('range', '');
|
||||||
|
my $regexp = GetParam('regexp', '');
|
||||||
if ($content) {
|
if ($content) {
|
||||||
SetParam('text', GetPageContent($BannedContent)
|
SetParam('text', GetPageContent($BannedContent)
|
||||||
. $content . " # " . CalcDay($Now) . " "
|
. $content . " # " . CalcDay($Now) . " "
|
||||||
. NormalToFree($id) . "\n");
|
. NormalToFree($id) . "\n");
|
||||||
SetParam('summary', NormalToFree($id));
|
SetParam('summary', NormalToFree($id));
|
||||||
DoPost($BannedContent);
|
DoPost($BannedContent);
|
||||||
} elsif ($host) {
|
} elsif ($regexp) {
|
||||||
$host =~ s/\./\\./g;
|
|
||||||
SetParam('text', GetPageContent($BannedHosts)
|
SetParam('text', GetPageContent($BannedHosts)
|
||||||
. "^" . $host . " # " . CalcDay($Now) . " "
|
. $regexp . " # " . CalcDay($Now)
|
||||||
|
. " $range "
|
||||||
. NormalToFree($id) . "\n");
|
. NormalToFree($id) . "\n");
|
||||||
SetParam('summary', NormalToFree($id));
|
SetParam('summary', NormalToFree($id));
|
||||||
DoPost($BannedHosts);
|
DoPost($BannedHosts);
|
||||||
@@ -94,10 +96,14 @@ sub DoBanHosts {
|
|||||||
if (IsItBanned($_, \@regexps)) {
|
if (IsItBanned($_, \@regexps)) {
|
||||||
print $q->p(Ts("%s is banned", $name));
|
print $q->p(Ts("%s is banned", $name));
|
||||||
} else {
|
} else {
|
||||||
|
my ($start, $end) = BanContributors::get_range($_);
|
||||||
|
$range = "[$start - $end]";
|
||||||
|
$name .= " " . $range;
|
||||||
print GetFormStart(undef, 'get', 'ban'),
|
print GetFormStart(undef, 'get', 'ban'),
|
||||||
GetHiddenValue('action', 'ban'),
|
GetHiddenValue('action', 'ban'),
|
||||||
GetHiddenValue('id', $id),
|
GetHiddenValue('id', $id),
|
||||||
GetHiddenValue('host', $_),
|
GetHiddenValue('range', $range),
|
||||||
|
GetHiddenValue('regexp', BanContributors::get_regexp_ip($start, $end)),
|
||||||
GetHiddenValue('recent_edit', 'on'),
|
GetHiddenValue('recent_edit', 'on'),
|
||||||
$q->p($name, $q->submit(T('Ban!'))), $q->end_form();
|
$q->p($name, $q->submit(T('Ban!'))), $q->end_form();
|
||||||
}
|
}
|
||||||
@@ -153,8 +159,100 @@ sub NewBanContributorsWriteRcLog {
|
|||||||
$q->submit(T('Ban!'))),
|
$q->submit(T('Ban!'))),
|
||||||
$q->end_form();
|
$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')));
|
ScriptLink('action=ban;id=' . UrlEncode($id), T('Ban contributors')));
|
||||||
};
|
};
|
||||||
return OldBanContributorsWriteRcLog(@_);
|
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;
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ This extension works with logbannedcontent.pl.
|
|||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile);
|
our (%AdminPages, %LockOnCreation, @MyInitVariables, %PlainTextPages, $BannedContent, $BannedFile,
|
||||||
|
$FullUrlPattern);
|
||||||
our ($BannedRegexps);
|
our ($BannedRegexps);
|
||||||
|
|
||||||
$BannedRegexps = 'BannedRegexps';
|
$BannedRegexps = 'BannedRegexps';
|
||||||
@@ -61,6 +62,8 @@ push(@MyInitVariables, sub {
|
|||||||
|
|
||||||
sub RegexpNewBannedContent {
|
sub RegexpNewBannedContent {
|
||||||
my $str = shift;
|
my $str = shift;
|
||||||
|
# remove URLs as they are controlled by $BannedContent
|
||||||
|
$str =~ s/$FullUrlPattern//g;
|
||||||
my $rule = RegexpOldBannedContent($str, @_);
|
my $rule = RegexpOldBannedContent($str, @_);
|
||||||
if (not $rule) {
|
if (not $rule) {
|
||||||
foreach (split(/\n/, GetPageContent($BannedRegexps))) {
|
foreach (split(/\n/, GetPageContent($BannedRegexps))) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ AddModuleDescription('bbcode.pl', 'bbCode Extension');
|
|||||||
|
|
||||||
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
|
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
|
||||||
push(@MyRules, \&bbCodeRule);
|
push(@MyRules, \&bbCodeRule);
|
||||||
$RuleOrder{\&bbCodeRule} = 100; # must come after PortraitSupportRule
|
$RuleOrder{\&bbCodeRule} = 300; # must come after PortraitSupportRule, MarkdownRule
|
||||||
|
|
||||||
our ($bbBlock);
|
our ($bbBlock);
|
||||||
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);
|
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ sub AddRecentVisitor {
|
|||||||
my $url = ScriptUrl(join(';', "action=$action;id=" . UrlEncode($id),
|
my $url = ScriptUrl(join(';', "action=$action;id=" . UrlEncode($id),
|
||||||
map { $_ . '=' . UrlEncode(GetParam($_)) }
|
map { $_ . '=' . UrlEncode(GetParam($_)) }
|
||||||
keys %params));
|
keys %params));
|
||||||
my $url = $q->url(-path_info=>1,-query=>1);
|
|
||||||
my $download = GetParam('action', 'browse') eq 'download'
|
my $download = GetParam('action', 'browse') eq 'download'
|
||||||
|| GetParam('download', 0)
|
|| GetParam('download', 0)
|
||||||
|| $q->path_info() =~ m/\/download\//;
|
|| $q->path_info() =~ m/\/download\//;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -12,10 +12,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
@@ -26,6 +23,7 @@ our ($q, %Page, %Action, $Now, $OpenPageName, $CollectingJournal, $FreeLinkPatte
|
|||||||
our ($CalendarOnEveryPage, $CalAsTable, $CalStartMonday);
|
our ($CalendarOnEveryPage, $CalAsTable, $CalStartMonday);
|
||||||
|
|
||||||
$CalendarOnEveryPage = 0; # 1=on every page is a month-div situated in the header, use css to control
|
$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
|
$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
|
$CalStartMonday = 0; # 0=week starts with Su, 1=week starts with Mo
|
||||||
|
|
||||||
@@ -37,8 +35,22 @@ sub NewCalendarGetHeader {
|
|||||||
return $header unless $CalendarOnEveryPage;
|
return $header unless $CalendarOnEveryPage;
|
||||||
my $action = GetParam('action', 'browse');
|
my $action = GetParam('action', 'browse');
|
||||||
return $header if grep(/^$action$/, ('calendar', 'edit'));
|
return $header if grep(/^$action$/, ('calendar', 'edit'));
|
||||||
my $cal = Cal();
|
my $cal;
|
||||||
$header =~ s/<div class="header">/$cal<div class="header">/;
|
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;
|
return $header;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +100,7 @@ sub Cal {
|
|||||||
$year_text, 'local collection year'));
|
$year_text, 'local collection year'));
|
||||||
}
|
}
|
||||||
}}e;
|
}}e;
|
||||||
return "<div class=\"cal month\"><pre>$cal</pre></div>";
|
return "<div class=\"month\"><pre>$cal</pre></div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$Action{collect} = \&DoCollect;
|
$Action{collect} = \&DoCollect;
|
||||||
@@ -129,7 +141,7 @@ sub CalendarRule {
|
|||||||
my $oldpos = pos;
|
my $oldpos = pos;
|
||||||
Clean(CloseHtmlEnvironments());
|
Clean(CloseHtmlEnvironments());
|
||||||
Dirty($1);
|
Dirty($1);
|
||||||
print Cal($2, $3);
|
print $q->div({-class => 'cal'}, Cal($2, $3));
|
||||||
pos = $oldpos;
|
pos = $oldpos;
|
||||||
return AddHtmlEnvironment('p');
|
return AddHtmlEnvironment('p');
|
||||||
} elsif (/\G(month:([+-]\d\d?))/cg
|
} elsif (/\G(month:([+-]\d\d?))/cg
|
||||||
@@ -144,7 +156,7 @@ sub CalendarRule {
|
|||||||
$mon += 1 + $delta;
|
$mon += 1 + $delta;
|
||||||
while ($mon < 1) { $year -= 1; $mon += 12; };
|
while ($mon < 1) { $year -= 1; $mon += 12; };
|
||||||
while ($mon > 12) { $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;
|
pos = $oldpos;
|
||||||
return AddHtmlEnvironment('p');
|
return AddHtmlEnvironment('p');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,8 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
@@ -59,8 +56,8 @@ sub NewCommentcountScriptLink {
|
|||||||
$num = $1;
|
$num = $1;
|
||||||
}
|
}
|
||||||
# Fix plurals
|
# Fix plurals
|
||||||
my $plural = T('Comments on ');
|
my $plural = T('Comments on');
|
||||||
my $singular = T('Comment on ');
|
my $singular = T('Comment on');
|
||||||
$text =~ s/$plural/$singular/ if($num == 1);
|
$text =~ s/$plural/$singular/ if($num == 1);
|
||||||
$text = $num . ' ' . $text;
|
$text = $num . ' ' . $text;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
|||||||
@@ -1,34 +1,35 @@
|
|||||||
# Copyright (C) 2005 Fletcher T. Penney <fletcher@freeshell.org>
|
# 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
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
# it under the terms of the GNU General Public License as published by
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
# (at your option) any later version.
|
# version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# along with this program; if not, write to the
|
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
=head1 Creation Date Extension
|
||||||
#
|
|
||||||
# This module stores additional information about a page when it is
|
This module stores additional information about a page when it is first created:
|
||||||
# first created:
|
|
||||||
# created = the date the page is FIRST saved
|
=over
|
||||||
# originalAuthor = the username that first created a page
|
=item C<created> is the date the page is first saved
|
||||||
#
|
=item C<originalAuthor> is the username that first created a page
|
||||||
# Of course, you can customize this to store more information
|
=back
|
||||||
|
=cut
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|
||||||
AddModuleDescription('creationdate.pl', 'CreationDate Module');
|
AddModuleDescription('creationdate.pl', 'CreationDate Module');
|
||||||
|
|
||||||
our (%Page, $Now);
|
our (%Page, $Now, @MyAdminCode, %Action, $q, $FS, $RcOldFile, $RcFile);
|
||||||
|
|
||||||
*CreationDateOldOpenPage = \&OpenPage;
|
*CreationDateOldOpenPage = \&OpenPage;
|
||||||
*OpenPage = \&CreationDateOpenPage;
|
*OpenPage = \&CreationDateOpenPage;
|
||||||
@@ -39,3 +40,45 @@ sub CreationDateOpenPage{
|
|||||||
$Page{originalAuthor} = GetParam('username','') unless $Page{originalAuthor}
|
$Page{originalAuthor} = GetParam('username','') unless $Page{originalAuthor}
|
||||||
or $Page{revision};
|
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();
|
||||||
|
}
|
||||||
|
|||||||
@@ -405,8 +405,7 @@ sub CreoleRule {
|
|||||||
if ($is_left_justified and
|
if ($is_left_justified and
|
||||||
$is_right_justified) { $attributes .= 'align="center"' }
|
$is_right_justified) { $attributes .= 'align="center"' }
|
||||||
elsif ($is_right_justified) { $attributes .= 'align="right"' }
|
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
|
return
|
||||||
(InElement('td') || InElement('th') ? CloseHtmlEnvironmentUntil('tr') : '')
|
(InElement('td') || InElement('th') ? CloseHtmlEnvironmentUntil('tr') : '')
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ sub DoUnifiedDiff { # copied from DoDiff
|
|||||||
RequestLockDir('diff') or return '';
|
RequestLockDir('diff') or return '';
|
||||||
WriteStringToFile($oldName, $_[0]);
|
WriteStringToFile($oldName, $_[0]);
|
||||||
WriteStringToFile($newName, $_[1]);
|
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!
|
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!
|
||||||
utf8::decode($diff_out); # needs decoding
|
|
||||||
$diff_out =~ s/\n\K\\ No newline.*\n//g; # Get rid of common complaint.
|
$diff_out =~ s/\n\K\\ No newline.*\n//g; # Get rid of common complaint.
|
||||||
ReleaseLockDir('diff');
|
ReleaseLockDir('diff');
|
||||||
# No need to unlink temp files--next diff will just overwrite.
|
# 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;
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -12,10 +12,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
# This module offers the user the additional possibility to
|
# This module offers the user the additional possibility to
|
||||||
# edit a page by double-clicking on it. The user must have
|
# edit a page by double-clicking on it. The user must have
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ push(@MyInitVariables, \&DraftInit);
|
|||||||
sub DraftInit {
|
sub DraftInit {
|
||||||
if (GetParam('Draft', '')) {
|
if (GetParam('Draft', '')) {
|
||||||
SetParam('action', 'draft') ; # Draft button used
|
SetParam('action', 'draft') ; # Draft button used
|
||||||
} elsif (-f "$DraftDir/" . GetParam('username', $q->remote_addr()) # draft exists
|
} elsif (IsFile("$DraftDir/" . GetParam('username', $q->remote_addr())) # draft exists
|
||||||
and $FooterNote !~ /action=draft/) { # take care of mod_perl persistence
|
and $FooterNote !~ /action=draft/) { # take care of mod_perl persistence
|
||||||
$FooterNote = $q->p(ScriptLink('action=draft', T('Recover Draft'))) . $FooterNote;
|
$FooterNote = $q->p(ScriptLink('action=draft', T('Recover Draft'))) . $FooterNote;
|
||||||
}
|
}
|
||||||
@@ -47,9 +47,9 @@ sub DoDraft {
|
|||||||
WriteStringToFile($draft, EncodePage(text=>$text, id=>$id));
|
WriteStringToFile($draft, EncodePage(text=>$text, id=>$id));
|
||||||
SetParam('msg', T('Draft saved')); # invalidate cache
|
SetParam('msg', T('Draft saved')); # invalidate cache
|
||||||
print GetHttpHeader('', T('Draft saved'), '204 NO CONTENT');
|
print GetHttpHeader('', T('Draft saved'), '204 NO CONTENT');
|
||||||
} elsif (-f $draft) {
|
} elsif (IsFile($draft)) {
|
||||||
my $data = ParseData(ReadFileOrDie($draft));
|
my $data = ParseData(ReadFileOrDie($draft));
|
||||||
unlink ($draft);
|
Unlink($draft);
|
||||||
$Message .= $q->p(T('Draft recovered'));
|
$Message .= $q->p(T('Draft recovered'));
|
||||||
DoEdit($data->{id}, $data->{text}, 1);
|
DoEdit($data->{id}, $data->{text}, 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -76,22 +76,19 @@ push(@MyMaintenance, \&DraftCleanup);
|
|||||||
|
|
||||||
sub DraftFiles {
|
sub DraftFiles {
|
||||||
return map {
|
return map {
|
||||||
my $x = $_;
|
substr($_, length($DraftDir) + 1);
|
||||||
$x = substr($x, length($DraftDir) + 1);
|
} Glob("$DraftDir/*"), Glob("$DraftDir/.*");
|
||||||
utf8::decode($x);
|
|
||||||
$x;
|
|
||||||
} bsd_glob("$DraftDir/*"), bsd_glob("$DraftDir/.*");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub DraftCleanup {
|
sub DraftCleanup {
|
||||||
print '<p>' . T('Draft Cleanup');
|
print '<p>' . T('Draft Cleanup');
|
||||||
foreach my $draft (DraftFiles()) {
|
foreach my $draft (DraftFiles()) {
|
||||||
next if $draft eq '.' or $draft eq '..';
|
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
|
if ($Now - $ts < 1209600) { # 14*24*60*60
|
||||||
print $q->br(), Tss("%1 was last modified %2 and was kept",
|
print $q->br(), Tss("%1 was last modified %2 and was kept",
|
||||||
$draft, CalcTimeSince($Now - $ts));
|
$draft, CalcTimeSince($Now - $ts));
|
||||||
} elsif (unlink("$DraftDir/$draft")) {
|
} elsif (Unlink("$DraftDir/$draft")) {
|
||||||
print $q->br(), Tss("%1 was last modified %2 and was deleted",
|
print $q->br(), Tss("%1 was last modified %2 and was deleted",
|
||||||
$draft, CalcTimeSince($Now - $ts));
|
$draft, CalcTimeSince($Now - $ts));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
# Makes the wiki logo depend on the current date.
|
# Makes the wiki logo depend on the current date.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -9,10 +9,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use v5.10;
|
|||||||
|
|
||||||
AddModuleDescription('edit-cluster.pl', 'Edit Cluster Extension');
|
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';
|
our $EditCluster = 'EditCluster';
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ sub GetRc {
|
|||||||
$changetime{$pagename} = $ts;
|
$changetime{$pagename} = $ts;
|
||||||
}
|
}
|
||||||
my $date = '';
|
my $date = '';
|
||||||
my $all = GetParam('all', 0);
|
my $all = GetParam('all', $ShowAll);
|
||||||
my ($idOnly, $userOnly, $hostOnly, $clusterOnly, $filterOnly, $match, $lang) =
|
my ($idOnly, $userOnly, $hostOnly, $clusterOnly, $filterOnly, $match, $lang) =
|
||||||
map { GetParam($_, ''); }
|
map { GetParam($_, ''); }
|
||||||
('rcidonly', 'rcuseronly', 'rchostonly', 'rcclusteronly',
|
('rcidonly', 'rcuseronly', 'rchostonly', 'rcclusteronly',
|
||||||
@@ -128,7 +128,7 @@ sub EditClusterNewRcHeader {
|
|||||||
$action = "action=rc$action";
|
$action = "action=rc$action";
|
||||||
}
|
}
|
||||||
my $days = GetParam('days', $RcDefault);
|
my $days = GetParam('days', $RcDefault);
|
||||||
my $all = GetParam('all', 0);
|
my $all = GetParam('all', $ShowAll);
|
||||||
my @menu;
|
my @menu;
|
||||||
if ($all) {
|
if ($all) {
|
||||||
push(@menu, ScriptLink("$action;days=$days;all=0",
|
push(@menu, ScriptLink("$action;days=$days;all=0",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -12,10 +12,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
# This module creates a list of all questions on the page, e.g.
|
# 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
|
# for a faq. It does so by recognizing all lines that begin with
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA,
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ sub FixEncoding {
|
|||||||
ValidIdOrDie($id);
|
ValidIdOrDie($id);
|
||||||
RequestLockOrError();
|
RequestLockOrError();
|
||||||
OpenPage($id);
|
OpenPage($id);
|
||||||
my $text = $Page{text};
|
my $text = decode_utf8($Page{text});
|
||||||
utf8::decode($text);
|
|
||||||
Save($id, $text, T('Fix character encoding'), 1) if $text ne $Page{text};
|
Save($id, $text, T('Fix character encoding'), 1) if $text ne $Page{text};
|
||||||
ReleaseLock();
|
ReleaseLock();
|
||||||
ReBrowsePage($id);
|
ReBrowsePage($id);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ our ($q, $OpenPageName, @MyRules, $CrossbarPageName);
|
|||||||
push(@MyRules, \&FormsRule);
|
push(@MyRules, \&FormsRule);
|
||||||
|
|
||||||
sub FormsRule {
|
sub FormsRule {
|
||||||
if (-f GetLockedPageFile($OpenPageName) or (InElement('div', '^class="crossbar"$') and
|
if (IsFile(GetLockedPageFile($OpenPageName)) or (InElement('div', '^class="crossbar"$') and
|
||||||
-f GetLockedPageFile($CrossbarPageName))) {
|
IsFile(GetLockedPageFile($CrossbarPageName)))) {
|
||||||
if (/\G(\<form.*?\<\/form\>)/cgs) {
|
if (/\G(\<form.*?\<\/form\>)/cgs) {
|
||||||
my $form = $1;
|
my $form = $1;
|
||||||
my $oldpos = pos;
|
my $oldpos = pos;
|
||||||
|
|||||||
@@ -163,8 +163,7 @@ sub GdSecurityImageGenerate {
|
|||||||
my ($imgData) = $img->out(force => 'png');
|
my ($imgData) = $img->out(force => 'png');
|
||||||
my $ticketId = Digest::MD5::md5_hex(rand());
|
my $ticketId = Digest::MD5::md5_hex(rand());
|
||||||
CreateDir($GdSecurityImageDir);
|
CreateDir($GdSecurityImageDir);
|
||||||
my $file = GdSecurityImageGetImageFile($ticketId);
|
open my $fh, ">:raw", encode_utf8(GdSecurityImageGetImageFile($ticketId))
|
||||||
open my $fh, ">:raw", $file
|
|
||||||
or ReportError(Ts('Image storing failed. (%s)', $!), '500 INTERNAL SERVER ERROR');
|
or ReportError(Ts('Image storing failed. (%s)', $!), '500 INTERNAL SERVER ERROR');
|
||||||
print $fh $imgData;
|
print $fh $imgData;
|
||||||
#print $fh $png; ### experimental ###
|
#print $fh $png; ### experimental ###
|
||||||
@@ -187,9 +186,7 @@ sub GdSecurityImageIsValidId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub GdSecurityImageReadImageFile {
|
sub GdSecurityImageReadImageFile {
|
||||||
my $file = shift;
|
if (open(my $IN, '<:raw', encode_utf8(shift))) {
|
||||||
utf8::encode($file); # filenames are bytes!
|
|
||||||
if (open(my $IN, '<:raw', $file)) {
|
|
||||||
local $/ = undef; # Read complete files
|
local $/ = undef; # Read complete files
|
||||||
my $data=<$IN>;
|
my $data=<$IN>;
|
||||||
close $IN;
|
close $IN;
|
||||||
@@ -211,7 +208,7 @@ sub GdSecurityImageDoImage {
|
|||||||
print $q->header(-type=>'image/png');
|
print $q->header(-type=>'image/png');
|
||||||
print $data;
|
print $data;
|
||||||
|
|
||||||
unlink(GdSecurityImageGetImageFile($id));
|
Unlink(GdSecurityImageGetImageFile($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
sub GdSecurityImageCleanup {
|
sub GdSecurityImageCleanup {
|
||||||
@@ -219,10 +216,10 @@ sub GdSecurityImageCleanup {
|
|||||||
if (!GdSecurityImageIsValidId($id)) {
|
if (!GdSecurityImageIsValidId($id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
my @files = (bsd_glob("$GdSecurityImageDir/*.png"), bsd_glob("$GdSecurityImageDir/*.ticket"));
|
my @files = (Glob("$GdSecurityImageDir/*.png"), Glob("$GdSecurityImageDir/*.ticket"));
|
||||||
foreach my $file (@files) {
|
foreach my $file (@files) {
|
||||||
if ($Now - (stat $file)[9] > $GdSecurityImageDuration) {
|
if ($Now - Modified($file) > $GdSecurityImageDuration) {
|
||||||
unlink($file);
|
Unlink($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -255,7 +252,7 @@ sub GdSecurityImageCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (GdSecurityImageIsValidId($id)) {
|
if (GdSecurityImageIsValidId($id)) {
|
||||||
unlink(GdSecurityImageGetTicketFile($id));
|
Unlink(GdSecurityImageGetTicketFile($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$GdSecurityImageId = GdSecurityImageGenerate();
|
$GdSecurityImageId = GdSecurityImageGenerate();
|
||||||
|
|||||||
@@ -30,18 +30,18 @@ $GitMail = 'unknown@oddmuse.org';
|
|||||||
sub GitCommit {
|
sub GitCommit {
|
||||||
my ($message, $author) = @_;
|
my ($message, $author) = @_;
|
||||||
my $oldDir = cwd;
|
my $oldDir = cwd;
|
||||||
chdir("$DataDir/page");
|
ChangeDir("$DataDir/page");
|
||||||
capture {
|
capture {
|
||||||
system($GitBinary, qw(add -A));
|
system($GitBinary, qw(add -A));
|
||||||
system($GitBinary, qw(commit -q -m), $message, "--author=$author <$GitMail>");
|
system($GitBinary, qw(commit -q -m), $message, "--author=$author <$GitMail>");
|
||||||
};
|
};
|
||||||
chdir($oldDir);
|
ChangeDir($oldDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub GitInitRepository {
|
sub GitInitRepository {
|
||||||
return if -d "$DataDir/page/.git";
|
return if IsDir("$DataDir/page/.git");
|
||||||
capture {
|
capture {
|
||||||
system($GitBinary, qw(init -q --), "$DataDir/page");
|
system($GitBinary, qw(init -q --), encode_utf8("$DataDir/page"));
|
||||||
};
|
};
|
||||||
GitCommit('Initial import', 'Oddmuse');
|
GitCommit('Initial import', 'Oddmuse');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ sub GitRun {
|
|||||||
my $exitStatus;
|
my $exitStatus;
|
||||||
# warn join(' ', $GitBinary, @_) . "\n";
|
# warn join(' ', $GitBinary, @_) . "\n";
|
||||||
|
|
||||||
chdir($GitRepo);
|
ChangeDir($GitRepo);
|
||||||
if ($GitDebug) {
|
if ($GitDebug) {
|
||||||
# TODO use ToString here
|
# TODO use ToString here
|
||||||
# capture the output of the git comand in a temporary file
|
# capture the output of the git comand in a temporary file
|
||||||
@@ -99,7 +99,7 @@ sub GitRun {
|
|||||||
} else {
|
} else {
|
||||||
$exitStatus = system($GitBinary, @_);
|
$exitStatus = system($GitBinary, @_);
|
||||||
}
|
}
|
||||||
chdir($oldDir);
|
ChangeDir($oldDir);
|
||||||
return $exitStatus;
|
return $exitStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ sub GitInitVariables {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub GitInitRepository {
|
sub GitInitRepository {
|
||||||
return if -d "$GitRepo/.git";
|
return if IsDir("$GitRepo/.git");
|
||||||
my $exception = shift;
|
my $exception = shift;
|
||||||
CreateDir($GitRepo);
|
CreateDir($GitRepo);
|
||||||
GitRun(qw(init --quiet));
|
GitRun(qw(init --quiet));
|
||||||
@@ -187,17 +187,16 @@ sub DoGitCleanup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub GitCleanup {
|
sub GitCleanup {
|
||||||
if (-d $GitRepo) {
|
if (IsDir($GitRepo)) {
|
||||||
print $q->p('Git cleanup starting');
|
print $q->p('Git cleanup starting');
|
||||||
AllPagesList();
|
AllPagesList();
|
||||||
# delete all the files including all the files starting with a dot
|
# delete all the files including all the files starting with a dot
|
||||||
opendir(DIR, $GitRepo) or ReportError("cannot open directory $GitRepo: $!");
|
opendir(DIR, encode_utf8($GitRepo)) or ReportError("cannot open directory $GitRepo: $!");
|
||||||
foreach my $file (readdir(DIR)) {
|
foreach my $file (readdir(DIR)) {
|
||||||
my $name = $file;
|
my $name = decode_utf8($file);
|
||||||
utf8::decode($name); # filenames are bytes
|
|
||||||
next if $file eq '.git' or $file eq '.' or $file eq '..' or $IndexHash{$name};
|
next if $file eq '.git' or $file eq '.' or $file eq '..' or $IndexHash{$name};
|
||||||
print $q->p("Deleting left over file $name");
|
print $q->p("Deleting left over file $name");
|
||||||
unlink "$GitRepo/$file" or ReportError("cannot delete $GitRepo/$name: $!");
|
Unlink("$GitRepo/$file") or print $q->p("Cannot delete $GitRepo/$name: $!");
|
||||||
}
|
}
|
||||||
closedir DIR;
|
closedir DIR;
|
||||||
# write all the files again, just to be sure
|
# write all the files again, just to be sure
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ sub GooglePlusPrintFooter {
|
|||||||
return q{
|
return q{
|
||||||
<!-- start of Google+ -->
|
<!-- start of Google+ -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function loadScript(jssource,link_id) {
|
function loadScript(jssource) {
|
||||||
// add javascript
|
// add javascript
|
||||||
var jsnode = document.createElement('script');
|
var jsnode = document.createElement('script');
|
||||||
jsnode.setAttribute('type','text/javascript');
|
jsnode.setAttribute('type','text/javascript');
|
||||||
@@ -66,15 +66,24 @@ function loadScript(jssource,link_id) {
|
|||||||
var butn = document.createElement('div');
|
var butn = document.createElement('div');
|
||||||
butn.setAttribute('class', 'g-plusone');
|
butn.setAttribute('class', 'g-plusone');
|
||||||
butn.setAttribute('id', 'my_plusone');
|
butn.setAttribute('id', 'my_plusone');
|
||||||
var link = document.getElementById(link_id);
|
var link = document.getElementById('plus1');
|
||||||
link.parentNode.insertBefore(butn, link);
|
link.parentNode.insertBefore(butn, link);
|
||||||
// hide the link
|
// hide the link
|
||||||
link.innerHTML = "";
|
link.innerHTML = "";
|
||||||
|
// when looking at action=plusone
|
||||||
|
var ul = document.getElementById('plus1s');
|
||||||
|
var children = ul.children;
|
||||||
|
for (var i = 0; i < children.length; i++) {
|
||||||
|
var li = children[i];
|
||||||
|
butn = document.createElement('g:plusone');
|
||||||
|
butn.setAttribute('href', li.firstElementChild.getAttribute('href'));
|
||||||
|
butn.setAttribute('id', 'my_plusone' + i);
|
||||||
|
li.appendChild(butn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var plus1source = "https://apis.google.com/js/plusone.js";
|
|
||||||
</script>
|
</script>
|
||||||
<p id="plus1">
|
<p id="plus1">
|
||||||
<a href="javascript:loadScript(plus1source,'plus1')">
|
<a href="javascript:loadScript('https://apis.google.com/js/plusone.js')">
|
||||||
<img src="/pics/plusone-h24.png" alt="Show Google +1" />
|
<img src="/pics/plusone-h24.png" alt="Show Google +1" />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -103,11 +112,9 @@ sub DoPlusOne {
|
|||||||
push(@pages, $id) if $id =~ /^\d\d\d\d-\d\d-\d\d/;
|
push(@pages, $id) if $id =~ /^\d\d\d\d-\d\d-\d\d/;
|
||||||
}
|
}
|
||||||
splice(@pages, 0, $#pages - 19); # last 20 items
|
splice(@pages, 0, $#pages - 19); # last 20 items
|
||||||
print "<ul>";
|
print '<ul id="plus1s">';
|
||||||
foreach my $id (@pages) {
|
foreach my $id (@pages) {
|
||||||
my $url = ScriptUrl(UrlEncode($id));
|
print $q->li(GetPageLink($id), ' ');
|
||||||
print $q->li(GetPageLink($id),
|
|
||||||
qq{ <g:plusone href="$url"></g:plusone>});
|
|
||||||
}
|
}
|
||||||
print "</ul>";
|
print "</ul>";
|
||||||
print $q->end_div();
|
print $q->end_div();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Copyright (C) 2006-2014 Alex Schroeder <alex@gnu.org>
|
# Copyright (C) 2006-2014 Alex Schroeder <alex@gnu.org>
|
||||||
|
# Copyright (C) 2016 Ingo Belka
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify it under
|
# 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
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -25,6 +26,9 @@ our ($GotobarName);
|
|||||||
|
|
||||||
$GotobarName = 'GotoBar';
|
$GotobarName = 'GotoBar';
|
||||||
|
|
||||||
|
our ($GotobarSetHome, $GotobarSetRC);
|
||||||
|
# 0 does set home-link and/or rc-link automatically, 1 doesn't
|
||||||
|
|
||||||
# do this later so that the user can customize $GotobarName
|
# do this later so that the user can customize $GotobarName
|
||||||
push(@MyInitVariables, \&GotobarInit);
|
push(@MyInitVariables, \&GotobarInit);
|
||||||
|
|
||||||
@@ -53,10 +57,10 @@ sub GotobarInit {
|
|||||||
# is the list of recent changes.
|
# is the list of recent changes.
|
||||||
$count++;
|
$count++;
|
||||||
if ($count == 1) {
|
if ($count == 1) {
|
||||||
$HomePage = FreeToNormal($page);
|
unless ($GotobarSetHome) {$HomePage = FreeToNormal($page)};
|
||||||
} elsif ($count == 2) {
|
} elsif ($count == 2) {
|
||||||
$RCName = FreeToNormal($page);
|
unless ($GotobarSetRC) {$RCName = FreeToNormal($page);}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ sub GravatarFormAddition {
|
|||||||
return $html unless $type eq 'comment';
|
return $html unless $type eq 'comment';
|
||||||
|
|
||||||
my $addition = $q->span({-class=>'mail'},
|
my $addition = $q->span({-class=>'mail'},
|
||||||
$q->label({-for=>'mail'}, T('Email: '))
|
$q->label({-for=>'mail'}, T('Email:') . ' ')
|
||||||
. ' ' . $q->textfield(-name=>'mail', -id=>'mail',
|
. ' ' . $q->textfield(-name=>'mail', -id=>'mail',
|
||||||
-default=>GetParam('mail', '')));
|
-default=>GetParam('mail', '')));
|
||||||
$html =~ s!(name="homepage".*?)</p>!$1 $addition</p>!i;
|
$html =~ s!(name="homepage".*?)</p>!$1 $addition</p>!i;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
@@ -43,7 +40,7 @@ sub HtmlTemplate {
|
|||||||
my $type = shift;
|
my $type = shift;
|
||||||
# return header.de.html, or header.html, or error.html, or report an error...
|
# return header.de.html, or header.html, or error.html, or report an error...
|
||||||
foreach my $f ((map { "$type.$_" } HtmlTemplateLanguage()), $type, "error") {
|
foreach my $f ((map { "$type.$_" } HtmlTemplateLanguage()), $type, "error") {
|
||||||
return "$HtmlTemplateDir/$f.html" if -r "$HtmlTemplateDir/$f.html";
|
return "$HtmlTemplateDir/$f.html" if IsFile("$HtmlTemplateDir/$f.html");
|
||||||
}
|
}
|
||||||
ReportError(Tss('Could not find %1.html template in %2', $type, $HtmlTemplateDir),
|
ReportError(Tss('Could not find %1.html template in %2', $type, $HtmlTemplateDir),
|
||||||
'500 INTERNAL SERVER ERROR');
|
'500 INTERNAL SERVER ERROR');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -12,10 +12,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -14,10 +14,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
# This module offers the possibility to restrict viewing of "hidden"
|
# This module offers the possibility to restrict viewing of "hidden"
|
||||||
# pages to only editors or admins. The restriction may be based
|
# pages to only editors or admins. The restriction may be based
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
@@ -87,7 +84,7 @@ sub GetActionHtmlTemplate {
|
|||||||
my $action = GetParam('action', 'browse');
|
my $action = GetParam('action', 'browse');
|
||||||
# return browse.de.html, or browse.html, or error.html, or report an error...
|
# return browse.de.html, or browse.html, or error.html, or report an error...
|
||||||
foreach my $f ((map { "$action.$_" } HtmlTemplateLanguage()), $action, "error") {
|
foreach my $f ((map { "$action.$_" } HtmlTemplateLanguage()), $action, "error") {
|
||||||
return "$HtmlTemplateDir/$f.html" if -r "$HtmlTemplateDir/$f.html";
|
return "$HtmlTemplateDir/$f.html" if IsFile("$HtmlTemplateDir/$f.html");
|
||||||
}
|
}
|
||||||
ReportError(Tss('Could not find %1.html template in %2', $action, $HtmlTemplateDir),
|
ReportError(Tss('Could not find %1.html template in %2', $action, $HtmlTemplateDir),
|
||||||
'500 INTERNAL SERVER ERROR');
|
'500 INTERNAL SERVER ERROR');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
@@ -31,7 +28,7 @@ push(@MyRules, \&HtmlLinksRule);
|
|||||||
$RuleOrder{\&HtmlLinksRule} = 105;
|
$RuleOrder{\&HtmlLinksRule} = 105;
|
||||||
|
|
||||||
sub HtmlLinksRule {
|
sub HtmlLinksRule {
|
||||||
if (-f GetLockedPageFile($OpenPageName)) {
|
if (IsFile(GetLockedPageFile($OpenPageName))) {
|
||||||
$HtmlLinks = 1;
|
$HtmlLinks = 1;
|
||||||
} else {
|
} else {
|
||||||
$HtmlLinks = 0;
|
$HtmlLinks = 0;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ sub DivFooRule {
|
|||||||
my $str = $1;
|
my $str = $1;
|
||||||
CreateDir($ImagifyDir);
|
CreateDir($ImagifyDir);
|
||||||
my $fileName = sha256_hex($str) . '.' . $ImagifyFormat;
|
my $fileName = sha256_hex($str) . '.' . $ImagifyFormat;
|
||||||
system('convert', %ImagifyParams, "caption:$str", "$ImagifyDir/$fileName") unless -e "$ImagifyDir/$fileName";
|
system('convert', %ImagifyParams, "caption:$str", "$ImagifyDir/$fileName") unless IsFile("$ImagifyDir/$fileName");
|
||||||
my $src = $ScriptName . "/imagify/" . UrlEncode($fileName);
|
my $src = $ScriptName . "/imagify/" . UrlEncode($fileName);
|
||||||
return CloseHtmlEnvironments() . $q->img({-class => 'imagify', -src => $src, -alt => '(rendered text)'}) . AddHtmlEnvironment('p');
|
return CloseHtmlEnvironments() . $q->img({-class => 'imagify', -src => $src, -alt => '(rendered text)'}) . AddHtmlEnvironment('p');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ sub JoinerSendRegistrationConfirmationEmail {
|
|||||||
print $EMAIL "From: $JoinerEmailSenderAddress\n";
|
print $EMAIL "From: $JoinerEmailSenderAddress\n";
|
||||||
print $EMAIL "Subject: $SiteName " . T('Registration Confirmation') . "\n";
|
print $EMAIL "Subject: $SiteName " . T('Registration Confirmation') . "\n";
|
||||||
print $EMAIL "\n";
|
print $EMAIL "\n";
|
||||||
print $EMAIL T('Visit the link blow to confirm registration.') . "\n";
|
print $EMAIL T('Visit the link below to confirm registration.') . "\n";
|
||||||
print $EMAIL "\n";
|
print $EMAIL "\n";
|
||||||
print $EMAIL "$link\n";
|
print $EMAIL "$link\n";
|
||||||
print $EMAIL "\n";
|
print $EMAIL "\n";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
# In your CSS file, use something like this, for example:
|
# In your CSS file, use something like this, for example:
|
||||||
|
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ sub MakeLaTeX {
|
|||||||
|
|
||||||
# Select which binary to use for conversion of dvi to images
|
# Select which binary to use for conversion of dvi to images
|
||||||
my $useConvert = 0;
|
my $useConvert = 0;
|
||||||
if (not -e $dvipngPath) {
|
if (not IsFile($dvipngPath)) {
|
||||||
if (not -e $convertPath) {
|
if (not IsFile($convertPath)) {
|
||||||
return "[Error: dvipng binary and convert binary not found at $dvipngPath or $convertPath ]";
|
return "[Error: dvipng binary and convert binary not found at $dvipngPath or $convertPath ]";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -155,13 +155,13 @@ sub MakeLaTeX {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# check cache
|
# check cache
|
||||||
if (not -f "$LatexDir/$hash.png" or -z "$LatexDir/$hash.png") { #If file doesn't exist or is zero bytes
|
if (not IsFile("$LatexDir/$hash.png") or ZeroSize("$LatexDir/$hash.png")) {
|
||||||
# Then create the image
|
# Then create the image
|
||||||
|
|
||||||
# read template and replace <math>
|
# read template and replace <math>
|
||||||
mkdir($LatexDir) unless -d $LatexDir;
|
CreateDir($LatexDir);
|
||||||
if (not -f $LatexDefaultTemplateName) {
|
if (not IsFile($LatexDefaultTemplateName)) {
|
||||||
open (my $F, '>', $LatexDefaultTemplateName) or return '[Unable to write template]';
|
open (my $F, '>', encode_utf8($LatexDefaultTemplateName)) or return '[Unable to write template]';
|
||||||
print $F $LatexDefaultTemplate;
|
print $F $LatexDefaultTemplate;
|
||||||
close $F;
|
close $F;
|
||||||
}
|
}
|
||||||
@@ -169,12 +169,12 @@ sub MakeLaTeX {
|
|||||||
$template =~ s/<math>/$latex/gi;
|
$template =~ s/<math>/$latex/gi;
|
||||||
#setup rendering directory
|
#setup rendering directory
|
||||||
my $dir = "$LatexDir/$hash";
|
my $dir = "$LatexDir/$hash";
|
||||||
if (-d $dir) {
|
if (IsDir($dir)) {
|
||||||
unlink (bsd_glob('$dir/*'));
|
Unlink((Glob("$dir/*")));
|
||||||
} else {
|
} else {
|
||||||
mkdir($dir) or return "[Unable to create $dir]";
|
CreateDir($dir);
|
||||||
}
|
}
|
||||||
chdir ($dir) or return "[Unable to switch to $dir]";
|
ChangeDir($dir) or return "[Unable to switch to $dir]";
|
||||||
WriteStringToFile ("srender.tex", $template);
|
WriteStringToFile ("srender.tex", $template);
|
||||||
my $errorText = qx(latex srender.tex);
|
my $errorText = qx(latex srender.tex);
|
||||||
|
|
||||||
@@ -197,16 +197,16 @@ sub MakeLaTeX {
|
|||||||
$error = "[dvipng error $? ($output)]" if $?;
|
$error = "[dvipng error $? ($output)]" if $?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not $error and -f 'srender1.png' and not -z 'srender1.png') {
|
if (not $error and IsFile('srender1.png') and not ZeroSize('srender1.png')) {
|
||||||
my $png = ReadFileOrDie("srender1.png");
|
my $png = ReadFileOrDie("srender1.png");
|
||||||
WriteStringToFile ("$LatexDir/$hash.png", $png);
|
WriteStringToFile ("$LatexDir/$hash.png", $png);
|
||||||
} else {
|
} else {
|
||||||
$error = "[Error retrieving image for $latex]";
|
$error = "[Error retrieving image for $latex]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlink (glob('*'));
|
Unlink(glob('*'));
|
||||||
chdir ($LatexDir);
|
ChangeDir($LatexDir);
|
||||||
rmdir ($dir);
|
RemoveDir($dir);
|
||||||
|
|
||||||
return $error if $error;
|
return $error if $error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,13 +11,8 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
# Based on code of tagmap.pl module by Fletcher T. Penney
|
|
||||||
# and searchtags.pl module by Brock Wilcox
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ sub DoListLocked {
|
|||||||
print $q->start_div({-class=>'content list locked'}), $q->start_p();
|
print $q->start_div({-class=>'content list locked'}), $q->start_p();
|
||||||
}
|
}
|
||||||
foreach my $id (AllPagesList()) {
|
foreach my $id (AllPagesList()) {
|
||||||
PrintPage($id) if -f GetLockedPageFile($id);
|
PrintPage($id) if IsFile(GetLockedPageFile($id));
|
||||||
}
|
}
|
||||||
if (not $raw) {
|
if (not $raw) {
|
||||||
print $q->end_p(), $q->end_div();
|
print $q->end_p(), $q->end_div();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Copyright (C) 2008 Weakish Jiang <weakish@gmail.com>
|
# Copyright (C) 2008 Weakish Jiang <weakish@gmail.com>
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -18,32 +18,39 @@ use v5.10;
|
|||||||
|
|
||||||
AddModuleDescription('load-lang.pl', 'Language Browser Preferences');
|
AddModuleDescription('load-lang.pl', 'Language Browser Preferences');
|
||||||
|
|
||||||
our ($q, %CookieParameters, $ConfigFile, $DataDir, $NamespaceCurrent, @MyInitVariables);
|
our ($q, %CookieParameters, $ConfigFile, $DataDir, $ModuleDir, $NamespaceCurrent, @MyInitVariables);
|
||||||
our ($CurrentLanguage, $LoadLanguageDir);
|
our $CurrentLanguage;
|
||||||
|
|
||||||
|
our $LoadLanguageDir = "$ModuleDir/translations"; # by default same as in git
|
||||||
|
|
||||||
$CookieParameters{interface} = '';
|
$CookieParameters{interface} = '';
|
||||||
|
|
||||||
my %library= ('bg' => 'bulgarian-utf8.pl',
|
our %TranslationsLibrary = (
|
||||||
'de' => 'german-utf8.pl',
|
'bg' => 'bulgarian-utf8.pl',
|
||||||
'es' => 'spanish-utf8.pl',
|
'ca' => 'catalan-utf8.pl',
|
||||||
'fr' => 'french-utf8.pl',
|
'de' => 'german-utf8.pl',
|
||||||
'fi' => 'finnish-utf8.pl',
|
'et' => 'estonian-utf8.pl',
|
||||||
'gr' => 'greek-utf8.pl',
|
'es' => 'spanish-utf8.pl',
|
||||||
'he' => 'hebrew-utf8.pl',
|
'fi' => 'finnish-utf8.pl',
|
||||||
'it' => 'italian-utf8.pl',
|
'fr' => 'french-utf8.pl',
|
||||||
'ja' => 'japanese-utf8.pl',
|
'gr' => 'greek-utf8.pl',
|
||||||
'ko' => 'korean-utf8.pl',
|
'he' => 'hebrew-utf8.pl',
|
||||||
'nl' => 'dutch-utf8.pl',
|
'it' => 'italian-utf8.pl',
|
||||||
'pl' => 'polish-utf8.pl',
|
'ja' => 'japanese-utf8.pl',
|
||||||
'pt' => 'portuguese-utf8.pl',
|
'ko' => 'korean-utf8.pl',
|
||||||
'ro' => 'romanian-utf8.pl',
|
'nl' => 'dutch-utf8.pl',
|
||||||
'ru' => 'russian-utf8.pl',
|
'pl' => 'polish-utf8.pl',
|
||||||
'se' => 'swedish-utf8.pl',
|
'pt' => 'portuguese-utf8.pl',
|
||||||
'sr' => 'serbian-utf8.pl',
|
'pt-br' => 'brazilian-portuguese-utf8.pl',
|
||||||
'zh' => 'chinese-utf8.pl',
|
'ro' => 'romanian-utf8.pl',
|
||||||
'zh-cn' => 'chinese_cn-utf8.pl',
|
'ru' => 'russian-utf8.pl',
|
||||||
'zh-tw' => 'chinese-utf8.pl',
|
'se' => 'swedish-utf8.pl',
|
||||||
);
|
'sr' => 'serbian-utf8.pl',
|
||||||
|
'uk' => 'ukrainian-utf8.pl',
|
||||||
|
'zh' => 'chinese-utf8.pl',
|
||||||
|
'zh-cn' => 'chinese_cn-utf8.pl',
|
||||||
|
'zh-tw' => 'chinese-utf8.pl',
|
||||||
|
);
|
||||||
|
|
||||||
sub LoadLanguage {
|
sub LoadLanguage {
|
||||||
# my $requested_language = "da, en-gb;q=0.8, en;q=0.7";
|
# my $requested_language = "da, en-gb;q=0.8, en;q=0.7";
|
||||||
@@ -65,11 +72,12 @@ sub LoadLanguage {
|
|||||||
# . $q->end_html) && exit if GetParam('debug', '');
|
# . $q->end_html) && exit if GetParam('debug', '');
|
||||||
foreach (@prefs) {
|
foreach (@prefs) {
|
||||||
last if $Lang{$_} eq 'en'; # the default
|
last if $Lang{$_} eq 'en'; # the default
|
||||||
my $file = $library{$Lang{$_}};
|
my $file = $TranslationsLibrary{$Lang{$_}};
|
||||||
|
next unless $file; # file is not listed, eg. there is no file for "de-ch"
|
||||||
$file = "$LoadLanguageDir/$file" if defined $LoadLanguageDir;
|
$file = "$LoadLanguageDir/$file" if defined $LoadLanguageDir;
|
||||||
if (-r $file) {
|
if (IsFile($file)) {
|
||||||
do $file;
|
do "./$file";
|
||||||
do "$ConfigFile-$Lang{$_}" if -r "$ConfigFile-$Lang{$_}";
|
do "./$ConfigFile-$Lang{$_}" if IsFile("$ConfigFile-$Lang{$_}");
|
||||||
$CurrentLanguage = $Lang{$_};
|
$CurrentLanguage = $Lang{$_};
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ You can change this expiry time by setting C<$LnCacheHours>.
|
|||||||
push (@MyMaintenance, \&LnMaintenance);
|
push (@MyMaintenance, \&LnMaintenance);
|
||||||
|
|
||||||
sub LnMaintenance {
|
sub LnMaintenance {
|
||||||
if (opendir(DIR, $RssDir)) { # cleanup if they should expire anyway
|
if (opendir(DIR, encode_utf8($RssDir))) { # cleanup if they should expire anyway
|
||||||
foreach (readdir(DIR)) {
|
foreach my $file (readdir(DIR)) {
|
||||||
unlink "$RssDir/$_" if $Now - (stat($_))[9] > $LnCacheHours * 3600;
|
Unlink("$RssDir/$file") if $Now - Modified($file) > $LnCacheHours * 3600;
|
||||||
}
|
}
|
||||||
closedir DIR;
|
closedir DIR;
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ sub LocalNamesInit {
|
|||||||
my %data = ();
|
my %data = ();
|
||||||
if (GetParam('cache', $UseCache) > 0) {
|
if (GetParam('cache', $UseCache) > 0) {
|
||||||
foreach my $uri (keys %todo) { # read cached rss files if possible
|
foreach my $uri (keys %todo) { # read cached rss files if possible
|
||||||
if ($Now - (stat($todo{$uri}))[9] < $LnCacheHours * 3600) {
|
if ($Now - Modified($todo{$uri}) < $LnCacheHours * 3600) {
|
||||||
$data{$uri} = ReadFile($todo{$uri});
|
$data{$uri} = ReadFile($todo{$uri});
|
||||||
delete($todo{$uri}); # no need to fetch them below
|
delete($todo{$uri}); # no need to fetch them below
|
||||||
}
|
}
|
||||||
@@ -396,10 +396,10 @@ sub DoDefine {
|
|||||||
$q->start_div({-class=>'content define'}),
|
$q->start_div({-class=>'content define'}),
|
||||||
GetFormStart(undef, 'get', 'def');
|
GetFormStart(undef, 'get', 'def');
|
||||||
my $go = T('Go!');
|
my $go = T('Go!');
|
||||||
print $q->p($q->label({-for=>"defined"}, T('Name: ')),
|
print $q->p($q->label({-for=>"defined"}, T('Name:') . ' '),
|
||||||
$q->textfield(-name=>"name", -id=>"defined",
|
$q->textfield(-name=>"name", -id=>"defined",
|
||||||
-tabindex=>"1", -size=>20));
|
-tabindex=>"1", -size=>20));
|
||||||
print $q->p($q->label({-for=>"definition"}, T('URL: ')),
|
print $q->p($q->label({-for=>"definition"}, T('URL:') . ' '),
|
||||||
$q->textfield(-name=>"link", -id=>"definition",
|
$q->textfield(-name=>"link", -id=>"definition",
|
||||||
-tabindex=>"2", -size=>20));
|
-tabindex=>"2", -size=>20));
|
||||||
print $q->p($q->submit(-label=>$go, -tabindex=>"3"),
|
print $q->p($q->submit(-label=>$go, -tabindex=>"3"),
|
||||||
@@ -446,7 +446,7 @@ sub GetWantedPages {
|
|||||||
# if any wanted pages remain, print them
|
# if any wanted pages remain, print them
|
||||||
if (@wanted) {
|
if (@wanted) {
|
||||||
return $q->div({-class=>'definition'},
|
return $q->div({-class=>'definition'},
|
||||||
$q->p(T('Define external redirect: '),
|
$q->p(T('Define external redirect:'), ' ',
|
||||||
map { my $page = NormalToFree($_);
|
map { my $page = NormalToFree($_);
|
||||||
ScriptLink('action=define;name='
|
ScriptLink('action=define;name='
|
||||||
. UrlEncode($page),
|
. UrlEncode($page),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
@@ -22,7 +19,7 @@ use v5.10;
|
|||||||
AddModuleDescription('login.pl', 'Login Module');
|
AddModuleDescription('login.pl', 'Login Module');
|
||||||
|
|
||||||
our ($q, %Action, $SiteName, @MyAdminCode, $IndexFile, $DataDir, $FullUrl);
|
our ($q, %Action, $SiteName, @MyAdminCode, $IndexFile, $DataDir, $FullUrl);
|
||||||
our ($RegistrationForm, $MinimumPasswordLength, $RegistrationsMustBeApproved, $LoginForm, $PasswordFile, $PasswordFileToUse, $PendingPasswordFile, $RequireLoginToEdit, $ConfirmEmailAddress, $UncomfirmedPasswordFile, $EmailSenderAddress, $EmailCommand, $EmailRegExp, $NotifyPendingRegistrations, $EmailConfirmationMessage, $ResetPasswordMessage, $LogoutForm, $ResetForm, $ChangePassForm, $RequireCamelUserName, $UsernameRegExp);
|
our ($RegistrationForm, $MinimumPasswordLength, $RegistrationsMustBeApproved, $LoginForm, $PasswordFile, $PasswordFileToUse, $PendingPasswordFile, $RequireLoginToEdit, $ConfirmEmailAddress, $UnconfirmedPasswordFile, $EmailSenderAddress, $EmailCommand, $EmailRegExp, $NotifyPendingRegistrations, $EmailConfirmationMessage, $ResetPasswordMessage, $LogoutForm, $ResetForm, $ChangePassForm, $RequireCamelUserName, $UsernameRegExp);
|
||||||
|
|
||||||
my $EncryptedPassword = "";
|
my $EncryptedPassword = "";
|
||||||
|
|
||||||
@@ -40,7 +37,7 @@ $RegistrationsMustBeApproved = 1 unless defined $RegistrationsMustBeApproved;
|
|||||||
$PendingPasswordFile = "$DataDir/pending" unless defined $PendingPasswordFile;
|
$PendingPasswordFile = "$DataDir/pending" unless defined $PendingPasswordFile;
|
||||||
|
|
||||||
$ConfirmEmailAddress = 1 unless defined $ConfirmEmailAddress;
|
$ConfirmEmailAddress = 1 unless defined $ConfirmEmailAddress;
|
||||||
$UncomfirmedPasswordFile = "$DataDir/uncomfirmed" unless defined $UncomfirmedPasswordFile;
|
$UnconfirmedPasswordFile = "$DataDir/uncomfirmed" unless defined $UnconfirmedPasswordFile;
|
||||||
|
|
||||||
$EmailSenderAddress = "fletcher\@freeshell.org" unless defined $EmailSenderAddress;
|
$EmailSenderAddress = "fletcher\@freeshell.org" unless defined $EmailSenderAddress;
|
||||||
$EmailCommand = "/usr/sbin/sendmail -oi -t" unless defined $EmailCommand;
|
$EmailCommand = "/usr/sbin/sendmail -oi -t" unless defined $EmailCommand;
|
||||||
@@ -71,7 +68,7 @@ $PasswordFileToUse = $RegistrationsMustBeApproved
|
|||||||
? $PendingPasswordFile : $PasswordFile;
|
? $PendingPasswordFile : $PasswordFile;
|
||||||
|
|
||||||
$PasswordFileToUse = $ConfirmEmailAddress
|
$PasswordFileToUse = $ConfirmEmailAddress
|
||||||
? $UncomfirmedPasswordFile : $PasswordFileToUse;
|
? $UnconfirmedPasswordFile : $PasswordFileToUse;
|
||||||
|
|
||||||
$RegistrationForm = <<'EOT' unless defined $RegistrationForm;
|
$RegistrationForm = <<'EOT' unless defined $RegistrationForm;
|
||||||
<p>Your Username should be a CamelCase form of your real name, e.g. JohnDoe.</p>
|
<p>Your Username should be a CamelCase form of your real name, e.g. JohnDoe.</p>
|
||||||
@@ -290,7 +287,7 @@ sub DoProcessLogin {
|
|||||||
ReportError(T('Username and/or password are incorrect.'))
|
ReportError(T('Username and/or password are incorrect.'))
|
||||||
unless (AuthenticateUser($username,$pwd));
|
unless (AuthenticateUser($username,$pwd));
|
||||||
|
|
||||||
unlink($IndexFile);
|
Unlink($IndexFile);
|
||||||
print GetHeader('', Ts('Register for %s', $SiteName), '');
|
print GetHeader('', Ts('Register for %s', $SiteName), '');
|
||||||
print '<div class="content">';
|
print '<div class="content">';
|
||||||
print Ts('Logged in as %s.', $username);
|
print Ts('Logged in as %s.', $username);
|
||||||
@@ -318,7 +315,7 @@ $Action{process_logout} = \&DoProcessLogout;
|
|||||||
sub DoProcessLogout {
|
sub DoProcessLogout {
|
||||||
SetParam('pwd','');
|
SetParam('pwd','');
|
||||||
SetParam('username','');
|
SetParam('username','');
|
||||||
unlink($IndexFile); # I shouldn't have to do this...
|
Unlink($IndexFile); # I shouldn't have to do this...
|
||||||
print GetHeader('', Ts('Logged out of %s', $SiteName), '');
|
print GetHeader('', Ts('Logged out of %s', $SiteName), '');
|
||||||
print '<div class="content">';
|
print '<div class="content">';
|
||||||
print T('You are now logged out.');
|
print T('You are now logged out.');
|
||||||
@@ -328,7 +325,7 @@ sub DoProcessLogout {
|
|||||||
|
|
||||||
sub UserExists {
|
sub UserExists {
|
||||||
my $username = shift;
|
my $username = shift;
|
||||||
if (open (my $PASSWD, '<', $PasswordFile)) {
|
if (open (my $PASSWD, '<', encode_utf8($PasswordFile))) {
|
||||||
while ( <$PASSWD> ) {
|
while ( <$PASSWD> ) {
|
||||||
if ($_ =~ /^$username:/) {
|
if ($_ =~ /^$username:/) {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -338,7 +335,7 @@ sub UserExists {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($RegistrationsMustBeApproved) {
|
if ($RegistrationsMustBeApproved) {
|
||||||
if (open (my $PASSWD, '<', $PendingPasswordFile)) {
|
if (open (my $PASSWD, '<', encode_utf8($PendingPasswordFile))) {
|
||||||
while ( <$PASSWD> ) {
|
while ( <$PASSWD> ) {
|
||||||
if ($_ =~ /^$username:/) {
|
if ($_ =~ /^$username:/) {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -349,7 +346,7 @@ sub UserExists {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($ConfirmEmailAddress) {
|
if ($ConfirmEmailAddress) {
|
||||||
if (open (my $PASSWD, '<', $UncomfirmedPasswordFile)) {
|
if (open (my $PASSWD, '<', encode_utf8($UnconfirmedPasswordFile))) {
|
||||||
while ( <$PASSWD> ) {
|
while ( <$PASSWD> ) {
|
||||||
if ($_ =~ /^$username:/) {
|
if ($_ =~ /^$username:/) {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -490,14 +487,13 @@ sub ConfirmUser {
|
|||||||
my ($username, $key) = @_;
|
my ($username, $key) = @_;
|
||||||
my $FileToUse = $RegistrationsMustBeApproved
|
my $FileToUse = $RegistrationsMustBeApproved
|
||||||
? $PendingPasswordFile : $PasswordFileToUse;
|
? $PendingPasswordFile : $PasswordFileToUse;
|
||||||
|
if (open(my $PASSWD, '<', encode_utf8($UnconfirmedPasswordFile))) {
|
||||||
if (open(my $PASSWD, '<', $UncomfirmedPasswordFile)) {
|
|
||||||
while (<$PASSWD>) {
|
while (<$PASSWD>) {
|
||||||
if ($_ =~ /^$username:(.*):(.*)/) {
|
if ($_ =~ /^$username:(.*):(.*)/) {
|
||||||
if (crypt($1,$key) eq $key) {
|
if (crypt($1,$key) eq $key) {
|
||||||
AddUser($username,$1,$2,$FileToUse);
|
AddUser($username,$1,$2,$FileToUse);
|
||||||
close $PASSWD;
|
close $PASSWD;
|
||||||
RemoveUser($username,$UncomfirmedPasswordFile);
|
RemoveUser($username,$UnconfirmedPasswordFile);
|
||||||
if ($RegistrationsMustBeApproved) {
|
if ($RegistrationsMustBeApproved) {
|
||||||
SendNotification($username);
|
SendNotification($username);
|
||||||
}
|
}
|
||||||
@@ -515,8 +511,7 @@ sub RemoveUser {
|
|||||||
|
|
||||||
my %passwords = ();
|
my %passwords = ();
|
||||||
my %emails = ();
|
my %emails = ();
|
||||||
|
if (open (my $PASSWD, '<', encode_utf8($FileToUse))) {
|
||||||
if (open (my $PASSWD, '<', $FileToUse)) {
|
|
||||||
while ( <$PASSWD> ) {
|
while ( <$PASSWD> ) {
|
||||||
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
||||||
next if ($1 eq $username);
|
next if ($1 eq $username);
|
||||||
@@ -599,8 +594,7 @@ sub ChangePassword {
|
|||||||
|
|
||||||
my %passwords = ();
|
my %passwords = ();
|
||||||
my %emails = ();
|
my %emails = ();
|
||||||
|
if (open (my $PASSWD, '<', encode_utf8($PasswordFile))) {
|
||||||
if (open (my $PASSWD, '<', $PasswordFile)) {
|
|
||||||
while ( <$PASSWD> ) {
|
while ( <$PASSWD> ) {
|
||||||
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
||||||
$passwords{$1}=$2;
|
$passwords{$1}=$2;
|
||||||
@@ -612,7 +606,7 @@ sub ChangePassword {
|
|||||||
|
|
||||||
$passwords{$user} = $hash;
|
$passwords{$user} = $hash;
|
||||||
|
|
||||||
open (my $PASSWD, '>', $PasswordFile);
|
open (my $PASSWD, '>', encode_utf8($PasswordFile));
|
||||||
foreach my $key ( sort keys(%passwords)) {
|
foreach my $key ( sort keys(%passwords)) {
|
||||||
print $PASSWD "$key:$passwords{$key}:$emails{$key}\n";
|
print $PASSWD "$key:$passwords{$key}:$emails{$key}\n";
|
||||||
}
|
}
|
||||||
@@ -719,7 +713,7 @@ sub DoApprovePending {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<ul>';
|
print '<ul>';
|
||||||
if (open(my $PASSWD, '<', $PendingPasswordFile)) {
|
if (open(my $PASSWD, '<', encode_utf8($PendingPasswordFile))) {
|
||||||
while (<$PASSWD>) {
|
while (<$PASSWD>) {
|
||||||
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
if ($_ =~ /^(.*):(.*):(.*)$/) {
|
||||||
print '<li>' . ScriptLink("action=approve_pending;user=$1;",$1) . ' - ' . $3 . '</li>';
|
print '<li>' . ScriptLink("action=approve_pending;user=$1;",$1) . ' - ' . $3 . '</li>';
|
||||||
@@ -740,8 +734,7 @@ sub DoApprovePending {
|
|||||||
|
|
||||||
sub ApproveUser {
|
sub ApproveUser {
|
||||||
my ($username) = @_;
|
my ($username) = @_;
|
||||||
|
if (open(my $PASSWD, '<', encode_utf8($PendingPasswordFile))) {
|
||||||
if (open(my $PASSWD, '<', $PendingPasswordFile)) {
|
|
||||||
while (<$PASSWD>) {
|
while (<$PASSWD>) {
|
||||||
if ($_ =~ /^$username:(.*):(.*)/) {
|
if ($_ =~ /^$username:(.*):(.*)/) {
|
||||||
AddUser($username,$1,$2,$PasswordFile);
|
AddUser($username,$1,$2,$PasswordFile);
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ sub DoLogout {
|
|||||||
|
|
||||||
print
|
print
|
||||||
GetHeader('', Ts('Logged out of %s', $SiteName), '') .
|
GetHeader('', Ts('Logged out of %s', $SiteName), '') .
|
||||||
$q->div({-class=> 'content'}, $q->p(T('You are now logged out.'), $id ? $q->p(ScriptLink('action=browse;id=' . UrlEncode($id) . '&time=' . time, T('Return to ' . NormalToFree($id)))) : ''));
|
$q->div({-class=> 'content'}, $q->p(T('You are now logged out.'), $id ? $q->p(ScriptLink('action=browse;id=' . UrlEncode($id) . '&time=' . time, Ts('Return to %s', NormalToFree($id)))) : ''));
|
||||||
PrintFooter();
|
PrintFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,18 +266,17 @@ except where noted.
|
|||||||
|
|
||||||
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
|
Copyleft 2008 by B.w.Curry <http://www.raiazome.com>.
|
||||||
|
|
||||||
This file is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or modify
|
||||||
modify it under the terms of the GNU General Public License
|
it under the terms of the GNU General Public License as published by
|
||||||
as published by the Free Software Foundation; either version 2
|
the Free Software Foundation; either version 3 of the License, or
|
||||||
of the License, or (at your option) any later version.
|
(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
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this file; if not, write to the Free Software
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
@@ -56,14 +56,12 @@ sub MacFixEncoding {
|
|||||||
return unless %Namespaces;
|
return unless %Namespaces;
|
||||||
my %hash = ();
|
my %hash = ();
|
||||||
for my $key (keys %Namespaces) {
|
for my $key (keys %Namespaces) {
|
||||||
utf8::decode($key);
|
|
||||||
$key = NFC($key);
|
$key = NFC($key);
|
||||||
$hash{$key} = $NamespaceRoot . '/' . $key . '/';
|
$hash{$key} = $NamespaceRoot . '/' . $key . '/';
|
||||||
}
|
}
|
||||||
%Namespaces = %hash;
|
%Namespaces = %hash;
|
||||||
%hash = ();
|
%hash = ();
|
||||||
for my $key (keys %InterSite) {
|
for my $key (keys %InterSite) {
|
||||||
utf8::decode($key);
|
|
||||||
$key = NFC($key);
|
$key = NFC($key);
|
||||||
$hash{$key} = $Namespaces{$key} if $Namespaces{$key};
|
$hash{$key} = $Namespaces{$key} if $Namespaces{$key};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ sub MailFormAddition {
|
|||||||
. ScriptLink("action=subscribe;pages=$id", T('subscribe'), 'subscribe');
|
. ScriptLink("action=subscribe;pages=$id", T('subscribe'), 'subscribe');
|
||||||
}
|
}
|
||||||
$addition = $q->span({-class=>'mail'},
|
$addition = $q->span({-class=>'mail'},
|
||||||
$q->label({-for=>'mail'}, T('Email: '))
|
$q->label({-for=>'mail'}, T('Email:') . ' ')
|
||||||
. ' ' . $q->textfield(-name=>'mail', -id=>'mail',
|
. ' ' . $q->textfield(-name=>'mail', -id=>'mail',
|
||||||
-default=>GetParam('mail', ''))
|
-default=>GetParam('mail', ''))
|
||||||
. $addition);
|
. $addition);
|
||||||
@@ -120,7 +120,7 @@ sub MailIsSubscribed {
|
|||||||
return 0 unless $mail;
|
return 0 unless $mail;
|
||||||
# open the DB file
|
# open the DB file
|
||||||
require DB_File;
|
require DB_File;
|
||||||
tie my %h, "DB_File", $MailFile;
|
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||||
my %subscribers = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($id)}));
|
my %subscribers = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($id)}));
|
||||||
untie %h;
|
untie %h;
|
||||||
return $subscribers{$mail};
|
return $subscribers{$mail};
|
||||||
@@ -197,7 +197,7 @@ sub NewMailDeletePage {
|
|||||||
sub MailDeletePage {
|
sub MailDeletePage {
|
||||||
my $id = shift;
|
my $id = shift;
|
||||||
require DB_File;
|
require DB_File;
|
||||||
tie my %h, "DB_File", $MailFile;
|
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||||
foreach my $mail (split(/$FS/, UrlDecode(delete $h{UrlEncode($id)}))) {
|
foreach my $mail (split(/$FS/, UrlDecode(delete $h{UrlEncode($id)}))) {
|
||||||
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||||
delete $subscriptions{$id};
|
delete $subscriptions{$id};
|
||||||
@@ -274,7 +274,7 @@ sub MailSubscription {
|
|||||||
my $mail = shift;
|
my $mail = shift;
|
||||||
return unless $mail;
|
return unless $mail;
|
||||||
require DB_File;
|
require DB_File;
|
||||||
tie my %h, "DB_File", $MailFile;
|
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||||
my @result = split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
my @result = split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||||
untie %h;
|
untie %h;
|
||||||
@result = sort @result;
|
@result = sort @result;
|
||||||
@@ -303,16 +303,15 @@ sub DoMailSubscriptionList {
|
|||||||
'<ul>';
|
'<ul>';
|
||||||
}
|
}
|
||||||
require DB_File;
|
require DB_File;
|
||||||
|
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||||
tie my %h, "DB_File", $MailFile;
|
|
||||||
foreach my $encodedkey (sort keys %h) {
|
foreach my $encodedkey (sort keys %h) {
|
||||||
my @values = sort split(/$FS/, UrlDecode($h{$encodedkey}));
|
my @values = sort split(/$FS/, UrlDecode($h{$encodedkey}));
|
||||||
my $key = UrlDecode($encodedkey);
|
my $key = UrlDecode($encodedkey);
|
||||||
if ($raw) {
|
if ($raw) {
|
||||||
print join(' ', $key, @values) . "\n";
|
print join(' ', $key, @values) . "\n";
|
||||||
} else {
|
} else {
|
||||||
print $q->li(Ts('%s: ', MailLink($key, @values)),
|
print $q->li(Ts('%s:', MailLink($key, @values)) . ' '
|
||||||
join(' ', map { MailLink($_, $key) } @values));
|
. join(' ', map { MailLink($_, $key) } @values));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</ul></div>' unless $raw;
|
print '</ul></div>' unless $raw;
|
||||||
@@ -383,7 +382,7 @@ sub MailSubscribe {
|
|||||||
return unless $mail and @pages;
|
return unless $mail and @pages;
|
||||||
# open the DB file
|
# open the DB file
|
||||||
require DB_File;
|
require DB_File;
|
||||||
tie my %h, "DB_File", $MailFile;
|
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||||
# add to the mail entry
|
# add to the mail entry
|
||||||
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||||
for my $id (@pages) {
|
for my $id (@pages) {
|
||||||
@@ -442,7 +441,7 @@ sub MailUnsubscribe {
|
|||||||
my ($mail, @pages) = @_;
|
my ($mail, @pages) = @_;
|
||||||
return unless $mail and @pages;
|
return unless $mail and @pages;
|
||||||
require DB_File;
|
require DB_File;
|
||||||
tie my %h, "DB_File", $MailFile;
|
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||||
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
my %subscriptions = map {$_=>1} split(/$FS/, UrlDecode($h{UrlEncode($mail)}));
|
||||||
foreach my $id (@pages) {
|
foreach my $id (@pages) {
|
||||||
delete $subscriptions{$id};
|
delete $subscriptions{$id};
|
||||||
@@ -481,8 +480,7 @@ sub DoMailMigration {
|
|||||||
$q->start_div({-class=>'content mailmigrate'});
|
$q->start_div({-class=>'content mailmigrate'});
|
||||||
|
|
||||||
require DB_File;
|
require DB_File;
|
||||||
|
tie my %h, "DB_File", encode_utf8($MailFile);
|
||||||
tie my %h, "DB_File", $MailFile;
|
|
||||||
my $found = 0;
|
my $found = 0;
|
||||||
foreach my $key (keys %h) {
|
foreach my $key (keys %h) {
|
||||||
if (index($key, '@') != -1) {
|
if (index($key, '@') != -1) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/perl
|
#! /usr/bin/perl
|
||||||
# Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
|
# Copyright (C) 2014–2017 Alex Schroeder <alex@gnu.org>
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify it under
|
# 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
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
@@ -18,7 +18,7 @@ use v5.10;
|
|||||||
|
|
||||||
AddModuleDescription('markdown-rule.pl', 'Markdown Rule Extension');
|
AddModuleDescription('markdown-rule.pl', 'Markdown Rule Extension');
|
||||||
|
|
||||||
our ($q, $bol, %RuleOrder, @MyRules, $UrlProtocols, $FullUrlPattern);
|
our ($q, $bol, %RuleOrder, @MyRules, $UrlProtocols, $FullUrlPattern, @HtmlStack);
|
||||||
|
|
||||||
push(@MyRules, \&MarkdownRule);
|
push(@MyRules, \&MarkdownRule);
|
||||||
# Since we want this package to be a simple add-on, we try and avoid
|
# Since we want this package to be a simple add-on, we try and avoid
|
||||||
@@ -31,16 +31,20 @@ $RuleOrder{\&MarkdownRule} = 200;
|
|||||||
# https://help.github.com/articles/github-flavored-markdown
|
# https://help.github.com/articles/github-flavored-markdown
|
||||||
|
|
||||||
sub MarkdownRule {
|
sub MarkdownRule {
|
||||||
|
# \escape
|
||||||
|
if (m/\G\\([-#>*`=])/cg) {
|
||||||
|
return $1;
|
||||||
|
}
|
||||||
# atx headers
|
# atx headers
|
||||||
if ($bol and m~\G(\s*\n)*(#{1,6})[ \t]*~cg) {
|
elsif ($bol and m~\G(\s*\n)*(#{1,6})[ \t]*~cg) {
|
||||||
my $header_depth = length($2);
|
my $header_depth = length($2);
|
||||||
return CloseHtmlEnvironments()
|
return CloseHtmlEnvironments()
|
||||||
. AddHtmlEnvironment("h" . $header_depth);
|
. AddHtmlEnvironment("h" . $header_depth);
|
||||||
}
|
}
|
||||||
# end atx header at a newline
|
# end atx header at a newline
|
||||||
elsif ((InElement('h1') or InElement('h2') or InElement('h3') or
|
elsif ((InElement('h1') or InElement('h2') or InElement('h3') or
|
||||||
InElement('h4') or InElement('h5') or InElement('h6'))
|
InElement('h4') or InElement('h5') or InElement('h6'))
|
||||||
and m/\G\n/cg) {
|
and m/\G\n/cg) {
|
||||||
return CloseHtmlEnvironments()
|
return CloseHtmlEnvironments()
|
||||||
. AddHtmlEnvironment("p");
|
. AddHtmlEnvironment("p");
|
||||||
}
|
}
|
||||||
@@ -56,33 +60,71 @@ sub MarkdownRule {
|
|||||||
return CloseHtmlEnvironments()
|
return CloseHtmlEnvironments()
|
||||||
. AddHtmlEnvironment('blockquote');
|
. AddHtmlEnvironment('blockquote');
|
||||||
}
|
}
|
||||||
|
# ``` = code
|
||||||
|
elsif ($bol and m/\G```[ \t]*\n(.*?)\n```[ \t]*(\n|$)/cgs) {
|
||||||
|
return CloseHtmlEnvironments() . $q->pre($1)
|
||||||
|
. AddHtmlEnvironment("p");
|
||||||
|
}
|
||||||
|
# ` = code
|
||||||
|
elsif (m/\G`([^`].*?)`/cg) {
|
||||||
|
return $q->code($1);
|
||||||
|
}
|
||||||
# ***bold and italic***
|
# ***bold and italic***
|
||||||
elsif (not InElement('strong') and not InElement('em') and m/\G\*\*\*/cg) {
|
elsif (not InElement('strong') and not InElement('em') and m/\G\*\*\*/cg) {
|
||||||
return AddHtmlEnvironment('em') . AddHtmlEnvironment('strong');
|
return AddHtmlEnvironment('em') . AddHtmlEnvironment('strong');
|
||||||
}
|
}
|
||||||
|
elsif (InElement('strong') and InElement('em') and m/\G\*\*\*/cg) {
|
||||||
|
return CloseHtmlEnvironment('strong') . CloseHtmlEnvironment('em');
|
||||||
|
}
|
||||||
# **bold**
|
# **bold**
|
||||||
elsif (m/\G\*\*/cg) {
|
elsif (m/\G\*\*/cg) {
|
||||||
return AddOrCloseHtmlEnvironment('strong');
|
return AddOrCloseHtmlEnvironment('strong');
|
||||||
}
|
}
|
||||||
# *italic*
|
# *italic* (closing before adding environment!)
|
||||||
elsif (m/\G\*/cg) {
|
elsif (InElement('em') and m/\G\*/cg) {
|
||||||
return AddOrCloseHtmlEnvironment('em');
|
return CloseHtmlEnvironment('em');
|
||||||
|
}
|
||||||
|
elsif ($bol and m/\G\*/cg or m/\G(?<=\P{Word})\*/cg) {
|
||||||
|
return AddHtmlEnvironment('em');
|
||||||
}
|
}
|
||||||
# ~~strikethrough~~ (deleted)
|
# ~~strikethrough~~ (deleted)
|
||||||
elsif (m/\G~~/cg) {
|
elsif (m/\G~~/cg) {
|
||||||
return AddOrCloseHtmlEnvironment('del');
|
return AddOrCloseHtmlEnvironment('del');
|
||||||
}
|
}
|
||||||
# - bullet list
|
# indented lists = nested lists
|
||||||
elsif ($bol and m/\G(\s*\n)*-[ \t]*/cg
|
elsif ($bol and m/\G(\s*\n)*()([*-]|\d+\.)[ \t]*/cg
|
||||||
or InElement('li') and m/\G(\s*\n)+-[ \t]*/cg) {
|
or InElement('li') && m/\G(\s*\n)+( *)([*-]|\d+\.)[ \t]*/cg) {
|
||||||
return CloseHtmlEnvironment('li')
|
my $nesting_goal = int(length($2)/4) + 1;
|
||||||
. OpenHtmlEnvironment('ul',1) . AddHtmlEnvironment('li');
|
my $tag = ($3 eq '*' or $3 eq '-') ? 'ul' : 'ol';
|
||||||
}
|
my $nesting_current = 0;
|
||||||
# 1. numbered list
|
my @nesting = grep(/^[uo]l$/, @HtmlStack);
|
||||||
elsif ($bol and m/\G(\s*\n)*\d+\.[ \t]*/cg
|
my $html = CloseHtmlEnvironmentUntil('li'); # but don't close li element
|
||||||
or InElement('li') and m/\G(\s*\n)+\d+\.[ \t]*/cg) {
|
# warn "\@nesting is (@nesting)\n";
|
||||||
return CloseHtmlEnvironment('li')
|
# warn " goal is $nesting_goal\n";
|
||||||
. OpenHtmlEnvironment('ol',1) . AddHtmlEnvironment('li');
|
# warn " tag is $3 > $tag\n";
|
||||||
|
while (@nesting > $nesting_goal) {
|
||||||
|
$html .= CloseHtmlEnvironment(pop(@nesting));
|
||||||
|
# warn " pop\n";
|
||||||
|
}
|
||||||
|
# if have the correct nesting level, but the wrong type, close it
|
||||||
|
if (@nesting == $nesting_goal
|
||||||
|
and $nesting[$#nesting] ne $tag) {
|
||||||
|
$html .= CloseHtmlEnvironment(pop(@nesting));
|
||||||
|
# warn " switch\n";
|
||||||
|
}
|
||||||
|
# now add a list of the appropriate type
|
||||||
|
if (@nesting < $nesting_goal) {
|
||||||
|
$html .= AddHtmlEnvironment($tag);
|
||||||
|
# warn " add $tag\n";
|
||||||
|
}
|
||||||
|
# and a new list item
|
||||||
|
if (InElement('li')) {
|
||||||
|
$html .= CloseHtmlEnvironmentUntil($nesting[$#nesting]);
|
||||||
|
# warn " close li\n";
|
||||||
|
}
|
||||||
|
$html .= AddHtmlEnvironment('li');
|
||||||
|
# warn " add li\n";
|
||||||
|
return $html;
|
||||||
}
|
}
|
||||||
# beginning of a table
|
# beginning of a table
|
||||||
elsif ($bol and !InElement('table') and m/\G\|/cg) {
|
elsif ($bol and !InElement('table') and m/\G\|/cg) {
|
||||||
@@ -124,11 +166,6 @@ sub MarkdownRule {
|
|||||||
}
|
}
|
||||||
return OpenHtmlEnvironment('pre',1) . $str; # always level 1
|
return OpenHtmlEnvironment('pre',1) . $str; # always level 1
|
||||||
}
|
}
|
||||||
# ``` = code
|
|
||||||
elsif ($bol and m/\G```[ \t]*\n(.*?)\n```[ \t]*(\n|$)/cgs) {
|
|
||||||
return CloseHtmlEnvironments() . $q->pre($1)
|
|
||||||
. AddHtmlEnvironment("p");
|
|
||||||
}
|
|
||||||
# [an example](http://example.com/ "Title")
|
# [an example](http://example.com/ "Title")
|
||||||
elsif (m/\G\[(.+?)\]\($FullUrlPattern(\s+"(.+?)")?\)/cg) {
|
elsif (m/\G\[(.+?)\]\($FullUrlPattern(\s+"(.+?)")?\)/cg) {
|
||||||
my ($text, $url, $title) = ($1, $2, $4);
|
my ($text, $url, $title) = ($1, $2, $4);
|
||||||
@@ -141,3 +178,31 @@ sub MarkdownRule {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
push(@MyRules, \&MarkdownExtraRule);
|
||||||
|
|
||||||
|
sub MarkdownExtraRule {
|
||||||
|
# __italic underline__
|
||||||
|
if (m/\G__/cg) {
|
||||||
|
return AddOrCloseHtmlEnvironment('em', 'style="font-style: normal; text-decoration: underline"');
|
||||||
|
}
|
||||||
|
# _underline_ (closing before adding environment!)
|
||||||
|
elsif (InElement('em', 'style="font-style: normal; text-decoration: underline"') and m/\G_/cg) {
|
||||||
|
return CloseHtmlEnvironment('em');
|
||||||
|
}
|
||||||
|
elsif ($bol and m/\G_/cg or m/\G(?<=\P{Word})_/cg) {
|
||||||
|
return AddHtmlEnvironment('em', 'style="font-style: normal; text-decoration: underline"');
|
||||||
|
}
|
||||||
|
# //italic//
|
||||||
|
elsif (m/\G\/\//cg) {
|
||||||
|
return AddOrCloseHtmlEnvironment('em');
|
||||||
|
}
|
||||||
|
# /italic/ (closing before adding environment!)
|
||||||
|
elsif (InElement('em') and m/\G\//cg) {
|
||||||
|
return CloseHtmlEnvironment('em');
|
||||||
|
}
|
||||||
|
elsif ($bol and m/\G\//cg or m/\G(?<=\P{Word})\//cg) {
|
||||||
|
return AddHtmlEnvironment('em');
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|||||||
73
modules/mermaid.pl
Normal file
73
modules/mermaid.pl
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#! /usr/bin/perl
|
||||||
|
# Copyright (C) 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('mermaid.pl', 'Mermaid for Diagrams');
|
||||||
|
|
||||||
|
our ($bol, @MyRules, $MermaidCss, $MermaidJs, $HtmlHeaders, %Page);
|
||||||
|
|
||||||
|
$MermaidCss = '/mermaid/mermaid.css';
|
||||||
|
$MermaidJs = '/mermaid/mermaid.min.js';
|
||||||
|
|
||||||
|
# When browsing a page containing mermaid markup, load the mermaid Javascript and CSS
|
||||||
|
|
||||||
|
*MermaidOldBrowsePage = *BrowsePage;
|
||||||
|
*BrowsePage = *MermaidNewBrowsePage;
|
||||||
|
|
||||||
|
sub MermaidNewBrowsePage {
|
||||||
|
my ($id) = @_;
|
||||||
|
OpenPage($id);
|
||||||
|
# Uses <mermaid> to render graphs
|
||||||
|
if ($Page{text} =~ /<mermaid>/
|
||||||
|
and $HtmlHeaders !~ /mermaid/) {
|
||||||
|
$HtmlHeaders .= qq{
|
||||||
|
<link type="text/css" rel="stylesheet" href="$MermaidCss" />
|
||||||
|
<script type="text/javascript" src="$MermaidJs"></script>
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return MermaidOldBrowsePage(@_);
|
||||||
|
}
|
||||||
|
|
||||||
|
# When previewing an edit containing mermaid markup, load the mermaid Javascript
|
||||||
|
# and CSS
|
||||||
|
|
||||||
|
*MermaidOldDoEdit = *DoEdit;
|
||||||
|
*DoEdit = *MermaidNewDoEdit;
|
||||||
|
|
||||||
|
sub MermaidNewDoEdit {
|
||||||
|
# Uses <mermaid> to render graphs
|
||||||
|
if (GetParam('text') =~ /<mermaid>/
|
||||||
|
and $HtmlHeaders !~ /mermaid/) {
|
||||||
|
$HtmlHeaders = q{
|
||||||
|
<link rel="stylesheet" href="/mermaid/mermaid.css" />
|
||||||
|
<script type="text/javascript" src="/mermaid/mermaid.min.js"></script>
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return MermaidOldDoEdit(@_);
|
||||||
|
}
|
||||||
|
|
||||||
|
# And a formatting rule, of course.
|
||||||
|
|
||||||
|
push(@MyRules, \&MermaidRule);
|
||||||
|
|
||||||
|
sub MermaidRule {
|
||||||
|
if ($bol && m/\G\<mermaid\>\n(.+?)\n\<\/mermaid\>/cgs) {
|
||||||
|
return CloseHtmlEnvironments()
|
||||||
|
. '<div class="mermaid">' . UrlDecode($1) . '</div>';
|
||||||
|
}
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
@@ -54,10 +54,10 @@ sub BisectAction {
|
|||||||
sub BisectInitialScreen {
|
sub BisectInitialScreen {
|
||||||
print GetFormStart(undef, 'get', 'bisect');
|
print GetFormStart(undef, 'get', 'bisect');
|
||||||
print GetHiddenValue('action', 'bisect');
|
print GetHiddenValue('action', 'bisect');
|
||||||
my @disabledFiles = bsd_glob("$ModuleDir/*.p[ml].disabled");
|
my @disabledFiles = Glob("$ModuleDir/*.p[ml].disabled");
|
||||||
if (@disabledFiles == 0) {
|
if (@disabledFiles == 0) {
|
||||||
print T('Test / Always enabled / Always disabled'), $q->br();
|
print T('Test / Always enabled / Always disabled'), $q->br();
|
||||||
my @files = bsd_glob("$ModuleDir/*.p[ml]");
|
my @files = Glob("$ModuleDir/*.p[ml]");
|
||||||
for (my $i = 0; $i < @files; $i++) {
|
for (my $i = 0; $i < @files; $i++) {
|
||||||
my $moduleName = fileparse($files[$i]);
|
my $moduleName = fileparse($files[$i]);
|
||||||
my @disabled = ($moduleName eq 'module-bisect.pl' ? (-disabled=>'disabled') : ());
|
my @disabled = ($moduleName eq 'module-bisect.pl' ? (-disabled=>'disabled') : ());
|
||||||
@@ -68,7 +68,7 @@ sub BisectInitialScreen {
|
|||||||
}
|
}
|
||||||
print $q->submit(-name=>'bad', -value=>T('Start'));
|
print $q->submit(-name=>'bad', -value=>T('Start'));
|
||||||
} else {
|
} else {
|
||||||
print T('Biscecting proccess is already active.'), $q->br();
|
print T('Bisecting proccess is already active.'), $q->br();
|
||||||
print $q->submit(-name=>'stop', -value=>T('Stop'));
|
print $q->submit(-name=>'stop', -value=>T('Stop'));
|
||||||
}
|
}
|
||||||
print $q->end_form();
|
print $q->end_form();
|
||||||
@@ -78,7 +78,7 @@ sub BisectProcess {
|
|||||||
my ($isGood) = @_;
|
my ($isGood) = @_;
|
||||||
my $parameterHandover = '';
|
my $parameterHandover = '';
|
||||||
BisectEnableAll();
|
BisectEnableAll();
|
||||||
my @files = bsd_glob("$ModuleDir/*.p[ml]");
|
my @files = Glob("$ModuleDir/*.p[ml]");
|
||||||
for (my $i = @files - 1; $i >= 0; $i--) { # handle user choices
|
for (my $i = @files - 1; $i >= 0; $i--) { # handle user choices
|
||||||
if (GetParam("m$i") eq 'on') {
|
if (GetParam("m$i") eq 'on') {
|
||||||
$parameterHandover .= GetHiddenValue("m$i", GetParam("m$i"));
|
$parameterHandover .= GetHiddenValue("m$i", GetParam("m$i"));
|
||||||
@@ -102,7 +102,7 @@ sub BisectProcess {
|
|||||||
print $q->end_form();
|
print $q->end_form();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
print T('Module count (only testable modules): '), $q->strong(scalar @files), $q->br();
|
print T('Module count (only testable modules):'), ' ', $q->strong(scalar @files), $q->br();
|
||||||
print $q->br(), T('Current module statuses:'), $q->br();
|
print $q->br(), T('Current module statuses:'), $q->br();
|
||||||
my $halfsize = ($end - $start + 1) / 2.0; # + 1 because it is count
|
my $halfsize = ($end - $start + 1) / 2.0; # + 1 because it is count
|
||||||
$end -= int($halfsize) unless $isGood;
|
$end -= int($halfsize) unless $isGood;
|
||||||
@@ -131,7 +131,7 @@ sub BisectProcess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub BisectEnableAll {
|
sub BisectEnableAll {
|
||||||
for (bsd_glob("$ModuleDir/*.p[ml].disabled")) { # reenable all modules
|
for (Glob("$ModuleDir/*.p[ml].disabled")) { # reenable all modules
|
||||||
my $oldName = $_;
|
my $oldName = $_;
|
||||||
s/\.disabled$//;
|
s/\.disabled$//;
|
||||||
print Ts('Enabling %s', (fileparse($_))[0]), '...', $q->br() if $_[0];
|
print Ts('Enabling %s', (fileparse($_))[0]), '...', $q->br() if $_[0];
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ sub ModuleUpdaterAction {
|
|||||||
if (GetParam('ok')) {
|
if (GetParam('ok')) {
|
||||||
ModuleUpdaterApply();
|
ModuleUpdaterApply();
|
||||||
} else {
|
} else {
|
||||||
unlink bsd_glob("$TempDir/*.p[ml]"); # XXX is it correct to use $TempDir for such stuff? What if something else puts .pm files there?
|
Unlink(Glob("$TempDir/*.p[ml]")); # XXX is it correct to use $TempDir for such stuff? What if something else puts .pm files there?
|
||||||
for (bsd_glob("$ModuleDir/*.p[ml]")) {
|
for (Glob("$ModuleDir/*.p[ml]")) {
|
||||||
my $curModule = fileparse($_);
|
my $curModule = fileparse($_);
|
||||||
ProcessModule($curModule);
|
ProcessModule($curModule);
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ sub ModuleUpdaterAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub ModuleUpdaterApply {
|
sub ModuleUpdaterApply {
|
||||||
for (bsd_glob("$TempDir/*.p[ml]")) {
|
for (Glob("$TempDir/*.p[ml]")) {
|
||||||
my $moduleName = fileparse($_);
|
my $moduleName = fileparse($_);
|
||||||
if (move($_, "$ModuleDir/$moduleName")) {
|
if (move($_, "$ModuleDir/$moduleName")) {
|
||||||
print $q->strong("Module $moduleName updated successfully!"), $q->br();
|
print $q->strong("Module $moduleName updated successfully!"), $q->br();
|
||||||
@@ -66,7 +66,7 @@ sub ModuleUpdaterApply {
|
|||||||
print $q->strong("Unable to replace module $moduleName: $!"), $q->br();
|
print $q->strong("Unable to replace module $moduleName: $!"), $q->br();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlink bsd_glob("$TempDir/*.p[ml]"); # XXX same as above
|
Unlink(Glob("$TempDir/*.p[ml]")); # XXX same as above
|
||||||
print $q->br(), $q->strong('Done!');
|
print $q->br(), $q->strong('Done!');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,15 +81,14 @@ sub ProcessModule {
|
|||||||
. ' If this is your own module, please contribute it to Oddmuse!'), $q->br();
|
. ' If this is your own module, please contribute it to Oddmuse!'), $q->br();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
open my $fh, ">", "$TempDir/$module" or die("Could not open file. $!");
|
open my $fh, ">:utf8", encode_utf8("$TempDir/$module") or die("Could not open file $TempDir/$module: $!");
|
||||||
utf8::encode($moduleData);
|
|
||||||
print $fh $moduleData;
|
print $fh $moduleData;
|
||||||
close $fh;
|
close $fh;
|
||||||
|
|
||||||
my $diff = DoModuleDiff("$ModuleDir/$module", "$TempDir/$module");
|
my $diff = DoModuleDiff("$ModuleDir/$module", "$TempDir/$module");
|
||||||
if (not $diff) {
|
if (not $diff) {
|
||||||
print $q->strong('This module is up to date, there is no need to update it.'), $q->br();
|
print $q->strong('This module is up to date, there is no need to update it.'), $q->br();
|
||||||
unlink "$TempDir/$module";
|
Unlink("$TempDir/$module");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
print $q->strong('There is a newer version of this module. Here is a diff:'), $q->br();
|
print $q->strong('There is a newer version of this module. Here is a diff:'), $q->br();
|
||||||
@@ -109,7 +108,5 @@ sub ProcessModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub DoModuleDiff {
|
sub DoModuleDiff {
|
||||||
my $diff = `diff -U 3 -- \Q$_[0]\E \Q$_[1]\E`;
|
decode_utf8(`diff -U 3 -- \Q$_[0]\E \Q$_[1]\E`);
|
||||||
utf8::decode($diff); # needs decoding
|
|
||||||
return $diff;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# 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.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
@@ -11,10 +11,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
# 59 Temple Place, Suite 330
|
|
||||||
# Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use v5.10;
|
use v5.10;
|
||||||
|
|||||||
@@ -80,14 +80,28 @@ $NamespaceSlashing = 0; # affects : decoding NamespaceRcLines
|
|||||||
# variables (eg. localnames.pl)
|
# variables (eg. localnames.pl)
|
||||||
unshift(@MyInitVariables, \&NamespacesInitVariables);
|
unshift(@MyInitVariables, \&NamespacesInitVariables);
|
||||||
|
|
||||||
|
sub GetNamespace {
|
||||||
|
my $ns = GetParam('ns', '');
|
||||||
|
if (not $ns and $UsePathInfo) {
|
||||||
|
my $path_info = decode_utf8($q->path_info());
|
||||||
|
# make sure ordinary page names are not matched!
|
||||||
|
if ($path_info =~ m|^/($InterSitePattern)(/.*)?|
|
||||||
|
and ($2 or $q->keywords or NamespaceRequiredByParameter())) {
|
||||||
|
$ns = $1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ReportError(Ts('%s is not a legal name for a namespace', $ns))
|
||||||
|
if $ns and $ns !~ m/^($InterSitePattern)$/;
|
||||||
|
return $ns;
|
||||||
|
}
|
||||||
|
|
||||||
sub NamespacesInitVariables {
|
sub NamespacesInitVariables {
|
||||||
%Namespaces = ();
|
%Namespaces = ();
|
||||||
# Do this before changing the $DataDir and $ScriptName
|
# Do this before changing the $DataDir and $ScriptName
|
||||||
if ($UsePathInfo) {
|
if ($UsePathInfo) {
|
||||||
$Namespaces{$NamespacesMain} = $ScriptName . '/';
|
$Namespaces{$NamespacesMain} = $ScriptName . '/';
|
||||||
foreach my $name (bsd_glob("$DataDir/*")) {
|
foreach my $name (Glob("$DataDir/*")) {
|
||||||
utf8::decode($name);
|
if (IsDir($name)
|
||||||
if (-d $name
|
|
||||||
and $name =~ m|/($InterSitePattern)$|
|
and $name =~ m|/($InterSitePattern)$|
|
||||||
and $name ne $NamespacesMain
|
and $name ne $NamespacesMain
|
||||||
and $name ne $NamespacesSelf) {
|
and $name ne $NamespacesSelf) {
|
||||||
@@ -97,18 +111,7 @@ sub NamespacesInitVariables {
|
|||||||
}
|
}
|
||||||
$NamespaceRoot = $ScriptName; # $ScriptName may be changed below
|
$NamespaceRoot = $ScriptName; # $ScriptName may be changed below
|
||||||
$NamespaceCurrent = '';
|
$NamespaceCurrent = '';
|
||||||
my $ns = GetParam('ns', '');
|
my $ns = GetNamespace();
|
||||||
if (not $ns and $UsePathInfo) {
|
|
||||||
my $path_info = $q->path_info();
|
|
||||||
utf8::decode($path_info);
|
|
||||||
# make sure ordinary page names are not matched!
|
|
||||||
if ($path_info =~ m|^/($InterSitePattern)(/.*)?|
|
|
||||||
and ($2 or $q->keywords or NamespaceRequiredByParameter())) {
|
|
||||||
$ns = $1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ReportError(Ts('%s is not a legal name for a namespace', $ns))
|
|
||||||
if $ns and $ns !~ m/^($InterSitePattern)$/;
|
|
||||||
if ($ns
|
if ($ns
|
||||||
and $ns ne $NamespacesMain
|
and $ns ne $NamespacesMain
|
||||||
and $ns ne $NamespacesSelf) {
|
and $ns ne $NamespacesSelf) {
|
||||||
@@ -137,13 +140,8 @@ sub NamespacesInitVariables {
|
|||||||
$StaticUrl .= UrlEncode($NamespaceCurrent) . '/'
|
$StaticUrl .= UrlEncode($NamespaceCurrent) . '/'
|
||||||
if substr($StaticUrl,-1) eq '/'; # from static-copy.pl
|
if substr($StaticUrl,-1) eq '/'; # from static-copy.pl
|
||||||
$WikiDescription .= "<p>Current namespace: $NamespaceCurrent</p>";
|
$WikiDescription .= "<p>Current namespace: $NamespaceCurrent</p>";
|
||||||
# override LastUpdate
|
$LastUpdate = Modified($IndexFile);
|
||||||
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks)
|
CreateDir($DataDir);
|
||||||
= stat($IndexFile);
|
|
||||||
$LastUpdate = $mtime;
|
|
||||||
CreateDir($DataDir); # Create directory if it doesn't exist
|
|
||||||
ReportError(Ts('Cannot create %s', $DataDir) . ": $!", '500 INTERNAL SERVER ERROR')
|
|
||||||
unless -d $DataDir;
|
|
||||||
}
|
}
|
||||||
$Namespaces{$NamespacesSelf} = $ScriptName . '?';
|
$Namespaces{$NamespacesSelf} = $ScriptName . '?';
|
||||||
# reinitialize
|
# reinitialize
|
||||||
@@ -224,19 +222,19 @@ sub NewNamespaceGetRcLines { # starttime, hash of seen pages to use as a second
|
|||||||
# opening a rcfile, compare the first timestamp with the
|
# opening a rcfile, compare the first timestamp with the
|
||||||
# starttime. If any rcfile exists with no timestamp before the
|
# starttime. If any rcfile exists with no timestamp before the
|
||||||
# starttime, we need to open its rcoldfile.
|
# starttime, we need to open its rcoldfile.
|
||||||
foreach my $file (@rcfiles) {
|
foreach my $rcfile (@rcfiles) {
|
||||||
open(my $F, '<:encoding(UTF-8)', $file);
|
open(my $F, '<:encoding(UTF-8)', encode_utf8($rcfile));
|
||||||
my $line = <$F>;
|
my $line = <$F>;
|
||||||
my ($ts) = split(/$FS/, $line); # the first timestamp in the regular rc file
|
my ($ts) = split(/$FS/, $line); # the first timestamp in the regular rc file
|
||||||
my @new;
|
my @new;
|
||||||
if (not $ts or $ts > $starttime) { # we need to read the old rc file, too
|
if (not $ts or $ts > $starttime) { # we need to read the old rc file, too
|
||||||
push(@new, GetRcLinesFor($rcoldfiles{$file}, $starttime,\%match, \%following));
|
push(@new, GetRcLinesFor($rcoldfiles{$rcfile}, $starttime,\%match, \%following));
|
||||||
}
|
}
|
||||||
push(@new, GetRcLinesFor($file, $starttime, \%match, \%following));
|
push(@new, GetRcLinesFor($rcfile, $starttime, \%match, \%following));
|
||||||
# strip rollbacks in each namespace separately
|
# strip rollbacks in each namespace separately
|
||||||
@new = StripRollbacks(@new);
|
@new = StripRollbacks(@new);
|
||||||
# prepend the namespace to both pagename and author
|
# prepend the namespace to both pagename and author
|
||||||
my $ns = $namespaces{$file};
|
my $ns = $namespaces{$rcfile};
|
||||||
if ($ns) {
|
if ($ns) {
|
||||||
for (my $i = $#new; $i >= 0; $i--) {
|
for (my $i = $#new; $i >= 0; $i--) {
|
||||||
# page id
|
# page id
|
||||||
@@ -407,7 +405,7 @@ $Action{namespaces} = \&DoNamespacesList;
|
|||||||
sub DoNamespacesList {
|
sub DoNamespacesList {
|
||||||
if (GetParam('raw', 0)) {
|
if (GetParam('raw', 0)) {
|
||||||
print GetHttpHeader('text/plain');
|
print GetHttpHeader('text/plain');
|
||||||
print join("\n", keys %Namespaces), "\n";
|
print join("\n", sort keys %Namespaces), "\n";
|
||||||
} else {
|
} else {
|
||||||
print GetHeader('', T('Namespaces')),
|
print GetHeader('', T('Namespaces')),
|
||||||
$q->start_div({-class=>'content namespaces'}),
|
$q->start_div({-class=>'content namespaces'}),
|
||||||
@@ -415,7 +413,7 @@ sub DoNamespacesList {
|
|||||||
GetHiddenValue('id', $HomePage);
|
GetHiddenValue('id', $HomePage);
|
||||||
my $new = $q->textfield('ns') . ' ' . $q->submit('donamespace', T('Go!'));
|
my $new = $q->textfield('ns') . ' ' . $q->submit('donamespace', T('Go!'));
|
||||||
print $q->ul($q->li([map { $q->a({-href => $Namespaces{$_} . $HomePage},
|
print $q->ul($q->li([map { $q->a({-href => $Namespaces{$_} . $HomePage},
|
||||||
$_); } keys %Namespaces]), $q->li($new));
|
$_); } sort keys %Namespaces]), $q->li($new));
|
||||||
print $q->end_form() . $q->end_div();
|
print $q->end_form() . $q->end_div();
|
||||||
PrintFooter();
|
PrintFooter();
|
||||||
}
|
}
|
||||||
@@ -441,8 +439,6 @@ sub NamespacesNewGetId {
|
|||||||
# In this case GetId() will have set the parameter Test to 1.
|
# In this case GetId() will have set the parameter Test to 1.
|
||||||
# http://example.org/cgi-bin/wiki.pl/Test?rollback-1234=foo
|
# http://example.org/cgi-bin/wiki.pl/Test?rollback-1234=foo
|
||||||
# This doesn't set the Test parameter.
|
# This doesn't set the Test parameter.
|
||||||
if ($UsePathInfo and $id eq $NamespaceCurrent and not GetParam($id) and not GetParam('ns')) {
|
return if $id and $UsePathInfo and $id eq $NamespaceCurrent and not GetParam($id) and not GetParam('ns');
|
||||||
$id = undef;
|
|
||||||
}
|
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use v5.10;
|
|||||||
|
|
||||||
AddModuleDescription('near-links.pl', 'Near Links');
|
AddModuleDescription('near-links.pl', 'Near Links');
|
||||||
|
|
||||||
our ($q, %AdminPages, %InterSite, $CommentsPrefix, $DataDir, $UseCache, @MyFooters, @MyMaintenance, @MyInitVariables, @Debugging, $InterSitePattern, @UserGotoBarPages, @IndexOptions);
|
our ($q, $Now, %AdminPages, %InterSite, $CommentsPrefix, $DataDir, $UseCache, @MyFooters, @MyMaintenance, @MyInitVariables, @Debugging, $InterSitePattern, @UserGotoBarPages, @IndexOptions);
|
||||||
|
|
||||||
=head1 Near Links
|
=head1 Near Links
|
||||||
|
|
||||||
@@ -128,7 +128,8 @@ sub NearLinksMaintenance {
|
|||||||
# skip if less than 12h old and caching allowed (the default)
|
# skip if less than 12h old and caching allowed (the default)
|
||||||
foreach my $site (keys %NearSite) {
|
foreach my $site (keys %NearSite) {
|
||||||
next if GetParam('cache', $UseCache) > 0
|
next if GetParam('cache', $UseCache) > 0
|
||||||
and -f "$NearDir/$site" and -M "$NearDir/$site" < 0.5;
|
and IsFile("$NearDir/$site")
|
||||||
|
and $Now - Modified("$NearDir/$site") < 0.5;
|
||||||
print $q->p(Ts('Getting page index file for %s.', $site));
|
print $q->p(Ts('Getting page index file for %s.', $site));
|
||||||
my $data = GetRaw($NearSite{$site});
|
my $data = GetRaw($NearSite{$site});
|
||||||
print $q->p($q->strong(Ts('%s returned no data, or LWP::UserAgent is not available.',
|
print $q->p($q->strong(Ts('%s returned no data, or LWP::UserAgent is not available.',
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user