This small patch enables you to edit a page by just double-clicking anywhere on the page, works on all browsers and degrades gracefully.

Locate common.php in your template directory and replace the line:

<body>

with:

<body <?=$GLOBALS["HTTP_GET_VARS"]["action"] == "view" ? " ondblclick=\"location.href='".editURL($GLOBALS["HTTP_GET_VARS"]["page"], $GLOBALS["HTTP_GET_VARS"]["version"])."';\"" : "";?>>

NOTE: The variable scope i'm using might be a bit harsh, feel free to send me any improvements you make.

-- SimenBrekken


Good trick. Personnally, I prefer this implementation in template/common.php (more clear):

<body<?
if ( ($GLOBALS["HTTP_GET_VARS"]["action"] == "view") ||
     (empty($GLOBALS["HTTP_GET_VARS"]["action"])) )
{
 echo " ondblclick=\"location.href='" .
        editURL($GLOBALS["HTTP_GET_VARS"]["page"], $GLOBALS["HTTP_GET_VARS"]["version"]) . "';\"";
}
?>>

because the default value for $action, that is when it is empty, is the value "view".

-- LaurentJacques