Repository navigation
Document window.Native.getPathForFile for dropped files - #603
Open
PunchRockgroin wants to merge 2 commits into
Open
PunchRockgroin wants to merge 2 commits into
PunchRockgroin wants to merge 2 commits into
Conversation
NativePHP/desktop#170 added getPathForFile to window.Native because Electron 32 removed File.path. Explain how to use it, what it returns when there's no file on disk, and how to stop stray drops navigating the window.
The docs use 'the browser' for the user's web browser, and the next paragraph of this section does too, so describe JavaScript running in a window instead.
8 of 9 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents
window.Native.getPathForFile(), added in NativePHP/desktop#170, as requested there. It adds a "Getting the path of a dropped file" section to the Desktop v2 Files page.The section covers how to use it from a drop handler, when it returns an empty string, what happens with files dragged from a web browser, and how to stop a stray drop navigating the window. The browser behaviour comes from the testing in NativePHP/desktop#170.
Notes
webUtils.getPathForFileaswindow.Native.getPathForFilefor dropped files desktop#170 isn't in a tagged release yet (the latest is 2.4.0), so you may want to hold this until the release that includes it. I haven't named a version in the docs because I don't know which one that will be.[aside]and[warning], which show up as literal text on the live site. This section uses<aside>like the other Desktop v2 pages. I've left the existing ones alone to keep this PR focused, and I'm happy to fix them separately.Testing
I rendered the new section with
league/commonmarkusing the site's core and GFM extensions andhtml_inputsetting: the aside and both code blocks came out correctly. I haven't run the full site locally, so Torchlight highlighting and the final styling are unchecked.