Joey Hess [Tue, 21 Oct 2008 21:57:19 +0000 (17:57 -0400)]
function injection overhaul
Add an inject function, that can be used by plugins that want to replace
one of ikiwiki's functions with their own version. (This is a scary thing
that grubs through the symbol table, and replaces all exported occurances
of a function with the injected version.)
external: RPC functions can be injected to replace exported functions.
Removed the stupid displaytime hook, and use injection instead.
Joey Hess [Mon, 20 Oct 2008 22:17:03 +0000 (18:17 -0400)]
tag: When tagpage is set, force the links created by tagging to point at the toplevel tagpage, and not closer subpages.
The html links already went there, but internally the links were not
recorded as absolute, which could cause confusing backlinks etc.
For example, with tagbase=tags, if blog/tags/bar existed and blog/foo was
tagged bar, it would link to /tags/bar. But, the link would be recorded
simply as a link to tags/bar, and so later blog/tags/bar would appear to
have the backlink.
Joey Hess [Mon, 20 Oct 2008 19:25:45 +0000 (15:25 -0400)]
inline: Only the last feed link was put on the page, fix this to include all feed links. So rss will be included along with atom, and pages with multiple feeds will get links added for all feeds.
Joey Hess [Mon, 20 Oct 2008 01:23:48 +0000 (21:23 -0400)]
Use the pure perl Data::Dumper when generating setup files to ensure that utf-8 characters are written out as such, and not as the encoded perl strings the C Data::Dumper produces.
Note that the text produced by the C version was interpreted fine
when ikiwiki loaded the setup file. But it was not user-friendly.
Joey Hess [Mon, 20 Oct 2008 00:12:37 +0000 (20:12 -0400)]
add displaytime hook
Need to use a hook because an exported function cannot be reliably
overridden. The replacement verstion was actually only affecting plugins
loaded after it.
formattime doesn't need a hook, since there's no reason to export it.
Joey Hess [Sun, 19 Oct 2008 23:25:23 +0000 (19:25 -0400)]
preserve underlay file times
I'd like to preserve the mtime and ctime of files in the underlay if
possible, to avoid ikiwiki thinking they've changed and refreshing them
each time it's upgraded.
But, fall back to the old install command for systems that lack cp -a.
Joey Hess [Sun, 19 Oct 2008 19:45:29 +0000 (15:45 -0400)]
partial support for calling onload once the DOM is ready
This adds support for gecko and newer versions of opera
to call onload once the DOM is ready, rather than waiting for
all images in the page to load. Makes relativedate behave
somewhat better.
Dealing with this means jumping into the browser
incompatability waters that I prefer to avoid.
Full solutions for most of the major browsers are listed here:
http://dean.edwards.name/weblog/2006/06/again/
However, no *license* is listed there, so I can't use that code. Also, the more
involved code appears to have various issues (such as the inline IE code not
working via https). So I only added the simple call to a hook needed
for gecko/opera.
It seems that the only standards-compliant way to do this is using the
`defer` attribute to a `script` tag, using an external script that will be
loaded once the DOM is ready, and can call onload. However, that has
browser compatability issues of its own, since not all browsers honor
`defer`.
Perhaps I should really just be using one of the javascript frameworks, that
include code to solve this for the major browsers. But something about them
still puts me off, and this issue is minor enough that I'm willing to live
with incomplete support for now.
Joey Hess [Sat, 18 Oct 2008 00:28:18 +0000 (20:28 -0400)]
Add an underlay for javascript, and add ikiwiki.js containing some utility code.
* Add an underlay for javascript, and add ikiwiki.js containing some utility
code.
* toggle: Stop embedding the full toggle code on each page using it, and
move it to toggle.js in the javascript underlay.