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

Bookmarked files do not load when opened again!? #40

Open
RaHahda opened this issue Nov 19, 2020 · 3 comments
Open

Bookmarked files do not load when opened again!? #40

RaHahda opened this issue Nov 19, 2020 · 3 comments

Comments

@RaHahda
Copy link

RaHahda commented Nov 19, 2020

Hi there,
I'm running pheditor and nearly everything is working perfectly (Thanks a lot for that great application!).
Nearly...
When I re-open a browser-bookmarked file the editor part of the windows remains empty.

Empty

Some info on my setup:

  • Apache and pheditor run in a docker container
  • Firefox and Chrome on Windows 10

First I set a browser bookmark (e.g. http://localhost/my-cgi-bin/pheditor/pheditor.php#/Demos/PHP/PHPunit/tests/CalcTest.php) on a perfectly displayed pheditor page.
Later I recall the page by the bookmark
The problem: Most of the time the editor-part of the window is empty (only sometimes the file is displayed)

There seems to be a dependency between the folder view and the problem.
If the folder shows the desired file - it works.
If the desired file is hidden in the folder view - it is not working!?

Maybe someone has got an idea?

Thanks
Ralf

@RaHahda
Copy link
Author

RaHahda commented Nov 20, 2020

Hi there,
I tracked the problem down today.
It is caused by messing up the name of the file in the function bound to $(window).on("hashchange").
I am not sure what the whole function is doing but I wrote a line of code returning the expected filename.

Here is my workaround:

Find the following code at aprox. line 1017

} else {
var file = $("a[data-file='" + hash + "']");

and replace the calculation of file by
var file=hash.substring(hash.lastIndexOf("/"));

Now the bookmarks will open files...
Thanks
Ralf

@hamidsamak
Copy link
Collaborator

Hello @RaHahda
I've checked the direct links containing file names in window hash. It seems ok.
Can you give me any details about the file name and your browser?

@RaHahda
Copy link
Author

RaHahda commented Nov 25, 2020

@hamidsamak
Hello Hamid,
well it happens in Firefox, Chrome and Edge Chromium (all up to date). I do not think it is a browser issue.
If there is something special with my setup it is the docker container running apache and php under linux on a windos 10 machine. But, did you really try my scenario?

  1. First select a file in a folder
  2. Set a bookmark to that file (or copy the link)
  3. Close the folder in the tree view (important!!!!)
  4. Open the bookmark / Link

Of course I could send you the docker setup!?

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

No branches or pull requests

2 participants