toolkit/content/editMenuOverlay.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 // update menu items that rely on focus or on the current selection
     8 function goUpdateGlobalEditMenuItems()
     9 {
    10   // Don't bother updating the edit commands if they aren't visible in any way
    11   // (i.e. the Edit menu isn't open, nor is the context menu open, nor have the
    12   // cut, copy, and paste buttons been added to the toolbars) for performance.
    13   // This only works in applications/on platforms that set the gEditUIVisible
    14   // flag, so we check to see if that flag is defined before using it.
    15   if (typeof gEditUIVisible != "undefined" && !gEditUIVisible)
    16     return;
    18   goUpdateCommand("cmd_undo");
    19   goUpdateCommand("cmd_redo");
    20   goUpdateCommand("cmd_cut");
    21   goUpdateCommand("cmd_copy");
    22   goUpdateCommand("cmd_paste");
    23   goUpdateCommand("cmd_selectAll");
    24   goUpdateCommand("cmd_delete");
    25   goUpdateCommand("cmd_switchTextDirection");
    26 }
    28 // update menu items that relate to undo/redo
    29 function goUpdateUndoEditMenuItems()
    30 {
    31   goUpdateCommand("cmd_undo");
    32   goUpdateCommand("cmd_redo");
    33 }
    35 // update menu items that depend on clipboard contents
    36 function goUpdatePasteMenuItems()
    37 {
    38   goUpdateCommand("cmd_paste");
    39 }

mercurial