-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Extract About dialog from main HTML file so that we can override it easily in Edge Code #2329
Conversation
…asily in Edge Code.
@@ -55,11 +56,17 @@ define(function (require, exports, module) { | |||
} | |||
|
|||
function _handleAboutDialog() { | |||
var templateVars = $.extend({ | |||
ABOUT_ICON : brackets.config.about_icon, | |||
APP_NAME_ABOUT_BOX : brackets.config.app_name_about |
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.
Note that VERSION no longer seems to be used in any of the dialogs directly (it's only used within other strings, and gets substituted into them in src/strings.js). So I took it out here.
APP_NAME_ABOUT_BOX : brackets.config.app_name_about | ||
}, Strings); | ||
|
||
var $template = Mustache.render(AboutDialogTemplate, templateVars); |
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.
I think this should be just template
since this isn't a jQuery object.
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.
Weird--I meant to wrap the render in $()
. I actually have no idea why this code works without it!
Seems appropriate to do Initial review complete. |
Updates pushed, ready for re-review. |
if (buildInfo) { | ||
$("#about-build-number").text(" (" + buildInfo + ")"); | ||
$("#about-build-number", $template).text(" (" + buildInfo + ")"); |
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.
I just realized we don't have to do this programmatically any more. Before this change, the template had to render early and couldn't wait for the buildInfo to resolve. Now that we build the template just-in-time, we can update the template to use a BUILD_INFO
template var.
Looks good. But one more comment to clean up some programmatic text injection. |
Done. Ready for another round. |
Merging. |
Extract About dialog from main HTML file so that we can override it easily in Edge Code
The only difference in
main-view.html
between Brackets and Edge Code is the about dialog. Since we want to move to having the differences in Edge Code be an overlay instead of a full fork, we want to localize differences as much as possible into separate minimally-sized files, so that as much is shared as possible.Note that while I only moved the About dialog into a separate file, it would make sense to take some of the other one-off dialogs that are only used by one module and break them out similarly; there's really no reason for dialog IDs/templates for these one-off dialogs to be centralized in Dialogs.js. I was tempted to just go ahead and do that, but for some dialogs it might additionally make sense to combine them into a single dialog template a la #258.
The dialogs that seem to be true one-offs are
update-dialog
andproject-settings-dialog
; all the other dialogs seem similar enough that they probably ought to be combined somehow. If you think it's worthwhile to go ahead and breakupdate-dialog
andproject-settings-dialog
out as part of this pull request, let me know and I can do it easily.