Fix stupid chrome behavior on index page

This commit is contained in:
calzoneman 2013-12-11 19:53:53 -06:00
parent 65ce2f661d
commit 5610b6f0b4
1 changed files with 3 additions and 5 deletions

View File

@ -92,7 +92,6 @@
<script src="./assets/js/data.js"></script>
<script src="./assets/js/iourl.js"></script>
<script type="text/javascript">
var host = location.protocol + "//" + location.host + "/";
setInterval(refresh, 10000);
refresh();
function idToURL(data) {
@ -143,7 +142,7 @@
var d = data[i];
var tr = $("<tr/>").appendTo($("#channeldata"));
var name = $("<td/>").appendTo(tr);
$("<a/>").attr("href", host + "r/" + d.name)
$("<a/>").attr("href", "r/" + d.name)
.text(d.pagetitle + " (" + d.name + ")")
.appendTo(name);
$("<td/>").text(d.usercount || 0).appendTo(tr);
@ -166,7 +165,7 @@
alert("Invalid channel names. Channel names may contain alphanumeric characters, underscores, and hyphens");
return;
}
document.location = host + "r/" + $("#channel").val();
document.location = "r/" + $("#channel").val();
}
});
</script>
@ -182,8 +181,7 @@
}
}
if(params["channel"] && params["channel"].match(/^[a-zA-Z0-9]+$/)) {
var host = location.protocol + "//" + location.host + "/";
document.location = host + "r/" + params["channel"];
document.location = "r/" + params["channel"];
}
</script>
</body>