Skip to content

Commit

Permalink
Item13619: Implement backwards compat for Foswiki 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Aug 23, 2015
1 parent 8ae4f3f commit abbbcac
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 18 deletions.
37 changes: 23 additions & 14 deletions data/System/RevCommentPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1439692933" format="1.1" version="1.1"}%
%META:TOPICINFO{author="ProjectContributor" date="1440210322" format="1.1" version="1.1"}%
---+!! <nop>%TOPIC%

This plugin allows to enter a short summary of changes made to a topic for a new revision.
Expand Down Expand Up @@ -71,18 +71,27 @@ Plugin settings are stored as preferences variables. To reference a plugin setti
---++ Plugin Installation Instructions
%$INSTALL_INSTRUCTIONS%

Note that this extension now ships with 3 templates, and requires a SKIN
override to incorporate this extension. For a Foswiki 2.0 system, set the
SKIN in %USERSWEB%.SitePreferences. =Set SKIN = revcomment,natedit,pattern=

$ =templates/edit.revcomment.tmpl=: Adds the =revcomment= parameter to the older Foswiki editor (Plain Text and !TinyMCE.)
$ =templates/edittoolbar.revcomment.tmpl=: Adds the =revcomment= parameter to the NatEdit editor.
$ =templates/oopshistory.revcomment.tmpl=: Incorporates the revision comments into the topic history.
* If you are using other skins than the pattern, you will need to fit these
template overrides into your site skin. These templates
add a textfield to the Editor interface:<verbatim>
Note that this extension now ships with 4 templates, and requires a SKIN
override to incorporate this extension. Set the SKIN in %USERSWEB%.SitePreferences.
* For a Foswiki 2.0 system, =Set SKIN = revcomment,natedit,pattern=
* For a Foswiki 1.1 system, =Set SKIN = revcom11,pattern=

* Foswiki 2.0
$ =templates/edit.revcomment.tmpl=: Adds the =revcomment= parameter to the older Foswiki editor (Plain Text and !TinyMCE.)
$ =templates/edittoolbar.revcomment.tmpl=: Adds the =revcomment= parameter to the NatEdit editor.
$ =templates/oopshistory.revcomment.tmpl=: Incorporates the revision comments into the topic history.
$ =templates/search.revcomment.tmpl=: Adds the revision comments to the default search

* Foswiki 1.1.x compatibility
$ =templates/edit.revcom11.tmpl=: Adds the =revcomment= parameter to the older Foswiki editor (Plain Text and !TinyMCE.)
$ =templates/edittoolbar.revcom11.tmpl=: Adds the =revcomment= parameter to the NatEdit editor.
$ =templates/oopshistory.revcom11.tmpl=: Incorporates the revision comments into the topic history.
$ =templates/search.revcom11.tmpl=: Adds the revision comments to the default search

<div class="foswikiHelp"> If you are using other skins than the pattern, you will need to fit these
template overrides into your site skin. These templates add a textfield to the Editor interface:<verbatim>
<input class='foswikiInputField' type='text' style='width:50%' name='revcomment' id='revcomment' />
</verbatim>
</verbatim></div>


* Test if the installation was successful:
Expand Down Expand Up @@ -112,5 +121,5 @@ SKIN in %USERSWEB%.SitePreferences. =Set SKIN = revcomment,natedit,pattern=

__Related Topics:__ %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences, [[%SYSTEMWEB%.Plugins][Plugins]]

%META:FILEATTACHMENT{name="ExampleHistory.png" attachment="ExampleHistory.png" attr="h" comment="" date="1439692933" size="25374" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="ExampleWebChanges.png" attachment="ExampleWebChanges.png" attr="h" comment="" date="1439692933" size="9532" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="ExampleHistory.png" attachment="ExampleHistory.png" attr="h" comment="" date="1440210322" size="25374" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="ExampleWebChanges.png" attachment="ExampleWebChanges.png" attr="h" comment="" date="1440210322" size="9532" user="ProjectContributor" version="1"}%
4 changes: 4 additions & 0 deletions lib/Foswiki/Plugins/RevCommentPlugin/MANIFEST
Expand Up @@ -9,3 +9,7 @@ templates/edit.revcomment.tmpl 0664
templates/edittoolbar.revcomment.tmpl 0664
templates/oopshistory.revcomment.tmpl 0664
templates/search.revcomment.tmpl 0664
templates/edit.revcom11.tmpl 0664
templates/edittoolbar.revcom11.tmpl 0664
templates/oopshistory.revcom11.tmpl 0664
templates/search.revcom11.tmpl 0664
4 changes: 4 additions & 0 deletions templates/edit.revcom11.tmpl
@@ -0,0 +1,4 @@
%TMPL:INCLUDE{"edit"}%
%{ ### Redefines the edit.pattern.tmpl for Foswiki 1.1.x, changing the comment field to revcomment ### }%
%TMPL:DEF{"revCommentPluginOptions"}%%IF{ "context RevCommentPluginEnabled" then="<div class='revComment'><label for='revcomment'>Summary of changes</label> <input class='foswikiInputField' type='text' style='width:50%' name='revcomment' id='revcomment' /> %POPUPWINDOW{"%SYSTEMWEB%.RevComment" label="%MAKETEXT{"help"}%"}%</div>" else=""}%%TMPL:END%
%TMPL:DEF{"topicinfo"}%%TMPL:P{"revCommentPluginOptions"}%%TMPL:P{"saveoptions"}%<div class="patternTopicActions foswikiFormStep"><div class="patternActionButtons">%TMPL:P{"action_buttons"}%<div class="foswikiClear"></div></div></div>%TMPL:END%
1 change: 1 addition & 0 deletions templates/edit.revcomment.tmpl
@@ -1,3 +1,4 @@
%TMPL:INCLUDE{"edit"}%
%{ ### Redefines the edit.pattern.tmpl for Foswiki 2.0, changing the comment field to revcomment ### }%
%TMPL:DEF{"revCommentPluginOptions"}%%IF{ "context RevCommentPluginEnabled" then="<hr /><div class='foswikiFormStep revComment'><label for='revcomment'>Summary of changes</label> <input class='foswikiInputField' type='text' style='width:50%' name='revcomment' id='revcomment' %IF{ "defined revcomment" then="value='%URLPARAM{ "revcomment" }%'" else="" }% /> %POPUPWINDOW{"%SYSTEMWEB%.RevCommentHelp" label="%MAKETEXT{"help"}%"}%</div>" else=""}%%TMPL:END%
%TMPL:DEF{"topicinfo"}%%TMPL:P{context="RevCommentPluginEnabled" then="revCommentPluginOptions"}%<hr /><div class="patternTopicActions foswikiFormStep clear"><div class="patternActionButtons">%TMPL:P{"action_buttons"}%</div></div>%TMPL:P{"forcerevisioncheckbox"}%%TMPL:END%
1 change: 1 addition & 0 deletions templates/edittoolbar.revcom11.tmpl
@@ -0,0 +1 @@
%TMPL:INCLUDE{"edittoolbar.revcomment.tmpl"}%
2 changes: 1 addition & 1 deletion templates/edittoolbar.revcomment.tmpl
@@ -1,5 +1,5 @@
%TMPL:INCLUDE{"edittoolbar"}%
%{ ################################################################################ }%
%{ ### Redefines the edittoolbar.pattern.tmpl for Foswiki 2.0, changing the comment field to revcomment ### }%
%TMPL:DEF{"bottomtopicactions"}%<div class="natEditBottomBar">
%IF{ "context RevCommentPluginEnabled" then="%TMPL:P{"revcomment"}%"}%
<ul>%TMPL:P{"saveorrestorebutton"}%%TMPL:P{"checkpointbutton"}%%TMPL:P{"previewbutton"}%%TMPL:P{"formbutton"}%%TMPL:P{"changeform"}%%TMPL:P{"cancelbutton"}%%TMPL:P{"forcenewrevision"}%</ul>
Expand Down
24 changes: 24 additions & 0 deletions templates/oopshistory.revcom11.tmpl
@@ -0,0 +1,24 @@
%TMPL:INCLUDE{"oopshistory"}%
%{ SMELL: historytable_rcp_disabled defined in oopshistory.tmpl. Foswiki 2.0.2 renames it. }%
%TMPL:DEF{"historytable"}%%TMPL:P{context="RevCommentPluginEnabled" then="historytable_rcp_enabled" else="historytable_rcp_disabled"}%%TMPL:END%
%TMPL:DEF{"historytable_rcp_enabled"}%<table class="foswikiTable historySelectTable" summary="%MAKETEXT{"Topic history"}%">
<tr>
<th colspan="3">%MAKETEXT{"Revision"}%</th>
<th>%MAKETEXT{"Changed on"}%</th>
<th>%MAKETEXT{"Last edited by"}%</th>
<th>%MAKETEXT{"Comment"}%</th>
</tr>
%HISTORY{"<tr><td align="right"><a href=\"%SCRIPTURL{view}%/%WEB%/%TOPIC%?rev=$rev\">$rev</a></td><td style=\"background-color:#fffaf2; text-align:center;\"><input type=\"radio\" name=\"rev2\" value=\"$rev\" style=\"border:none; background-color:#fffaf2;\" /></td><td style=\"background-color:#f2f7fc; text-align:center;\"><input type=\"radio\" name=\"rev1\" value=\"$rev\" style=\"border:none; background-color:#f2f7fc;\" /></td><td style="white-space: nowrap;">$date</td><td>[[$wikiusername][$wikiname]]</td><td><div class="historyRevComment">%REVCOMMENT[$rev]%</div></td></tr>" rev1="%URLPARAM{"rev1"}%" rev2="%URLPARAM{"rev2"}%" nrev="%URLPARAM{"nrev"}%" header="" footer="</table>$n%TMPL:P{"historytable:navigation"}%%TMPL:END%

%TMPL:DEF{"cssFoswikiDiffOptions"}%%TMPL:PREV%%ADDTOZONE{"head" id="cssFoswikiRcpDiffOptions" text="<style type='text/css' media='all'>
.historyRevComment ul {
list-style:none;
padding:0;
margin:0 0 0 1em;
}
.historyRevComment li {
padding:0;
margin:0;
}
</style>"}%%TMPL:END%

3 changes: 1 addition & 2 deletions templates/oopshistory.revcomment.tmpl
@@ -1,6 +1,5 @@
%TMPL:INCLUDE{"oopshistory"}%
%{ SMELL: historytable_rcp_disabled defined in oopshistory.tmp. It really ought to be renamed. }%
%TMPL:DEF{"historytable"}%%TMPL:P{context="RevCommentPluginEnabled" then="historytable_rcp_enabled" else="historytable_rcp_disabled"}%%TMPL:END%
%TMPL:DEF{"historytable"}%%TMPL:P{context="RevCommentPluginEnabled" then="historytable_rcp_enabled" else="historytable"}%%TMPL:END%
%TMPL:DEF{"historytable_rcp_enabled"}%<table class="foswikiTable historySelectTable" summary="%MAKETEXT{"Topic history"}%">
<tr>
<th colspan="3">%MAKETEXT{"Revision"}%</th>
Expand Down
2 changes: 2 additions & 0 deletions templates/search.revcom11.tmpl
@@ -0,0 +1,2 @@
%{ This is the template used when the format prameter is not set in SEARCH. This template adds REVCOMMENT display to the history. }%
%TMPL:INCLUDE{"search.revcomment.tmpl"}%
2 changes: 1 addition & 1 deletion templates/search.revcomment.tmpl
@@ -1,4 +1,4 @@
%{ This is a default template }%%{ this is the template used when the format prameter is not set in SEARCH }%
%{ this is the template used when the format prameter is not set in SEARCH. This template adds REVCOMMENT display to the history. }%
%TMPL:INCLUDE{"searchformat"}%
%{ remove the extra linefeed that is needed when format="" is used }%
%TMPL:DEF{SEARCH:count}%%TMPL:P{SEARCH:count_result}%%TMPL:END%
Expand Down

0 comments on commit abbbcac

Please sign in to comment.