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

Rely on viewer app to open single shared .md file #2772

Open
max-nextcloud opened this issue Aug 2, 2022 · 2 comments
Open

Rely on viewer app to open single shared .md file #2772

max-nextcloud opened this issue Aug 2, 2022 · 2 comments

Comments

@max-nextcloud
Copy link
Collaborator

With nextcloud/server#33347 and nextcloud/viewer#1242 the viewer will be used to open single shared files. Text still has its own handling in src/public.js. Using the viewer to open the file just like we do in other places seems like the more generic approach.

Using the viewer as is does not work right now mainly due to css style issues. The text editor will have a hight of 0 and therefore not be visible. There's also other side effects of the surrounding page such as text-align: center that need to be accounted for.

@juliusknorr
Copy link
Member

@max-nextcloud Could you outline what is still needed here since the viewer or seems to be merged?

@max-nextcloud
Copy link
Collaborator Author

The change merged to server is limited to only open images and videos directly in the viewer for now:
https://github.com/nextcloud/server/pull/33347/files#diff-22f78918676c8422a8c807a774435aae85eb2f9feed73d4af629f194092d349bR156

It would be nice if we could either broaden that condition to also open things text handles or remove it entirely.

For now if we removed it the file would be opened twice:

  • once by the server code calling viewer.open(...)
  • once by our own code in src/public.js

The servers viewer.open(...) will open the file inside the page itself rather than in a modal. Quite a bit of our styles still depend on being opened in a modal.

So in order to get this to work here's what i'd try:

  • add the mimetype to the list in server - markdown for example
  • prevent src/public.js from loading the file as well so we do not open it twice
  • take a look at the result and adjust the css and maybe html until it works properly.

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

No branches or pull requests

3 participants