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
Revise or delete load-leo.html #3005
Comments
@tbpassin I see the behavior you describe. Notes:
Conclusion: |
Fixing the JS is beyond me at present. Someone else will have to fix this issue. |
I think the error is coming from the php file do-leo.php. The error message wording appears in lines 635 and 683. |
Currently, the php file mungs the LeoDocs.leo outline to insert a stylehseet PI (Process Instruction). If the stylesheet PI (<?xml-stylesheet ...) could be permanently put into LeoDocs.leo, there would be no need for the php file, jquery, or any of that. When a browser loads the .leo file, it would automatically be displayed using the xslt stylesheet. If the current code that opens a Leo outline in Leo cannot accept (and ignore) a stylesheet PI, then I would regard that as a bug that should be fixed. (I have not yet tested for this). |
I added a stylesheet PI to my workbook outline and Leo opened it without a problem. However, when I opened the same outline in the browser from the filesystem, the xslt stylesheet didn't get applied. That surprises me because it does get applied when the LeoDoecs.leo outline is downloaded from the internet (i.e., the Leo site). |
@tbpassin Thanks, Thomas, for these comments. With your permission, I'll delegate this issue to you. |
The page in question uses a server-side php file on leoeditor.com. I'd need admin permissions to make changes. |
If you use URL https://leoeditor.com/load-leo.html The [Upload From the Internet] button does not work. However if you use new URL https://leo-editor.github.io/leo-editor/load-leo.html neither button works. |
This issue fell off my radar. I'll look at it again. But something about @LewisNeal's description puzzles me. I just tried _[Upload From Your Hard Drive] _ on a Leo outline on my hard drive, and the file was displayed in the browser as expected. It sounds like @LewisNeal entered the url into the file dialog, and didn't get a document displayed. I assumed up til now that this dialog was intended for an outline on one's file system, not a url. When I tried it with @LewisNeals's url, I found that the requested page was in fact downloaded. But it was served with the content type application/xml. However, the document was actually an HTML5 document starting with <!doctype html>, and that's not well-formed for an XML file. An XML file must start with When I uploaded an outline from my hard drive, it was converted correctly to an XML file, so the MIME type was correct. My conclusion - there is nothing wrong with the _[Upload From Your Hard Drive] _ button. If you try use it to upload something that is not on your hard drive, don't be surprised if it doesn't work. Ideally, I suppose that this condition could be detected and an error message given. Alternatively, there could be one upload button that would accept a URL or a file system outline. But I don't know as it would be worth the effort since the __[Upload From Your Hard Drive] _ button works as advertised. The problem with the [Upload From the Internet] button remains. |
To clarify - I did not load a url into the file dialog. But use old URL https://leoeditor.com/load-leo.html and the [Upload From Your Hard Drive] button works correctly, opening a File Open window dialog asking you to select a file, and press Open. |
Well, you just wrote that you used a url and the [Upload From Your Hard Drive] didn't work. That button opens a file dialog. It does not use the url you type into the url box, as best as I know. If you did not "load a url into the file dialog", then how did you try to open it with the button? |
I only wanted to show that for |
When you click the [Upload From Your Hard Drive] button, you should get a file dialog. If you don't get it, there is something wrong at your end, possibly because javascript is not allowed (e.g., by NoScript). When I tried it, I had to allow scripts (I use NoScript) before the button would work. If you do get the File Open dialog, and navigate it to a Leo outline on your computer's drive, that will work, or at least it works on my system. If you do get a file dialog and type in a URL instead of a file path, that will not work as I explained earlier, because the script expects a file, not a url. The file dialog will not make use of https://leo-editor.github.io/leo-editor/load-leo.html, or any other entry displayed in the URL box, so far as I know. |
I am only using the [Upload From Your Hard Drive] button. |
Oh, now I get it. I had loaded the upload page from the old link, and it worked as expected. I just got it from the link on the current Leo-editor page on GitHub and clicking the button had no effect. I'm sorry I misunderstood you. I think what is wrong is that two support scripts probably didn't get copied over to the new github.io site:
At any rate, the page is failing because these two scripts aren't being found. I guess it is up to @edward to provide them... |
@tbpassin Thanks for your investigation. I may have removed the two .js file because of a dependabot complaint. |
I have reopened this issue and assigned it to 6.7.4. A simple fix may be possible. |
As long as the scripts don't import other scripts, they could be embedded into the HTML output file using <script> elements (though that might make it pretty large). |
Completed via PR #3441. |
See PR #3441.
Temporary solution
The PR rewrites
load-leo.html
to say that vscode.dev will (eventually!?!) support leoInteg.Original report
In Leo's Readme om Github, there is a link near the bottom : A web page that displays .leo files. Trying to load the default outline offered, my browser gave an error "File is too large":
A smaller outline should be found for this demonstration.
The text was updated successfully, but these errors were encountered: