Wikit web Cancel button

This page describes a modification to Wiki to add a Cancel button to the web editing page.

The patch is against Wikit version: 2003/08/20 19:06:22 68261-69214.

A wikit.kit containing this and other patches is available for download, please see AKG Wikit and AKG.

Note that this patch doesn't handle the "Page Saved" message very well (it says saved when editing is cancelled). This is fixed in AKG Wikit.


May 2004 - cancel patch is in wikit now, code removed -jcw


30 Sep 2003 AKG

Extend the patch to allow the page to be renamed. As with the Tk interface, all references are automatically renamed. This patch superseeds the one above.

Warning: The patch as presented below is simplistic. If you rename a page to an existing page name, the more recently created page will become inaccessible. I've improved the behaviour, by not saving the change in page name if there is a conflict, in the wikit.kit that is available for download from AKG. Even better behaviour would be to warn the user that there is a name conflict (but that is a much larger job :-)).


 Index: web.tcl
 238a239,244
 >         cgi_import_as Action editAction
 >         # Only actually save the page if the user selected "Save"
 >         if {$editAction == "Save" && ![catch {import T}]} {
 >             set T1 [string trim $T]
 >             if {$T1 != ""} {
 >                 set name $T1
 239a246,247
 >             }
 >         }
 347a356,357
 >               cgi_puts "Title: "
 >               text T=$name style=width:70%
 351c361,364
 <               submit_button "=  Save  "
 ---
 >               # Create Save and Cancel buttons
 >               submit_button "Action=Save"
 >               cgi_puts " [nbspace] "
 >               submit_button "Action=Cancel"