From 86443251a90c7d8b1b93131bd40c32ea5b5be46e Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:04:43 -0500 Subject: [PATCH 01/18] Add processing gif for Broken Url Report --- .../system/create/assets/images/processing.gif | Bin 0 -> 6694 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 scripts/system/create/assets/images/processing.gif diff --git a/scripts/system/create/assets/images/processing.gif b/scripts/system/create/assets/images/processing.gif new file mode 100644 index 0000000000000000000000000000000000000000..94d1486b0a3f6b44ebbc795b17e656572a0e6641 GIT binary patch literal 6694 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 N5THW7>Wc=p{U7)BRm=bY literal 0 HcmV?d00001 From 9b5a1b82e18f2810e837310307ce294048526511 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:30:17 -0500 Subject: [PATCH 02/18] Add Broken Url Report --- scripts/system/create/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 9bd0147002..023021f5cc 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -35,7 +35,8 @@ Script.include([ "../libraries/gridTool.js", "entityList/entityList.js", "entitySelectionTool/entitySelectionTool.js", - "audioFeedback/audioFeedback.js" + "audioFeedback/audioFeedback.js", + "modules/brokenUrlReport.js" ]); var CreateWindow = Script.require('./modules/createWindow.js'); From 2fd648f881b6263282f355657972e6b96634748e Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:31:02 -0500 Subject: [PATCH 03/18] Add Broken Url Report --- scripts/system/create/entityList/entityList.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/system/create/entityList/entityList.js b/scripts/system/create/entityList/entityList.js index 5119d7d3da..0059c589d3 100644 --- a/scripts/system/create/entityList/entityList.js +++ b/scripts/system/create/entityList/entityList.js @@ -413,12 +413,14 @@ EntityListTool = function(shouldUseEditTabletApp) { alignGridToSelection(); } else if (data.type === 'alignGridToAvatar') { alignGridToAvatar(); + } else if (data.type === 'brokenUrlReport') { + brokenUrlReport(selectionManager.selections); } else if (data.type === 'toggleGridVisibility') { toggleGridVisibility(); } else if (data.type === 'toggleSnapToGrid') { - that.toggleSnapToGrid(); + that.toggleSnapToGrid(); } - + }; webView.webEventReceived.connect(onWebEventReceived); From 4836fa8c61bca245055ca97711c8ffcd0017f4bb Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:31:29 -0500 Subject: [PATCH 04/18] Add Broken Url Report --- scripts/system/create/entityList/html/entityList.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/system/create/entityList/html/entityList.html b/scripts/system/create/entityList/html/entityList.html index e054ca121b..398dd34c70 100644 --- a/scripts/system/create/entityList/html/entityList.html +++ b/scripts/system/create/entityList/html/entityList.html @@ -308,6 +308,13 @@ + + + From 608fe21045bd0ebbb2d003c836fe5c512187adbe Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:32:05 -0500 Subject: [PATCH 05/18] Add Broken Url Report --- scripts/system/create/entityList/html/js/entityList.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/system/create/entityList/html/js/entityList.js b/scripts/system/create/entityList/html/js/entityList.js index d21e65d47d..00600bd88a 100644 --- a/scripts/system/create/entityList/html/js/entityList.js +++ b/scripts/system/create/entityList/html/js/entityList.js @@ -273,6 +273,7 @@ let elEntityTable, elSnapToGridActivatorCaption, elAlignGridToSelection, elAlignGridToAvatar, + elBrokenUrlReport, elFilterTypeMultiselectBox, elFilterTypeText, elFilterTypeOptions, @@ -359,7 +360,8 @@ function loaded() { elSnapToGridActivator = document.getElementById("snapToGridActivator"); elSnapToGridActivatorCaption = document.getElementById("snapToGridActivatorCaption"); elAlignGridToSelection = document.getElementById("alignGridToSelection"); - elAlignGridToAvatar = document.getElementById("alignGridToAvatar"); + elAlignGridToAvatar = document.getElementById("alignGridToAvatar"); + elBrokenUrlReport = document.getElementById("brokenUrlReport"); elFilterTypeMultiselectBox = document.getElementById("filter-type-multiselect-box"); elFilterTypeText = document.getElementById("filter-type-text"); elFilterTypeOptions = document.getElementById("filter-type-options"); @@ -597,7 +599,11 @@ function loaded() { elAlignGridToAvatar.onclick = function () { EventBridge.emitWebEvent(JSON.stringify({ type: "alignGridToAvatar" })); closeAllEntityListMenu(); - }; + }; + elBrokenUrlReport.onclick = function () { + EventBridge.emitWebEvent(JSON.stringify({ type: "brokenUrlReport" })); + closeAllEntityListMenu(); + }; elToggleSpaceMode.onclick = function() { EventBridge.emitWebEvent(JSON.stringify({ type: "toggleSpaceMode" })); }; From 6e3ab1707958f9d5ed1212a0008fbdeb768d30d5 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:34:51 -0500 Subject: [PATCH 06/18] Add Broken Url Report functionality --- .../create/modules/brokenUrlReport.html | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 scripts/system/create/modules/brokenUrlReport.html diff --git a/scripts/system/create/modules/brokenUrlReport.html b/scripts/system/create/modules/brokenUrlReport.html new file mode 100644 index 0000000000..4c80f9cfb9 --- /dev/null +++ b/scripts/system/create/modules/brokenUrlReport.html @@ -0,0 +1,68 @@ + + + + + + + + +
+
+

+
+
+ Testing in progress... +

+
+ +
+
+ + + \ No newline at end of file From 940b45ee85b5a4badaca4ba06f64ada8fa9a1d5b Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 13:13:37 -0500 Subject: [PATCH 07/18] Add Broken Url Report feature --- .../system/create/modules/brokenUrlReport.js | 369 ++++++++++++++++++ 1 file changed, 369 insertions(+) create mode 100644 scripts/system/create/modules/brokenUrlReport.js diff --git a/scripts/system/create/modules/brokenUrlReport.js b/scripts/system/create/modules/brokenUrlReport.js new file mode 100644 index 0000000000..34c36caf05 --- /dev/null +++ b/scripts/system/create/modules/brokenUrlReport.js @@ -0,0 +1,369 @@ +// +// brokenUrlReport.js +// +// Created by Alezia Kurdis on February 22, 2021. +// Copyright 2021 Vircadia contributors. +// +// This script add reports functionalities to the Create Application. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +var brokenUrlReportHttpRequest; +var brokenUrlReportUrlList = []; +var brokenUrlReportInvalideUrlList = []; +var brokenUrlReportProcessedUrlNo = 0; +var brokenUrlReportUrlEntry; +var brokenUrlReportMessageBox; +var brokenUrlReportOverlayWebWindow; +var BROKEN_URL_REPORT_YES_BUTTON = 0x4000; +var BROKEN_URL_REPORT_NO_BUTTON = 0x10000; +var MAX_URL_BEFORE_WARNING_FOR_LONG_PROCESS = 20; + +function brokenUrlReportRequestUrlValidityCheck(no) { + brokenUrlReportHttpRequest = new XMLHttpRequest(); + brokenUrlReportHttpRequest.requestComplete.connect(brokenUrlReportGetResponseStatus); + brokenUrlReportHttpRequest.open("GET", brokenUrlReportUrlList[no].url); + brokenUrlReportHttpRequest.send(); +} + +function brokenUrlReportGetResponseStatus() { + if (brokenUrlReportHttpRequest.status === 0 || brokenUrlReportHttpRequest.status > 299) { + brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo].validity = brokenUrlReportHttpRequest.status; + brokenUrlReportInvalideUrlList.push(brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo]); + } + brokenUrlReportHttpRequest.requestComplete.disconnect(brokenUrlReportGetResponseStatus); + brokenUrlReportHttpRequest = null; + brokenUrlReportProcessedUrlNo = brokenUrlReportProcessedUrlNo + 1; + if (brokenUrlReportProcessedUrlNo === brokenUrlReportUrlList.length) { + brokenUrlReportGenerateFormatedReport(brokenUrlReportInvalideUrlList); + brokenUrlReportUrlList = []; + brokenUrlReportInvalideUrlList = []; + brokenUrlReportProcessedUrlNo = 0; + } else { + brokenUrlReportRequestUrlValidityCheck(brokenUrlReportProcessedUrlNo); + } +} + +function brokenUrlReportGenerateFormatedReport(brokenUrlReportInvalideUrlList) { + var brokenUrlReportContent = ""; + if (brokenUrlReportInvalideUrlList.length === 0) { + brokenUrlReportContent = "

Broken Url Report

" + brokenUrlReportUrlList.length + " URL tested.
NO ISSUE HAS BEEN FOUND.




"; + brokenUrlReportContent = brokenUrlReportContent + "

This report ignores URL from the Asset Server (atp://), local drive paths or any string not starting by 'http'.
"; + Script.setTimeout(function () { + brokenUrlReportOverlayWebWindow.emitScriptEvent(brokenUrlReportContent); + }, 3000); + return; + } + brokenUrlReportContent = "

Broken Url Report

\n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + for (var i = 0; i < brokenUrlReportInvalideUrlList.length; i++ ){ + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; + } + brokenUrlReportContent = brokenUrlReportContent + "
 EntityBroken Url
NoTypeName & IDPropertyStatusCurrent URL
" + (i + 1) + "" + brokenUrlReportInvalideUrlList[i].type + "" + brokenUrlReportInvalideUrlList[i].name + "
" + brokenUrlReportInvalideUrlList[i].id + "
" + brokenUrlReportInvalideUrlList[i].urlType + "" + brokenUrlReportInvalideUrlList[i].validity + "" + brokenUrlReportInvalideUrlList[i].url + "
\n"; + brokenUrlReportContent = brokenUrlReportContent + "

" + brokenUrlReportUrlList.length + " URL tested.

"; + brokenUrlReportContent = brokenUrlReportContent + "
This report ignores URL from the Asset Server (atp://), local drive paths or any string not starting by 'http'.
"; + + Script.setTimeout(function () { + brokenUrlReportOverlayWebWindow.emitScriptEvent(brokenUrlReportContent); + }, 3000); +} + +function brokenUrlReportGetUrlTypeColor(urlType) { + var hexaColor = "#FFFFFF"; + switch (urlType) { + case "script": + hexaColor = "#00FF00"; + break; + case "serverScripts": + hexaColor = "#FF00FF"; + break; + case "imageURL": + hexaColor = "#00FFFF"; + break; + case "materialURL": + hexaColor = "#FF6600"; + break; + case "modelURL": + hexaColor = "#FFFF00"; + break; + case "compoundShapeURL": + hexaColor = "#6666FF"; + break; + case "animation.url": + hexaColor = "#6699FF"; + break; + case "textures": + hexaColor = "#FF0066"; + break; + case "xTextureURL": + hexaColor = "#0000FF"; + break; + case "yTextureURL": + hexaColor = "#009966"; + break; + case "zTextureURL": + hexaColor = "#993366"; + break; + case "font": + hexaColor = "#FFFFFF"; + break; + case "sourceUrl": + hexaColor = "#BBFF00"; + break; + case "scriptURL": + hexaColor = "#FFBBBB"; + break; + case "filterURL": + hexaColor = "#BBBBFF"; + break; + case "skybox.url": + hexaColor = "#BBFFFF"; + break; + case "ambientLight.ambientURL": + hexaColor = "#FF3300"; + } + return hexaColor; +} + +function brokenUrlReport(entityIds) { + if (entityIds.length === 0) { + audioFeedback.rejection(); + Window.alert("You have nothing selected."); + return; + } else { + var properties; + for (var i = 0; i < entityIds.length; i++ ){ + properties = Entities.getEntityProperties(entityIds[i]); + if (properties.script.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "script", + url: properties.script, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.serverScripts.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "serverScripts", + url: properties.serverScripts, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Image" && properties.imageURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "imageURL", + url: properties.imageURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Material" && properties.materialURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "materialURL", + url: properties.materialURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Model" && properties.modelURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "modelURL", + url: properties.modelURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if ((properties.type === "Zone" || properties.type === "Model" || properties.type === "ParticleEffect") && properties.compoundShapeURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "compoundShapeURL", + url: properties.compoundShapeURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Model" && properties.animation.url.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "animation.url", + url: properties.animation.url, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "ParticleEffect" && properties.textures.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "textures", + url: properties.textures, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "PolyVox" && properties.xTextureURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "xTextureURL", + url: properties.xTextureURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "PolyVox" && properties.yTextureURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "yTextureURL", + url: properties.yTextureURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "PolyVox" && properties.zTextureURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "zTextureURL", + url: properties.zTextureURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Text" && properties.font.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "font", + url: properties.font, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Web" && properties.sourceUrl.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "sourceUrl", + url: properties.sourceUrl, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Web" && properties.scriptURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "scriptURL", + url: properties.scriptURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Zone" && properties.filterURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "filterURL", + url: properties.filterURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Zone" && properties.skybox.url.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "skybox.url", + url: properties.skybox.url, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + if (properties.type === "Zone" && properties.ambientLight.ambientURL.toLowerCase().startsWith("http")) { + brokenUrlReportUrlEntry = { + id: entityIds[i], + name: properties.name, + type: properties.type, + urlType: "ambientLight.ambientURL", + url: properties.ambientLight.ambientURL, + validity: "NOT_TESTED" + }; + brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); + } + } + if (brokenUrlReportUrlList.length === 0) { + audioFeedback.confirmation(); + Window.alert("No 'http' url has been found within the current selection."); + return; + } else { + if (brokenUrlReportUrlList.length > MAX_URL_BEFORE_WARNING_FOR_LONG_PROCESS) { + var message = "Number of http URL found: " + brokenUrlReportUrlList.length + "\n The analysis may take time. Do you want to proceed?"; + var answer = Window.confirm(message); + if (!answer) { + return; + } + } + brokenUrlReportOverlayWebWindow = new OverlayWebWindow({ + title: "Broken Url Report", + source: Script.resolvePath("brokenUrlReport.html"), + width: 1000, + height: 600 + }); + brokenUrlReportContent = ""; + brokenUrlReportRequestUrlValidityCheck(brokenUrlReportProcessedUrlNo); + } + } +} From 6565270648bf3bbede9aa447a6fc66c08bd65b29 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 13:22:40 -0500 Subject: [PATCH 08/18] Change Menu Item Highlight color This change the hover color for the menu item of the menu bar previously it was blue-cyan as the selected entities which was visually annoying when we used the menu over a selection of entities in the list. This hover color is now a grey tonality. --- scripts/system/html/css/edit-style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/html/css/edit-style.css b/scripts/system/html/css/edit-style.css index efbb531124..f9eb6e6060 100644 --- a/scripts/system/html/css/edit-style.css +++ b/scripts/system/html/css/edit-style.css @@ -1987,12 +1987,12 @@ button.menu-button { } button.menu-button:hover { - background-color: #00B4EF; + background-color: #919191; border: none; } button.menu-button:active { - background-color: #00B4EF; + background-color: #919191; border: none; } From ec04f068166e7eccd41a1fd129a05b4cb3d086f7 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 23:30:44 -0500 Subject: [PATCH 09/18] Create App: menubar: minor css adjustment The menu separator wasn't full width. --- scripts/system/html/css/edit-style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/html/css/edit-style.css b/scripts/system/html/css/edit-style.css index f9eb6e6060..9b3e862210 100644 --- a/scripts/system/html/css/edit-style.css +++ b/scripts/system/html/css/edit-style.css @@ -1969,7 +1969,7 @@ div.entity-list-menu { } div.menu-separator{ - width: 90%; + width: 100%; height: 2px; background-color: #505050; } From f8d93a8429d092edb110696a0b63e8db3d329cbb Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 27 Feb 2021 23:33:10 -0500 Subject: [PATCH 10/18] Add a Link to select the entity. Add a Link to select the entity. So the user can edit each entity listed in the report by clicking on it. This select the entity. --- .../create/modules/brokenUrlReport.html | 46 ++++++++++++++++--- .../system/create/modules/brokenUrlReport.js | 23 ++++++++-- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/scripts/system/create/modules/brokenUrlReport.html b/scripts/system/create/modules/brokenUrlReport.html index 4c80f9cfb9..197d377490 100644 --- a/scripts/system/create/modules/brokenUrlReport.html +++ b/scripts/system/create/modules/brokenUrlReport.html @@ -12,7 +12,7 @@ @@ -64,5 +91,12 @@ EventBridge.scriptEventReceived.connect(function (message) { document.getElementById("report").innerHTML = message; }); + + function selectEntity(id) { + EventBridge.emitWebEvent(JSON.stringify({ + "action": "select", + "entityID": id + })); + } \ No newline at end of file diff --git a/scripts/system/create/modules/brokenUrlReport.js b/scripts/system/create/modules/brokenUrlReport.js index 34c36caf05..3ae6dbadee 100644 --- a/scripts/system/create/modules/brokenUrlReport.js +++ b/scripts/system/create/modules/brokenUrlReport.js @@ -60,13 +60,14 @@ function brokenUrlReportGenerateFormatedReport(brokenUrlReportInvalideUrlList) { brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; @@ -76,8 +77,9 @@ function brokenUrlReportGenerateFormatedReport(brokenUrlReportInvalideUrlList) { brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; + brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; brokenUrlReportContent = brokenUrlReportContent + " \n"; } @@ -356,14 +358,29 @@ function brokenUrlReport(entityIds) { return; } } + if (brokenUrlReportOverlayWebWindow !== undefined) { + brokenUrlReportOverlayWebWindow.close(); + } brokenUrlReportOverlayWebWindow = new OverlayWebWindow({ title: "Broken Url Report", source: Script.resolvePath("brokenUrlReport.html"), width: 1000, height: 600 - }); + }); brokenUrlReportContent = ""; brokenUrlReportRequestUrlValidityCheck(brokenUrlReportProcessedUrlNo); } } + + brokenUrlReportOverlayWebWindow.webEventReceived.connect(function (message) { + try { + var data = JSON.parse(message); + } catch(e) { + print("brokenUrlReport.js: Error parsing JSON"); + return; + } + if (data.action === "select") { + selectionManager.setSelections([data.entityID], this); + } + }); } From 090cd176e0480b6e78f0d44dff2b731c091c490b Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Mon, 1 Mar 2021 23:41:38 -0500 Subject: [PATCH 11/18] Display the error text instead of only the no --- scripts/system/create/modules/brokenUrlReport.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/system/create/modules/brokenUrlReport.js b/scripts/system/create/modules/brokenUrlReport.js index 3ae6dbadee..b6747305fd 100644 --- a/scripts/system/create/modules/brokenUrlReport.js +++ b/scripts/system/create/modules/brokenUrlReport.js @@ -30,7 +30,11 @@ function brokenUrlReportRequestUrlValidityCheck(no) { function brokenUrlReportGetResponseStatus() { if (brokenUrlReportHttpRequest.status === 0 || brokenUrlReportHttpRequest.status > 299) { - brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo].validity = brokenUrlReportHttpRequest.status; + if (brokenUrlReportHttpRequest.status === 0) { + brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo].validity = "0 - URL not well-formed"; + } else { + brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo].validity = brokenUrlReportHttpRequest.status + " - " + brokenUrlReportHttpRequest.statusText; + } brokenUrlReportInvalideUrlList.push(brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo]); } brokenUrlReportHttpRequest.requestComplete.disconnect(brokenUrlReportGetResponseStatus); From b65d31c477b2fb6e775a377cc4e70efdbe5761ec Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:49:10 -0400 Subject: [PATCH 12/18] Broken Url Report - adjustments Broken Url Report - adjustments --- scripts/system/create/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 023021f5cc..ed9763875d 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -36,7 +36,7 @@ Script.include([ "entityList/entityList.js", "entitySelectionTool/entitySelectionTool.js", "audioFeedback/audioFeedback.js", - "modules/brokenUrlReport.js" + "modules/brokenURLReport.js" ]); var CreateWindow = Script.require('./modules/createWindow.js'); From d51337c98fe9d0e414e9f093f7b14162a81f0708 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:49:58 -0400 Subject: [PATCH 13/18] Broken Url Report - adjustments Broken Url Report - adjustments --- scripts/system/create/entityList/entityList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/create/entityList/entityList.js b/scripts/system/create/entityList/entityList.js index 0059c589d3..02cd9a14ca 100644 --- a/scripts/system/create/entityList/entityList.js +++ b/scripts/system/create/entityList/entityList.js @@ -413,8 +413,8 @@ EntityListTool = function(shouldUseEditTabletApp) { alignGridToSelection(); } else if (data.type === 'alignGridToAvatar') { alignGridToAvatar(); - } else if (data.type === 'brokenUrlReport') { - brokenUrlReport(selectionManager.selections); + } else if (data.type === 'brokenURLReport') { + brokenURLReport(selectionManager.selections); } else if (data.type === 'toggleGridVisibility') { toggleGridVisibility(); } else if (data.type === 'toggleSnapToGrid') { From ffdf1960bb23d3037dbbd85e00450b7b05d3a79b Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:50:53 -0400 Subject: [PATCH 14/18] Broken Url Report - adjustments Broken Url Report - adjustments --- scripts/system/create/entityList/html/entityList.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/system/create/entityList/html/entityList.html b/scripts/system/create/entityList/html/entityList.html index 398dd34c70..75b172e201 100644 --- a/scripts/system/create/entityList/html/entityList.html +++ b/scripts/system/create/entityList/html/entityList.html @@ -310,12 +310,12 @@ - + From 0797e2668b523ef40b58a610c4752b02857ca53d Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:51:26 -0400 Subject: [PATCH 15/18] Broken Url Report - adjustments Broken Url Report - adjustments --- scripts/system/create/entityList/html/js/entityList.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/system/create/entityList/html/js/entityList.js b/scripts/system/create/entityList/html/js/entityList.js index 00600bd88a..e3526296d9 100644 --- a/scripts/system/create/entityList/html/js/entityList.js +++ b/scripts/system/create/entityList/html/js/entityList.js @@ -273,7 +273,7 @@ let elEntityTable, elSnapToGridActivatorCaption, elAlignGridToSelection, elAlignGridToAvatar, - elBrokenUrlReport, + elBrokenURLReport, elFilterTypeMultiselectBox, elFilterTypeText, elFilterTypeOptions, @@ -361,7 +361,7 @@ function loaded() { elSnapToGridActivatorCaption = document.getElementById("snapToGridActivatorCaption"); elAlignGridToSelection = document.getElementById("alignGridToSelection"); elAlignGridToAvatar = document.getElementById("alignGridToAvatar"); - elBrokenUrlReport = document.getElementById("brokenUrlReport"); + elBrokenURLReport = document.getElementById("brokenURLReport"); elFilterTypeMultiselectBox = document.getElementById("filter-type-multiselect-box"); elFilterTypeText = document.getElementById("filter-type-text"); elFilterTypeOptions = document.getElementById("filter-type-options"); @@ -600,8 +600,8 @@ function loaded() { EventBridge.emitWebEvent(JSON.stringify({ type: "alignGridToAvatar" })); closeAllEntityListMenu(); }; - elBrokenUrlReport.onclick = function () { - EventBridge.emitWebEvent(JSON.stringify({ type: "brokenUrlReport" })); + elBrokenURLReport.onclick = function () { + EventBridge.emitWebEvent(JSON.stringify({ type: "brokenURLReport" })); closeAllEntityListMenu(); }; elToggleSpaceMode.onclick = function() { From a9fadfa6540036464926d3f5901c37a527fa6042 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:52:25 -0400 Subject: [PATCH 16/18] Broken Url Report - adjustments Broken Url Report - adjustments --- .../create/modules/brokenURLReport.html | 102 +++++ .../system/create/modules/brokenURLReport.js | 393 ++++++++++++++++++ 2 files changed, 495 insertions(+) create mode 100644 scripts/system/create/modules/brokenURLReport.html create mode 100644 scripts/system/create/modules/brokenURLReport.js diff --git a/scripts/system/create/modules/brokenURLReport.html b/scripts/system/create/modules/brokenURLReport.html new file mode 100644 index 0000000000..17ab908f0c --- /dev/null +++ b/scripts/system/create/modules/brokenURLReport.html @@ -0,0 +1,102 @@ + + + + + + + + +
+
+

+
+
+ Testing in progress... +

+
+ +
+
+ + + diff --git a/scripts/system/create/modules/brokenURLReport.js b/scripts/system/create/modules/brokenURLReport.js new file mode 100644 index 0000000000..c3a6eba8cd --- /dev/null +++ b/scripts/system/create/modules/brokenURLReport.js @@ -0,0 +1,393 @@ +// +// brokenURLReport.js +// +// Created by Alezia Kurdis on February 22, 2021. +// Copyright 2021 Vircadia contributors. +// +// This script reports broken URLs to the Create Application. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +var brokenURLReportHttpRequest; +var brokenURLReportUrlList = []; +var brokenURLReportInvalideUrlList = []; +var brokenURLReportProcessedUrlNo = 0; +var brokenURLReportUrlEntry; +var brokenURLReportMessageBox; +var brokenURLReportOverlayWebWindow; +var BROKEN_URL_REPORT_YES_BUTTON = 0x4000; +var BROKEN_URL_REPORT_NO_BUTTON = 0x10000; +var MAX_URL_BEFORE_WARNING_FOR_LONG_PROCESS = 20; + +function brokenURLReportRequestUrlValidityCheck(no) { + brokenURLReportHttpRequest = new XMLHttpRequest(); + brokenURLReportHttpRequest.requestComplete.connect(brokenURLReportGetResponseStatus); + brokenURLReportHttpRequest.open("GET", brokenURLReportUrlList[no].url); + brokenURLReportHttpRequest.send(); +} + +function brokenURLReportGetResponseStatus() { + if (brokenURLReportHttpRequest.status === 0 || brokenURLReportHttpRequest.status > 299) { + if (brokenURLReportHttpRequest.status === 0) { + brokenURLReportUrlList[brokenURLReportProcessedUrlNo].validity = "0 - URL not well-formed"; + } else { + brokenURLReportUrlList[brokenURLReportProcessedUrlNo].validity = brokenURLReportHttpRequest.status + " - " + brokenURLReportHttpRequest.statusText; + } + brokenURLReportInvalideUrlList.push(brokenURLReportUrlList[brokenURLReportProcessedUrlNo]); + } + brokenURLReportHttpRequest.requestComplete.disconnect(brokenURLReportGetResponseStatus); + brokenURLReportHttpRequest = null; + brokenURLReportProcessedUrlNo = brokenURLReportProcessedUrlNo + 1; + if (brokenURLReportProcessedUrlNo === brokenURLReportUrlList.length) { + brokenURLReportGenerateFormatedReport(brokenURLReportInvalideUrlList); + brokenURLReportUrlList = []; + brokenURLReportInvalideUrlList = []; + brokenURLReportProcessedUrlNo = 0; + } else { + brokenURLReportRequestUrlValidityCheck(brokenURLReportProcessedUrlNo); + } +} + +function brokenURLReportGenerateFormatedReport(brokenURLReportInvalideUrlList) { + var brokenURLReportContent = ""; + if (brokenURLReportInvalideUrlList.length === 0) { + brokenURLReportContent = "

Broken URL Report

" + brokenURLReportUrlList.length + " URL tested.
NO ISSUES HAVE BEEN FOUND.




"; + brokenURLReportContent += "

This report ignores Asset Server URLs (atp://), local drive paths, and any string not starting with 'http'.
"; + Script.setTimeout(function () { + brokenURLReportOverlayWebWindow.emitScriptEvent(brokenURLReportContent); + }, 3000); + return; + } + brokenURLReportContent = "

Broken URL Report

\n"; + brokenURLReportContent += "
 EntityEntityBroken Url
NoTypeName & ID PropertyStatusCurrent URL" + (i + 1) + "" + brokenUrlReportInvalideUrlList[i].type + "" + brokenUrlReportInvalideUrlList[i].name + "
" + brokenUrlReportInvalideUrlList[i].id + "
" + brokenUrlReportInvalideUrlList[i].urlType + "" + brokenUrlReportInvalideUrlList[i].validity + "" + brokenUrlReportInvalideUrlList[i].validity + "" + brokenUrlReportInvalideUrlList[i].url + "
\n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + for (var i = 0; i < brokenURLReportInvalideUrlList.length; i++ ){ + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + brokenURLReportContent += " \n"; + } + brokenURLReportContent += "
 EntityBroken Url
NoTypeName & ID PropertyStatusCurrent URL
" + (i + 1) + "" + brokenURLReportInvalideUrlList[i].type + "" + brokenURLReportInvalideUrlList[i].name + "
" + brokenURLReportInvalideUrlList[i].id + "
" + brokenURLReportInvalideUrlList[i].urlType + "" + brokenURLReportInvalideUrlList[i].validity + "" + brokenURLReportInvalideUrlList[i].url + "
\n"; + brokenURLReportContent += "

" + brokenURLReportUrlList.length + " URL tested.

"; + brokenURLReportContent += "
This report ignores Asset Server URLs (atp://), local drive paths, and any string not starting with 'http'.
"; + + Script.setTimeout(function () { + brokenURLReportOverlayWebWindow.emitScriptEvent(brokenURLReportContent); + }, 3000); +} + +function brokenURLReportGetUrlTypeColor(urlType) { + var color = "#FFFFFF"; + switch (urlType) { + case "script": + color = "#00FF00"; + break; + case "serverScripts": + color = "#FF00FF"; + break; + case "imageURL": + color = "#00FFFF"; + break; + case "materialURL": + color = "#FF6600"; + break; + case "modelURL": + color = "#FFFF00"; + break; + case "compoundShapeURL": + color = "#6666FF"; + break; + case "animation.url": + color = "#6699FF"; + break; + case "textures": + color = "#FF0066"; + break; + case "xTextureURL": + color = "#0000FF"; + break; + case "yTextureURL": + color = "#009966"; + break; + case "zTextureURL": + color = "#993366"; + break; + case "font": + color = "#FFFFFF"; + break; + case "sourceUrl": + color = "#BBFF00"; + break; + case "scriptURL": + color = "#FFBBBB"; + break; + case "filterURL": + color = "#BBBBFF"; + break; + case "skybox.url": + color = "#BBFFFF"; + break; + case "ambientLight.ambientURL": + color = "#FF3300"; + } + return color; +} + +function brokenURLReport(entityIDs) { + if (entityIDs.length === 0) { + audioFeedback.rejection(); + Window.alert("You have nothing selected."); + return; + } else { + var properties; + for (var i = 0; i < entityIDs.length; i++ ){ + properties = Entities.getEntityProperties(entityIDs[i]); + if (properties.script.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "script", + url: properties.script, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.serverScripts.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "serverScripts", + url: properties.serverScripts, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Image" && properties.imageURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "imageURL", + url: properties.imageURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Material" && properties.materialURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "materialURL", + url: properties.materialURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Model" && properties.modelURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "modelURL", + url: properties.modelURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if ( + (properties.type === "Zone" || properties.type === "Model" || properties.type === "ParticleEffect") + && properties.compoundShapeURL.toLowerCase().startsWith("http") + ) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "compoundShapeURL", + url: properties.compoundShapeURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Model" && properties.animation.url.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "animation.url", + url: properties.animation.url, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "ParticleEffect" && properties.textures.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "textures", + url: properties.textures, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "PolyVox" && properties.xTextureURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "xTextureURL", + url: properties.xTextureURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "PolyVox" && properties.yTextureURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "yTextureURL", + url: properties.yTextureURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "PolyVox" && properties.zTextureURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "zTextureURL", + url: properties.zTextureURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Text" && properties.font.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "font", + url: properties.font, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Web" && properties.sourceUrl.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "sourceUrl", + url: properties.sourceUrl, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Web" && properties.scriptURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "scriptURL", + url: properties.scriptURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Zone" && properties.filterURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "filterURL", + url: properties.filterURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Zone" && properties.skybox.url.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "skybox.url", + url: properties.skybox.url, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + if (properties.type === "Zone" && properties.ambientLight.ambientURL.toLowerCase().startsWith("http")) { + brokenURLReportUrlEntry = { + id: entityIDs[i], + name: properties.name, + type: properties.type, + urlType: "ambientLight.ambientURL", + url: properties.ambientLight.ambientURL, + validity: "NOT_TESTED" + }; + brokenURLReportUrlList.push(brokenURLReportUrlEntry); + } + } + if (brokenURLReportUrlList.length === 0) { + audioFeedback.confirmation(); + Window.alert("No 'http' URL has been found within the current selection."); + return; + } else { + if (brokenURLReportUrlList.length > MAX_URL_BEFORE_WARNING_FOR_LONG_PROCESS) { + var message = "Number of http URLs found: " + brokenURLReportUrlList.length + "\n The analysis may take time. Do you want to proceed?"; + var answer = Window.confirm(message); + if (!answer) { + return; + } + } + if (brokenURLReportOverlayWebWindow !== undefined) { + brokenURLReportOverlayWebWindow.close(); + } + brokenURLReportOverlayWebWindow = new OverlayWebWindow({ + title: "Broken URL Report", + source: Script.resolvePath("brokenURLReport.html"), + width: 1000, + height: 600 + }); + brokenURLReportContent = ""; + brokenURLReportRequestUrlValidityCheck(brokenURLReportProcessedUrlNo); + } + } + + brokenURLReportOverlayWebWindow.webEventReceived.connect(function (message) { + try { + var data = JSON.parse(message); + } catch(e) { + print("brokenURLReport.js: Error parsing JSON"); + return; + } + if (data.action === "select") { + selectionManager.setSelections([data.entityID], this); + } + }); +} From 0da1d9ad5bf3e346a159c311c606c1901e23ff27 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:53:10 -0400 Subject: [PATCH 17/18] Delete brokenUrlReport.html Broken Url Report - adjustments --- .../create/modules/brokenUrlReport.html | 102 ------------------ 1 file changed, 102 deletions(-) delete mode 100644 scripts/system/create/modules/brokenUrlReport.html diff --git a/scripts/system/create/modules/brokenUrlReport.html b/scripts/system/create/modules/brokenUrlReport.html deleted file mode 100644 index 197d377490..0000000000 --- a/scripts/system/create/modules/brokenUrlReport.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - -
-
-

-
-
- Testing in progress... -

-
- -
-
- - - \ No newline at end of file From 0b04eee7bc082750d712ed193bc5f330dd568837 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:53:40 -0400 Subject: [PATCH 18/18] Delete brokenUrlReport.js Broken Url Report - adjustments --- .../system/create/modules/brokenUrlReport.js | 390 ------------------ 1 file changed, 390 deletions(-) delete mode 100644 scripts/system/create/modules/brokenUrlReport.js diff --git a/scripts/system/create/modules/brokenUrlReport.js b/scripts/system/create/modules/brokenUrlReport.js deleted file mode 100644 index b6747305fd..0000000000 --- a/scripts/system/create/modules/brokenUrlReport.js +++ /dev/null @@ -1,390 +0,0 @@ -// -// brokenUrlReport.js -// -// Created by Alezia Kurdis on February 22, 2021. -// Copyright 2021 Vircadia contributors. -// -// This script add reports functionalities to the Create Application. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -var brokenUrlReportHttpRequest; -var brokenUrlReportUrlList = []; -var brokenUrlReportInvalideUrlList = []; -var brokenUrlReportProcessedUrlNo = 0; -var brokenUrlReportUrlEntry; -var brokenUrlReportMessageBox; -var brokenUrlReportOverlayWebWindow; -var BROKEN_URL_REPORT_YES_BUTTON = 0x4000; -var BROKEN_URL_REPORT_NO_BUTTON = 0x10000; -var MAX_URL_BEFORE_WARNING_FOR_LONG_PROCESS = 20; - -function brokenUrlReportRequestUrlValidityCheck(no) { - brokenUrlReportHttpRequest = new XMLHttpRequest(); - brokenUrlReportHttpRequest.requestComplete.connect(brokenUrlReportGetResponseStatus); - brokenUrlReportHttpRequest.open("GET", brokenUrlReportUrlList[no].url); - brokenUrlReportHttpRequest.send(); -} - -function brokenUrlReportGetResponseStatus() { - if (brokenUrlReportHttpRequest.status === 0 || brokenUrlReportHttpRequest.status > 299) { - if (brokenUrlReportHttpRequest.status === 0) { - brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo].validity = "0 - URL not well-formed"; - } else { - brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo].validity = brokenUrlReportHttpRequest.status + " - " + brokenUrlReportHttpRequest.statusText; - } - brokenUrlReportInvalideUrlList.push(brokenUrlReportUrlList[brokenUrlReportProcessedUrlNo]); - } - brokenUrlReportHttpRequest.requestComplete.disconnect(brokenUrlReportGetResponseStatus); - brokenUrlReportHttpRequest = null; - brokenUrlReportProcessedUrlNo = brokenUrlReportProcessedUrlNo + 1; - if (brokenUrlReportProcessedUrlNo === brokenUrlReportUrlList.length) { - brokenUrlReportGenerateFormatedReport(brokenUrlReportInvalideUrlList); - brokenUrlReportUrlList = []; - brokenUrlReportInvalideUrlList = []; - brokenUrlReportProcessedUrlNo = 0; - } else { - brokenUrlReportRequestUrlValidityCheck(brokenUrlReportProcessedUrlNo); - } -} - -function brokenUrlReportGenerateFormatedReport(brokenUrlReportInvalideUrlList) { - var brokenUrlReportContent = ""; - if (brokenUrlReportInvalideUrlList.length === 0) { - brokenUrlReportContent = "

Broken Url Report

" + brokenUrlReportUrlList.length + " URL tested.
NO ISSUE HAS BEEN FOUND.




"; - brokenUrlReportContent = brokenUrlReportContent + "

This report ignores URL from the Asset Server (atp://), local drive paths or any string not starting by 'http'.
"; - Script.setTimeout(function () { - brokenUrlReportOverlayWebWindow.emitScriptEvent(brokenUrlReportContent); - }, 3000); - return; - } - brokenUrlReportContent = "

Broken Url Report

\n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - for (var i = 0; i < brokenUrlReportInvalideUrlList.length; i++ ){ - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - brokenUrlReportContent = brokenUrlReportContent + " \n"; - } - brokenUrlReportContent = brokenUrlReportContent + "
 EntityBroken Url
NoTypeName & ID PropertyStatusCurrent URL
" + (i + 1) + "" + brokenUrlReportInvalideUrlList[i].type + "" + brokenUrlReportInvalideUrlList[i].name + "
" + brokenUrlReportInvalideUrlList[i].id + "
" + brokenUrlReportInvalideUrlList[i].urlType + "" + brokenUrlReportInvalideUrlList[i].validity + "" + brokenUrlReportInvalideUrlList[i].url + "
\n"; - brokenUrlReportContent = brokenUrlReportContent + "

" + brokenUrlReportUrlList.length + " URL tested.

"; - brokenUrlReportContent = brokenUrlReportContent + "
This report ignores URL from the Asset Server (atp://), local drive paths or any string not starting by 'http'.
"; - - Script.setTimeout(function () { - brokenUrlReportOverlayWebWindow.emitScriptEvent(brokenUrlReportContent); - }, 3000); -} - -function brokenUrlReportGetUrlTypeColor(urlType) { - var hexaColor = "#FFFFFF"; - switch (urlType) { - case "script": - hexaColor = "#00FF00"; - break; - case "serverScripts": - hexaColor = "#FF00FF"; - break; - case "imageURL": - hexaColor = "#00FFFF"; - break; - case "materialURL": - hexaColor = "#FF6600"; - break; - case "modelURL": - hexaColor = "#FFFF00"; - break; - case "compoundShapeURL": - hexaColor = "#6666FF"; - break; - case "animation.url": - hexaColor = "#6699FF"; - break; - case "textures": - hexaColor = "#FF0066"; - break; - case "xTextureURL": - hexaColor = "#0000FF"; - break; - case "yTextureURL": - hexaColor = "#009966"; - break; - case "zTextureURL": - hexaColor = "#993366"; - break; - case "font": - hexaColor = "#FFFFFF"; - break; - case "sourceUrl": - hexaColor = "#BBFF00"; - break; - case "scriptURL": - hexaColor = "#FFBBBB"; - break; - case "filterURL": - hexaColor = "#BBBBFF"; - break; - case "skybox.url": - hexaColor = "#BBFFFF"; - break; - case "ambientLight.ambientURL": - hexaColor = "#FF3300"; - } - return hexaColor; -} - -function brokenUrlReport(entityIds) { - if (entityIds.length === 0) { - audioFeedback.rejection(); - Window.alert("You have nothing selected."); - return; - } else { - var properties; - for (var i = 0; i < entityIds.length; i++ ){ - properties = Entities.getEntityProperties(entityIds[i]); - if (properties.script.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "script", - url: properties.script, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.serverScripts.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "serverScripts", - url: properties.serverScripts, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Image" && properties.imageURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "imageURL", - url: properties.imageURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Material" && properties.materialURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "materialURL", - url: properties.materialURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Model" && properties.modelURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "modelURL", - url: properties.modelURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if ((properties.type === "Zone" || properties.type === "Model" || properties.type === "ParticleEffect") && properties.compoundShapeURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "compoundShapeURL", - url: properties.compoundShapeURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Model" && properties.animation.url.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "animation.url", - url: properties.animation.url, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "ParticleEffect" && properties.textures.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "textures", - url: properties.textures, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "PolyVox" && properties.xTextureURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "xTextureURL", - url: properties.xTextureURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "PolyVox" && properties.yTextureURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "yTextureURL", - url: properties.yTextureURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "PolyVox" && properties.zTextureURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "zTextureURL", - url: properties.zTextureURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Text" && properties.font.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "font", - url: properties.font, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Web" && properties.sourceUrl.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "sourceUrl", - url: properties.sourceUrl, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Web" && properties.scriptURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "scriptURL", - url: properties.scriptURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Zone" && properties.filterURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "filterURL", - url: properties.filterURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Zone" && properties.skybox.url.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "skybox.url", - url: properties.skybox.url, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - if (properties.type === "Zone" && properties.ambientLight.ambientURL.toLowerCase().startsWith("http")) { - brokenUrlReportUrlEntry = { - id: entityIds[i], - name: properties.name, - type: properties.type, - urlType: "ambientLight.ambientURL", - url: properties.ambientLight.ambientURL, - validity: "NOT_TESTED" - }; - brokenUrlReportUrlList.push(brokenUrlReportUrlEntry); - } - } - if (brokenUrlReportUrlList.length === 0) { - audioFeedback.confirmation(); - Window.alert("No 'http' url has been found within the current selection."); - return; - } else { - if (brokenUrlReportUrlList.length > MAX_URL_BEFORE_WARNING_FOR_LONG_PROCESS) { - var message = "Number of http URL found: " + brokenUrlReportUrlList.length + "\n The analysis may take time. Do you want to proceed?"; - var answer = Window.confirm(message); - if (!answer) { - return; - } - } - if (brokenUrlReportOverlayWebWindow !== undefined) { - brokenUrlReportOverlayWebWindow.close(); - } - brokenUrlReportOverlayWebWindow = new OverlayWebWindow({ - title: "Broken Url Report", - source: Script.resolvePath("brokenUrlReport.html"), - width: 1000, - height: 600 - }); - brokenUrlReportContent = ""; - brokenUrlReportRequestUrlValidityCheck(brokenUrlReportProcessedUrlNo); - } - } - - brokenUrlReportOverlayWebWindow.webEventReceived.connect(function (message) { - try { - var data = JSON.parse(message); - } catch(e) { - print("brokenUrlReport.js: Error parsing JSON"); - return; - } - if (data.action === "select") { - selectionManager.setSelections([data.entityID], this); - } - }); -}