Version 7 of Wikit web Cancel button

Updated 2003-09-26 15:47:17

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

Patch (web.tcl)


 239c239,243
 <       SavePage $N $C $host $name
 ---
 >       cgi_import_as Action editAction
 >       # Only actually save the page if the user selected "Save"
 >       if {$editAction == "Save"} {
 >           SavePage $N $C $host $name
 >       }
 351c355,358
 <             submit_button "=  Save  "
 ---
 >             # Create Save and Cancel buttons
 >             submit_button "Action=Save"
 >             cgi_puts " [nbspace] "
 >             submit_button "Action=Cancel"

26 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: This is a very simplistic function at the moment. If you rename a page to an existing page name, the more recently created page will become inaccessible. Improved patch to be provided (modify SavePage to not create a duplicate name).


 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"

Category Wikit