Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13614: JHotDrawPlugin should hide the created attachments
Item13613: JHotDrawPlugin no longer works in Foswiki 2.0 because of the changed rest
Updated for release. I name is 2.0
  • Loading branch information
KennethLavrsen committed Aug 11, 2015
1 parent 7374b11 commit 4bdfd3e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions data/System/JHotDrawPlugin.txt
Expand Up @@ -83,6 +83,7 @@ Edit text defined here so you can change it for local languages. Text is shown w
| Version: | %$VERSION% |
| Release: | %$RELEASE% |
| Change History: | |
| 11 Aug 2015 | Foswikitask:Item13613: JHotDrawPlugin is required to enable GET and strikeone to work with Foswiki 2.0 and newer. <br /> Foswikitask:Item13614: JHotDrawPlugin should hide the created attachments <br /> Foswikitask:Item10963: Put parentheses around qw() as it throws a warning on Perl 5.14 |
| 29 Oct 2010 | Foswikitask:Item2614: Fix so the plugin will work with all setting of validation methis, strikeone, embedded, and none.<br /> Foswikitask:Item9917: Fix so plugin can save and exit in Foswiki 1.1.X. This also adds a dependency of !JQueryPlugin and !ZonePlugin for the plugin to be used in old 1.0 installations only. <br /> Foswikitask:Item8387: Plugin now works in other skins than Pattern and Nat. <br /> Foswikitask:Item8558: Added all the graphic files used on plugin topic as attachments in meta. Replaced some small icons by the best version |
| 13 Jan 2010 | Foswikitask:Item2624: Help Foswiki:Extensions.JHotDrawPlugin work correctly under Foswiki:Extensions.NatSkin |
| 11 Jan 2010 | Foswikitask:Item2620 and Foswikitask:Item2614. Documented that upgraders must delete any old templates/jhotdraw.pattern.tmpl file. Documented that because of a bug the plugin only works with 1.0.7 or later and with {Validation}{Method} = 'strikeone'. Provided links to older versions for those not yet at Foswiki 1.0.7. |
Expand Down
25 changes: 20 additions & 5 deletions lib/Foswiki/Plugins/JHotDrawPlugin.pm
Expand Up @@ -29,15 +29,29 @@ use File::Temp ();
use MIME::Base64 ();
use Encode ();

our $VERSION = '$Rev$';
our $RELEASE = '29 Oct 2010';
our $VERSION = '2.0';
our $RELEASE = '11 Aug 2015';
our $SHORTDESCRIPTION = 'Java Applet based drawing editor';

sub initPlugin {
Foswiki::Func::registerTagHandler( 'DRAWING', \&_DRAWING );

Foswiki::Func::registerRESTHandler( 'edit', \&_restEdit );
Foswiki::Func::registerRESTHandler( 'upload', \&_restUpload );
Foswiki::Func::registerRESTHandler(
'edit',
\&_restEdit,
authenticate => 1, # Set to 0 if handler should be useable by WikiGuest
validate => 1, # Set to 0 to disable StrikeOne CSRF protection
http_allow =>
'GET,POST', # Set to 'GET,POST' to allow use HTTP GET and POST
description => 'Edit handler for JHotDrawPlugin'
);
Foswiki::Func::registerRESTHandler(
'upload',
\&_restUpload,
validate => 1, # Set to 0 to disable StrikeOne CSRF protection
http_allow => 'POST', # Set to 'GET,POST' to allow use HTTP GET and POST
description => 'Upload handler for JHotDrawPlugin'
);

return 1;
}
Expand Down Expand Up @@ -278,7 +292,8 @@ sub _restUpload {
"$fileName.$ftype",
{
dontlog => !$Foswiki::cfg{Log}{upload},
comment => "JHotDrawPlugin file",
comment => "!JHotDrawPlugin file",
hide => 1,
filedate => time(),
file => $fn,
}
Expand Down

0 comments on commit 4bdfd3e

Please sign in to comment.