Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker #656

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Picker #656

wants to merge 14 commits into from

Conversation

Thatoo
Copy link

@Thatoo Thatoo commented Oct 8, 2024

This is a draft to make Nextcloud Picker very handy within Element for Nextcloud to answer this issue.
The idea is to add a button that would open an iframe to select a file and get one of the three link :

  • internal link of the file
  • read only public link of the file
  • editable public link of the file
    It requires to install the app https://github.com/nextcloud/picker on version 1.0.11 or above.

So far, it is a POC.
The way the button is added, using const interval = setInterval(() => {... }, 100); isn't satisfying.
I don't know how to make

function closePickerIframe() {
  const pickerFrame = document.getElementById('pickerFrame');
  document.body.removeChild(pickerFrame); // Remove the iframe
}

survive the webpack building operation. Indeed, this function isn't directly used by Element for Nextcloud but it needs to exist for the Picker app to be able to call this function (window.parent.closePickerIframe()) and close the iframe once the link has been copied. Webpack delete this function at building time as it consider it being unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant