On 3/16/06, Felix Collins <[EMAIL PROTECTED]> wrote:
> Not quite sure how to do this.  When I tried to view the HTML on my
> local machine the submit buttons didn't do anything.  Not quite sure
> what a hidden form element is either.  Do you mean a hidden input field
> in the form?

Yep. To test this, I went to
http://projects.edgewall.com/trac/ticket/1580 (just a random ticket)
and saved the page's source code to my computer. I then edited that
code, adding an <input type="hidden" name="hdfdump" value="" />
element inside the main form body. I also added a <base
href="http://projects.edgewall.com/trac/ticket/1580"; /> so that the
links (and form URLs) would resolve properly even though the file was
on my local machine. I then submitted the form and got back an HDF
dump.

> I suspect that there isn't actually anything already in the HDF that
> tells the template that it is a preview.  So something would have to be
> added in the web_ui.py code.  Can anyone who knows confirm this before I
> give it a crack?

There actually are multiple nodes in the HDF that will tell you that
it's a preview, including the presence of these:

ticket.comment_preview (could be empty if the user hasn't entered a comment)
args.preview (always has the value of the preview button's caption: "Preview")

You can poke around more using the procedure that I described above.

--Bruce
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev

Reply via email to