The JavaScript does not support template switching via variables, but only via $conf

The only Event that is being fired on js.php is the init_lang_load.
This is after the $conf has been set up and before the javascript will
be loaded. Here we can inject the new template.

Since the js.php does not support any parameters on its own, we have to
rely on the referrer - which should most likely always be the dokuwiki.
The siteexporter itself adds the template as query parameter when
fetching the javascript, so this is mainly for
template-switching-testing-purpose.