From 3dd794cac91fafc9b47736b9f5f36d8127ff322c Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 29 May 2015 11:51:27 -0500 Subject: [PATCH] Bug 1168081 - Go to Line accesskey for view source tabs. r=Gijs --- toolkit/components/viewsource/content/viewSource-content.js | 6 ++++++ toolkit/locales/en-US/chrome/global/viewSource.properties | 1 + 2 files changed, 7 insertions(+) diff --git a/toolkit/components/viewsource/content/viewSource-content.js b/toolkit/components/viewsource/content/viewSource-content.js index 969b0767e0db..443394d6785c 100644 --- a/toolkit/components/viewsource/content/viewSource-content.js +++ b/toolkit/components/viewsource/content/viewSource-content.js @@ -885,6 +885,7 @@ let ViewSourceContent = { contextMenuItems: [ { id: "goToLine", + accesskey: true, handler() { sendAsyncMessage("ViewSource:PromptAndGoToLine"); } @@ -930,6 +931,11 @@ let ViewSourceContent = { if ("checked" in itemSpec) { item.setAttribute("type", "checkbox"); } + if (itemSpec.accesskey) { + let accesskeyName = `context_${itemSpec.id}_accesskey`; + item.setAttribute("accesskey", + this.bundle.GetStringFromName(accesskeyName)) + } menu.appendChild(item); }); diff --git a/toolkit/locales/en-US/chrome/global/viewSource.properties b/toolkit/locales/en-US/chrome/global/viewSource.properties index dea434e58869..9137b383ac8c 100644 --- a/toolkit/locales/en-US/chrome/global/viewSource.properties +++ b/toolkit/locales/en-US/chrome/global/viewSource.properties @@ -13,5 +13,6 @@ viewSelectionSourceTitle = DOM Source of Selection viewMathMLSourceTitle = DOM Source of MathML context_goToLine_label = Go to Lineā€¦ +context_goToLine_accesskey = L context_wrapLongLines_label = Wrap Long Lines context_highlightSyntax_label = Syntax Highlighting