[pmwiki-users] new edit form, accesskeys, user preferences

Patrick R. Michaud pmichaud at pobox.com
Sat Jul 9 01:32:10 CDT 2005


As mentioned earlier on the list, today I spent some time
redesigning the "Edit Page" code in PmWiki.  You can see
the current status on pmwiki.org.  The big change is that
the layout for editing pages can now be specified in a
wiki page (Site.EditForm) instead of strictly in a PHP
variable.  This may make it easier to customize the edit page,
as well as provide better control over the interactions between
recipes and skins.  There is also now a "Save and edit" button
that saves the page but continues editing, and a "Cancel" button
that returns to viewing the page.

While working on this, I've also implemented "accesskey" keyboard
shortcuts that can be shared among skins and customized on a site-wide,
language, skin, or even per-browser basis.  In other words, the
specific accesskeys associated with an action no longer have to
be hardcoded into a skin template -- they're now looked up from
a table of accesskey settings, so a user's or site's settings can
be automatically and seamlessly shared among many skins.  For
example, pmwiki.org now has the following accesskeys set by 
default (in the 'pmwiki' skin):

    ALT+c       Recent Changes
    ALT+h       Page History
    ALT+e       Edit Page
    ALT+s       Save Page (from edit form)
    ALT+u       Save and keep editing
    ALT+p       Edit Preview
    ALT+b       Strong text (bold)
    ALT+i       Emphasized text (italic)

These are all currently specified at http://www.pmwiki.org/Site/Preferences.

A couple of minor edits to Site.PageTopMenu also automatically enabled
the accesskeys for the top menus of both the Gemini and FixFlow skins.

Of course, someone will point out that the key bindings given
above might not make sense for other languages.  However, the
defaults can be easily overridden in the language-specific XLPage
files -- i.e., when a language translator adjusts the "Edit Page"
link to "Bearbeiten", they can also specify that the access key for
editing a page should instead be ALT+b, and when loaded this 
can override the site default.

But what about people who want their own custom accesskey settings,
either because of browser idiosyncracies or because they're used
to other defaults?  Well, PmWiki now has the beginning of "user 
preferences" (which are really "browser preferences", but we tend
to associate users with browser).  User preferences means that
each individual visitor to a site can specify the accesskey and 
other settings they'd like to use for the browser they're accessing
the site with.

To customize the settings for a given browser, the user simply 
finds or creates a custom copy of a preferences page that has
the desired settings (e.g., a modified version of Site.Preferences),
and then issueses a ?setprefs= parameter to set a cookie
that associates the browser with the custom preferences for 
that browser.  Subsequent accesses to the site will use the settings
on the "setprefs" page in preference to any site, skin, or
language-specific settings from other sources.  (Of course, 
all of this can be completely disabled/overridden by a site 
administrator if they choose to do so.)

So, we now have a nice, relatively seamless way for negotiating 
preference settings such as accesskeys between a site, language
translations, skins, recipe authors, and individual visitors.

The best way to get a feel for what can be done is to take
a quick look at http://www.pmwiki.org/wiki/Site/Preferences,
and perhaps try creating a custom preferences page.

I'll be releasing this new code soon -- I need to do a bit more
testing first, especially to see how these changes may impact existing
sites, recipes, and configurations.  However, I'm encouraged
by the fact that most of the skins on pmwiki.org seem to be
still working properly despite the extent of the changes made.

Pm



More information about the pmwiki-users mailing list