diff --git a/Desktop/UI/WebAppLoader.js b/Desktop/UI/WebAppLoader.js index cfdce582f..97b732c94 100644 --- a/Desktop/UI/WebAppLoader.js +++ b/Desktop/UI/WebAppLoader.js @@ -14,87 +14,42 @@ function newWebAppLoader() { 'WebApp.js' ] - functionLibraries() + for (let i = 0; i < UI.schemas.projectSchema.length; i++) { + let project = UI.schemas.projectSchema[i] - function functionLibraries() { - let url = 'ListFunctionLibraries' - httpRequest(undefined, url, onResponse) - - function onResponse(err, fileList) { - let urlArray = [] - let fileArray = JSON.parse(fileList) - for (let i = 0; i < fileArray.length; i++) { - let item = fileArray[i] - - project = item[0] - fileName = item[1] - urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Function-Libraries' + '/' + fileName) + if (project.UI !== undefined) { + if (project.UI.functionLibraries !== undefined) { + for (let j = 0; j < project.UI.functionLibraries.length; j++) { + let fileName = project.UI.functionLibraries[j].fileName + if (fileName === undefined) {fileName = project.UI.functionLibraries[j].name.replaceAll(' ', '') + '.js'} + modulesArray.push('Projects' + '/' + project.name + '/' + 'UI' + '/' + 'Function-Libraries' + '/' + fileName) + } + } + if (project.UI.utilities !== undefined) { + for (let j = 0; j < project.UI.utilities.length; j++) { + let fileName = project.UI.utilities[j].fileName + if (fileName === undefined) {fileName = project.UI.utilities[j].name.replaceAll(' ', '') + '.js'} + modulesArray.push('Projects' + '/' + project.name + '/' + 'UI' + '/' + 'Utilities' + '/' + fileName) + } + } + if (project.UI.globals !== undefined) { + for (let j = 0; j < project.UI.globals.length; j++) { + let fileName = project.UI.globals[j].fileName + if (fileName === undefined) {fileName = project.UI.globals[j].name.replaceAll(' ', '') + '.js'} + modulesArray.push('Projects' + '/' + project.name + '/' + 'UI' + '/' + 'Globals' + '/' + fileName) + } + } + if (project.UI.modules !== undefined) { + for (let j = 0; j < project.UI.modules.length; j++) { + let fileName = project.UI.modules[j].fileName + if (fileName === undefined) {fileName = project.UI.modules[j].name.replaceAll(' ', '') + '.js'} + modulesArray.push('Projects' + '/' + project.name + '/' + 'UI' + '/' + 'Modules' + '/' + fileName) + } } - - modulesArray = modulesArray.concat(urlArray) - utilities() } } - function utilities() { - let url = 'ListUtilitiesFiles' - httpRequest(undefined, url, onResponse) - - function onResponse(err, fileList) { - let urlArray = [] - let fileArray = JSON.parse(fileList) - for (let i = 0; i < fileArray.length; i++) { - let item = fileArray[i] - - project = item[0] - fileName = item[1] - urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Utilities' + '/' + fileName) - } - - modulesArray = modulesArray.concat(urlArray) - globals() - } - } - - function globals() { - let url = 'ListGlobalFiles' - httpRequest(undefined, url, onResponse) - - function onResponse(err, fileList) { - let urlArray = [] - let fileArray = JSON.parse(fileList) - for (let i = 0; i < fileArray.length; i++) { - let item = fileArray[i] - - project = item[0] - fileName = item[1] - urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Globals' + '/' + fileName) - } - - modulesArray = modulesArray.concat(urlArray) - modules() - } - } - - function modules() { - let url = 'ListModulesFiles' - httpRequest(undefined, url, onResponse) - - function onResponse(err, fileList) { - let urlArray = [] - let fileArray = JSON.parse(fileList) - for (let i = 0; i < fileArray.length; i++) { - let item = fileArray[i] - - project = item[0] - fileName = item[1] - urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Modules' + '/' + fileName) - } - - modulesArray = modulesArray.concat(urlArray) - downloadIncludedFiles() - } - } + downloadIncludedFiles() function downloadIncludedFiles() { diff --git a/Projects/Foundations/UI/Function-Libraries/ReferenceAttachDetach.js b/Projects/Foundations/UI/Function-Libraries/ReferenceAttachDetach.js index fd6338f3b..0e82a6356 100644 --- a/Projects/Foundations/UI/Function-Libraries/ReferenceAttachDetach.js +++ b/Projects/Foundations/UI/Function-Libraries/ReferenceAttachDetach.js @@ -1,5 +1,5 @@ // These function are used across the system to establish and remove references between nodes -function newFoundationsFunctionLibraryAttachDetach() { +function newFoundationsFunctionLibraryReferenceAttachDetach() { let thisObject = { referenceDetachNode: referenceDetachNode, referenceAttachNode: referenceAttachNode diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 6705b6a81..e03e7b334 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -12,9 +12,9 @@ ], "functionLibraries": [ { - "name": "Attach Detach", + "name": "Reference Attach Detach", "propertyName": "attachDetach", - "functionName": "newFoundationsFunctionLibraryAttachDetach" + "functionName": "newFoundationsFunctionLibraryReferenceAttachDetach" }, { "name": "Chain Attach Detach", @@ -51,11 +51,6 @@ "propertyName": "onFocus", "functionName": "newFoundationsFunctionLibraryOnFocus" }, - { - "name": "Super Scripts Functions", - "propertyName": "superScriptsFunctions", - "functionName": "newFoundationsFunctionLibrarySuperScriptsFunctions" - }, { "name": "Webhook Functions", "propertyName": "webhookFunctions", @@ -184,7 +179,7 @@ "functionName": "newFoundationsUtilitiesMeshes" }, { - "name": "Children", + "name": "Node Children", "propertyName": "children", "functionName": "newFoundationsUtilitiesNodeChildren" },