From 1a46f18aa3960cb30ab10d7adc6dc896fcdccd34 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Fri, 17 Mar 2017 15:56:55 -0700 Subject: [PATCH 1/3] adding export button + hiding jump to selection --- scripts/system/html/entityList.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/html/entityList.html b/scripts/system/html/entityList.html index 3cb79353f9..bdd01bc7d2 100644 --- a/scripts/system/html/entityList.html +++ b/scripts/system/html/entityList.html @@ -24,7 +24,8 @@ - + + From 197a06c423355497e3b7f74d84153cc093c53099 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Fri, 17 Mar 2017 16:17:21 -0700 Subject: [PATCH 2/3] changes in TWO entityList.js to register the export event --- scripts/system/html/js/entityList.js | 4 ++++ scripts/system/libraries/entityList.js | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index dd8e8199b4..a371b3bdc9 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -40,6 +40,7 @@ function loaded() { elInView = document.getElementById("in-view") elRadius = document.getElementById("radius"); elTeleport = document.getElementById("teleport"); + elExport = document.getElementById("export"); elPal = document.getElementById("pal"); elEntityTable = document.getElementById("entity-table"); elInfoToggle = document.getElementById("info-toggle"); @@ -276,6 +277,9 @@ function loaded() { elTeleport.onclick = function () { EventBridge.emitWebEvent(JSON.stringify({ type: 'teleport' })); } + elExport.onclick = function() { + EventBridge.emitWebEvent(JSON.stringify({ type: 'export'})); + } elPal.onclick = function () { EventBridge.emitWebEvent(JSON.stringify({ type: 'pal' })); } diff --git a/scripts/system/libraries/entityList.js b/scripts/system/libraries/entityList.js index 63ac33a1dd..3488733289 100644 --- a/scripts/system/libraries/entityList.js +++ b/scripts/system/libraries/entityList.js @@ -128,6 +128,18 @@ EntityListTool = function(opts) { if (selectionManager.hasSelection()) { MyAvatar.position = selectionManager.worldPosition; } + } else if (data.type == "export") { + if (!selectionManager.hasSelection()) { + Window.notifyEditError("No entities have been selected."); + } else { + var filename = Window.save("Select Where to Save", "", "*.json"); + if (filename) { + var success = Clipboard.exportEntities(filename, selectionManager.selections); + if (!success) { + Window.notifyEditError("Export failed."); + } + } + } } else if (data.type == "pal") { var sessionIds = {}; // Collect the sessionsIds of all selected entitities, w/o duplicates. selectionManager.selections.forEach(function (id) { From f57905fbb3225a176587ae7775f61c0e0e19ddd2 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Mon, 20 Mar 2017 10:23:55 -0700 Subject: [PATCH 3/3] remove code for jump to selection --- scripts/system/html/entityList.html | 1 - scripts/system/html/js/entityList.js | 4 ---- 2 files changed, 5 deletions(-) diff --git a/scripts/system/html/entityList.html b/scripts/system/html/entityList.html index bdd01bc7d2..9d774f1861 100644 --- a/scripts/system/html/entityList.html +++ b/scripts/system/html/entityList.html @@ -25,7 +25,6 @@ - diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index a371b3bdc9..c6692fc26e 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -39,7 +39,6 @@ function loaded() { elFilter = document.getElementById("filter"); elInView = document.getElementById("in-view") elRadius = document.getElementById("radius"); - elTeleport = document.getElementById("teleport"); elExport = document.getElementById("export"); elPal = document.getElementById("pal"); elEntityTable = document.getElementById("entity-table"); @@ -274,9 +273,6 @@ function loaded() { elToggleVisible.onclick = function () { EventBridge.emitWebEvent(JSON.stringify({ type: 'toggleVisible' })); } - elTeleport.onclick = function () { - EventBridge.emitWebEvent(JSON.stringify({ type: 'teleport' })); - } elExport.onclick = function() { EventBridge.emitWebEvent(JSON.stringify({ type: 'export'})); }