Skip to content

Commit

Permalink
Added an inline script to detect installation as a plugin.
Browse files Browse the repository at this point in the history
Script sniffs for "/_plugin/" in location.href. If found it will
automatically populate the REST endpoint and simulate clicking
the "Connect" button.
  • Loading branch information
bd808 committed Apr 26, 2012
1 parent 2ee68e0 commit d6e15db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,14 @@
<div class="twelvecol last"/>
</div>
</div>
<script type="text/javascript">
$(function() {
var l = location, h = l.href, p = l.pathname;
if (h.indexOf("/_plugin/") != -1) {
document.forms[0].restEndPoint.value = h.substr(0, h.length-p.length);
$("#connectButton").click();
}
});
</script>
</body>
</html>

0 comments on commit d6e15db

Please sign in to comment.