Changeset 9801


Ignore:
Timestamp:
10/29/10 22:52:41 (19 months ago)
Author:
KennethLavrsen
Message:

Item2614: Fix so the plugin will work with all setting of validation methis, strikeone, embedded, and none.
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.
Item8387: Plugin now works in other skins than Pattern and Nat.
Item8558: Added all the graphic files used on plugin topic as attachments in meta. Replaced some small icons by the best version
Thanks to Arthur Clemens for the already checked in fix for the 1.1 save.

Location:
trunk/JHotDrawPlugin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JHotDrawPlugin/data/System/JHotDrawPlugin.txt

    r6027 r9801  
    1 %META:TOPICINFO{author="ProjectContributor" date="1144799477" format="1.1" version="1.1"}% 
     1%META:TOPICINFO{author="ProjectContributor" date="1288389452" format="1.1" version="1"}% 
    22---+!! <nop>%TOPIC% 
    33 
     
    2121 
    2222The tools on the left create or manipulate figures. 
    23 | <img src="%ATTACHURLPATH%/SEL1.gif" width="24" height="24" alt="Selection"> | selects, moves or resizes a figure; the shift-key toggles the selection. Dragging the selection tool in the background selects the figures within the dragged rectangle. | 
    24 | <img src="%ATTACHURLPATH%/TEXT1.gif" width="24" height="24" alt="Text"> | creates a new or edits an existing text figure | 
    25 | <img src="%ATTACHURLPATH%/ATEXT1.gif" width="24" height="24" alt="Connected Text"> | creates a new text figure and attaches it to the clicked figure. Once a text figure is attached it remains connected to the figure. | 
    26 | <img src="%ATTACHURLPATH%/RECT1.gif" width="24" height="24" alt="Rectangle"> | creates a rectangle figure | 
    27 | <img src="%ATTACHURLPATH%/RRECT1.gif" width="24" height="24" alt="Round Rectangle"> | creates a round rectangle figure | 
    28 | <img src="%ATTACHURLPATH%/ELLIPSE1.gif" width="24" height="24" alt="Ellipse"> | creates an ellipse figure | 
    29 | <img src="%ATTACHURLPATH%/LINE1.gif" width="24" height="24" alt="Line"> | creates a line figure | 
    30 | <img src="%ATTACHURLPATH%/CONN1.gif" width="24" height="24" alt="Connection Line"> | creates or adjusts connections between figures. A connection is split into segments by dragging a point on the connection. To join two segments click the end point of a segment | 
    31 | <img src="%ATTACHURLPATH%/OCONN1.gif" width="24" height="24" alt="Elbow Connection Line"> | creates an elbow connection and offers the same features as the ordinary connection tool | 
    32 | <img src="%ATTACHURLPATH%/SCRIBBL1.gif" width="24" height="24" alt="Scribble"> | creates a scribble figure; dragging the mouse creates a smooth line while successive clicks yields a polyline figure. A two-button click terminates the figure. | 
    33 | <img src="%ATTACHURLPATH%/POLYGON1.gif" width="24" height="24" alt="Polygon"> | creates a polygon figure; dragging the mouse creates a smooth border while successive clicks yields a polyline border. A two-button click or the ESCAPE key terminates the figure. | 
    34 | <img src="%ATTACHURLPATH%/BORDDEC1.gif" width="24" height="24" alt="Border"> | decorates the clicked figure with a border | 
    35 | <img src="%ATTACHURLPATH%/URL1.gif" width="24" height="24" alt="URL"> | adds a sensitive area to the figure that will redirect to a URL. If an image contains any sensitive areas it can only be selected for edit by clicking on the boundary or (if enabled) the attached Edit button. You can use wikiwords and web.topic wiki link expressions as well as full URLs. | 
     23| <img src="%ATTACHURLPATH%/SEL3.gif" width="24" height="24" alt="Selection"> | selects, moves or resizes a figure; the shift-key toggles the selection. Dragging the selection tool in the background selects the figures within the dragged rectangle. | 
     24| <img src="%ATTACHURLPATH%/TEXT3.gif" width="24" height="24" alt="Text"> | creates a new or edits an existing text figure | 
     25| <img src="%ATTACHURLPATH%/ATEXT3.gif" width="24" height="24" alt="Connected Text"> | creates a new text figure and attaches it to the clicked figure. Once a text figure is attached it remains connected to the figure. | 
     26| <img src="%ATTACHURLPATH%/RECT3.gif" width="24" height="24" alt="Rectangle"> | creates a rectangle figure | 
     27| <img src="%ATTACHURLPATH%/RRECT3.gif" width="24" height="24" alt="Round Rectangle"> | creates a round rectangle figure | 
     28| <img src="%ATTACHURLPATH%/ELLIPSE3.gif" width="24" height="24" alt="Ellipse"> | creates an ellipse figure | 
     29| <img src="%ATTACHURLPATH%/LINE3.gif" width="24" height="24" alt="Line"> | creates a line figure | 
     30| <img src="%ATTACHURLPATH%/CONN2.gif" width="24" height="24" alt="Connection Line"> | creates or adjusts connections between figures. A connection is split into segments by dragging a point on the connection. To join two segments click the end point of a segment | 
     31| <img src="%ATTACHURLPATH%/OCONN3.gif" width="24" height="24" alt="Elbow Connection Line"> | creates an elbow connection and offers the same features as the ordinary connection tool | 
     32| <img src="%ATTACHURLPATH%/SCRIBBL2.gif" width="24" height="24" alt="Scribble"> | creates a scribble figure; dragging the mouse creates a smooth line while successive clicks yields a polyline figure. A two-button click terminates the figure. | 
     33| <img src="%ATTACHURLPATH%/POLYGON3.gif" width="24" height="24" alt="Polygon"> | creates a polygon figure; dragging the mouse creates a smooth border while successive clicks yields a polyline border. A two-button click or the ESCAPE key terminates the figure. | 
     34| <img src="%ATTACHURLPATH%/BORDDEC3.gif" width="24" height="24" alt="Border"> | decorates the clicked figure with a border | 
     35| <img src="%ATTACHURLPATH%/URL3.gif" width="24" height="24" alt="URL"> | adds a sensitive area to the figure that will redirect to a URL. If an image contains any sensitive areas it can only be selected for edit by clicking on the boundary or (if enabled) the attached Edit button. You can use wikiwords and web.topic wiki link expressions as well as full URLs. | 
    3636 
    3737---+++ Handles 
     
    7373   %DRAWING{example}% 
    7474    
    75 ---+++ Known Problems 
    76  
    77    * %X% Versions since 13 Oct 2009 will only work with Foswiki 1.0.7 or later and only with Foswiki having {Validation}{Method} set to the high security setting of 'strikeone' in configure (recommended anyway). Look out for updates of the plugin as this will naturally be fixed in future versions. If you run Foswiki 1.0.6 or older please download the 16 Jun 2009 version of the plugin (which you can download as [[http://foswiki.org/bin/viewfile/Extensions/JHotDrawPlugin?filename=JHotDrawPlugin.zip;rev=6][old zip]] or [[http://foswiki.org/bin/viewfile/Extensions/JHotDrawPlugin?filename=JHotDrawPlugin.tgz;rev=6][old tgz]]) 
    78  
    7975   * If you add a map to a drawing by setting a URL on any of the figures a map file is created. If you subsequently remove all the URLs from figures in the drawing the map still exists, but is now empty. There is no way to remove the map other than by manually moving the attachment. 
    8076 
     
    8884|  Release: | %$RELEASE% | 
    8985|  Change History: | | 
     86|  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 | 
    9087|  13 Jan 2010 | Foswikitask:Item2624: Help Foswiki:Extensions.JHotDrawPlugin work correctly under Foswiki:Extensions.NatSkin | 
    9188|  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. | 
     
    121118|  01 Oct 2001 | Updated this text | 
    122119|  23 Sep 2001 | Initial version | 
    123 |  2000 | Peter Thoeny created <nop>TWikiDraw based on JHotDraw (<nop>TWikiDraw applet that allows you to save a drawing as a =.draw= and a =.gif= file. New =%<nop>DRAWING%= variable to insert a drawing into any TWiki topic. New =oopstwikidraw.tmpl= template that contains the <nop>TWikiDraw applet. | 
    124 |  Dependencies: | Java 1.1 enabled browser<br />%$DEPENDENCIES% | 
    125 Plugin Home: | http://foswiki.org/Extensions/%TOPIC% | 
    126 Feedback: | http://foswiki.org/Extensions/%TOPIC%Dev | 
     120|  2000 | Peter Thoeny created <nop>TWikiDraw based on !JHotDraw (<nop>TWikiDraw applet that allows you to save a drawing as a =.draw= and a =.gif= file. New =%<nop>DRAWING%= variable to insert a drawing into any TWiki topic. New =oopstwikidraw.tmpl= template that contains the <nop>TWikiDraw applet. | 
     121|  Dependencies: | Java enabled browser<br />%$DEPENDENCIES% | 
     122Home: | http://foswiki.org/Extensions/%TOPIC% | 
     123Support: | http://foswiki.org/Support/%TOPIC% |  
    127124 
    128125   * JHotDraw is Copyright 1996, 1997 by <a href="http://www.ifa.ch/">IFA Informatik</a> and Erich Gamma, erich_gamma@acm.org . _It is hereby granted that this software can be used, copied, modified, and distributed without fee provided that this copyright notice appears in all copies._ 
     
    132129   * Copyright &copy; 2001 Motorola. All Rights Reserved. 
    133130   * Copyright &copy; 2003-2008 Crawford Currie http://www.c-dot.co.uk 
    134    * Foswiki version: &copy; 2008 Foswiki Contributors 
     131   * Foswiki version: &copy; 2008-2010 Foswiki Contributors 
    135132 
    136  
     133%META:FILEATTACHMENT{name="screenshot.png" attachment="screenshot.png" attr="h" comment="" date="1288389452" path="screenshot.png" size="9794" user="ProjectContributor" version="1"}% 
     134%META:FILEATTACHMENT{name="example.draw" attachment="example.draw" attr="h" comment="" date="1288389452" path="example.draw" size="29114" user="ProjectContributor" version="1"}% 
     135%META:FILEATTACHMENT{name="ATEXT3.gif" attachment="ATEXT3.gif" attr="h" comment="" date="1288389452" path="ATEXT3.gif" size="191" user="ProjectContributor" version="1"}% 
     136%META:FILEATTACHMENT{name="BORDDEC3.gif" attachment="BORDDEC3.gif" attr="h" comment="" date="1288389452" path="BORDDEC3.gif" size="186" user="ProjectContributor" version="1"}% 
     137%META:FILEATTACHMENT{name="CONN2.gif" attachment="CONN2.gif" attr="h" comment="" date="1288389452" path="CONN2.gif" size="161" user="ProjectContributor" version="1"}% 
     138%META:FILEATTACHMENT{name="ELLIPSE3.gif" attachment="ELLIPSE3.gif" attr="h" comment="" date="1288389452" path="ELLIPSE3.gif" size="202" user="ProjectContributor" version="1"}% 
     139%META:FILEATTACHMENT{name="example.gif" attachment="example.gif" attr="h" comment="" date="1288389452" path="example.gif" size="9910" user="ProjectContributor" version="1"}% 
     140%META:FILEATTACHMENT{name="LINE3.gif" attachment="LINE3.gif" attr="h" comment="" date="1288389452" path="LINE3.gif" size="164" user="ProjectContributor" version="1"}% 
     141%META:FILEATTACHMENT{name="OCONN3.gif" attachment="OCONN3.gif" attr="h" comment="" date="1288389452" path="OCONN3.gif" size="170" user="ProjectContributor" version="1"}% 
     142%META:FILEATTACHMENT{name="POLYGON3.gif" attachment="POLYGON3.gif" attr="h" comment="" date="1288389452" path="POLYGON3.gif" size="189" user="ProjectContributor" version="1"}% 
     143%META:FILEATTACHMENT{name="RECT3.gif" attachment="RECT3.gif" attr="h" comment="" date="1288389452" path="RECT3.gif" size="190" user="ProjectContributor" version="1"}% 
     144%META:FILEATTACHMENT{name="RRECT3.gif" attachment="RRECT3.gif" attr="h" comment="" date="1288389452" path="RRECT3.gif" size="190" user="ProjectContributor" version="1"}% 
     145%META:FILEATTACHMENT{name="SCRIBBL2.gif" attachment="SCRIBBL2.gif" attr="h" comment="" date="1288389452" path="SCRIBBL2.gif" size="169" user="ProjectContributor" version="1"}% 
     146%META:FILEATTACHMENT{name="SEL3.gif" attachment="SEL3.gif" attr="h" comment="" date="1288389452" path="SEL3.gif" size="192" user="ProjectContributor" version="1"}% 
     147%META:FILEATTACHMENT{name="TEXT3.gif" attachment="TEXT3.gif" attr="h" comment="" date="1288389452" path="TEXT3.gif" size="186" user="ProjectContributor" version="1"}% 
     148%META:FILEATTACHMENT{name="URL3.gif" attachment="URL3.gif" attr="h" comment="" date="1288389452" path="URL3.gif" size="230" user="ProjectContributor" version="1"}% 
     149%META:FILEATTACHMENT{name="example.map" attachment="example.map" attr="h" comment="" date="1288389452" path="example.map" size="3732" user="ProjectContributor" version="1"}% 
  • trunk/JHotDrawPlugin/lib/Foswiki/Plugins/JHotDrawPlugin.pm

    r9797 r9801  
    3131 
    3232our $VERSION = '$Rev$'; 
    33 our $RELEASE = '13 Jan 2010'; 
     33our $RELEASE = '29 Oct 2010'; 
    3434our $SHORTDESCRIPTION = 'Java Applet based drawing editor'; 
    3535 
     
    220220    my $query = Foswiki::Func::getCgiQuery(); 
    221221 
    222     require Foswiki::Validation; 
    223     my $nonce = $query->param('validation_key'); 
    224     if ( !defined($nonce) 
    225         || !Foswiki::Validation::isValidNonce( $session->getCGISession(), 
    226             $nonce ) ) 
    227     { 
    228         returnRESTResult( $response, 403, "Invalid validation key" ); 
    229         return; 
    230     } 
     222    if ( $Foswiki::cfg{Validation}{Method} eq 'strikeone' ) { 
     223        require Foswiki::Validation; 
     224        my $nonce = $query->param('validation_key'); 
     225        if ( !defined($nonce) 
     226            || !Foswiki::Validation::isValidNonce( $session->getCGISession(), 
     227                $nonce ) ) 
     228        { 
     229            returnRESTResult( $response, 403, "Invalid validation key" ); 
     230            return; 
     231        } 
     232    } 
     233     
    231234    my ($web, $topic) = _getTopic( @_ ); 
    232235 
  • trunk/JHotDrawPlugin/pub/System/JHotDrawPlugin/jhotdraw_src.js

    r9797 r9801  
    4242                  + drawing); 
    4343 
    44         try { 
    45             foswikiStrikeOne(document.saveform); 
    46             form.push( 
    47                 'Content-Disposition: form-data; name="validation_key"\r\n\r\n' 
    48                 + document.saveform.validation_key.value); 
    49         } catch (e) { 
    50             alert(e); 
     44        if (typeof(foswikiStrikeOne) === "function") { 
     45            try { 
     46                foswikiStrikeOne(document.saveform); 
     47                form.push( 
     48                    'Content-Disposition: form-data; name="validation_key"\r\n\r\n' 
     49                    + document.saveform.validation_key.value); 
     50            } catch (e) { 
     51                alert(e); 
     52            } 
    5153        } 
    5254 
Note: See TracChangeset for help on using the changeset viewer.