Closed anoadragon453 closed 5 years ago
I have added some tweaks, because it was under the "v:latest" bottom right button and the redirect checked does not worked, because it was done in async. Modified to do it on hover, so it should be hidden from the user in most cases, but still does not trigger automatically on every page load
https://github.com/HelloZeroNet/Documentation/commit/053609c5c628a4189850f13801206135aea0cb07
The popup doesn't trigger or the redirect?
The problem was with these lines:
request.open('GET', newDocsURL, true);
request.send();
return (request.status == 200)
Since the request was async the request.status was always 0, as it does not waited for the result
Ahh, I see. I thought this line:
Modified to do it on hover, so it should be hidden from the user in most cases, but still does not trigger automatically on every page load
Meant there was still a problem. I assume it is instead working? :)
If so, I don't yet see it on https://zeronet.readthedocs.io
Probably its just caching of docs.js, I can see it in multiple browsers
Ohh, I was expecting the little slide up thing. Didn't realize it had moved to the top :)
Works well!
Here is some JavaScript to redirect the old docs pages to the new site. A little pop up notice shows if it detects you're on the old site, and offers to take you to the new one.
If the page you're currently on is available on the new site, it will take you directly there, otherwise you'll be taken to the homepage.
I've set up a little demo that you can try here, treating my own site as the old site. CORS is still required for this to function properly, but as the docs pages are very similar at the moment I've gone ahead and made the check assume the page always exists.