improved handling of document.referrer in timeslider.html: if a referrer with a pad-url is given (/p/*) use this referrer for the Return to pad link, if not use a substring of document.location

This commit is contained in:
Kai Hermann 2011-08-30 16:47:16 +02:00
parent ced79fe867
commit ae73b1101a

View file

@ -272,7 +272,11 @@
<!-- termporary place holder-->
<a id = "returnbutton">Return to pad</a>
<script>
$("#returnbutton").attr("href", document.location.href.substring(0,document.location.href.lastIndexOf("/")));
if(document.referrer.length > 0 && document.referrer.substring(document.referrer.lastIndexOf("/")-1,document.referrer.lastIndexOf("/")) === "p") {
$("#returnbutton").attr("href", document.referrer);
} else {
$("#returnbutton").attr("href", document.location.href.substring(0,document.location.href.lastIndexOf("/")));
}
</script>
</div>