Uh oh!
There was an error while loading. Please reload this page.
Add error detection to live browser launching and connecting. - #492
Conversation
chrisbank
commented
Mar 28, 2012
reviewing |
There was a problem hiding this comment.
I was just wondering how come NativeApp.openLiveBrowser is using callbacks instead of $.Deferred.
There was a problem hiding this comment.
That is the way Jonathan wrote it. I agree it should return a promise, and have made that change.
There was a problem hiding this comment.
Ah, no worries. Not directly related to this, but do you see wrapping other brackets_extensions.js functions here (like should I add the corresponding closeLiveBrowser here)? The main benefit I see is translating other async brackets extensions to use $.Deferred here since we shouldn't depend on jQuery in the brackets_extensions. This would somewhat mirror what happened to the brackets.fs async code.
I could also be looking for patterns and abstractions when none are needed and if there aren't much more native calls then we could refactor to not use this anymore.
There was a problem hiding this comment.
We have a pretty consistent pattern that is working well: the brackets.* functions are all minimal, without any external dependencies, and all brackets.* functions are wrapped in something higher level for general consumption. I don't think this is overly abstracting.
There was a problem hiding this comment.
Oh, and I've wrapped closeLiveBrowser in my local branch.
chrisbank
commented
Mar 28, 2012
looks good |
Add error detection to live browser launching and connecting.
updated code to load hidden image and use that url to load our canvas; indentation fixes, added basic error handling for callback of line 24 attempt to take the code from filters.js and put it into ImageViewer.js fixes the swatches not loading and allows canvas to be shown for multiple images, but save problem persists First fixes Abstract base64 to buffer conversion logic Cleanup image filter code Update main.js "added a comma to fix build error" got rid of extra lines that weren't working with current build reverted change to dimensionString fixed a capitalization typo for Image.js require updated caman library with comment block for details of license, url, etc updated base64toBuffer to be in fileUtils fixed a variable name typo [FileUtils] to [FilerUtils] updated to make text fixes (IMAGE_FILTER to IMAGE_FILTERS_TITLE and alignment), and removed the filesystemRefresh function (seems stable from my testing) Some styling updates to the image filter UI. Added a progress spinner De-selecting selected filter after it's applied to the image. Hard to force a style override and fixed a nit. Code style fixes
updated code to load hidden image and use that url to load our canvas; indentation fixes, added basic error handling for callback of line 24 attempt to take the code from filters.js and put it into ImageViewer.js fixes the swatches not loading and allows canvas to be shown for multiple images, but save problem persists First fixes Abstract base64 to buffer conversion logic Cleanup image filter code Update main.js "added a comma to fix build error" got rid of extra lines that weren't working with current build reverted change to dimensionString fixed a capitalization typo for Image.js require updated caman library with comment block for details of license, url, etc updated base64toBuffer to be in fileUtils fixed a variable name typo [FileUtils] to [FilerUtils] updated to make text fixes (IMAGE_FILTER to IMAGE_FILTERS_TITLE and alignment), and removed the filesystemRefresh function (seems stable from my testing) Some styling updates to the image filter UI. Added a progress spinner De-selecting selected filter after it's applied to the image. Hard to force a style override and fixed a nit. Code style fixes
This commit also restricts live browser connections to HTML files only, and disables auto-reconnect when switching to a new HTML file.