Re: seaside Digest, Vol 98, Issue 12

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: seaside Digest, Vol 98, Issue 12

Paul DeBruicker
Fritz,

Is there any way you could quote the messages you're replying to when you're replying to them?  And post your responses below the things you're quoting?  It'd help me track the discussion. Thanks

Paul



On Feb 4, 2011, at 6:20 PM, [hidden email] wrote:

> Send seaside mailing list submissions to
>    [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>    http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> or, via email, send a message with subject or body 'help' to
>    [hidden email]
>
> You can reach the person managing the list at
>    [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of seaside digest..."
>
>
> Today's Topics:
>
>   1. Re: I would like to attach an onClick event according to
>      (Fritz Schenk)
>   2. Re: I would like to attach an onClick event according to
>      (Fritz Schenk)
>   3. RE: Re: I would like to attach an onClick event according to
>      (Robert Sirois)
>   4. RE: Re: I would like to attach an onClick event according to
>      (Boris Popov, DeepCove Labs)
>   5. Re: I would like to attach an onClick event according to
>      (Fritz Schenk)
>   6. Re: I would like to attach an onClick event according to
>      (Fritz Schenk)
>   7. RE: Re: I would like to attach an onClick event according to
>      (Robert Sirois)
>   8. Re: I would like to attach an onClick event according to
>      (Fritz Schenk)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 4 Feb 2011 20:05:36 +0000 (UTC)
> From: Fritz Schenk <[hidden email]>
> Subject: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Thanks Robert
> I understand what it does - however it does it incorrectly. The Seaside onClick
> handler surrounds the text in double quotes, which invalidates the single quotes
> in <snippet>expression:'external_links a'</snippet>
> <bad code>
> <button onclick="$("#external_links a").click(function(){return confirm("You are
> going to visit: "+ this.href)})" type="submit" class="submit">Attach
> Click</button>
> </bad code>
> My question is how to use Seaside to express the IBM example's code in the most
> direct and DRY way.
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 4 Feb 2011 20:14:00 +0000 (UTC)
> From: Fritz Schenk <[hidden email]>
> Subject: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Thanks Boris. The code for you provided
> <bad code does not compile>
>    | onclick |
>    onclick := html javascript return: ((Javascript.JSStream new)
>                        nextPutAll: 'confirm';
>                        argument: (html jQuery
> </bad code does not compile>
>
> To my thinking we should strive to say it Seaside. In this case, Seaside does
> handle the desired text correctly when handling
>
> <desired Seaside>
> html button
> onClick: ((html jQuery expression: '#external_links a') onClick: 'return
> confirm("You are going to visit: "+ this.href)');
> with: 'Attach Click'.
> </desired Seaside>
>
> <desired result in javascript>
> <button onClick="$('#external_links a').click(function() {
>    return confirm('You are going to visit: ' + this.href);
> });" type="submit" class="submit">Attach Click</button>
> </desired result in javascript>
> and the jsbin: http://jsbin.com/imuka5/2
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 4 Feb 2011 13:15:11 -0700
> From: Robert Sirois <[hidden email]>
> Subject: RE: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> My understanding is that javascript doesn't differentiate between double and single quotes.
>
> Either pass a string in as the event (generated or static from the server), or simply import your code into the head of the page.
>
> Seaside provides a great way to generate javascript, as per Boris' responses.
>
> I personally use the jQuery classes almost exclusively so I don't have to look at raw javascript often.
>
> Without further examination (I'm on my phone), you'll have to allow someone else to help you right now.
>
> RS
>
>> To: [hidden email]
>> From: [hidden email]
>> Date: Fri, 4 Feb 2011 20:05:36 +0000
>> Subject: [Seaside] Re: I would like to attach an onClick event according to
>>
>> Thanks Robert
>> I understand what it does - however it does it incorrectly. The Seaside onClick
>> handler surrounds the text in double quotes, which invalidates the single quotes
>> in <snippet>expression:'external_links a'</snippet>
>> <bad code>
>> <button onclick="$("#external_links a").click(function(){return confirm("You are
>> going to visit: "+ this.href)})" type="submit" class="submit">Attach
>> Click</button>
>> </bad code>
>> My question is how to use Seaside to express the IBM example's code in the most
>> direct and DRY way.
>>
>>
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>                        
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110204/0503fb1e/attachment-0001.htm
>
> ------------------------------
>
> Message: 4
> Date: Fri, 4 Feb 2011 12:14:59 -0800
> From: "Boris Popov, DeepCove Labs" <[hidden email]>
> Subject: RE: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: "Seaside - general discussion"
>    <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain;    charset="us-ascii"
>
> You may need to remove namespace declaration if you're not on
> VisualWorks.
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Fritz
> Schenk
> Sent: Friday, February 04, 2011 3:14 PM
> To: [hidden email]
> Subject: [Seaside] Re: I would like to attach an onClick event according
> to
>
> Thanks Boris. The code for you provided
> <bad code does not compile>
>    | onclick |
>    onclick := html javascript return: ((Javascript.JSStream new)
>                        nextPutAll: 'confirm';
>                        argument: (html jQuery
> </bad code does not compile>
>
> To my thinking we should strive to say it Seaside. In this case, Seaside
> does handle the desired text correctly when handling
>
> <desired Seaside>
> html button
> onClick: ((html jQuery expression: '#external_links a') onClick: 'return
> confirm("You are going to visit: "+ this.href)');
> with: 'Attach Click'.
> </desired Seaside>
>
> <desired result in javascript>
> <button onClick="$('#external_links a').click(function() {
>    return confirm('You are going to visit: ' + this.href); });"
> type="submit" class="submit">Attach Click</button> </desired result in
> javascript> and the jsbin: http://jsbin.com/imuka5/2
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 4 Feb 2011 22:31:12 +0000 (UTC)
> From: Fritz Schenk <[hidden email]>
> Subject: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> JavaScript expects proper nesting of quotes. Double quotes can't be nested in
> double quotes. If you need to do that you must use "\""", but in this case we
> can't
>
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 4 Feb 2011 22:34:12 +0000 (UTC)
> From: Fritz Schenk <[hidden email]>
> Subject: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Thanks for your help so far.
>
> According to Lukas we should 'say it in Seaside' - but we can't directly; we have
>
> to play games.
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 4 Feb 2011 15:57:07 -0700
> From: Robert Sirois <[hidden email]>
> Subject: RE: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> They have to be consistent, yes.
>
> The Seaside factory classes will make that a non-issue. The javascript classes Lukas built have all the functionality you need... it's a matter of learning how to do it. Boris gave a great example. If you want to write out the javascript, then concatenate the strings and simply escape when you need to.
>
> ie.
>
> '"I''m a Smalltalk string in double quotes"'.
> '''I''m a Smalltalk string in single quotes'''.
>
> Would look like, printed:
>
> "I'm a Smalltalk string in double quotes"
> 'I'm a Smalltalk string in single quotes'
>
> I'm failing to see where the problem is. It sounds like a matter of looking at what, precisely, you want, and then translating it to syntax.
>
> RS
>
>> To: [hidden email]
>> From: [hidden email]
>> Date: Fri, 4 Feb 2011 22:34:12 +0000
>> Subject: [Seaside] Re: I would like to attach an onClick event according to
>>
>> Thanks for your help so far.
>>
>> According to Lukas we should 'say it in Seaside' - but we can't directly; we have
>>
>> to play games.
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>                        
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110204/8c439281/attachment-0001.htm
>
> ------------------------------
>
> Message: 8
> Date: Fri, 4 Feb 2011 23:19:41 +0000 (UTC)
> From: Fritz Schenk <[hidden email]>
> Subject: [Seaside] Re: I would like to attach an onClick event
>    according to
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> I agree that your are failing to see the problem. I have the most efficient way
> to to what I want given by the JavaScript:
> <most direct way to do this>
> $('#external_links a').click(function() {
>    return confirm('You are going to visit: ' + this.href);
> });
> </most direct way to do this>
> And I can't do it in Seaside without having to take care of special requirements
> about strings in the click method (onClick)
>
> <the direct way does not work>
> html button
> onClick: ((html jQuery expression: '#external_links a') onClick: 'return
> confirm("You are going to visit: "+ this.href)');
> with: 'Attach Click'.
> </the direct way does not work>
> If does not work because the onClick message enclosed the whole argument in
> double quotes, sand the converts single quotes to double quotes (incorrectly)
> with the
> <resulting incorrect javascript>
> <button onclick="$("#external_links a").click(function(){return confirm("You are
> going to visit: "+ this.href)})" type="submit" class="submit">Attach
> Click</button>
> </resulting incorrect javascript)
> So think about it and write it in Seaside in a short, concise, and 'say it in
> Seaside' mode.
> <I have tried>
>    html button
>        onClick: ((html jQuery expression: selector)
>                onClick: 'return confirm("You are going to
> visit: "+ this.href)');
>         with: 'Attach Click'
> </I have tried>
> with select set to 'external_links a', but with the same bad result (nested
> double quotes).
> Thanks
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
> End of seaside Digest, Vol 98, Issue 12
> ***************************************
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: seaside Digest, Vol 98, Issue 12

Intrader Intrader
Paul thanks for following. The thread of interest is correctly threaded. To
summarize, I have a problem expressing in seaside the following javascript:

I have a jsbin with the example at http://jsbin.com/imuka5/2

The problem is that Seaside is in my opinion not allowing me to express the
following javascript:
<javscript>
$('#external_links a').click(function() {
    return confirm('You are going to visit: ' + this.href);
});
</javascript>

I have written in Seaside

<Seaside>
        html button
                onClick: ((html jQuery expression: selector)
                                onClick: 'return confirm("You are going to
visit: "+ this.href)');
                 with: 'Attach Click'
</Seaside>

The above Seaside translates into:

<javascript from Source Halo>
<button onclick="$("external_links a").click(function(){return confirm("You are
going to visit: "+ this.href)})" type="submit" class="submit">Attach
Click</button>
</javascript from Srouce Halo>

As you can see the double quotes are a problem.

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: seaside Digest, Vol 98, Issue 12

Intrader Intrader
In reply to this post by Paul DeBruicker
Paul,
I have reported http://code.google.com/p/seaside/issues/list?
cursor=640&start=100&updated=640&ts=1297027779



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside