Tags:
create new tag
, view all tags

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:

  1. 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 wink . 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

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2005-01-24 - LynnwoodBrown
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.