ACME demo plans

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.

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.

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
@canelo_co <https://twitter.com/canelo_co> | @nickbarreto
<http://www.twitter.com/nickbarreto>

Received on Thursday, 17 December 2015 16:38:44 UTC