mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-04 22:27:10 -04:00
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:
parent
ced79fe867
commit
ae73b1101a
1 changed files with 5 additions and 1 deletions
|
@ -272,7 +272,11 @@
|
||||||
<!-- termporary place holder-->
|
<!-- termporary place holder-->
|
||||||
<a id = "returnbutton">Return to pad</a>
|
<a id = "returnbutton">Return to pad</a>
|
||||||
<script>
|
<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>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue