mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 21:32:12 +02:00
Add "Copy ID"
Add "Copy ID" on entity list menu and contextual menu.
This commit is contained in:
parent
634dc64f8f
commit
e802d0ec12
2 changed files with 17 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
// entityList.js
|
||||
//
|
||||
// Created by Ryan Huffman on 19 Nov 2014
|
||||
// Created by Ryan Huffman on November 19th, 2014
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
// Copyright 2020 Vircadia contributors.
|
||||
// Copyright 2024 Overte e.V.
|
||||
|
@ -328,6 +328,7 @@ function loaded() {
|
|||
elToolsMenu = document.getElementById("tools");
|
||||
elMenuBackgroundOverlay = document.getElementById("menuBackgroundOverlay");
|
||||
elHmdCopy = document.getElementById("hmdcopy");
|
||||
elHmdCopyID = document.getElementById("hmdcopyid");
|
||||
elHmdCut = document.getElementById("hmdcut");
|
||||
elHmdPaste = document.getElementById("hmdpaste");
|
||||
elHmdDuplicate = document.getElementById("hmdduplicate");
|
||||
|
@ -424,6 +425,10 @@ function loaded() {
|
|||
EventBridge.emitWebEvent(JSON.stringify({ type: "copy" }));
|
||||
closeAllEntityListMenu();
|
||||
};
|
||||
elHmdCopyID.onclick = function() {
|
||||
EventBridge.emitWebEvent(JSON.stringify({ type: "copyID" }));
|
||||
closeAllEntityListMenu();
|
||||
};
|
||||
elHmdCut.onclick = function() {
|
||||
EventBridge.emitWebEvent(JSON.stringify({ type: "cut" }));
|
||||
closeAllEntityListMenu();
|
||||
|
@ -822,6 +827,9 @@ function loaded() {
|
|||
case "Copy":
|
||||
EventBridge.emitWebEvent(JSON.stringify({ type: "copy" }));
|
||||
break;
|
||||
case "Copy ID":
|
||||
EventBridge.emitWebEvent(JSON.stringify({ type: "copyID" }));
|
||||
break;
|
||||
case "Paste":
|
||||
EventBridge.emitWebEvent(JSON.stringify({ type: "paste" }));
|
||||
break;
|
||||
|
@ -862,6 +870,10 @@ function loaded() {
|
|||
enabledContextMenuItems.push("Rename");
|
||||
enabledContextMenuItems.push("Delete");
|
||||
}
|
||||
|
||||
if (selectedEntities.length === 1) {
|
||||
enabledContextMenuItems.push("Copy ID");
|
||||
}
|
||||
|
||||
entityListContextMenu.open(clickEvent, entityID, enabledContextMenuItems);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
//
|
||||
// entityListContextMenu.js
|
||||
//
|
||||
// exampleContextMenus.js was originally created by David Rowe on 22 Aug 2018.
|
||||
// Modified to entityListContextMenu.js by Thijs Wenker on 10 Oct 2018
|
||||
// exampleContextMenus.js was originally created by David Rowe on August 22nd, 2018.
|
||||
// Modified to entityListContextMenu.js by Thijs Wenker on October 10th, 2018
|
||||
// Copyright 2018 High Fidelity, Inc.
|
||||
// Copyright 2024 Overte e.V.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
@ -137,6 +138,7 @@ EntityListContextMenu.prototype = {
|
|||
|
||||
this._addListItem("Cut");
|
||||
this._addListItem("Copy");
|
||||
this._addListItem("Copy ID");
|
||||
this._addListItem("Paste");
|
||||
this._addListSeparator();
|
||||
this._addListItem("Rename");
|
||||
|
|
Loading…
Reference in a new issue