Improving App Loader

This commit is contained in:
Luis Fernando Molina committed 2021-09-09 13:03:46 +02:00
1 parent c18e1a776d
commit 7b3aa8da85
3 files changed
+35 -85

No files matched your search

+31 -76
View File
@@ -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() {
@@ -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
+3 -8
View File
@@ -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"
},