Age | Commit message (Collapse) | Author |
|
Looks like the [accessor to state] was removed from the Viewer api
and replaced with [separate getters].
So we need to replace `OCA.Viewer.state.file` with `OCA.Viewer.file`.
Fixes #1676
[accessor to state]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1L52-L63)
[separate getters]: (https://github.com/nextcloud/viewer/commit/dbfa6bc8ead717530001a981b7d442510bf8d897#diff-c29528ea58a2d0307765d4357b88c9a469c148ccca2d82b653dbb97290ab6ab1R79-R81)
Signed-off-by: Azul <azul@riseup.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
This is more relyable then parsing the window location query for dir:
* ?dir does not change when navigating between files right now
* ?dir is not present when the viewer is used from within other apps.
We used to fallback to the viewer state which solved the latter.
However it is easier and less error prone
to just rely on viewer state in the first place.
Signed-off-by: Azul <azul@riseup.net>
|
|
This way they also work if the viewer was opened from other apps
than the file app.
Also move the `relPath` param into the fragment.
It is only used to remember the relative path
for generating the short markdown form from the link.
Signed-off-by: Azul <azul@riseup.net>
|
|
Signed-off-by: Azul <azul@riseup.net>
|
|
The markdown we create for links to local files looks like this:
```
[Check this out!](subdir/file.md?fileid=123)
```
Turn this into a link like this
```
<a href="?dir=/current&openfile=123&relPath=subdir/file.md">
Check this out!
</a>
```
The `relPath` part of the url is needed
to convert it back to the original markdown.
Includes a test.
Next steps:
* open links to local files in same tab.
* change dir param according to relative Path.
Signed-off-by: Azul <azul@riseup.net>
|
|
The short relative links used in markdown
need to be converted to working urls in the href attributes.
In order to properly serialize the content
the full urls in html need to be converted to relative links as well.
This commit splits out the href handling into a new helper.
This way it can be easily tested.
Signed-off-by: Azul <azul@riseup.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
includes a unit test for turning the src in markdown
into a src for html that can be resolved by nextcloud
Signed-off-by: Azul <azul@riseup.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|
|
Signed-off-by: Julius Härtl <jus@bitgrid.net>
|