UseModWiki | WikiPatches | RecentChanges | Preferences

Save Button at Bottom of Preview

A small change (the rest of the code is shown for context) to provide a (second) save button at the bottom of the preview along with the UserName?., making it easy to review the preview and save from the bottom, rather than having to scroll back up to the top.
 sub DoEdit {
  print "<hr class=wikilinepreview>\n"; ##TAB
  if ($preview) {
    print "<div class=wikipreview>\n"; ##TAB
    print "<h2 class=wikiheadpreview>", T('Preview:'), "</h2>\n"; ##TAB
    if ($isConflict) {
      print "<b>",
            T('NOTE: This preview shows the revision of the other author.'),
            "</b><hr class=wikilinepreview>\n"; ##TAB
    $MainPage = $id;
    $MainPage =~ s|/.*||;  # Only the main page name (remove subpage)
    print &WikiToHTML($oldText) . "<hr class=wikilinepreview>\n"; ##TAB
    print "<h2 class=wikiheadpreview>", T('Preview only, not yet saved'), "</h2>\n"; ##TAB
### patch save button and user name at bottom of preview follows
    print $q->submit(-name=>'Save', -value=>T('Save')), "\n"; ##TAB Save Button at bottom of preview
    $userName = &GetParam("username", ""); ##TAB
    if ($userName ne "") { ##TAB
      print ' (', T('Your user name is'), ' ', ##TAB
            &GetPageLink($userName) . ') '; ##TAB
    } else { ##TAB
      print ' (', Ts('Visit %s to set your user name.', &GetPrefsLink()), ') '; ##TAB
    } ##TAB
### finish patch
    print "</div>\n"; ##TAB
  print &GetHistoryLink($id, T('View other revisions')) . "<br>\n";
  print &GetGotoBar($id);
  print $q->endform;
  print &GetMinimumFooter();

I like it better above the "Preview only". Additionally, if you use WikiPatches/BetterEditPage change the line
print ' (', Ts('Visit %s to set your user name.', &GetPrefsLink()), ') '; ##TAB
print Ts('Visit %s to set a user name ', &GetPrefsLink()), Ts('or %s with a\n existing one.', &GetLoginLink()); ## Login link provided
-- DavidAndel
I thought about that as well. But then I didn't do it because I think there should be the "This is a minor change" checkbox as well. And if so, it should be synchronised with the upper checkbox. And I didn't have the time to go into that. I would definitely appreciate any solution for this. -- DavidAndel
I didn't think of this idea, because I always make a point of entering the "Summary" and deciding if it is a minor edit before I preview (otherwise I tend to save and then haven't put the summary in). In the interests of keeping it as simple as possible all the fields could be moved to below the preview, I don't favour duplicating (and synchronising) the summary and minor edit checkbox. -- SimonDavis

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 21, 2007 10:44 am by JuanmaMP (diff)