-
Notifications
You must be signed in to change notification settings - Fork 311
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
Support for native files on Apache Cordova #134
Closed
Closed
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ed0de11
cordova file support inspired by naranjamecanica
0c5e4c9
CordovaFile support modified by the PR review comments
39675d3
undoed package-lcok.json changes from PR
5c2f566
function success() with no means removed
033d106
single quotas replaced with double quotas
3455387
still one more function was useless (used in dev time)
5c2cbba
Merge changes from latest master branch
Acconut ce5aa42
Cordova FileReader readAsByteArray called for slice result
601b4f7
missing newline added
7380fdb
moved readAsByteArray call inside slice method in case of cordova
30884b1
cordova demo with camera and file plugin
ccd724a
master merged and slice missing callback added
1a98599
tus.js copied from projects dist
cdcb15a
Readme for Cordova Demo added
5e670db
correcting some errors for demo
5d128b9
Had to undo a little bit demo changes cause not worked
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
const isCordova = typeof window != "undefined" && ( | ||
typeof window.PhoneGap != "undefined" || | ||
typeof window.Cordova != "undefined" || | ||
typeof window.cordova != "undefined"); | ||
const isCordova = () => typeof window != "undefined" && ( | ||
typeof window.PhoneGap != "undefined" || | ||
typeof window.Cordova != "undefined" || | ||
typeof window.cordova != "undefined"); | ||
|
||
export default isCordova; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* In cordova FileReader is used to read a slice of the file */ | ||
function readAsByteArray(chunk, done) { | ||
let reader = new FileReader(); | ||
reader.onload = () => { | ||
done(null, new Uint8Array(reader.result)); | ||
}; | ||
reader.onerror = (err) => { | ||
done(err); | ||
}; | ||
reader.readAsArrayBuffer(chunk); | ||
} | ||
|
||
export default readAsByteArray; |
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we still
xhr.send
in the face of this error or is there a missing return?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved that block to source.js in commit 7380fdb since that would be more suitable Could you confirm that is correct. There should be this also corrected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks OK from what I can tell when looking at it from the git diff.