Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

DriveParentCollab - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page DriveParentCollab

Last modified by bougault on 2022/01/07 11:03

From version 2.2
edited by bougault
on 2022/01/05 15:27
Change comment: There is no comment for this version
To version 9.2
edited by bougault
on 2022/01/06 16:27
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -14,14 +14,25 @@
14 14   const driveId = getDriveId(driveURL.value);
15 15   if(driveId) {
16 16   console.log('Perform request with id:', driveId);
17 + fetch(`/rest/v1/collabs?driveId=${driveId}`)
18 + .then(res => res.json())
19 + .then(json => {
20 + console.log(json);
21 + const { link } = json;
22 + window.location.pathname = link;
23 + })
17 17   }
18 18   }
19 19   function getDriveId(driveURL) {
20 20   const url = new URL(driveURL);
21 - const re = /\/library\/([^/]*)\/.*/;
22 - const id = re.exec(url.pathname)[1];
28 + const re = /\/(library|lib)\/([^/]*)\/.*/;
29 + const id = re.exec(url.pathname)[2];
23 23   return id;
24 24   }
25 25  })();
33 +
34 +window.addEventListener("message", function(event) {
35 + alert('XXXX', event);
36 +})
26 26  </script>
27 27  {{/html}}