JS routing. Fixes #12

Very rudimentary JS routing using a switch statement against `window.location.pathname`. This fixes the js error being thrown on all pages other than the homepage as reported in issue #12 
:+1:

Oliver Joseph Ash
Software Engineer


On 21 July 2014 12:21, Sébastien Cevey <notifications@github.com> wrote:

> In src/js/app.js:
>
> >
> > -    var developerBlogSectionDropZone = window.document.querySelector('.developer-blog-section .drop-zone');
> > -    developerBlogSectionDropZone.appendChild(renderedElement);
> > -    developerBlogSectionDropZone.hidden = false;
> > -});
> > +switch(window.location.pathname) {
>
> For the record, I think the cleanest way would be to detect whether the
> thing you want to enhance is present and if so, enhance it. That way, you
> don't have an invisible coupling of a URL with some components you "know"
> exists at that URL. Could just run the querySelector and see if the
> container is present. (In the Future, it'd just be a web component and its
> mere presence would trigger its enhancement). But the URL trick is fine for
> now imho.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/guardian/developers-site/pull/35/files#r15163515>.
>

-- 

------------------------------
Visit theguardian.com. On your mobile and tablet, download the Guardian 
iPhone and Android apps theguardian.com/guardianapp and our tablet editions 
theguardian.com/editions.  Save up to 57% by subscribing to the Guardian 
and Observer - choose the papers you want and get full digital access. 
 Visit subscribe.theguardian.com

This e-mail and all attachments are confidential and may also be 
privileged. If you are not the named recipient, please notify the sender 
and delete the e-mail and all attachments immediately. Do not disclose the 
contents to another person. You may not use the information for any 
purpose, or store, or copy, it in any way.  Guardian News & Media Limited 
is not liable for any computer viruses or other material transmitted with 
or as part of this e-mail. You should employ virus checking software.
 
Guardian News & Media Limited is a member of Guardian Media Group plc. Registered 
Office: PO Box 68164, Kings Place, 90 York Way, London, N1P 2AP.  Registered 
in England Number 908396