When browsing the wiki, users can edit a page simply by double-clicking on it (especially useful for long pages, if you don't want to scroll all the way down). The added value in this patch versus others DoubleClick is its functionality with old revisions. (Note that the user must have JavaScript enabled for the extension to work. If JavaScript is disabled, nothing will happen on a double-click).
# Other global variables: use vars qw( ... + $ClickEdit ); # Default configuration (used if UseConfig is 0) ... @ImageSites = qw(); # Url prefixes of good image sites: ()=all + $ClickEdit = 1; # 1 = edit page by double click on page, 0 = no use sub DoBrowseRequest { } elsif ($action eq 'history') { + $ClickEdit = 0; sub GetHtmlHeader { - my ($title) = @_; + my ($title, $id) = @_; + my $revision = &GetParam('revision', ''); ... $bodyExtra .= qq( BGCOLOR="$BGColor"); } + if ($ClickEdit && &UserCanEdit($id,0)) { + if ($revision) { + $bodyExtra .= qq| ondblclick="location.href='$ScriptName${\(&ScriptLinkChar())}action=edit&id=$id&revision=$revision'" |; + } else { + $bodyExtra .= qq| ondblclick="location.href='$ScriptName${\(&ScriptLinkChar())}action=edit&id=$id'" |; + } + } sub DoOtherRequest { my ($id, $action, $text, $search); + $ClickEdit = 0;
Other Perl-wikis with this feature or related: http://www.oddmuse.org/cgi-bin/wiki/Doubleclick_Extension.
--JuanmaMP