feature description
to provide preview facilities on the edit page
http://koala.ilog.fr/twikiirc/bin/irclogger_log/twiki?date=2004-08-12,Thu&sel=234#l230
implementation
i'm posting the changes i've made to my local installation in the hope that other people may find them useful.
--
WillNorris - 12 Aug 2004
templates
in order to display a preview on the edit page, the following changes need to be made to a skin's edit template:
- add a
%RENDEREDTEXT% variable for the rendered topic text
code changes
Index: UI.pm
===================================================================
RCS file: /home/cvs/cvsroot/projects/owiki/system/lib/Owiki/Attic/UI.pm,v
retrieving revision 1.1.2.6
diff -r1.1.2.6 UI.pm
161a162,166
> my $rawText = $text;
308a314,315
> $tmpl =~ s/%RENDEREDTEXT%/Owiki::getRenderedVersion($rawText)/ge;
>
--
WillNorris - 12 Aug 2004
discussion
Will - I think this is a
very worthwhile feature to work on, so thanks! Just a couple of thoughts on creating an interface to allow quick-switching between edit/preview modes. You might check out
TabInterface for references on using tabs for this. In particular, check out
TextPattern.
Here's
a direct link to an animated screen-shot of it's edit/preview screen showing the switch.
Also, (begin heresy) might you consider use of a frame? This would allow user to resize and scroll edit and/or preview frames for best viewing. (end heresy)
Just my 2¢.
--
LynnwoodBrown - 13 Aug 2004
thanks for the feedback. i do view this as a stopgap measure until inline editting like you describe above is available, but i feel it provides a lot of "bang for the buck".
of course, this was just the first step of actually getting the code working (this was much easier to do, btw, than
EditOnPreviewPage). i haven't worked on better integrating these into skins as i'm holding off until i can dig into
PatternSkin. i'd welcome any offers of templates modifications, though

. frames could work quite well in this circumstance, although it may now be possible to get the desired panes using css these days; i may play around with the template a bit later.
--
WillNorris - 13 Aug 2004
http://koala.ilog.fr/twikiirc/bin/irclogger_log/twiki?date=2004-08-13,Fri&sel=195#l191
i've made some changes to the templates; these changes are to demonstrate capabilities, they are not well thought out skin designs. edit now shows up with just the edit box, but has also toggle button to
switch between the edit textbox and the (p)review of the original topic text.
EditOnPreviewPage demonstrates a different technique where both the preview and the edit box are on the screen at the same time, and the toggle button will turn the edit box on/off. these changes are made with
CSS and a tiny amount of
JavaScript to change class names.
--
WillNorris - 14 Aug 2004
I'm been working on a slightly different approach to this same goal on and off for awhile. You can see a demostration of what I've come up by visiting
http://skyloom.com/bin/view/Demo/SplitScreenEditDemo
.
--
LynnwoodBrown - 24 Jan 2005