web commit by http://jeremie.koenig.myopenid.com/
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 16 Aug 2007 16:26:08 +0000 (16:26 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 16 Aug 2007 16:26:08 +0000 (16:26 +0000)
doc/todo/preview_changes.mdwn

index d04c32314e3632772b47b7856b860302ebc6d0ec..5b77981a61256197048a74c05bc40f133146392b 100644 (file)
@@ -28,59 +28,10 @@ But:
     the following patch. (note that this is not the only template which has
     its submit buttons hardcoded; is this supposed to work around something?)
 
-<pre>
-Index: templates/editpage.tmpl
-===================================================================
---- templates/editpage.tmpl     (rĂ©vision 4130)
-+++ templates/editpage.tmpl     (copie de travail)
-@@ -57,9 +57,7 @@
- Optional comment about this change:<br />
- <TMPL_VAR FIELD-COMMENTS><br />
- </TMPL_IF>
--<input id="_submit" name="_submit" type="submit" value="Save Page" />
--<input id="_submit_2" name="_submit" type="submit" value="Preview" />
--<input id="_submit_3" name="_submit" type="submit" value="Cancel" />
-+<TMPL_VAR FORM-SUBMIT>
- <TMPL_VAR HELPONFORMATTINGLINK>
- <TMPL_VAR FORM-END>
-Index: IkiWiki/CGI.pm
-===================================================================
---- IkiWiki/CGI.pm      (rĂ©vision 4130)
-+++ IkiWiki/CGI.pm      (copie de travail)
-@@ -304,6 +304,7 @@
-        eval q{use CGI::FormBuilder};
-        error($@) if $@;
-        my $form = CGI::FormBuilder->new(
-+               title => "editpage",
-                fields => \@fields,
-                charset => "utf-8",
-                method => 'POST',
-@@ -321,7 +322,8 @@
-        );
-        
-        run_hooks(formbuilder_setup => sub {
--               shift->(form => $form, cgi => $q, session => $session);
-+               shift->(form => $form, cgi => $q, session => $session,
-+                       buttons => \@buttons);
-        });
-        
-        decode_form_utf8($form);
-@@ -402,12 +404,12 @@
-                        preprocess($page, $page,
-                        filter($page, $page, $form->field('editcontent')), 0, 1))));
-        }
--       else {
-+       elsif ($form->submitted eq "Save Page") {
-                $form->tmpl_param("page_preview", "");
-        }
-        $form->tmpl_param("page_conflict", "");
-        
--       if (! $form->submitted || $form->submitted eq "Preview" || 
-+       if ($form->submitted ne "Save Page" || 
-            ! $form->validate) {
-                if ($form->field("do") eq "create") {
-                        my @page_locs;
-</pre>
+I've got a [preliminary implementation](http://www.jk.fr.eu.org/ikiwiki/showdiff.pm),
+which depends on [this patch](http://www.jk.fr.eu.org/ikiwiki/pluggable_editpage_buttons.diff)
+and the [[plugins/contrib/plaintext]] plugin.
+
+There is still some tweaking needed, though.
 
 --[[JeremieKoenig]]
\ No newline at end of file