adzerk/boot-cljs — pull request #19 by Deraen (2015-01-01 02:16:38+00:00)
Title: Fix #18. Fix shim when loaded using relative src.

Shim now guesses if it was loaded e.g. using src="../shim.js" and uses the same
prefix (../) for script tags it created.
This way shim can be loaded from index.html and posts/foobar.html and
it generates proper relative script tags.

This will generate shim like this:
```js
// boot-cljs shim
(function() {
var shimRegex = new RegExp('(.*)main.js$');
function findPrefix() {
var els = document.getElementsByTagName('script');
for (var i = 0; i < els.length; i++) {
var match = els[i].getAttribute('src').match(shimRegex);
if (match) {
return match[1];
}
}
return '';
}
var prefix = findPrefix();
document.write("");
document.write("");
document.write("");
document.write("");
})();
```