- From: Ivan Herman <ivan@w3.org>
- Date: Thu, 17 Dec 2015 18:26:51 +0100
- To: Nick Barreto <nick@canelo.co>
- Cc: W3C Digital Publishing IG <public-digipub-ig@w3.org>
- Message-Id: <BD5BBD74-6A62-4EB8-B8CC-F36A2333EAAA@w3.org>
> On 17 Dec 2015, at 17:37, Nick Barreto <nick@canelo.co> wrote: > > Hello everyone, > > I've been planning on publishing a fork of Dave's (really great) ACME demo for a little while which I haven't had time to implement fully yet. However, I think the general reasoning is probably worth discussing and would benefit from your collective wisdom and experience. > > The main reason I haven't got it working yet is that I didn't want to rely on any external libraries (namely, JQuery's AJAX methods) as I am not an expert of JS and usually let JQuery take care of these sorts of interactions for me. > > Simply put, the idea is to have a JS file in the index of a book which effectively turns that index into a sort of container for the actual book content, as well as its navigation. Following a link in the nav would, instead of reloading the page, replace most of the body of the index with the content in the linked. The 'next' and 'previous' links would remain on the page, as well as a link which goes back to the nav itself. > > My reasoning here is that the html content of this proto-pwp remains exactly as it would be in, say, an epub or on the web. Each file would contain _only_ the html content for that chapter/section, without the need for the Service Workers or any other JS. The index would provide the scaffolding, the JS and Service Workers, but the content stays 'clean', if that makes sense. And that is very important indeed. Although Service Workers are currently a good approach of choice, the specification of PWP, and the content thereof, should not be dependent on Service Workers. > > I feel this setup would simplify the authoring of a pwp because then the service worker and other JS is only linked to _once_, rather than needing to be referenced in each content chapter or section. > To move one step further sometimes in the future: I completely get that for a prototype having the JS for Service Worker is linked from what you call the index file. But, I presume, one could envisage a version running entirely in the browser that would recognize a PWP (e.g., if we had a media type for a PWP) and would load the necessary JS from itself, ie, even the creation of that index would be unnecessary. (This could be done either in the core browser or, for now, in an extension I presume.) Am I right that your approach could lead, eventually, to such a setup? (I say 'eventually', because I do not expect that to happen now!) All this sounds great. You guys rockā¦ Ivan P.S. By the way, my challenge is to have a slide set like: https://w3c.github.io/dpub/markup-forum-2015-11/index.html <https://w3c.github.io/dpub/markup-forum-2015-11/index.html> as a PWP running with this PWP player. That slide set is based on a complex javascript that turn things into a slide set with all the necessary interaction and, ideally, that should be automatically handled offline without further ado (I am careful enough that all the JS and CSS and other media are actually in the same folder, ie, this is, technically, a PWP!). It could make a great demo if I made a presentation like that:-) > Apart from getting the DOM replacements with AJAX, which I am sure an experienced JS developer could achieve simply and concisely, the only downside I can foresee with this implementation is that outside links will need to be escaped somehow so that it is clear that this is a link to something outside the package, and as such should actually trigger a full page reload. Though I suppose a simple target="_blank" could achieve that. > > I'll hopefully get a simple implementation working soon, but probably not before our meeting. > > Any thoughts or suggestions appreciated. > > Cheers, > -Nick > > Nick Barreto > Co-founder & Technology Director > CANELO | www.canelo.co > <http://www.canelo.co/>@canelo_co <https://twitter.com/canelo_co> | @nickbarreto <http://www.twitter.com/nickbarreto> ---- Ivan Herman, W3C Digital Publishing Lead Home: http://www.w3.org/People/Ivan/ mobile: +31-641044153 ORCID ID: http://orcid.org/0000-0003-0782-2704
Received on Thursday, 17 December 2015 17:27:35 UTC