This repository was archived by the owner on Jan 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed
Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 1414# that collapses the left and right panes in the debugger UI.
1515collapsePanes =Collapse panes
1616
17+ # LOCALIZATION NOTE (copyToClipboard.label): This is the text that appears in the
18+ # context menu to copy the complete source of the open file.
19+ copyToClipboard.label =Copy to clipboard
20+ copyToClipboard.accesskey =C
21+
1722# LOCALIZATION NOTE (copySource): This is the text that appears in the
1823# context menu to copy the selected source of file open.
1924copySource =Copy
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ function getMenuItems(
7777 const copyFunctionLabel = L10N . getStr ( "copyFunction.label" ) ;
7878 const copySourceKey = L10N . getStr ( "copySource.accesskey" ) ;
7979 const copySourceLabel = L10N . getStr ( "copySource" ) ;
80+ const copyToClipboardKey = L10N . getStr ( "copyToClipboard.accesskey" ) ;
81+ const copyToClipboardLabel = L10N . getStr ( "copyToClipboard.label" ) ;
8082 const copySourceUri2Key = L10N . getStr ( "copySourceUri2.accesskey" ) ;
8183 const copySourceUri2Label = L10N . getStr ( "copySourceUri2" ) ;
8284 const evaluateInConsoleLabel = L10N . getStr ( "evaluateInConsole.label" ) ;
@@ -93,6 +95,15 @@ function getMenuItems(
9395 const watchExpressionLabel = L10N . getStr ( "expressions.label" ) ;
9496
9597 // menu items
98+
99+ const copyToClipboardItem = {
100+ id : "node-menu-copy-to-clipboard" ,
101+ label : copyToClipboardLabel ,
102+ accesskey : copyToClipboardKey ,
103+ disabled : false ,
104+ click : ( ) => copyToTheClipboard ( selectedSource . get ( "text" ) )
105+ } ;
106+
96107 const copySourceItem = {
97108 id : "node-menu-copy-source" ,
98109 label : copySourceLabel ,
@@ -168,6 +179,7 @@ function getMenuItems(
168179
169180 // construct menu
170181 const menuItems = [
182+ copyToClipboardItem ,
171183 copySourceItem ,
172184 copySourceUri2Item ,
173185 copyFunctionItem ,
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ class Tab extends PureComponent<Props> {
6363 closeTabs,
6464 tabSources,
6565 showSource,
66- togglePrettyPrint
66+ togglePrettyPrint,
67+ selectedSource
6768 } = this . props ;
6869
6970 const otherTabs = tabSources . filter ( t => t . get ( "id" ) !== tab ) ;
@@ -107,6 +108,13 @@ class Tab extends PureComponent<Props> {
107108 item : { ...tabMenuItems . closeAllTabs , click : ( ) => closeTabs ( tabURLs ) }
108109 } ,
109110 { item : { type : "separator" } } ,
111+ {
112+ item : {
113+ ...tabMenuItems . copyToClipboard ,
114+ disabled : selectedSource . get ( "id" ) !== tab ,
115+ click : ( ) => copyToTheClipboard ( sourceTab . get ( "text" ) )
116+ }
117+ } ,
110118 {
111119 item : {
112120 ...tabMenuItems . copySourceUri2 ,
Original file line number Diff line number Diff line change @@ -98,6 +98,12 @@ export function getTabMenuItems() {
9898 accesskey : L10N . getStr ( "sourceTabs.revealInTree.accesskey" ) ,
9999 disabled : false
100100 } ,
101+ copyToClipboard : {
102+ id : "node-menu-copy-to-clipboard" ,
103+ label : L10N . getStr ( "copyToClipboard.label" ) ,
104+ accesskey : L10N . getStr ( "copyToClipboard.accesskey" ) ,
105+ disabled : false
106+ } ,
101107 copySourceUri2 : {
102108 id : "node-menu-copy-source-url" ,
103109 label : L10N . getStr ( "copySourceUri2" ) ,
You can’t perform that action at this time.
0 commit comments