diff --git a/lib/WebGUI/Asset/File/Image.pm b/lib/WebGUI/Asset/File/Image.pm index bf3e9bfd7..180eae2ba 100644 --- a/lib/WebGUI/Asset/File/Image.pm +++ b/lib/WebGUI/Asset/File/Image.pm @@ -319,6 +319,13 @@ sub www_undo { } #------------------------------------------------------------------- + +# +# All of the images will have to change to support annotate. +# The revision system doesn't support the blobs, it seems. +# All of the image operations will have to be updated to support annotations. +# + sub www_annotate { my $self = shift; return $self->session->privilege->insufficient() unless $self->canEdit; @@ -339,126 +346,60 @@ sub www_annotate { my ($style, $url) = $self->session->quick(qw(style url)); # http://www.kryogenix.org/code/browser/annimg/annimg.html (creative commons) - $style->setLink($url->extras('annotate/imageMap.css'), {rel=>'stylesheet', type=>'text/css'}); + # $style->setLink($url->extras('annotate/imageMap.css'), {rel=>'stylesheet', type=>'text/css'}); my $imageAsset = $self->session->db->getRow("ImageAsset","assetId",$self->getId); - warn($imageAsset->{annotations}); + warn("annotations: " . $self->{annotations}); my @pieces = split(/\n/, $imageAsset->{annotations}); # my ($top_left, $width_height, $note) = split(/\n/, $imageAsset->{annotations}); - my $imageLoc = $self->getStorageLocation->getUrl($self->get("filename")); - my $image = '
'.$self->get(
'; + my $image = '
'.$self->get(
'; my ($width, $height) = $self->getStorageLocation->getSize($self->get("filename")); - my $hotspots = ""; - my $notes = ""; my @checkboxes = (); my $i18n = WebGUI::International->new($self->session,"Asset_Image"); my $f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl); - my $mouseCoord_js = qq( - - ); - - my $crop_js = qq( - - ); + my $hotspots = ''; + my $domMe = ''; for (my $i = 0; $i < $#pieces; $i += 3) { my $top_left = $pieces[$i]; my $width_height = $pieces[$i + 1]; my $note = $pieces[$i + 2]; - $hotspots .= qq( - dd#Def_${i} { $top_left } - dd#Def_$i a{ position: absolute; $width_height; text-decoration: none; border: 1px solid #FFFCE6; background: transparent url(/www/extras/annotate/note.png) repeat; } - dd#Def_$i a span{ display: none; } - dd#Def_$i a:hover{ background: transparent url(/www/extras/annotate/hover.png) repeat; border: 1px solid #BCBCBC; } - dd#Def_$i a:hover span{ - display: block; - text-indent: 0; - vertical-align: top; - color: #000; - background-color: #F4F4F4; - font-weight: bold; - position: absolute; - border: 1px solid #BCBCBC; - bottom: 100%; - margin: 0; - padding: 5px; - width: 75%; - } - ); + $hotspots .= qq( + + + ); + + $domMe .= qq( + + ); - $notes .= qq( -
$note
- ); push(@checkboxes, $f->checkbox( -label=>$i18n->get('delete') . " '$note'", @@ -471,55 +412,16 @@ sub www_annotate { -name=>"annotates", -value=>"$i" ); + + # last; } - my $imageMap = qq( -
-
- - - $notes -
-
- ); - - my $imageCss = qq( - - ); $self->getAdminConsole->addSubmenuItem($self->getUrl('func=edit'),$i18n->get("edit image")); $f->hidden( -name=>"func", -value=>"annotate" ); - $f->text( + $f->text( -label=>$i18n->get('annotate image'), -value=>'', -hoverHelp=>$i18n->get('annotate image description'), @@ -546,7 +448,7 @@ sub www_annotate { -value=>, ); $f->submit; - return $self->getAdminConsole->render($f->print."$mouseCoord_js\n$crop_js\n$imageCss\n$image\n$imageMap",$i18n->get("annotate image")); + return $self->getAdminConsole->render($f->print."$hotspots$image$domMe",$i18n->get("annotate image")); } #-------------------------------------------------------------------