[Seaside] Image map tag

Philippe Marschall philippe.marschall at gmail.com
Fri Feb 9 19:21:28 UTC 2007


2007/2/9, Philippe Marschall <philippe.marschall at gmail.com>:
> 2007/2/9, Bany, Michel <mbany at cincom.com>:
> > > > Hey we're trying to figure out the WAImageMapTag.  Is this
> > > a complete item?
> > >
> > > What do you mean with complete item? Whether it works or it
> > > maps directly to an html element or it or has room for improvement?
> >
> > I believe Carl would like WAImageMapTag to provide an api
> > as complete as WAImageTag's api, i.e. #altText:, #document:,
> > #mimeType:, #url:, #fileName:
> >
> > Currently, the only way to supply an image to an WAImageMapTag
> > is to send #form: with a Form object.
> >
> > > > It's not clear at all how to use it.
> > >
> > > Have a look at the screenshoot application.
> >
> > Carl is using VW, there is no screenshot application in VW.
> >
> > The #form: message cannot be used since VW does not have Form.
> >
> > > > Do we need to flesh it out?
> >
> > I agree with Carl that we should add the missing apis.
> > Maybe with an api like this
> >
> >         (html imageMap)
> >                 callback: [:pt | self clickAt: pt];
> >                 title: '...';
> >                 id: #id;
> >                 image: [:image | ... ]
> >
> > where image is an instance of WAImageTag
> >
> > If no one else volunteers, I can take care.
>
> That's a cool idea. I just implemented this in Seaside2.7a1-pmm.168.
> What about the name of the #image: selector, this that ok? What about
> #withImage: or #imageIn: ?

After some discussion with Lukas I have come up with the following:

	html map
		id: #pictureMap;
		title: 'Click here';
		callback: [ :point | self click: point + self offset];
		with: [
			html image
				form: self form ]


This has the following advantages
- the full interface of WAAnchorTag und WAImageTag is available
- uses the familiar canvas api (with: [ html image) to create images
- less code

disadvantages:
- breaks old code (WAScreenshot is updated)

See Seaside2.7a1-pmm.169

Cheers
Philippe


More information about the Seaside mailing list