[pmwiki-users] Using an iframe in the edit page?

Patrick R. Michaud pmichaud at pobox.com
Thu Jul 14 16:46:17 CDT 2005


On Thu, Jul 14, 2005 at 01:11:00AM -0500, Jeremy Sproat wrote:
> I like the preview button on the edit page.  My complaint is that when
> I'm editing a large page with a preview, I find myself constantly
> scrolling up and down, from the textarea to the part in the preview
> document I'm working on, and back again.
> 
> How about putting the preview text in an iframe, so that when the user
> scrolls through it, he or she doesn't need to scroll away from the
> textarea?
> 
> I'm almost certain that this is fairly easy to do in a skin or via the
> $PageEditFmt variable, but not so easy to make Site.EditForm behave
> this way.

Well, it's not "fairly easy" in either approach, although it might 
not be "impossibly difficult" either.  It's similar to the problem 
of trying to display the preview in an external window:  pressing "Preview" 
has to somehow effectively become *two* separate HTTP requests to
PmWiki -- one to return the edit form into the current window/frame
and another to return the preview into a separate window/frame.  The
problem is getting the current text into both requests...

In writing this it occurs to me that the markup text could be preserved 
in a $_SESSION variable somewhere, so that when the call comes to place
the preview in an iframe or external window it simply grabs the
appropriate text out of the session variable.

At any rate, anything that can be done with $PageEditFmt could likely
be made to work somehow with Site.EditForm, so that's not the
stumbling block.

Pm




More information about the pmwiki-users mailing list