From e802d0ec12921dc6b813fcd9e4610e4add6331b0 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:35:03 -0400 Subject: [PATCH 1/9] Add "Copy ID" Add "Copy ID" on entity list menu and contextual menu. --- .../system/create/entityList/html/js/entityList.js | 14 +++++++++++++- .../entityList/html/js/entityListContextMenu.js | 6 ++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/system/create/entityList/html/js/entityList.js b/scripts/system/create/entityList/html/js/entityList.js index 99e2851d96..2e43be159e 100644 --- a/scripts/system/create/entityList/html/js/entityList.js +++ b/scripts/system/create/entityList/html/js/entityList.js @@ -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); } diff --git a/scripts/system/create/entityList/html/js/entityListContextMenu.js b/scripts/system/create/entityList/html/js/entityListContextMenu.js index d71719f252..f4b07f21b8 100644 --- a/scripts/system/create/entityList/html/js/entityListContextMenu.js +++ b/scripts/system/create/entityList/html/js/entityListContextMenu.js @@ -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"); From 2f3aefc9262bef67b23e64725e32a8bae3ee93d2 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:36:01 -0400 Subject: [PATCH 2/9] Add "Copy ID" --- scripts/system/create/entityList/html/entityList.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/system/create/entityList/html/entityList.html b/scripts/system/create/entityList/html/entityList.html index 38ea66832b..1884431d65 100644 --- a/scripts/system/create/entityList/html/entityList.html +++ b/scripts/system/create/entityList/html/entityList.html @@ -122,6 +122,12 @@
+