intrigeri [Mon, 26 Jan 2009 21:54:40 +0000 (22:54 +0100)]
po(formbuilder): stop hunting down non-existent cases
After some thinking about it, I can't find why the type of a page being created
in the CGI could be restricted to po. So the previous case seems enough.
Joey Hess [Mon, 26 Jan 2009 18:51:31 +0000 (13:51 -0500)]
remove unnecessary returns
check_canremove/canrename is called only for its side effect (of failing if
removal is not allowed), its return value is never used and returning
something makes that unclear
Joey Hess [Mon, 26 Jan 2009 18:35:50 +0000 (13:35 -0500)]
remove redundant use
use is file-scoped so warnings and strict are already enabled
inside the second package, and IkiWiki is already loaded
(though not imported into this context)
Joey Hess [Mon, 26 Jan 2009 04:13:14 +0000 (23:13 -0500)]
git: Fix malformed utf8 recieved from git.
If git log outputs malformed utf8 in, eg, usernames, detect it and fix it
up. This avoids commits such as f71abc92aa279fbe0b7578b8c4752d775dd4a259
breaking things.
Joey Hess [Mon, 26 Jan 2009 03:30:28 +0000 (22:30 -0500)]
format moderation queue only at end, avoid O(N^3) bug
It was calling format hooks for each comment on the page.
When relativedate is enabled, that made it insert <script> tags
for each comment. And the browser loaded the same script over and over,
which was slow on its own. But that was nothing compared to running
the onload even over and over.. especially since the hook system
added a new call to the hook each time it loaded.
For a page with 10 comments, that caused the relativedate DOM parsing
code to run 1000 times, I think. Anyway, it was sloow. Now it runs once.
Gabriel McManus [Mon, 7 Jul 2008 11:33:01 +0000 (21:33 +1000)]
img: only provide alt text if it was specified
if suitable alternate text is unknown, then it should not be given.
empty alt text is suitable mainly for purely decorative images.
(cherry picked from commit 3cd7f67f0cf894f4fd5ba16f68e82e4f7bdbfdc5)
Joey Hess [Tue, 20 Jan 2009 21:30:59 +0000 (16:30 -0500)]
add human-readable error when unknown pagespec function is called
It used to replace unknown functions with "0" when translating a pagespec.
Instead, replace it with a FailReason object. This way, the pagespec will
still evaluate as before (possibly successfully if other terminals exist),
but a human-readable error will be shown if the result is displayed.
Also, an empty pagespec used to be replaced with "0", to avoid a eval
error. Also use a FailReason here.
intrigeri [Mon, 19 Jan 2009 18:44:39 +0000 (19:44 +0100)]
make checkcontent compatible with hooks that need the full content
Always pass the full (modified) content in `content` named parameter. When the
user edits an existing wiki page, also pass a `diff` named parameter, which
includes only the lines that they added to the page, or modified.
Joey Hess [Sun, 18 Jan 2009 19:52:49 +0000 (14:52 -0500)]
Avoid feeding decoded unicode to Term::ReadLine
That resulted in double encoded display when using perl's stub
readline module. Apparently that module unconditionally upgrades
text to utf8, in a quite braindead way.
Joey Hess [Sat, 17 Jan 2009 18:39:53 +0000 (13:39 -0500)]
use short names in comittype
Use mtn for monontone and hg for mercurial. The long names cause ugly
formatting in recentchanges, which has CSS that only allows a few
characters for the commit type column.