Internet line endings

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

Internet line endings

sebastianconcept@gmail.co
Hey there,

for the record:

If you find yourself having to debug javascript served by Seaside libraries you could be in trouble because you probably find that code all in a long single line. So you can't put breakpoints, etc. Is not even readable.

In such situation you want to use this:

WAFileLibrary>>documentForFile: aFilename
| content |
content := self asSelector: aFilename.
^ (self perform: content) withInternetLineEndings

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

Re: Internet line endings

Paul DeBruicker
Chrome/Chromium can pretty print javascript in its developer tools.


At the bottom of the "Scripts" pane there is a button that is a matched
set of braces (e.g. {} ).  In the script drop down switch to the
'(program)' script and click the braces.

As you make ajax requests or whatever the scripts in the responses are
added to that menu.






On 12-03-08 10:13 AM, Sebastian Sastre wrote:

> Hey there,
>
> for the record:
>
> If you find yourself having to debug javascript /served by Seaside
> libraries/ you could be in trouble because you probably find that code
> all in a long single line. So you can't put breakpoints, etc. Is not
> even readable.
>
> In such situation you want to use this:
>
> WAFileLibrary>>documentForFile: aFilename
> | content |
> content := self asSelector: aFilename.
> ^ (self perform: content) withInternetLineEndings
>
> sebastian <http://about.me/sebastianconcept>
>
> o/
>
>
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

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

Re: Internet line endings

sebastianconcept@gmail.co
yep, good one


On Mar 8, 2012, at 3:42 PM, Paul DeBruicker wrote:

Chrome/Chromium can pretty print javascript in its developer tools.


At the bottom of the "Scripts" pane there is a button that is a matched set of braces (e.g. {} ).  In the script drop down switch to the '(program)' script and click the braces.

As you make ajax requests or whatever the scripts in the responses are added to that menu.






On 12-03-08 10:13 AM, Sebastian Sastre wrote:
Hey there,

for the record:

If you find yourself having to debug javascript /served by Seaside
libraries/ you could be in trouble because you probably find that code
all in a long single line. So you can't put breakpoints, etc. Is not
even readable.

In such situation you want to use this:

WAFileLibrary>>documentForFile: aFilename
| content |
content := self asSelector: aFilename.
^ (self perform: content) withInternetLineEndings

sebastian <http://about.me/sebastianconcept>

o/





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

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



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

Re: Internet line endings

Paul DeBruicker
I think what you've shown is more robust as the XHR responses still
aren't pretty printed in the "Net" panel.  They just come out as one
long line.








On 12-03-08 10:47 AM, Sebastian Sastre wrote:

> yep, good one
>
>
> On Mar 8, 2012, at 3:42 PM, Paul DeBruicker wrote:
>
>> Chrome/Chromium can pretty print javascript in its developer tools.
>>
>>
>> At the bottom of the "Scripts" pane there is a button that is a
>> matched set of braces (e.g. {} ). In the script drop down switch to
>> the '(program)' script and click the braces.
>>
>> As you make ajax requests or whatever the scripts in the responses are
>> added to that menu.
>>
>>
>>
>>
>>
>>
>> On 12-03-08 10:13 AM, Sebastian Sastre wrote:
>>> Hey there,
>>>
>>> for the record:
>>>
>>> If you find yourself having to debug javascript /served by Seaside
>>> libraries/ you could be in trouble because you probably find that code
>>> all in a long single line. So you can't put breakpoints, etc. Is not
>>> even readable.
>>>
>>> In such situation you want to use this:
>>>
>>> WAFileLibrary>>documentForFile: aFilename
>>> | content |
>>> content := self asSelector: aFilename.
>>> ^ (self perform: content) withInternetLineEndings
>>>
>>> sebastian <http://about.me/sebastianconcept>
>>>
>>> o/
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> seaside mailing list
>>> [hidden email]
>>> <mailto:[hidden email]>
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> <mailto:[hidden email]>
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> sebastian <http://about.me/sebastianconcept>
>
> o/
>
>
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

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

Re: Internet line endings

sebastianconcept@gmail.co
ok. 

Here is a correction on the suggested code:

WAFileLibrary>>documentForFile: aFilename
| content |
content := self perform: (self asSelector: aFilename).
^ content isString
ifTrue: [content withInternetLineEndings]
ifFalse: [content]



On Mar 8, 2012, at 4:33 PM, Paul DeBruicker wrote:

I think what you've shown is more robust as the XHR responses still aren't pretty printed in the "Net" panel.  They just come out as one long line.








On 12-03-08 10:47 AM, Sebastian Sastre wrote:
yep, good one


On Mar 8, 2012, at 3:42 PM, Paul DeBruicker wrote:

Chrome/Chromium can pretty print javascript in its developer tools.


At the bottom of the "Scripts" pane there is a button that is a
matched set of braces (e.g. {} ). In the script drop down switch to
the '(program)' script and click the braces.

As you make ajax requests or whatever the scripts in the responses are
added to that menu.






On 12-03-08 10:13 AM, Sebastian Sastre wrote:
Hey there,

for the record:

If you find yourself having to debug javascript /served by Seaside
libraries/ you could be in trouble because you probably find that code
all in a long single line. So you can't put breakpoints, etc. Is not
even readable.

In such situation you want to use this:

WAFileLibrary>>documentForFile: aFilename
| content |
content := self asSelector: aFilename.
^ (self perform: content) withInternetLineEndings

sebastian <http://about.me/sebastianconcept>

o/





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

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

sebastian <http://about.me/sebastianconcept>

o/





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

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



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

Re: Internet line endings

Nick
Hi Sebastian,

I came across this issue a while ago:


Nick


On 8 March 2012 19:54, Sebastian Sastre <[hidden email]> wrote:
ok. 

Here is a correction on the suggested code:

WAFileLibrary>>documentForFile: aFilename
| content |
content := self perform: (self asSelector: aFilename).
^ content isString
ifTrue: [content withInternetLineEndings]
ifFalse: [content]



On Mar 8, 2012, at 4:33 PM, Paul DeBruicker wrote:

I think what you've shown is more robust as the XHR responses still aren't pretty printed in the "Net" panel.  They just come out as one long line.








On 12-03-08 10:47 AM, Sebastian Sastre wrote:
yep, good one


On Mar 8, 2012, at 3:42 PM, Paul DeBruicker wrote:

Chrome/Chromium can pretty print javascript in its developer tools.


At the bottom of the "Scripts" pane there is a button that is a
matched set of braces (e.g. {} ). In the script drop down switch to
the '(program)' script and click the braces.

As you make ajax requests or whatever the scripts in the responses are
added to that menu.






On 12-03-08 10:13 AM, Sebastian Sastre wrote:
Hey there,

for the record:

If you find yourself having to debug javascript /served by Seaside
libraries/ you could be in trouble because you probably find that code
all in a long single line. So you can't put breakpoints, etc. Is not
even readable.

In such situation you want to use this:

WAFileLibrary>>documentForFile: aFilename
| content |
content := self asSelector: aFilename.
^ (self perform: content) withInternetLineEndings

sebastian <http://about.me/sebastianconcept>

o/





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

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

sebastian <http://about.me/sebastianconcept>

o/





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

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



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



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