Enterprise JS is 400 lines of code... 0 lines of tests. Kudos, NYT.
NYTimes Opensources Their Deep Linking JS
11–20 of 56 posts
Re: NYTimes Opensources Their Deep Linking JS
#12On Github, they say they'll eventually remove the dependency on PrototypeJS. The library is only ~10k now, hopefully that change won't increase the size too much.
You know what I would love to have the HTML5 guys add to the spec? Some way of keeping libraries like PrototypeJS and jQuery in the browser cache at all times, so that pages could just use them without worrying about the size. Perhaps some kind of alternate src attribute on script tags, so you could list a local copy (for reliability) as well as Google and Microsoft CDN URLs, and the browser would go with the first o…
Re: NYTimes Opensources Their Deep Linking JS
#13It's simpler, of course. It's in plain JS and as jQuery plugin
Re: NYTimes Opensources Their Deep Linking JS
#14An issue with it though, when sending the link to someone, and then they click it, browsers (Chrome here) turn the #h[TArTWw,1] into #h%5BTArTWw,1%5D which then seems to be ignored by the script.
Re: NYTimes Opensources Their Deep Linking JS
#15Re: NYTimes Opensources Their Deep Linking JS
#16Earlier quoted context omitted.
You know what I would love to have the HTML5 guys add to the spec? Some way of keeping libraries like PrototypeJS and jQuery in the browser cache at all times, so that pages could just use them without worrying about the size. Perhaps some kind of alternate src attribute on script tags, so you could list a local copy (for reliability) as well as Google and Microsoft CDN URLs, and the browser would go with the first o…
Why isn't it sufficient to use the Google-hosted jQuery? It's likely to be cached.
2. it's another dependency that you don't control
Re: NYTimes Opensources Their Deep Linking JS
#17I played around with this and got it so you can both highlight and have it move the view to the paragraph of choice. Seems pretty interesting. An issue with it though, when sending the link to someone, and then they click it, browsers (Chrome here) turn the #h[TArTWw,1] into #h%5BTArTWw,1%5D which then seems to be ignored by the script.
Re: NYTimes Opensources Their Deep Linking JS
#18I don't understand what's so awesome about this? Browsers have supported deep linking since forever. You can link to any specific id on a page and the browser will scroll to it when you open the page. For example, I could have every paragraph an id say id="p5" and then link ad example.com/story#p5 and voila, deep linking. Hoorah for reinventing the wheel :)
RTFM? :) The difference is no 'href' tags. The 'tag' is automatically created based on the words in the paragraph, via Javascript, and decoded appropriately. It is also slightly neat in that you can highlight a specific sentence (multiple sentences actually, see the little tutorial at the bottom). I actually kind of like it, it would be a neat way to really highlight what you think is interesting in an article when s…
My hope tis that this approach is equally unhelpful to everyone :)
Seriously, my hope is that if an approach like this is going to happen that we can keep the usage (syntax) consistent.
Further down the road I'd like the view to also show you what people in your network have highlighted, or on a more aggregate and subtle level, what everyone has...
Re: NYTimes Opensources Their Deep Linking JS
#19Re: NYTimes Opensources Their Deep Linking JS
#20I'm surprised to find this posted here. I developed this and given the community here I'd appreciate any feedback for future iterations...