On Oct 30, 4:51 pm, "Ted Gifford" <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 30, 2008 at 11:53 AM, Martin S. <[EMAIL PROTECTED]>
>
>
>
> wrote:
>
> > On Oct 30, 3:01 pm, "Ted Gifford" <[EMAIL PROTECTED]> wrote:
> > > And then your jquery call would be something like
>
> > > jQuery('.foo').each(function(){
> > > var settings = jQuery('.fooinput', this).val();
> > > // find one of many implementations online
> > > var dict = parsevalues(settings);
> > > // new GMaps2(this, dict)
>
> > > });
> > Mmmm, nice idea,
> > but this would move most of the setting parsing from python to
> > javascript, which I would like to avoid.
> > All this just to avoid the problems with an ID is a little to much in
> > my opinion.
>
> If that is too much parsing in javascript (it's really not that much [15
> lines?], you're using a large javascript API in GMaps), then you could
Hey, but GMap is written by Google, the rest I have to (re-)code by
myself.
And that's stuff which is already present in python, and then the
thing
with javascript browser compatibility etc..
See also my comment below.
> instead store all the values separately in inputs, and use the
> jQuery('.dataDiv').serializeArray() method:
> <div class="container">
> <form class="inputs" action="#">
> <input type="hidden" name="center" value="79.4,67.3"/>
> <input type="hidden" name="zoom" value="5"/>
> ...
> </form>
> <div class="gmap"></div>
> </div>
>
> and then
>
> jQuery('.container').each(function(){
> var dict = jQuery('form.inputs', this).serializeArray();
I wasn't talking about the argument parsing/splitting but about the
interpretation.
E.g. it must be checked if the user set 'marker=...' and then create/
call the appropriate javascript functions
for all markers. At the moment I do this in python and put a
'SetMarkerByCoords(..);' function call into the
'script' tag for every marker.
And there's enough other arguments to handle ... and I like to add
some new in future releases.
It's all possible, but just not the way I like to go.
> });
> > Do you know if jQuery code can access somehow the surrounding tag if
> > it in a 'script' tag (inside an 'div' tag)?
> > <div class='googlemap'>
> > <script type="text/javascript">
> > // something like:
> > jQuery(....).SurroundingScriptTag().ParentTag()
> > </script>
> > </div>
>
> I don't think so. And besides, who wants ugly scripts in their markup when
> there's a better way?
Hey, you are right. It was just an idea which jumped into my mind.
Martin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---