diff --git a/src/brackets.config.json b/src/brackets.config.json index 85a00b85350..ef478dfb38f 100644 --- a/src/brackets.config.json +++ b/src/brackets.config.json @@ -12,6 +12,7 @@ "report_issue_url" : "https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue", "twitter_url" : "https://twitter.com/brackets", "troubleshoot_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev", - "twitter_name" : "@brackets" + "twitter_name" : "@brackets", + "contributors_url" : "https://api.github.com/repos/adobe/brackets/contributors" } } \ No newline at end of file diff --git a/src/config.json b/src/config.json index 6522db13896..f7088a57dda 100644 --- a/src/config.json +++ b/src/config.json @@ -11,7 +11,8 @@ "report_issue_url": "https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue", "twitter_url": "https://twitter.com/brackets", "troubleshoot_url": "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev", - "twitter_name": "@brackets" + "twitter_name": "@brackets", + "contributors_url": "https://api.github.com/repos/adobe/brackets/contributors" }, "name": "Brackets", "version": "0.21.0-0", diff --git a/src/help/HelpCommandHandlers.js b/src/help/HelpCommandHandlers.js index 147261f7cf0..4498d207939 100644 --- a/src/help/HelpCommandHandlers.js +++ b/src/help/HelpCommandHandlers.js @@ -23,7 +23,7 @@ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ -/*global define, $, brackets, window, Mustache */ +/*global define, $, brackets, window, PathUtils, Mustache */ define(function (require, exports, module) { "use strict"; @@ -39,10 +39,32 @@ define(function (require, exports, module) { FileUtils = require("file/FileUtils"), NativeApp = require("utils/NativeApp"), StringUtils = require("utils/StringUtils"), - AboutDialogTemplate = require("text!htmlContent/about-dialog.html"); + AboutDialogTemplate = require("text!htmlContent/about-dialog.html"), + ContributorsTemplate = require("text!htmlContent/contributors-list.html"); var buildInfo; - + + + /** + * @private + * Gets a data structure that has the information for all the contributors of Brackets. + * The information is fetched from brackets.config.contributors_url using the github API. + * @return {$.Promise} jQuery Promise object that is resolved or rejected after the information is fetched. + */ + function _getContributorsInformation() { + var result = new $.Deferred(); + + $.getJSON(brackets.config.contributors_url) + .done(function (data) { + result.resolve(data); + }).fail(function () { + result.reject(); + }); + + return result.promise(); + } + + function _handleCheckForUpdates() { UpdateNotification.checkForUpdate(true); } @@ -69,7 +91,46 @@ define(function (require, exports, module) { APP_NAME_ABOUT_BOX : brackets.config.app_name_about, BUILD_INFO : buildInfo || "" }, Strings); + Dialogs.showModalDialogUsingTemplate(Mustache.render(AboutDialogTemplate, templateVars)); + + // Get all the project contributors and add them to the dialog + _getContributorsInformation().done(function (contributorsInfo) { + + // Populate the contributors data + var $dlg = $(".about-dialog.instance"); + var $contributors = $dlg.find(".about-contributors"); + var totalContributors = contributorsInfo.length; + var contributorsCount = 0; + + $contributors.html(Mustache.render(ContributorsTemplate, contributorsInfo)); + + // This is used to create an opacity transition when each image is loaded + $contributors.find("img").one("load", function () { + $(this).css("opacity", 1); + + // Count the contributors loaded and hide the spinner once all are loaded + contributorsCount++; + if (contributorsCount >= totalContributors) { + $dlg.find(".about-spinner").css("display", "none"); + } + }).each(function () { + if (this.complete) { + $(this).trigger("load"); + } + }); + + // Create a link for each contributor image to their github account + $contributors.on("click", "img", function (e) { + var url = $(e.target).data("url"); + if (url) { + // Make sure the URL has a domain that we know about + if (/(^|\.)github\.com$/i.test(PathUtils.parseUrl(url).hostname)) { + NativeApp.openURLInDefaultBrowser(url); + } + } + }); + }); } // Read "build number" SHAs off disk immediately at APP_READY, instead diff --git a/src/htmlContent/about-dialog.html b/src/htmlContent/about-dialog.html index 2e9cd84da1d..05cb933e0aa 100644 --- a/src/htmlContent/about-dialog.html +++ b/src/htmlContent/about-dialog.html @@ -6,10 +6,18 @@

{{ABOUT}}

{{APP_NAME_ABOUT_BOX}}

-

{{ABOUT_TEXT_LINE1}} {{BUILD_INFO}}

-

Copyright 2012 - 2013 Adobe Systems Incorporated and its licensors. All rights reserved.

-

{{{ABOUT_TEXT_LINE3}}}

-

{{{ABOUT_TEXT_LINE4}}}

+
+

{{ABOUT_TEXT_LINE1}} {{BUILD_INFO}}

+

Copyright 2012 - 2013 Adobe Systems Incorporated and its licensors. All rights reserved.

+

{{{ABOUT_TEXT_LINE3}}}

+

{{{ABOUT_TEXT_LINE4}}}

+

+ {{ABOUT_TEXT_LINE5}} + +

+
+
+