From dd5dc5401c11da19411336b6463fa8693ad6358d Mon Sep 17 00:00:00 2001 From: Hubert Boma Manilla Date: Thu, 28 Sep 2017 14:52:46 +0100 Subject: [PATCH 1/6] add the tabs reducer --- src/reducers/tabs.js | 107 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 src/reducers/tabs.js diff --git a/src/reducers/tabs.js b/src/reducers/tabs.js new file mode 100644 index 0000000000..bf36f604be --- /dev/null +++ b/src/reducers/tabs.js @@ -0,0 +1,107 @@ +// @flow +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * Tabs reducer + * @module reducers/tabs + */ + +import * as I from "immutable"; +import makeRecord from "../utils/makeRecord"; +import { prefs } from "../utils/prefs"; + +import type { List } from "immutable"; +import type { Action } from "../actions/types"; +import type { Record } from "../utils/makeRecord"; + +type Tab = { + id: string, + title: string, + tooltip?: string +}; + +type TabList = List; +export type TabsState = { + currentTabIndex: number + tabs: TabList +} + +export function initialState(): Record { + return makeRecord({ + currentTabIndex: 0, + tabs: I.List() + }) +} + +export default function update(state: Record, action: Action): Record { + switch (action.type) { + case "ADD_TAB": + const tab = { id: action.id, title: action.title, tooltip: action.tooltip }; + return state.merge({ tabs: updateTabList({ tabsState: state }, tab, action.tabIndex) }); + + case "SELECT_TAB": + return state.set("currentTabIndex", action.tabIndex); + + case "MOVE_TAB": + const tab = state.tabs.find(tab => tab.id === id); + return state.merge({ + tabs: updateTabList({ tabsState: state }, tab, action.tabIndex) + }); + + case "CLOSE_TAB": + const tabs = removeFromTabList({ tabsState: state }, [action.id]); + prefs.tabs = tabs; + return state.merge({ tabs }); + + case "CLOSE_TABS": + const tabs = removeFromTabList({ tabsState: state }, action.ids); + prefs.tabs = tabs; + return state.merge({ tabs }); + } + + return state; +}; + +/** + * Adds the new tab to the list or moves the tab in the list if it is not already there + * @memberof reducers/sources + * @static + */ +function updateTabList(state: OuterState, currentTab: Tab, moveIndex?: number) { + let tabs = state.tabsState.get("tabs"); + + const currentTabIndex = tabs.findIndex(tab => tab.id === id); + + if (currentTabIndex === -1) { + tabs = tabs.insert(0, currentTab); + } + + if (moveIndex !== undefined) { + const currentIndex = tabs.indexOf(currentTab); + tabs = tabs.delete(currentIndex).insert(moveIndex, currentTab); + } + + prefs.tabs = tabs.toJS(); + return tabs; +} + +export function removeFromTabList(state: OuterState, tabIds: Array) { + let tabs = state.tabsState.get("tabs"); + return tabIds.reduce((tabs, id) => tabs.filter(tab => tab != id)), tabs); +} + +function restoreTabs() { + const prefsTabs = prefs.tabs || []; + if (prefsTabs.length == 0) { + return; + } + return prefsTabs; +} + +type OuterState = { tabs: Record }; + +const getTabsState = state => state.tabs; + +const getTabs = createSelector(getTabsState, tabs => tabs.tabs); \ No newline at end of file From b26bc183ec5e6e244727fbf824ff5f0a73e34e1e Mon Sep 17 00:00:00 2001 From: Hubert Boma Manilla Date: Thu, 28 Sep 2017 14:59:48 +0100 Subject: [PATCH 2/6] add space --- src/reducers/tabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reducers/tabs.js b/src/reducers/tabs.js index bf36f604be..e58bc87f38 100644 --- a/src/reducers/tabs.js +++ b/src/reducers/tabs.js @@ -104,4 +104,4 @@ type OuterState = { tabs: Record }; const getTabsState = state => state.tabs; -const getTabs = createSelector(getTabsState, tabs => tabs.tabs); \ No newline at end of file +const getTabs = createSelector(getTabsState, tabs => tabs.tabs); From fc87eb65e30cde6e57d824589abda2c4a134182f Mon Sep 17 00:00:00 2001 From: Hubert Boma Manilla Date: Wed, 24 Jan 2018 00:59:39 +0000 Subject: [PATCH 3/6] move part of the tab menuitems to the utils --- src/components/Editor/Tab.js | 127 +++++++++++------------------------ src/utils/tabs.js | 48 +++++++++++++ 2 files changed, 88 insertions(+), 87 deletions(-) diff --git a/src/components/Editor/Tab.js b/src/components/Editor/Tab.js index cd1a461ae0..d4512230c7 100644 --- a/src/components/Editor/Tab.js +++ b/src/components/Editor/Tab.js @@ -19,7 +19,7 @@ import actions from "../../actions"; import { getFilename, getFileURL, isPretty } from "../../utils/source"; import { copyToTheClipboard } from "../../utils/clipboard"; -import { getSourceAnnotation } from "../../utils/tabs"; +import { getSourceAnnotation, getTabMenuItems } from "../../utils/tabs"; import { getSelectedSource, @@ -60,26 +60,6 @@ class Tab extends PureComponent { togglePrettyPrint } = this.props; - const closeTabLabel = L10N.getStr("sourceTabs.closeTab"); - const closeOtherTabsLabel = L10N.getStr("sourceTabs.closeOtherTabs"); - const closeTabsToEndLabel = L10N.getStr("sourceTabs.closeTabsToEnd"); - const closeAllTabsLabel = L10N.getStr("sourceTabs.closeAllTabs"); - const revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree"); - const copyLinkLabel = L10N.getStr("copySourceUri2"); - const prettyPrintLabel = L10N.getStr("sourceTabs.prettyPrint"); - - const closeTabKey = L10N.getStr("sourceTabs.closeTab.accesskey"); - const closeOtherTabsKey = L10N.getStr( - "sourceTabs.closeOtherTabs.accesskey" - ); - const closeTabsToEndKey = L10N.getStr( - "sourceTabs.closeTabsToEnd.accesskey" - ); - const closeAllTabsKey = L10N.getStr("sourceTabs.closeAllTabs.accesskey"); - const revealInTreeKey = L10N.getStr("sourceTabs.revealInTree.accesskey"); - const copyLinkKey = L10N.getStr("copySourceUri2.accesskey"); - const prettyPrintKey = L10N.getStr("sourceTabs.prettyPrint.accesskey"); - const otherTabs = tabSources.filter(t => t.get("id") !== tab); const sourceTab = tabSources.find(t => t.get("id") == tab); const tabURLs = tabSources.map(t => t.get("url")); @@ -90,82 +70,55 @@ class Tab extends PureComponent { } const isPrettySource = isPretty(sourceTab); - - const closeTabMenuItem = { - id: "node-menu-close-tab", - label: closeTabLabel, - accesskey: closeTabKey, - disabled: false, - click: () => closeTab(sourceTab.get("url")) - }; - - const closeOtherTabsMenuItem = { - id: "node-menu-close-other-tabs", - label: closeOtherTabsLabel, - accesskey: closeOtherTabsKey, - disabled: false, - click: () => closeTabs(otherTabURLs) - }; - - const closeTabsToEndMenuItem = { - id: "node-menu-close-tabs-to-end", - label: closeTabsToEndLabel, - accesskey: closeTabsToEndKey, - disabled: false, - click: () => { - const tabIndex = tabSources.findIndex(t => t == tab); - closeTabs(tabURLs.filter((t, i) => i > tabIndex)); - } - }; - - const closeAllTabsMenuItem = { - id: "node-menu-close-all-tabs", - label: closeAllTabsLabel, - accesskey: closeAllTabsKey, - disabled: false, - click: () => closeTabs(tabURLs) - }; - - const showSourceMenuItem = { - id: "node-menu-show-source", - label: revealInTreeLabel, - accesskey: revealInTreeKey, - disabled: false, - click: () => showSource(sourceTab) - }; - - const copySourceUri2 = { - id: "node-menu-copy-source-url", - label: copyLinkLabel, - accesskey: copyLinkKey, - disabled: false, - click: () => copyToTheClipboard(sourceTab.get("url")) - }; - - const prettyPrint = { - id: "node-menu-pretty-print", - label: prettyPrintLabel, - accesskey: prettyPrintKey, - disabled: false, - click: () => togglePrettyPrint(sourceTab.get("id")) - }; + const tabMenuItems = getTabMenuItems(); const items = [ - { item: closeTabMenuItem }, - { item: closeOtherTabsMenuItem, hidden: () => tabSources.size === 1 }, { - item: closeTabsToEndMenuItem, + item: { + ...tabMenuItems.closeTab, + click: () => closeTab(sourceTab.get("url")) + } + }, + { + item: { + ...tabMenuItems.closeOtherTabs, + click: () => closeTabs(otherTabURLs) + }, + hidden: () => tabSources.size === 1 + }, + { + item: { + ...tabMenuItems.closeTabsToEnd, + click: () => { + const tabIndex = tabSources.findIndex(t => t.get("id") == tab); + closeTabs(tabURLs.filter((t, i) => i > tabIndex)); + } + }, hidden: () => tabSources.some((t, i) => t === tab && tabSources.size - 1 === i) }, - { item: closeAllTabsMenuItem }, + { + item: { ...tabMenuItems.closeAllTabs, click: () => closeTabs(tabURLs) } + }, { item: { type: "separator" } }, - { item: copySourceUri2 } + { + item: { + ...tabMenuItems.copySourceUri2, + click: () => copyToTheClipboard(sourceTab.get("url")) + } + } ]; if (!isPrettySource) { - items.push({ item: showSourceMenuItem }); - items.push({ item: prettyPrint }); + items.push({ + item: { ...tabMenuItems.showSource, click: () => showSource(tab) } + }); + items.push({ + item: { + ...tabMenuItems.prettyPrint, + click: () => showSource(tab) + } + }); } showMenu(e, buildMenu(items)); diff --git a/src/utils/tabs.js b/src/utils/tabs.js index 725e0c93c6..dae169cddb 100644 --- a/src/utils/tabs.js +++ b/src/utils/tabs.js @@ -61,3 +61,51 @@ export function getSourceAnnotation( return ; } } + +export function getTabMenuItems() { + const items = { + closeTab: { + id: "node-menu-close-tab", + label: L10N.getStr("sourceTabs.closeTab"), + accesskey: L10N.getStr("sourceTabs.closeTab.accesskey"), + disabled: false + }, + closeOtherTabs: { + id: "node-menu-close-other-tabs", + label: L10N.getStr("sourceTabs.closeOtherTabs"), + accesskey: L10N.getStr("sourceTabs.closeOtherTabs.accesskey"), + disabled: false + }, + closeTabsToEnd: { + id: "node-menu-close-tabs-to-end", + label: L10N.getStr("sourceTabs.closeTabsToEnd"), + accesskey: L10N.getStr("sourceTabs.closeTabsToEnd.accesskey"), + disabled: false + }, + closeAllTabs: { + id: "node-menu-close-all-tabs", + label: L10N.getStr("sourceTabs.closeAllTabs"), + accesskey: L10N.getStr("sourceTabs.closeAllTabs.accesskey"), + disabled: false + }, + showSource: { + id: "node-menu-show-source", + label: L10N.getStr("sourceTabs.revealInTree"), + accesskey: L10N.getStr("sourceTabs.revealInTree.accesskey"), + disabled: false + }, + copySourceUri2: { + id: "node-menu-copy-source-url", + label: L10N.getStr("copySourceUri2"), + accesskey: L10N.getStr("copySourceUri2.accesskey"), + disabled: false + }, + prettyPrint: { + id: "node-menu-pretty-print", + label: L10N.getStr("sourceTabs.prettyPrint"), + accesskey: L10N.getStr("sourceTabs.prettyPrint.accesskey"), + disabled: false + } + }; + return items; +} From 6d5bc253c9afa2a03e4b1f1f7cfac79a1d80cfc0 Mon Sep 17 00:00:00 2001 From: Hubert Boma Manilla Date: Wed, 24 Jan 2018 01:03:29 +0000 Subject: [PATCH 4/6] remove abs reducers --- src/reducers/tabs.js | 107 ------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 src/reducers/tabs.js diff --git a/src/reducers/tabs.js b/src/reducers/tabs.js deleted file mode 100644 index e58bc87f38..0000000000 --- a/src/reducers/tabs.js +++ /dev/null @@ -1,107 +0,0 @@ -// @flow -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * Tabs reducer - * @module reducers/tabs - */ - -import * as I from "immutable"; -import makeRecord from "../utils/makeRecord"; -import { prefs } from "../utils/prefs"; - -import type { List } from "immutable"; -import type { Action } from "../actions/types"; -import type { Record } from "../utils/makeRecord"; - -type Tab = { - id: string, - title: string, - tooltip?: string -}; - -type TabList = List; -export type TabsState = { - currentTabIndex: number - tabs: TabList -} - -export function initialState(): Record { - return makeRecord({ - currentTabIndex: 0, - tabs: I.List() - }) -} - -export default function update(state: Record, action: Action): Record { - switch (action.type) { - case "ADD_TAB": - const tab = { id: action.id, title: action.title, tooltip: action.tooltip }; - return state.merge({ tabs: updateTabList({ tabsState: state }, tab, action.tabIndex) }); - - case "SELECT_TAB": - return state.set("currentTabIndex", action.tabIndex); - - case "MOVE_TAB": - const tab = state.tabs.find(tab => tab.id === id); - return state.merge({ - tabs: updateTabList({ tabsState: state }, tab, action.tabIndex) - }); - - case "CLOSE_TAB": - const tabs = removeFromTabList({ tabsState: state }, [action.id]); - prefs.tabs = tabs; - return state.merge({ tabs }); - - case "CLOSE_TABS": - const tabs = removeFromTabList({ tabsState: state }, action.ids); - prefs.tabs = tabs; - return state.merge({ tabs }); - } - - return state; -}; - -/** - * Adds the new tab to the list or moves the tab in the list if it is not already there - * @memberof reducers/sources - * @static - */ -function updateTabList(state: OuterState, currentTab: Tab, moveIndex?: number) { - let tabs = state.tabsState.get("tabs"); - - const currentTabIndex = tabs.findIndex(tab => tab.id === id); - - if (currentTabIndex === -1) { - tabs = tabs.insert(0, currentTab); - } - - if (moveIndex !== undefined) { - const currentIndex = tabs.indexOf(currentTab); - tabs = tabs.delete(currentIndex).insert(moveIndex, currentTab); - } - - prefs.tabs = tabs.toJS(); - return tabs; -} - -export function removeFromTabList(state: OuterState, tabIds: Array) { - let tabs = state.tabsState.get("tabs"); - return tabIds.reduce((tabs, id) => tabs.filter(tab => tab != id)), tabs); -} - -function restoreTabs() { - const prefsTabs = prefs.tabs || []; - if (prefsTabs.length == 0) { - return; - } - return prefsTabs; -} - -type OuterState = { tabs: Record }; - -const getTabsState = state => state.tabs; - -const getTabs = createSelector(getTabsState, tabs => tabs.tabs); From f09c200c218089f6425454c7a4ab21e048f0f06e Mon Sep 17 00:00:00 2001 From: Hubert Boma Manilla Date: Thu, 25 Jan 2018 19:08:16 +0000 Subject: [PATCH 5/6] fixes --- src/components/Editor/Tab.js | 6 +-- src/utils/tabs.js | 91 +++++++++++++++++------------------- 2 files changed, 47 insertions(+), 50 deletions(-) diff --git a/src/components/Editor/Tab.js b/src/components/Editor/Tab.js index d4512230c7..e3372bdcd9 100644 --- a/src/components/Editor/Tab.js +++ b/src/components/Editor/Tab.js @@ -19,7 +19,7 @@ import actions from "../../actions"; import { getFilename, getFileURL, isPretty } from "../../utils/source"; import { copyToTheClipboard } from "../../utils/clipboard"; -import { getSourceAnnotation, getTabMenuItems } from "../../utils/tabs"; +import { getSourceAnnotation, tabMenuItems } from "../../utils/tabs"; import { getSelectedSource, @@ -70,7 +70,6 @@ class Tab extends PureComponent { } const isPrettySource = isPretty(sourceTab); - const tabMenuItems = getTabMenuItems(); const items = [ { @@ -113,10 +112,11 @@ class Tab extends PureComponent { items.push({ item: { ...tabMenuItems.showSource, click: () => showSource(tab) } }); + items.push({ item: { ...tabMenuItems.prettyPrint, - click: () => showSource(tab) + click: () => togglePrettyPrint(tab) } }); } diff --git a/src/utils/tabs.js b/src/utils/tabs.js index dae169cddb..5de8cfe584 100644 --- a/src/utils/tabs.js +++ b/src/utils/tabs.js @@ -62,50 +62,47 @@ export function getSourceAnnotation( } } -export function getTabMenuItems() { - const items = { - closeTab: { - id: "node-menu-close-tab", - label: L10N.getStr("sourceTabs.closeTab"), - accesskey: L10N.getStr("sourceTabs.closeTab.accesskey"), - disabled: false - }, - closeOtherTabs: { - id: "node-menu-close-other-tabs", - label: L10N.getStr("sourceTabs.closeOtherTabs"), - accesskey: L10N.getStr("sourceTabs.closeOtherTabs.accesskey"), - disabled: false - }, - closeTabsToEnd: { - id: "node-menu-close-tabs-to-end", - label: L10N.getStr("sourceTabs.closeTabsToEnd"), - accesskey: L10N.getStr("sourceTabs.closeTabsToEnd.accesskey"), - disabled: false - }, - closeAllTabs: { - id: "node-menu-close-all-tabs", - label: L10N.getStr("sourceTabs.closeAllTabs"), - accesskey: L10N.getStr("sourceTabs.closeAllTabs.accesskey"), - disabled: false - }, - showSource: { - id: "node-menu-show-source", - label: L10N.getStr("sourceTabs.revealInTree"), - accesskey: L10N.getStr("sourceTabs.revealInTree.accesskey"), - disabled: false - }, - copySourceUri2: { - id: "node-menu-copy-source-url", - label: L10N.getStr("copySourceUri2"), - accesskey: L10N.getStr("copySourceUri2.accesskey"), - disabled: false - }, - prettyPrint: { - id: "node-menu-pretty-print", - label: L10N.getStr("sourceTabs.prettyPrint"), - accesskey: L10N.getStr("sourceTabs.prettyPrint.accesskey"), - disabled: false - } - }; - return items; -} +export const tabMenuItems = { + closeTab: { + id: "node-menu-close-tab", + label: L10N.getStr("sourceTabs.closeTab"), + accesskey: L10N.getStr("sourceTabs.closeTab.accesskey"), + disabled: false + }, + closeOtherTabs: { + id: "node-menu-close-other-tabs", + label: L10N.getStr("sourceTabs.closeOtherTabs"), + accesskey: L10N.getStr("sourceTabs.closeOtherTabs.accesskey"), + disabled: false + }, + closeTabsToEnd: { + id: "node-menu-close-tabs-to-end", + label: L10N.getStr("sourceTabs.closeTabsToEnd"), + accesskey: L10N.getStr("sourceTabs.closeTabsToEnd.accesskey"), + disabled: false + }, + closeAllTabs: { + id: "node-menu-close-all-tabs", + label: L10N.getStr("sourceTabs.closeAllTabs"), + accesskey: L10N.getStr("sourceTabs.closeAllTabs.accesskey"), + disabled: false + }, + showSource: { + id: "node-menu-show-source", + label: L10N.getStr("sourceTabs.revealInTree"), + accesskey: L10N.getStr("sourceTabs.revealInTree.accesskey"), + disabled: false + }, + copySourceUri2: { + id: "node-menu-copy-source-url", + label: L10N.getStr("copySourceUri2"), + accesskey: L10N.getStr("copySourceUri2.accesskey"), + disabled: false + }, + prettyPrint: { + id: "node-menu-pretty-print", + label: L10N.getStr("sourceTabs.prettyPrint"), + accesskey: L10N.getStr("sourceTabs.prettyPrint.accesskey"), + disabled: false + } +}; From 183a40ef3f44afca01a94568954e3942a79ae51f Mon Sep 17 00:00:00 2001 From: Hubert Boma Manilla Date: Thu, 25 Jan 2018 19:12:46 +0000 Subject: [PATCH 6/6] make a function as LION does not exist in the scope of the util --- src/components/Editor/Tab.js | 4 +- src/utils/tabs.js | 90 ++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/src/components/Editor/Tab.js b/src/components/Editor/Tab.js index e3372bdcd9..66b288997a 100644 --- a/src/components/Editor/Tab.js +++ b/src/components/Editor/Tab.js @@ -19,7 +19,7 @@ import actions from "../../actions"; import { getFilename, getFileURL, isPretty } from "../../utils/source"; import { copyToTheClipboard } from "../../utils/clipboard"; -import { getSourceAnnotation, tabMenuItems } from "../../utils/tabs"; +import { getSourceAnnotation, getTabMenuItems } from "../../utils/tabs"; import { getSelectedSource, @@ -70,7 +70,7 @@ class Tab extends PureComponent { } const isPrettySource = isPretty(sourceTab); - + const tabMenuItems = getTabMenuItems(); const items = [ { item: { diff --git a/src/utils/tabs.js b/src/utils/tabs.js index 5de8cfe584..d62a0858a4 100644 --- a/src/utils/tabs.js +++ b/src/utils/tabs.js @@ -62,47 +62,49 @@ export function getSourceAnnotation( } } -export const tabMenuItems = { - closeTab: { - id: "node-menu-close-tab", - label: L10N.getStr("sourceTabs.closeTab"), - accesskey: L10N.getStr("sourceTabs.closeTab.accesskey"), - disabled: false - }, - closeOtherTabs: { - id: "node-menu-close-other-tabs", - label: L10N.getStr("sourceTabs.closeOtherTabs"), - accesskey: L10N.getStr("sourceTabs.closeOtherTabs.accesskey"), - disabled: false - }, - closeTabsToEnd: { - id: "node-menu-close-tabs-to-end", - label: L10N.getStr("sourceTabs.closeTabsToEnd"), - accesskey: L10N.getStr("sourceTabs.closeTabsToEnd.accesskey"), - disabled: false - }, - closeAllTabs: { - id: "node-menu-close-all-tabs", - label: L10N.getStr("sourceTabs.closeAllTabs"), - accesskey: L10N.getStr("sourceTabs.closeAllTabs.accesskey"), - disabled: false - }, - showSource: { - id: "node-menu-show-source", - label: L10N.getStr("sourceTabs.revealInTree"), - accesskey: L10N.getStr("sourceTabs.revealInTree.accesskey"), - disabled: false - }, - copySourceUri2: { - id: "node-menu-copy-source-url", - label: L10N.getStr("copySourceUri2"), - accesskey: L10N.getStr("copySourceUri2.accesskey"), - disabled: false - }, - prettyPrint: { - id: "node-menu-pretty-print", - label: L10N.getStr("sourceTabs.prettyPrint"), - accesskey: L10N.getStr("sourceTabs.prettyPrint.accesskey"), - disabled: false - } -}; +export function getTabMenuItems() { + return { + closeTab: { + id: "node-menu-close-tab", + label: L10N.getStr("sourceTabs.closeTab"), + accesskey: L10N.getStr("sourceTabs.closeTab.accesskey"), + disabled: false + }, + closeOtherTabs: { + id: "node-menu-close-other-tabs", + label: L10N.getStr("sourceTabs.closeOtherTabs"), + accesskey: L10N.getStr("sourceTabs.closeOtherTabs.accesskey"), + disabled: false + }, + closeTabsToEnd: { + id: "node-menu-close-tabs-to-end", + label: L10N.getStr("sourceTabs.closeTabsToEnd"), + accesskey: L10N.getStr("sourceTabs.closeTabsToEnd.accesskey"), + disabled: false + }, + closeAllTabs: { + id: "node-menu-close-all-tabs", + label: L10N.getStr("sourceTabs.closeAllTabs"), + accesskey: L10N.getStr("sourceTabs.closeAllTabs.accesskey"), + disabled: false + }, + showSource: { + id: "node-menu-show-source", + label: L10N.getStr("sourceTabs.revealInTree"), + accesskey: L10N.getStr("sourceTabs.revealInTree.accesskey"), + disabled: false + }, + copySourceUri2: { + id: "node-menu-copy-source-url", + label: L10N.getStr("copySourceUri2"), + accesskey: L10N.getStr("copySourceUri2.accesskey"), + disabled: false + }, + prettyPrint: { + id: "node-menu-pretty-print", + label: L10N.getStr("sourceTabs.prettyPrint"), + accesskey: L10N.getStr("sourceTabs.prettyPrint.accesskey"), + disabled: false + } + }; +}