Last modified by Alex Cotiuga on 2026/07/27 06:09

From version 18.19
edited by Alex Cotiuga
on 2026/07/09 20:32
Change comment: There is no comment for this version
To version 18.14
edited by Alex Cotiuga
on 2026/07/09 20:12
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[1]
cache
... ... @@ -1,1 +1,0 @@
1 -long
code
... ... @@ -1,32 +1,0 @@
1 -require(['jquery'], function ($) {
2 - $(function () {
3 - var sourcePageField = $('input[name="sourcePage"]');
4 -
5 - if (!sourcePageField.length || sourcePageField.val()) {
6 - return;
7 - }
8 -
9 - if (!document.referrer) {
10 - return;
11 - }
12 -
13 - try {
14 - var referrerUrl = new URL(document.referrer);
15 -
16 - if (referrerUrl.origin !== window.location.origin) {
17 - return;
18 - }
19 -
20 - var sourcePage = referrerUrl.pathname
21 - .replace(/^\/bin\//, '')
22 - .replace(/\/$/, '')
23 - .replace(/\//g, '.');
24 -
25 - if (sourcePage) {
26 - sourcePageField.val(sourcePage);
27 - }
28 - } catch (e) {
29 - // Ignore invalid referrer values.
30 - }
31 - });
32 -});
name
... ... @@ -1,1 +1,0 @@
1 -document referrer catcher
use
... ... @@ -1,1 +1,0 @@
1 -currentPage