-
-
Notifications
You must be signed in to change notification settings - Fork 273
files.js -- Update with code from Files Expanded #1833
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
base: master
Are you sure you want to change the base?
Conversation
!format |
Related PR: #1594 |
|
Ah, someone that actually knows what they are doing. I'm just going to close mine, since this does everything that mine would do (and better). |
Renamed the branch, reopen the PR from |
!format |
!format |
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.
A more indepth review is indeed required.
fileDate = "", | ||
lastData = ""; | ||
let openModals = 0; | ||
let selectorOptions = { |
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.
is there a reason you cant just make this a constant
if (override === "folder") { | ||
fileInfo = await window.showDirectoryPicker({ | ||
multiple: false, | ||
types: [{ accept: { "*/*": [] } }], |
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.
is there a reason you cant accept other types
* @param {Uint8Array} buffer | ||
* @returns {string} base64 | ||
*/ | ||
function bufferToBase64(buffer) { |
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.
this seems wasteful and copied from stackoverflow, is there a reason you cant use the globally exposed Base64 module
const picker = await showFilePrompt("Folder", "", "folder"); | ||
if (!picker) return; | ||
|
||
const createExtFile = async (folderN, data) => { |
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.
is there a reason these have to be inlined instead of just functions on the class itself
@@ -444,7 +1117,242 @@ | |||
console.warn(`unknown mode`, args.mode); | |||
} | |||
} | |||
|
|||
fileInfo(args) { | |||
if (args.FORMAT === "size formatted") return FileSize; |
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.
checking again you dont cast anything in your new changes, that should be fixed
selectorOptions.image = `url(${encodeURI(args.IMG)})`; | ||
updateModalVisuals(); | ||
} else { | ||
console.warn("Cannot fetch content from the URL."); |
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.
there's no reason to console.warn but okay
Super Mega Update to the Files Extension to port over many new features from my expansion of the extension.
This includes:
Closes:
#1603
#156
#837
Files Expanded:
https://github.com/SharkPool-SP/SharkPools-Extensions/blob/main/extension-code/Files-Expanded.js