Skip to content

Commit aaa6d4a

Browse files
committed
chore: view license option in help menu
1 parent 6ba9abd commit aaa6d4a

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

docs/API-Reference/command/Commands.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,12 @@ Opens support resources
734734
## HELP\_GET\_PRO
735735
Opens Phoenix Pro page
736736

737+
**Kind**: global variable
738+
<a name="HELP_VIEW_LICENSE"></a>
739+
740+
## HELP\_VIEW\_LICENSE
741+
Opens Phoenix License page
742+
737743
**Kind**: global variable
738744
<a name="HELP_MANAGE_LICENSES"></a>
739745

src/command/Commands.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ define(function (require, exports, module) {
405405
/** Opens Phoenix Pro page */
406406
exports.HELP_GET_PRO = "help.getPro"; // HelpCommandHandlers.js _handleLinkMenuItem()
407407

408+
/** Opens Phoenix License page */
409+
exports.HELP_VIEW_LICENSE = "help.viewLicense"; // HelpCommandHandlers.js _handleLinkMenuItem()
410+
408411
/** Manage Pro licenses */
409412
exports.HELP_MANAGE_LICENSES = "help.manageLicenses"; // HelpCommandHandlers.js _handleLinkMenuItem()
410413

src/command/DefaultMenus.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ define(function (require, exports, module) {
267267
menu.addMenuItem(Commands.HELP_SUPPORT);
268268
menu.addMenuDivider();
269269
menu.addMenuItem(Commands.HELP_GET_PRO);
270+
menu.addMenuItem(Commands.HELP_VIEW_LICENSE);
270271
menu.addMenuDivider();
271272
if (brackets.config.suggest_feature_url) {
272273
menu.addMenuItem(Commands.HELP_SUGGEST);

src/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"account_url": "https://account.phcode.dev/",
1010
"promotions_url": "https://promotions.phcode.dev/dev/",
1111
"purchase_url": "https://phcode.io/pricing",
12+
"license_url": "https://www.gnu.org/licenses/agpl-3.0.en.html",
1213
"how_to_use_url": "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets",
1314
"docs_url": "https://docs.phcode.dev/",
1415
"support_url": "https://account.phcode.dev/?returnUrl=https%3A%2F%2Faccount.phcode.dev%2F%23support",

src/help/HelpCommandHandlers.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ define(function (require, exports, module) {
165165
});
166166
});
167167

168+
function _openLicenseLink() {
169+
if(brackets.config.license_url) {
170+
// license loaded based on pro-context from config
171+
NativeApp.openURLInDefaultBrowser(brackets.config.license_url);
172+
}
173+
}
174+
168175
const getProString = `${Strings.CMD_GET_PRO}<i class='fa fa-feather' style='margin-left: 4px;'></i>`;
169176

170177
CommandManager.register(Strings.CMD_HOW_TO_USE_BRACKETS, Commands.HELP_HOW_TO_USE_BRACKETS, _handleLinkMenuItem(brackets.config.how_to_use_url));
@@ -173,6 +180,7 @@ define(function (require, exports, module) {
173180
CommandManager.register(Strings.CMD_GET_PRO, Commands.HELP_GET_PRO, _handleLinkMenuItem(brackets.config.purchase_url), {
174181
htmlName: getProString
175182
});
183+
CommandManager.register(Strings.CMD_VIEW_LICENSE, Commands.HELP_VIEW_LICENSE, _openLicenseLink);
176184
CommandManager.register(Strings.CMD_SUGGEST, Commands.HELP_SUGGEST, _handleLinkMenuItem(brackets.config.suggest_feature_url));
177185
CommandManager.register(Strings.CMD_REPORT_ISSUE, Commands.HELP_REPORT_ISSUE, _handleLinkMenuItem(brackets.config.report_issue_url));
178186
CommandManager.register(Strings.CMD_RELEASE_NOTES, Commands.HELP_RELEASE_NOTES, _handleLinkMenuItem(brackets.config.release_notes_url));

src/nls/root/strings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ define({
688688
"CMD_HOW_TO_USE_BRACKETS": "How to Use {APP_NAME}",
689689
"CMD_SUPPORT": "{APP_NAME} Support",
690690
"CMD_GET_PRO": "Get Phoenix Pro",
691+
"CMD_VIEW_LICENSE": "View License",
691692
"CMD_MANAGE_LICENSES": "Manage Licenses",
692693
"CMD_USER_PROFILE": "{APP_NAME} Account",
693694
"CMD_DOCS": "Help, Getting Started",

0 commit comments

Comments
 (0)