From ff333d120f553a8f324e9fa4f9b1da0f08648e4e Mon Sep 17 00:00:00 2001 From: Kasen IO Date: Mon, 13 Apr 2020 22:25:14 -0400 Subject: [PATCH] Save state of conversion... too tired. --- scripts/system/inventory/src/App.vue | 308 +++--------------- .../system/inventory/src/components/Root.vue | 286 ++++++++++++++++ 2 files changed, 331 insertions(+), 263 deletions(-) create mode 100644 scripts/system/inventory/src/components/Root.vue diff --git a/scripts/system/inventory/src/App.vue b/scripts/system/inventory/src/App.vue index e41cb48555..ee47cca917 100644 --- a/scripts/system/inventory/src/App.vue +++ b/scripts/system/inventory/src/App.vue @@ -75,264 +75,7 @@ - - - + @@ -871,15 +614,18 @@ if (!browserDevelopment()) { } import draggable from 'vuedraggable' +import Root from 'components/Root' export default { name: 'App', components: { draggable, + Root }, data: () => ({ items: [ { + "hasChildren": false, "type": "script", "name": "VRGrabScale", "url": "https://gooawefaweawfgle.com/vr.js", @@ -887,10 +633,11 @@ export default { "uuid": "54254354353", }, { - "isFolder": true, + "hasChildren": true, "name": "Test Folder", "items": [ { + "hasChildren": false, "type": "script", "name": "TESTFOLDERSCRIPT", "url": "https://googfdafsgaergale.com/vr.js", @@ -898,16 +645,41 @@ export default { "uuid": "54hgfhgf25fdfadf4354353", }, { + "hasChildren": false, "type": "script", "name": "FOLDERSCRIPT2", "url": "https://googfdafsgaergale.com/vr.js", "folder": "No Folder", "uuid": "54hgfhgf25ffdafddfadf4354353", }, + { + "hasChildren": true, + "name": "FolderWithinAFolder", + "items": [ + { + "hasChildren": false, + "type": "script", + "name": "TESTFOLDERSCRIPT", + "url": "https://googfdafsgaergale.com/vr.js", + "folder": "No Folder", + "uuid": "54hgfhgf25fdfadf4354353", + }, + { + "hasChildren": false, + "type": "script", + "name": "FOLDERSCRIPT2", + "url": "https://googfdafsgaergale.com/vr.js", + "folder": "No Folder", + "uuid": "54hgfhgf25ffdafddfadf4354353", + }, + ], + "uuid": "54354363wgtrhtrhegs45ujs" + }, ], "uuid": "54354363wgsegs45ujs", }, { + "hasChildren": false, "type": "script", "name": "VRGrabScale", "url": "https://googfdafsgaergale.com/vr.js", @@ -915,6 +687,7 @@ export default { "uuid": "54hgfhgf254354353", }, { + "hasChildren": false, "type": "script", "name": "TEST", "url": "https://gooadfdagle.com/vr.js", @@ -922,6 +695,7 @@ export default { "uuid": "542rfwat4t5fsddf4354353", }, { + "hasChildren": false, "type": "json", "name": "TESTJSON", "url": "https://gooadfdagle.com/vr.json", @@ -929,6 +703,7 @@ export default { "uuid": "542rfwat4t54354353", }, { + "hasChildren": false, "type": "script", "name": "TESTLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG", "url": "https://googfdaffle.com/vrLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG.js", @@ -936,6 +711,7 @@ export default { "uuid": "5425ggsrg45354353", }, { + "hasChildren": false, "type": "whatttype", "name": "BrokenIcon", "url": "https://googfdaffle.com/vrLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG.js", @@ -943,6 +719,7 @@ export default { "uuid": "5425ggsrg4fdaffdff535asdasd4353", }, { + "hasChildren": false, "type": "avatar", "name": "AVI", "url": "https://googlfadfe.com/vr.fst", @@ -950,6 +727,7 @@ export default { "uuid": "542gregg45s3g4354353", }, { + "hasChildren": false, "type": "avatar", "name": "AVI", "url": "https://googlefdaf.com/vr.fst", @@ -957,6 +735,7 @@ export default { "uuid": "5420798-087-54354353", }, { + "hasChildren": false, "type": "model", "name": "3D MODEL", "url": "https://googlee.com/vr.fbx", @@ -964,6 +743,7 @@ export default { "uuid": "54254354980-7667jt353", }, { + "hasChildren": false, "type": "place", "name": "PLACE DOMAIN", "url": "https://googleee.com/vr.fbx", @@ -1130,6 +910,7 @@ export default { var itemToPush = { + "hasChildren": false, "type": type, "name": name, "url": url, @@ -1146,7 +927,7 @@ export default { pushFolderToItems: function(name) { var folderToPush = { - "isFolder": true, + "hasChildren": true, "name": name, "items": [], "uuid": this.createUUID(), @@ -1398,8 +1179,8 @@ export default { } for (var i = 0; i < this.items.length; i++) { - if (Object.prototype.hasOwnProperty.call(this.items[i], "isFolder")) { - if (this.items[i].isFolder === true) { + if (Object.prototype.hasOwnProperty.call(this.items[i], "hasChildren")) { + if (this.items[i].hasChildren === true) { this.folderList.push({ "name": this.items[i].name, "uuid": this.items[i].uuid, @@ -1411,6 +1192,7 @@ export default { moveItemToFolder: function(uuid, folderUUID) { // This function is used to take an item one level deep, do not use it for any other purposes and check beforehand if you need to do this. var itemToPush = { + "hasChildren": false, 'type': null, 'name': null, 'folder': null, @@ -1435,7 +1217,7 @@ export default { // Find that folder in our main items array. for (var folder = 0; folder < this.items.length; folder++) { - if (this.items[folder].uuid === folderUUID && this.items[folder].isFolder === true) { + if (this.items[folder].uuid === folderUUID && this.items[folder].hasChildren === true) { this.items[folder].items.push(itemToPush); } } diff --git a/scripts/system/inventory/src/components/Root.vue b/scripts/system/inventory/src/components/Root.vue new file mode 100644 index 0000000000..ea3b96d5b7 --- /dev/null +++ b/scripts/system/inventory/src/components/Root.vue @@ -0,0 +1,286 @@ + + + + + + \ No newline at end of file