[Clipart] SVG::Metadata 0.11 Released

Jonadab the Unsightly One jonadab at bright.net
Tue Aug 10 04:54:13 PDT 2004


Nicu Buculei <nicu at apsro.com> writes:

> - what is happen if i enter more keywords than available fields?
> those not displayed anymore are not used?

Currently, that is correct, the keywords not listed are not submitted.
I'm open to suggestions on how to improve this situation.  (Remember
that the ECMA script is all client-side; it is not able to talk to the
server; it just helps you fill in the form.  Only when you hit the
submit button does anything go to the server.)  Ideally I'd like to
allow the user to add an unlimited number of keywords and see all the
keywords that have been added and change his mind and remove some of
them, all without consuming an infinite amount of space on the
webpage.  I'm not sure how to do that.  Is it possible for a
client-side script to actually *insert* additional form input fields
on the fly, in response to a user action?  Someone with a stronger
knowledge of Javascript might be able to help here.  If you can get
the Javascript that does what you want into a static-HTML copy of the
upload form, it'll be easy to add that into the script that produces
the form.

> - what is happen if i enter a keyword twice?

Currently, my ECMA script isn't smart enough to handle that very well.
All it does when you pull down the drop-down list and select a keyword
is to rotate down the listed keyword fields and add the new one to the
first field.  So if you select the same one twice it will get put on
the form twice.  (When you submit, however, the Perl code on the
server side will only put the keyword into the RDF once, because
SVG::Metadata treats the keywords as unique hash keys.)  The user can
of course edit the keyword fields directly, if he knows what keywords
he wants.

Oh, and if you check the "Add more fields" checkbox, then you should
get the full number of blank keyword fields in addition to any you've
already filled out.  I think this wasn't working properly until this
morning, probably, due to an oversight I just noticed, but it should
be working now.  (Maybe I should put a copy of the "Add more" checkbox
into the short version of the form that gets included on the main
front page of the website?)

Also, a user who is in the know can add extra keywords by putting a
comma-separated or space-separated list of keywords in each keyword
field.  But this is not a very discoverable feature.  I included it
mainly because it was really easy to do:
      $meta->addKeyword($_) for split /\s*(?:[,]|\s)\s*/;

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"ten.thgirb\@badanoj$/ --";$\=$ ;-> ();print$/




More information about the clipart mailing list