Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Extract About dialog from main HTML file so that we can override it easily in Edge Code #2329

Merged
merged 3 commits into from
Dec 12, 2012

Conversation

njx
Copy link

@njx njx commented Dec 11, 2012

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 and project-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 break update-dialog and project-settings-dialog out as part of this pull request, let me know and I can do it easily.

@@ -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
Copy link
Author

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.

@ghost ghost assigned jasonsanjose Dec 11, 2012
APP_NAME_ABOUT_BOX : brackets.config.app_name_about
}, Strings);

var $template = Mustache.render(AboutDialogTemplate, templateVars);
Copy link
Member

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.

Copy link
Author

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!

@jasonsanjose
Copy link
Member

Seems appropriate to do update-dialog and project-settings-dialog while your at it.

Initial review complete.

@njx
Copy link
Author

njx commented Dec 11, 2012

Updates pushed, ready for re-review.

if (buildInfo) {
$("#about-build-number").text(" (" + buildInfo + ")");
$("#about-build-number", $template).text(" (" + buildInfo + ")");
Copy link
Member

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.

@jasonsanjose
Copy link
Member

Looks good. But one more comment to clean up some programmatic text injection.

@njx
Copy link
Author

njx commented Dec 12, 2012

Done. Ready for another round.

@jasonsanjose
Copy link
Member

Merging.

jasonsanjose added a commit that referenced this pull request Dec 12, 2012
Extract About dialog from main HTML file so that we can override it easily in Edge Code
@jasonsanjose jasonsanjose merged commit cc7e4c9 into master Dec 12, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants