michael@0: // -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // update menu items that rely on focus or on the current selection michael@0: function goUpdateGlobalEditMenuItems() michael@0: { michael@0: // Don't bother updating the edit commands if they aren't visible in any way michael@0: // (i.e. the Edit menu isn't open, nor is the context menu open, nor have the michael@0: // cut, copy, and paste buttons been added to the toolbars) for performance. michael@0: // This only works in applications/on platforms that set the gEditUIVisible michael@0: // flag, so we check to see if that flag is defined before using it. michael@0: if (typeof gEditUIVisible != "undefined" && !gEditUIVisible) michael@0: return; michael@0: michael@0: goUpdateCommand("cmd_undo"); michael@0: goUpdateCommand("cmd_redo"); michael@0: goUpdateCommand("cmd_cut"); michael@0: goUpdateCommand("cmd_copy"); michael@0: goUpdateCommand("cmd_paste"); michael@0: goUpdateCommand("cmd_selectAll"); michael@0: goUpdateCommand("cmd_delete"); michael@0: goUpdateCommand("cmd_switchTextDirection"); michael@0: } michael@0: michael@0: // update menu items that relate to undo/redo michael@0: function goUpdateUndoEditMenuItems() michael@0: { michael@0: goUpdateCommand("cmd_undo"); michael@0: goUpdateCommand("cmd_redo"); michael@0: } michael@0: michael@0: // update menu items that depend on clipboard contents michael@0: function goUpdatePasteMenuItems() michael@0: { michael@0: goUpdateCommand("cmd_paste"); michael@0: }