diff --git a/data/System/DiffPlugin.txt b/data/System/DiffPlugin.txt index 8e2d929..7ae3246 100644 --- a/data/System/DiffPlugin.txt +++ b/data/System/DiffPlugin.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="ProjectContributor" comment="" date="1540454078" format="1.1" version="1"}% +%META:TOPICINFO{author="ProjectContributor" comment="" date="1540458596" format="1.1" version="1"}% ---+!! %TOPIC% %FORMFIELD{"Description"}% @@ -30,7 +30,7 @@ You type: You get: -diff screenshot +diff screenshot ---++ Syntax @@ -112,7 +112,7 @@ scripts with a call to =diff=. ---++ Change History %TABLE{columnwidths="7em" tablewidth="100%"}% -| 25 Oct 2018 | implement a separate DIFFCONTROL macro | +| 25 Oct 2018 | implement a separate DIFFCONTROL macro; separate diff.tmpl and diffview.tmpl | | 11 Jun 2018 | fix changes not displayed under certain conditions | | 09 Jan 2018 | throw an access exception instead of showing an inline error diffing revisions | | 01 Jun 2016 | initial release | @@ -127,4 +127,4 @@ scripts with a call to =diff=. %META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}% %META:FIELD{name="Home" title="Home" value="https://foswiki.org/Extensions/%25$ROOTMODULE%25"}% %META:FIELD{name="Support" title="Support" value="https://foswiki.org/Support/%25$ROOTMODULE%25"}% -%META:FILEATTACHMENT{name="DiffScreenshot.png" attachment="DiffScreenshot.png" attr="" comment="" date="1540454078" size="112670" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="DiffScreenshot.png" attachment="DiffScreenshot.png" attr="" comment="" date="1540458596" size="112670" user="ProjectContributor" version="1"}% diff --git a/lib/Foswiki/Plugins/DiffPlugin.pm b/lib/Foswiki/Plugins/DiffPlugin.pm index f488d37..055624b 100644 --- a/lib/Foswiki/Plugins/DiffPlugin.pm +++ b/lib/Foswiki/Plugins/DiffPlugin.pm @@ -21,7 +21,7 @@ use warnings; use Foswiki::Func (); #use Foswiki::Plugins::DiffPlugin::Core(); # only enable during development of DiffPlugin -our $VERSION = '2.00'; +our $VERSION = '2.01'; our $RELEASE = '25 Oct 2018'; our $SHORTDESCRIPTION = 'Compare difference between topics and revisions'; our $NO_PREFS_IN_TOPIC = 1; diff --git a/lib/Foswiki/Plugins/DiffPlugin/Core.pm b/lib/Foswiki/Plugins/DiffPlugin/Core.pm index 270b6e8..5d72f32 100644 --- a/lib/Foswiki/Plugins/DiffPlugin/Core.pm +++ b/lib/Foswiki/Plugins/DiffPlugin/Core.pm @@ -73,7 +73,7 @@ sub handleDiffScript { Foswiki::UI::checkTopicExists($session, $web, $topic, 'diff'); my $meta = Foswiki::Meta->new($session, $web, $topic); - my $tmpl = Foswiki::Func::readTemplate("diff"); + my $tmpl = Foswiki::Func::readTemplate("diffview"); $tmpl = $meta->expandMacros($tmpl); $tmpl = $meta->renderTML($tmpl); $session->writeCompletePage($tmpl); @@ -203,7 +203,8 @@ sub handleDiffMacro { my $opts = $this->_getOpts($session, $params, $topic, $web); $this->addAssets; - Foswiki::Func::loadTemplate("diff"); + Foswiki::Func::loadTemplate("diff") + unless Foswiki::Func::expandTemplate("diff"); # prevent loading it twice # SMELL: deep error in store #die ("asked for old rev=$opts->{oldRev} but got $oldTestRev") unless $opts->{oldRev} eq $oldTestRev; diff --git a/lib/Foswiki/Plugins/DiffPlugin/MANIFEST b/lib/Foswiki/Plugins/DiffPlugin/MANIFEST index 1593d6e..bb15bf5 100644 --- a/lib/Foswiki/Plugins/DiffPlugin/MANIFEST +++ b/lib/Foswiki/Plugins/DiffPlugin/MANIFEST @@ -21,3 +21,4 @@ pub/System/DiffPlugin/diff.uncompressed.css 0644 pub/System/DiffPlugin/Makefile 0644 templates/diff.pattern.tmpl 0644 templates/diff.tmpl 0644 +templates/diffview.tmpl 0644 diff --git a/pub/System/DiffPlugin/DiffScreenshot.png b/pub/System/DiffPlugin/DiffScreenshot.png index ed5d4b5..a67fa07 100644 Binary files a/pub/System/DiffPlugin/DiffScreenshot.png and b/pub/System/DiffPlugin/DiffScreenshot.png differ diff --git a/templates/diff.tmpl b/templates/diff.tmpl index 21fb850..c57dc8f 100644 --- a/templates/diff.tmpl +++ b/templates/diff.tmpl @@ -1,5 +1,3 @@ -%TMPL:DEF{"content"}%%TMPL:P{"diff"}%%TMPL:END% - %TMPL:DEF{"diff"}%%DIFF{ newrev="%TMPL:P{"newrev"}%" oldrev="%TMPL:P{"oldrev"}%" @@ -30,6 +28,8 @@ %TMPL:DEF{"diff::control::end::disabled::icon"}%start%TMPL:END% %TMPL:DEF{"diff::control::quit::icon"}%quit%TMPL:END% +%TMPL:DEF{"diff::control::quit"}%%TMPL:P{"diff::control::quit::icon"}%%TMPL:END% + %TMPL:DEF{"diff::control::start"}%%IF{"$oldrev>1" then=" %TMPL:P{"diff::control::start::icon"}% diff --git a/templates/diffview.tmpl b/templates/diffview.tmpl new file mode 100644 index 0000000..ac9c46d --- /dev/null +++ b/templates/diffview.tmpl @@ -0,0 +1,2 @@ +%TMPL:INCLUDE{"foswiki"}%%TMPL:INCLUDE{"diff"}%%{}% +%TMPL:DEF{"content"}%%TMPL:P{"diff"}%%TMPL:END%