diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index 26d3d41dd13448fe6e18d8b8396b6880f4d2a23b..218df383df75971d831eb90b278b89c04d4fd322 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -851,7 +851,7 @@ export class VSCodeMenu { product.releaseNotesUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miReleaseNotes', comment: ['&& denotes a mnemonic'] }, "&&Release Notes")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'update.showCurrentReleaseNotes') }) : null, enableWelcomePage || product.documentationUrl || product.releaseNotesUrl ? __separator__() : null, keyboardShortcutsUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miKeyboardShortcuts', comment: ['&& denotes a mnemonic'] }, "&&Keyboard Shortcuts Reference")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.keybindingsReference') }) : null, - product.introductoryVideosUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miIntroductoryVideos', comment: ['&& denotes a mnemonic'] }, "Introductory &&Videos")), click: () => this.openUrl(product.introductoryVideosUrl, 'openIntroductoryVideosUrl') }) : null, + product.introductoryVideosUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miIntroductoryVideos', comment: ['&& denotes a mnemonic'] }, "Introductory &&Videos")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.openIntroductoryVideosUrl') }) : null, (product.introductoryVideosUrl || keyboardShortcutsUrl) ? __separator__() : null, product.twitterUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miTwitter', comment: ['&& denotes a mnemonic'] }, "&&Join us on Twitter")), click: () => this.openUrl(product.twitterUrl, 'openTwitterUrl') }) : null, product.requestFeatureUrl ? new MenuItem({ label: mnemonicLabel(nls.localize({ key: 'miUserVoice', comment: ['&& denotes a mnemonic'] }, "&&Search Feature Requests")), click: () => this.openUrl(product.requestFeatureUrl, 'openUserVoiceUrl') }) : null, diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index 568f7a5aae09857859f5910dd6752f5dbfed284f..7415b45f4a0b5ea9d879fb17532471a99e12a573 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -877,6 +877,27 @@ export class OpenDocumentationUrlAction extends Action { } } +export class OpenIntroductoryVideosUrlAction extends Action { + + public static ID = 'workbench.action.openIntroductoryVideosUrl'; + public static LABEL = nls.localize('openIntroductoryVideosUrl', "Introductory Videos"); + + private static URL = product.introductoryVideosUrl; + public static AVAILABLE = !!OpenIntroductoryVideosUrlAction.URL; + + constructor( + id: string, + label: string + ) { + super(id, label); + } + + public run(): TPromise { + window.open(OpenIntroductoryVideosUrlAction.URL); + return null; + } +} + // --- commands CommandsRegistry.registerCommand('_workbench.diff', function (accessor: ServicesAccessor, args: [URI, URI, string, string]) { diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 8ceacfc882b8268972076e44e6d73c6512dd82b5..c1224b5b0c1c8a2857f02772c1a1c08c3fef4823 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -19,7 +19,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe import { IPartService } from 'vs/workbench/services/part/common/partService'; import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; -import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseFolderAction, CloseWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction } from 'vs/workbench/electron-browser/actions'; +import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseFolderAction, CloseWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction } from 'vs/workbench/electron-browser/actions'; import { MessagesVisibleContext, NoEditorsVisibleContext, InZenModeContext } from 'vs/workbench/electron-browser/workbench'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { IWindowsService } from 'vs/platform/windows/common/windows'; @@ -45,6 +45,9 @@ if (KeybindingsReferenceAction.AVAILABLE) { if (OpenDocumentationUrlAction.AVAILABLE) { workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenDocumentationUrlAction, OpenDocumentationUrlAction.ID, OpenDocumentationUrlAction.LABEL), 'Help: Documentation', helpCategory); } +if (OpenIntroductoryVideosUrlAction.AVAILABLE) { + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenIntroductoryVideosUrlAction, OpenIntroductoryVideosUrlAction.ID, OpenIntroductoryVideosUrlAction.LABEL), 'Help: Introductory Videos', helpCategory); +} workbenchActionsRegistry.registerWorkbenchAction( new SyncActionDescriptor(ZoomInAction, ZoomInAction.ID, ZoomInAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.US_EQUAL, diff --git a/src/vs/workbench/parts/welcomePage/electron-browser/welcomePage.html b/src/vs/workbench/parts/welcomePage/electron-browser/welcomePage.html index 242b61aaf690e276f7ca61d1e6e3538fd8e98a5c..53e8e53cd07e0f7cbfdf492429a87d35ad4893da 100644 --- a/src/vs/workbench/parts/welcomePage/electron-browser/welcomePage.html +++ b/src/vs/workbench/parts/welcomePage/electron-browser/welcomePage.html @@ -23,7 +23,7 @@

Help