Re: [whatwg] srcset javascript implementation (Respondu) [updated]

2012-05-22 Thread David Clements
Hey all,

Just wanted to thank Julian and Glenn for their help in pointing me in the
right direction for the srcset implementation in the Respondu framework.

Respondu srcset now works with url's containing commas, as it more closely
follows the parsing algorithm,
If anyone takes a look at the improved code
 (https://github.com/davidmarkclements/Respondu/blob/master/R.js#L230-L295)
and spots any other oversights
I'd be so grateful if you let me know about it (either on the list, or by
filing a github issue).

If anyone has any other questions about the Respondu framework, I'd look
forward to answering them!

All the best,

Dave


Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-22 Thread huperekchuno
Hey brenton, 

No I've not pulled respondu.davidmarkclements.com, but I noticed it was down a 
few times, looked into and found my domain provider had over written two of the 
nameserver records (lesson: cheap doesn't always pay), this has been corrected 
but of course propagation takes a while. If you try again a few times 
eventually it'll reach a valid name server. In under 36hours max this should be 
a non issue - apologies to anyone who had problems with this. 

--Original Message--
From: brenton strine
To: David Clements
Subject: Re: [whatwg] srcset javascript implementation (Respondu)
Sent: 22 May 2012 20:49

On Sun, May 20, 2012 at 7:21 PM, David Clements
 wrote:
> You can also see working examples at
>
> http://respondu.davidmarkclements.com/

Did you pull this down recently? It doesn't seem to be working for me.


Sent from my BlackBerry® smartphone on O2

Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-21 Thread huperekchuno
Hey Glen, 

Thanks for that!

Dave
Sent from my BlackBerry® smartphone on O2

-Original Message-
From: Glenn Maynard 
Date: Mon, 21 May 2012 09:12:58 
To: 
Cc: Julian Reschke; 
Subject: Re: [whatwg] srcset javascript implementation (Respondu)

On Mon, May 21, 2012 at 2:36 AM,  wrote:

> Hey Julian
>
> I believe the attribute sets are delimited by comma, whereas each
> attribute itself is separated by space?
>
> The split is to load each attribute set into an array.
>
> The actual attributes themselves are matched with regex's, to be more
> forgiving to the order.
>

What you need is the parsing algorithm:

http://www.whatwg.org/specs/web-apps/current-work/#processing-the-image-candidates

(modulo https://www.w3.org/Bugs/Public/show_bug.cgi?id=17079, at least)

-- 
Glenn Maynard



Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-21 Thread huperekchuno
Hey Julian

Thanks for picking up on that, that's exactly why I needed another pair of 
eyes. I've actually read about the comma in urls issue but at some point that 
got lost at around 2am. 

I suppose I'll split it into an array by matching filenames instead.

If you (or anyone) has any more comments I'd be glad to hear them,

Many thanks,
Dave 
--Original Message--
From: Julian Reschke
To: huperekch...@googlemail.com
Cc: wha...@whatwg.org
Subject: Re: [whatwg] srcset javascript implementation (Respondu)
Sent: 21 May 2012 08:52

On 2012-05-21 09:36, huperekch...@googlemail.com wrote:
> Hey Julian
>
> I believe the attribute sets are delimited by comma, whereas each attribute 
> itself is separated by space?

No. The URIs can contain a comma, so you can't use that delimiter. See 
the parsing definition in the spec.

> ...

(Please don't take this as a complaint about your code, but about the 
syntax of the attribute).


Best regards, Julian


Sent from my BlackBerry® smartphone on O2

Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-21 Thread Glenn Maynard
On Mon, May 21, 2012 at 2:36 AM,  wrote:

> Hey Julian
>
> I believe the attribute sets are delimited by comma, whereas each
> attribute itself is separated by space?
>
> The split is to load each attribute set into an array.
>
> The actual attributes themselves are matched with regex's, to be more
> forgiving to the order.
>

What you need is the parsing algorithm:

http://www.whatwg.org/specs/web-apps/current-work/#processing-the-image-candidates

(modulo https://www.w3.org/Bugs/Public/show_bug.cgi?id=17079, at least)

-- 
Glenn Maynard


Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-21 Thread Julian Reschke

On 2012-05-21 09:36, huperekch...@googlemail.com wrote:

Hey Julian

I believe the attribute sets are delimited by comma, whereas each attribute 
itself is separated by space?


No. The URIs can contain a comma, so you can't use that delimiter. See 
the parsing definition in the spec.



...


(Please don't take this as a complaint about your code, but about the 
syntax of the attribute).



Best regards, Julian


Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-21 Thread huperekchuno
Hey Julian

I believe the attribute sets are delimited by comma, whereas each attribute 
itself is separated by space?

The split is to load each attribute set into an array.

The actual attributes themselves are matched with regex's, to be more forgiving 
to the order.

Best regards,

Dave
--Original Message--
From: Julian Reschke
To: David Clements
Cc: wha...@whatwg.org
Subject: Re: [whatwg] srcset javascript implementation (Respondu)
Sent: 21 May 2012 07:59

On 2012-05-21 04:21, David Clements wrote:
> Hi guys,
>
> Just to let you all know, I've written a javascript implementation of
> srcset using a framework for responsive images (which I also wrote)
> called Respondu (I'm open to new name suggestions), I'd love it if someone
> could check that I've implemented srcset right.
>
> Respondu manages to process the DOM without allowing any assets (contained
> in the body) to load, it also gracefully degrades for non-js
> browsers and is fairly unintrusive (it simply wraps the contents of the
> body tags).
>
> Check out the github page (feedback, pull requests, lunch money etc.
> welcome)
>
> https://github.com/davidmarkclements/Respondu
> ...

<https://github.com/davidmarkclements/Respondu/blob/master/R.js#L243>

This looks like you are splitting the attribute value by ","?

Best regards, Julian


Sent from my BlackBerry® smartphone on O2

Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-21 Thread huperekchuno
Hey Shaun,

Nope :)

Dave
Sent from my BlackBerry® smartphone on O2

-Original Message-
From: Shaun Moss 
Date: Mon, 21 May 2012 09:32:46 
To: David Clements
Subject: Re: [whatwg] srcset javascript implementation (Respondu)

David, you didn't go to Burnside High School in Queensland perchance?

Cheers,
Shaun

On 21 May 2012 09:21, David Clements  wrote:

> Hi guys,
>
> Just to let you all know, I've written a javascript implementation of
> srcset using a framework for responsive images (which I also wrote)
> called Respondu (I'm open to new name suggestions), I'd love it if someone
> could check that I've implemented srcset right.
>
> Respondu manages to process the DOM without allowing any assets (contained
> in the body) to load, it also gracefully degrades for non-js
> browsers and is fairly unintrusive (it simply wraps the contents of the
> body tags).
>
> Check out the github page (feedback, pull requests, lunch money etc.
> welcome)
>
> https://github.com/davidmarkclements/Respondu
>
> You can also see working examples at
>
> http://respondu.davidmarkclements.com/
>
> The framework, and srcset implementation are currently in alpha - its not
> presently compatible the document.ready et. al., however
> you can simply put scripts at the bottom of the body instead (which is best
> practice in most cases anyway).
>
> So far, it's tested and works in ie8, chrome, firefox, and iOS safari.
>
> Let me know if it works/doesn't work in other browsers!
>
> All the best,
>
> Dave
>



Re: [whatwg] srcset javascript implementation (Respondu)

2012-05-20 Thread Julian Reschke

On 2012-05-21 04:21, David Clements wrote:

Hi guys,

Just to let you all know, I've written a javascript implementation of
srcset using a framework for responsive images (which I also wrote)
called Respondu (I'm open to new name suggestions), I'd love it if someone
could check that I've implemented srcset right.

Respondu manages to process the DOM without allowing any assets (contained
in the body) to load, it also gracefully degrades for non-js
browsers and is fairly unintrusive (it simply wraps the contents of the
body tags).

Check out the github page (feedback, pull requests, lunch money etc.
welcome)

https://github.com/davidmarkclements/Respondu
...




This looks like you are splitting the attribute value by ","?

Best regards, Julian


[whatwg] srcset javascript implementation (Respondu)

2012-05-20 Thread David Clements
Hi guys,

Just to let you all know, I've written a javascript implementation of
srcset using a framework for responsive images (which I also wrote)
called Respondu (I'm open to new name suggestions), I'd love it if someone
could check that I've implemented srcset right.

Respondu manages to process the DOM without allowing any assets (contained
in the body) to load, it also gracefully degrades for non-js
browsers and is fairly unintrusive (it simply wraps the contents of the
body tags).

Check out the github page (feedback, pull requests, lunch money etc.
welcome)

https://github.com/davidmarkclements/Respondu

You can also see working examples at

http://respondu.davidmarkclements.com/

The framework, and srcset implementation are currently in alpha - its not
presently compatible the document.ready et. al., however
you can simply put scripts at the bottom of the body instead (which is best
practice in most cases anyway).

So far, it's tested and works in ie8, chrome, firefox, and iOS safari.

Let me know if it works/doesn't work in other browsers!

All the best,

Dave