Permalink
Browse files

Use a reasonable default for apiurl, unless it's been explicitly set.

  • Loading branch information...
ieure committed May 26, 2010
1 parent 381a7f2 commit ae0b9f318e9c1266efb40940533f85868ef63c41
Showing with 5 additions and 1 deletion.
  1. +5 −1 html/index.html
View
@@ -4,14 +4,18 @@
<link rel="stylesheet" type="text/css" href="css/base.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
-var apiurl = "http://127.0.0.1:9998/";
+var apiurl = undefined;
var default_dist = 'example-unstable-lenny';
var gitref = '';
var repolist = [];
var distlist = [];
var selected = {};
var statusurl = '';
+if (typeof(apiurl) == "undefined") {
+ apiurl = window.location.protocol + "//" + window.location.host;
+}
+
function package_list(dist) {
selected['dist'] = dist;
$.getJSON(apiurl + '/repository/' + dist + '?callback=?', function(data) {

0 comments on commit ae0b9f3

Please sign in to comment.