Joey Hess
7ba65e7f4b
remove deprecated admin prefs
...
A new ikiwiki-transition moveprefs subcommand can pull the old data out of
the userdb and inject it into the setup file.
Note that it leaves the old values behind in the userdb too. I did this
because I didn't want to lose data if it fails writing the setup file for
some reason, and the old data in the userdb will only use a small amount of
space. Running the command multiple times will mostly not change anything.
2008-12-24 16:16:03 -05:00
Joey Hess
c9e65fded1
camelcase: Add camelcase_ignore setting.
2008-12-23 19:11:03 -05:00
Joey Hess
678d467a40
finalise version 3.00 of the plugin api
2008-12-23 16:34:19 -05:00
Joey Hess
14a9e704c1
enable aggregate_internal by default
2008-12-23 16:08:21 -05:00
Simon McVittie
05bb65fc68
recentchanges_link CGI: If the linked page is internal, use its permalink
...
This fixes a bug, that comments appear in recentchanges as broken links.
2008-12-22 23:02:08 +00:00
Joey Hess
79d2d44db2
Merge commit 'smcv/openid'
2008-12-21 13:13:28 -05:00
Simon McVittie
d0d598e429
comments: substitute commentsurl and atomcommentsurl for use in feeds
2008-12-21 17:15:49 +00:00
Simon McVittie
801dc76bf0
openid: in &openiduser, allow subdirectory-style providers to end with '/'
...
This improves the display of OpenIDs like 'http://id.mayfirst.org/jamie/ '
(taking an example from the IkiWiki commit log).
2008-12-21 16:36:22 +00:00
Simon McVittie
e0cd19f30b
openid: in &openiduser, let domain-style providers have arbitrarily many subdomains
...
This leads to better display for OpenIDs like smcv.pseudorandom.co.uk
and thm.id.fedoraproject.org (to take a couple of examples from the
IkiWiki commit history).
2008-12-21 16:36:10 +00:00
Simon McVittie
95b3bbbf7c
comments: run pagetemplate hooks
...
This fixes the bug that comments are always said to be from an anonymous
user at an unknown IP address.
2008-12-21 15:08:14 +00:00
Simon McVittie
bc66a00b90
comments: linkify and preprocess preview with correct 'page' param
2008-12-21 15:07:36 +00:00
Joey Hess
c84fcdd32a
meta: Process meta date during scan pass so that the date will always affect sorting in inlines.
2008-12-21 01:52:08 -05:00
Joey Hess
c53a3a1d3e
avoid storing transient state in pagestate
...
None of the comment state needs to be stored through the a later run of
ikiwiki, so move it all from pagestate to a more transient storage.
This is assuming that we'll never want to add pagespecs to search against
the comment state. Pagespecs like author() are why the meta plugin does
store its meta data in pagestate -- the data can be needed later to match
against.
2008-12-20 20:55:38 -05:00
Simon McVittie
9e889c39ed
comments: Rename COMMENTURL to ADDCOMMENTURL to avoid confusion with COMMENTAUTHORURL
...
Also refactor page.tmpl to use if/else rather than unless/if.
2008-12-20 17:34:55 +00:00
Simon McVittie
8ed94c0a18
comments: pass COMMENTOPENID to templates
2008-12-20 17:34:55 +00:00
Simon McVittie
8a9f4e225f
comments: remove linkuser(), it's been integrated into preprocess() now
2008-12-20 17:34:55 +00:00
Simon McVittie
f4e69ed815
_comment directive: if the user looks like an OpenID, store that
2008-12-20 17:34:54 +00:00
Joey Hess
61f8ea7f1d
avoid uninitialized value
...
This can happen when a new field,
such as the new lasttry, is added.
2008-12-19 17:57:09 -05:00
Joey Hess
301733ba13
fix comment permalink to always point to comment parent page
2008-12-19 17:33:40 -05:00
Joey Hess
4bdeec4961
remove cruft
...
wtf does it do? absolutely nothing
2008-12-19 14:09:39 -05:00
Joey Hess
79a787a466
rename comments_form to editcomment
2008-12-19 14:07:22 -05:00
Joey Hess
ddabb010b2
rename comments_display to comment
2008-12-19 14:03:26 -05:00
Joey Hess
f7fc062a12
replace discussion links on pages with comments link
...
The thinking here is that having both a Discussion page and comments for
the same page is redundant, and certianly not what you want if you enable
comments for a page. At first I considered making configurable via pagespec
what pages got discussion links. But that would mean testing a new pagespec
for every page, and a redundant config setting to keep in sync. So intead,
take a lead from my previous change to make inlined pages have a comments
link, and change the discussion link at the top of regular pages to link to
their comments.
(Implementation is a bit optimised to avoid redundant pagespec checking.)
2008-12-19 13:55:41 -05:00
Joey Hess
7521dd6c75
jump to comment after posting
...
Jumping to the just posted comment was the imputus, but I killed a number
of birds here.
Added a INLINEPAGE template variable, which can be used to add anchors to
any inline template.
To keep that sufficiently general, it is the full page name, so the
comment anchors and links changed form.
Got rid of the FIXMEd hardcoded html anchor div.
More importantly, the anchor is now to the very top of the comment, not the
text below. So you can see the title, and how it attributes you.
Avoid changing the permalink of pages that are not really comments, but
happen to contain the _comment directive. I think that behavior was a bug,
though not a likely one to occur since _comment should only really be used
on comment pages.
2008-12-18 20:58:16 -05:00
Joey Hess
f3bec255e4
aggregate: If a feed fails to be downloaded, try again immediatly next time aggregation is run, even if the usual time has not passed. Closes : #508622 (Michael Gold)
2008-12-17 21:27:28 -05:00
Joey Hess
81165dd2e0
jump to comments anchor after post
...
Not ideal, it would be nicer to jump to the actual comment posted, but no
anchor is available.
2008-12-17 20:29:55 -05:00
Joey Hess
339bfbd44a
typo
2008-12-17 20:22:42 -05:00
Joey Hess
cd7ac8f72a
add Comments link when displaying a page inline
...
This link will supplant the usual Discussion link for pages
that have comments enabled.
2008-12-17 19:38:02 -05:00
Joey Hess
5feffc8b0b
fix test when comments_closed_pagespec is empty
2008-12-17 19:06:29 -05:00
Joey Hess
140c0bacba
change around comments pagespecs
...
I think it is clearer to have one pagespec that controls all pages with
comments, and a separate pagespec that can be used to close new comments on
a subset of those pages.
2008-12-17 18:50:04 -05:00
Joey Hess
9b837fd5ed
fix default values for config settings
...
defaults cannot be set in getsetup, do it in checkconfig to avoid
uninitialized value warnings.
2008-12-17 17:05:49 -05:00
Joey Hess
bb93fccf06
Coding style change: Remove explcit vim folding markers.
2008-12-17 15:22:16 -05:00
Joey Hess
985b229be6
checksessionexpiry: rework
...
This function as factored out was a bit confusing, I think this makes more
sense.
2008-12-17 14:26:08 -05:00
Joey Hess
613a54a3cb
Merge branch 'master' into comments
2008-12-17 14:06:57 -05:00
Joey Hess
f9b87a9f8b
monotone: When getting the log, tell monotone how many entries we want, rather than closing the pipe, which it dislikes. (thm)
2008-12-17 13:59:12 -05:00
Joey Hess
b2366f764b
rename: Fix double-escaping of page name in edit box.
...
titlepage normally escapes, but so does formbuilder.
2008-12-17 13:56:10 -05:00
Joey Hess
15ec55eff5
elide unnecessary variables
2008-12-12 15:38:23 -05:00
Joey Hess
ef972a871b
remove fixme
...
sessioncgi hooks are always called with the wiki locked
2008-12-12 15:25:12 -05:00
Joey Hess
928f6938d2
fix redefinition of $author
2008-12-12 15:22:43 -05:00
Joey Hess
9557c7c890
move related code together
2008-12-12 15:19:01 -05:00
Joey Hess
f3735891ca
whitespace
2008-12-12 15:13:07 -05:00
Joey Hess
18eeb068a6
don't explicitly use inline
...
loadplugin("inline") should take care of that
2008-12-12 15:10:17 -05:00
Joey Hess
2a7849b838
avoid unnecessary variable
2008-12-12 15:08:06 -05:00
Joey Hess
0ced5995d5
get rid of the [postcomment] hack
...
I think that using a flag variable is sorta cleaner.
(This is untested.)
2008-12-12 15:05:26 -05:00
Joey Hess
38c92e63bb
move getsetup to usual place
2008-12-12 14:59:23 -05:00
Simon McVittie
473160c947
htmlbalance: don't compact whitespace, and set misc other options
...
Not compacting whitespace is the most important one: now that we run
sanitize hooks on individual posted comments in the comments plugin,
whitespace that is significant to Markdown (but not HTML) is lost.
(cherry picked from commit cb5aaa3cee
)
2008-12-12 14:23:12 -05:00
Joey Hess
41efa5ac92
Merge branch 'master' into comments
2008-12-12 14:21:08 -05:00
Joey Hess
88e8d4bf8d
meta: Pass info to htmlscrubber so htmlscrubber_skip can take effect.
2008-12-12 14:06:45 -05:00
Simon McVittie
1942fc3bd6
comments: Store dates in GMT and in ISO-8601
...
The [[!_comment]] directive is a serialization format, not something for
presentation to users, so we should use the least ambiguous possible
representation.
2008-12-12 11:02:41 +00:00
Joey Hess
8d3a3c6a1e
simplifiy logic
2008-12-11 17:31:57 -05:00
Simon McVittie
f2d5ead6af
comments: Change internal-use-only directive from [[!comment]] to [[!_comment]]
2008-12-11 21:23:55 +00:00
Simon McVittie
dd1fa13bce
comments: Use new feedfile, emptyfeeds options to inline
2008-12-11 21:19:50 +00:00
Simon McVittie
3560460eb6
comments: don't interpolate IP into anonymous user's "name"
...
If an admin wants the IP in the comment display template they can still
get it (the default template shows it).
2008-12-11 21:14:05 +00:00
Simon McVittie
1698364da0
comments: fix invocation of possibly_foolish_untaint
2008-12-11 21:14:05 +00:00
Simon McVittie
fbf145ca3f
comments: avoid warning if there's no subject
2008-12-11 21:14:05 +00:00
Simon McVittie
a5889912b3
comments: Optionally allow anonymous commenters to set their name/URL.
...
Also provide a way for the comment template to pick up the verified
username/IP.
2008-12-11 21:14:05 +00:00
Simon McVittie
0a69c7ed56
comments: Remove some dead code
2008-12-11 21:14:05 +00:00
Simon McVittie
44a7d77a30
comments: rename main field to "editcontent" consistent with editpage
...
This has the side-effect that Ikiwiki's default style.css gives the text
box 100% width.
2008-12-11 21:14:05 +00:00
Simon McVittie
edb69335f2
comments: instead of hard-coding mdwn, allow any supported page format
2008-12-11 21:14:05 +00:00
Simon McVittie
9af0f04df3
comments: Save comments as a file with one big [[!comment]] directive.
...
This delays all comment formatting until the last possible time, allows
us to set metadata without worrying that commenters may be able to evade
it, and means that changes to how a comment is saved can be handled
gracefully. It also gives us somewhere to put the commenter's username
or IP address for later reference.
2008-12-11 21:14:05 +00:00
Simon McVittie
6a986a8a0b
Remove dead code for preprocessing [[!comments]]
2008-12-11 21:14:05 +00:00
Simon McVittie
1d696aef2c
comments: Duplicate logic and CGI hook from recentchanges to link user pages correctly
2008-12-11 21:14:05 +00:00
Simon McVittie
f88870f102
Qualify name of formattime() correctly
2008-12-11 21:14:04 +00:00
Simon McVittie
80e84e32bf
Delay checking for session expiry til we actually post a comment
2008-12-11 21:14:04 +00:00
Simon McVittie
24bfc3fdc5
comments: record the time at which each comment was posted
2008-12-11 21:14:04 +00:00
Simon McVittie
e66e2c2a7e
comments: Use a checkconfig hook to get the default value of comments_pagename
2008-12-11 21:14:04 +00:00
Simon McVittie
4ff161ba0b
comments: render comments/commenturl in page.tmpl
2008-12-11 21:14:04 +00:00
Simon McVittie
49eabc676a
comments: use global config to decide whether commenting is allowed, and for name of page
...
Also:
* decide comment page name sooner
* set permalink on it
2008-12-11 21:14:04 +00:00
Simon McVittie
a9b0b3da5f
comments: use global configuration for allow_directives, commit, and pagename
2008-12-11 21:14:04 +00:00
Simon McVittie
d35a2bd2de
comments: Add some global configuration
2008-12-11 21:14:04 +00:00
Simon McVittie
4972baac4d
comments: make preprocess a no-op
2008-12-11 21:14:04 +00:00
Simon McVittie
c9bb8b03a4
comments: document what linkuser does
2008-12-11 21:14:03 +00:00
Simon McVittie
404792c618
comments: add a stub pagetemplate hook to show the comments
2008-12-11 21:14:03 +00:00
Simon McVittie
3abfc1d71c
comments: Use HTML entities to escape directives
2008-12-11 21:14:03 +00:00
Simon McVittie
430ac61f21
Embed comments into comments_embed.tmpl rather than concatenating in perl
2008-12-11 21:14:03 +00:00
Simon McVittie
286dbb0541
comments: use CGI module's checksessionexpiry
2008-12-11 21:14:03 +00:00
Simon McVittie
9a6005a212
editpage: factor out checksessionexpiry into IkiWiki::CGI
2008-12-11 21:14:03 +00:00
Simon McVittie
cb5aaa3cee
htmlbalance: don't compact whitespace, and set misc other options
...
Not compacting whitespace is the most important one: now that we run
sanitize hooks on individual posted comments in the comments plugin,
whitespace that is significant to Markdown (but not HTML) is lost.
2008-12-11 21:14:03 +00:00
Simon McVittie
249ea2ed75
comments: remove allowhtml option, just switch it on all the time
...
Now that posts are individually sanitized, that should be safe.
2008-12-11 21:14:03 +00:00
Simon McVittie
4663f364bb
comments: load inline and mdwn lazily
2008-12-11 21:14:03 +00:00
Simon McVittie
9d92fd5eb0
comments: don't rely on mdwn getting loaded first
2008-12-11 21:14:03 +00:00
Simon McVittie
ebe140201e
comments: sanitize the body of each comment before posting it
...
This should ensure that users can't "break out" from the enclosing
<div>, making it impossible to forge comments (assuming htmlscrubber
is enabled, and so is either htmlbalance or htmltidy).
2008-12-11 21:14:03 +00:00
Simon McVittie
57e40b9ce5
Fix typo that led to comments being blanked
2008-12-11 21:14:02 +00:00
Simon McVittie
3d4aa065d6
postcomment: Rename plugin to comments, use *._comment files
...
The PageSpec is still called "postcomment" since that's what it means.
2008-12-11 21:14:02 +00:00
Simon McVittie
3c9ccb406b
Rename smcvpostcomment plugin to postcomment to propose for inclusion
2008-12-11 21:14:02 +00:00
Simon McVittie
b7db3444a5
smcvpostcomment: allow commenting to be closed
2008-12-11 21:14:02 +00:00
Simon McVittie
f49603bf86
smcvpostcomment: import other plugins lazily and remove unnecessary use of CGI
2008-12-11 21:14:02 +00:00
Simon McVittie
442e4e7e12
smcvpostcomment: allow inlining to be disabled, and pass through atom etc. better
2008-12-11 21:14:02 +00:00
Simon McVittie
bb4eb07bdd
smcvpostcomment: make allowhtml etc. configurable, and don't allow commenting on pages where comments have never been allowed
2008-12-11 21:14:02 +00:00
Simon McVittie
d18adfb1ad
smcvpostcomment: indicate in form whether HTML and directives are allowed
2008-12-11 21:14:02 +00:00
Simon McVittie
1bd1b03766
smcvpostcomment: remove HTML if not allowed
2008-12-11 21:14:02 +00:00
Simon McVittie
660a4ef151
smcvpostcomment: always allow wikilinks, and do access control
...
wikilinks are harmless, so we might as well allow them.
Access control for this plugin is a bit odd, since we specifically
don't want to allow comments to be edited - so the check is whether the
user is allowed to edit a deliberately invalid page name,
page/commented/on[smcvpostcomment]. You can put smcvpostcomment(*)
or smcvpostcomment(some/subdir/*) in $config{anonok_pagespec}
or the opposite in $config{locked_pages} to allow "editing" (really
just posting) comments.
2008-12-11 21:14:02 +00:00
Simon McVittie
798dea2033
smcvpostcomment: reduce length of subject field
2008-12-11 21:14:02 +00:00
Simon McVittie
29862a8cc8
smcvpostcomment: explain what $fake is for
2008-12-11 21:14:01 +00:00
Simon McVittie
42b15f7633
smcvpostcomment: avoid warnings if form field 'body' is undef
2008-12-11 21:14:01 +00:00
Simon McVittie
e65c7b73af
smcvpostcomment: load inline plugin more forcibly
2008-12-11 21:14:01 +00:00
Simon McVittie
49835784d8
smcvpostcomment: use better names for special comment files
2008-12-11 21:14:01 +00:00
Simon McVittie
bd8c4674a8
smcvpostcomment: use gettext where appropriate
2008-12-11 21:14:01 +00:00
Simon McVittie
f77f7a02a6
Add initial version of a postcomment plugin (temporarily namespaced as smcvpostcomment)
2008-12-11 21:14:01 +00:00
Joey Hess
b67632cdcd
inline: Support feedfile option to change the filename of the feed generated.
2008-12-11 15:01:26 -05:00