Change in Code Indentation
This commit is contained in:
1 parent
1a52e5494e
commit
199a71a4e5
89 files changed
+22093
-22093
No files matched your search
@@ -1,90 +1,90 @@
|
||||
function newSuperScriptsFunctions () {
|
||||
thisObject = {
|
||||
runSuperScript: runSuperScript
|
||||
}
|
||||
function newSuperScriptsFunctions() {
|
||||
thisObject = {
|
||||
runSuperScript: runSuperScript
|
||||
}
|
||||
|
||||
return thisObject
|
||||
return thisObject
|
||||
|
||||
function runSuperScript (node, rootNodes, functionLibraryNodeCloning, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter) {
|
||||
try {
|
||||
let clone = functionLibraryNodeCloning.getNodeClone
|
||||
let executionResult = true
|
||||
let superAction = node
|
||||
function runSuperScript(node, rootNodes, functionLibraryNodeCloning, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter) {
|
||||
try {
|
||||
let clone = functionLibraryNodeCloning.getNodeClone
|
||||
let executionResult = true
|
||||
let superAction = node
|
||||
|
||||
function setup (templateClone, target, exchange, exchangeNodeType, arrayPropertyName) {
|
||||
spawnPosition.x = target.payload.position.x
|
||||
spawnPosition.y = target.payload.position.y
|
||||
function setup(templateClone, target, exchange, exchangeNodeType, arrayPropertyName) {
|
||||
spawnPosition.x = target.payload.position.x
|
||||
spawnPosition.y = target.payload.position.y
|
||||
|
||||
if (exchange === undefined) {
|
||||
functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, target, target)
|
||||
} else {
|
||||
let definition = getNodeDefinition (target)
|
||||
for (let i = 0; i < definition.properties.length; i++) {
|
||||
let property = definition.properties[i]
|
||||
if (property.childType === exchangeNodeType) {
|
||||
let exchanges = target[property.name]
|
||||
if (exchanges === undefined) {
|
||||
exchanges = []
|
||||
}
|
||||
let targetExchange
|
||||
for (let j = 0; j < exchanges.length; j++) {
|
||||
let thisExchange = exchanges[j]
|
||||
if (thisExchange.payload.referenceParent !== undefined) {
|
||||
if (thisExchange.payload.referenceParent.id === exchange.id) {
|
||||
targetExchange = thisExchange
|
||||
}
|
||||
if (exchange === undefined) {
|
||||
functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, target, target)
|
||||
} else {
|
||||
let definition = getNodeDefinition(target)
|
||||
for (let i = 0; i < definition.properties.length; i++) {
|
||||
let property = definition.properties[i]
|
||||
if (property.childType === exchangeNodeType) {
|
||||
let exchanges = target[property.name]
|
||||
if (exchanges === undefined) {
|
||||
exchanges = []
|
||||
}
|
||||
let targetExchange
|
||||
for (let j = 0; j < exchanges.length; j++) {
|
||||
let thisExchange = exchanges[j]
|
||||
if (thisExchange.payload.referenceParent !== undefined) {
|
||||
if (thisExchange.payload.referenceParent.id === exchange.id) {
|
||||
targetExchange = thisExchange
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetExchange === undefined) {
|
||||
targetExchange = functionLibraryUiObjectsFromNodes.addUIObject(target, exchangeNodeType)
|
||||
targetExchange.payload.referenceParent = exchange
|
||||
}
|
||||
let nodesArray = targetExchange[arrayPropertyName]
|
||||
nodesArray.push(templateClone)
|
||||
functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, targetExchange, targetExchange)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetExchange === undefined) {
|
||||
targetExchange = functionLibraryUiObjectsFromNodes.addUIObject(target, exchangeNodeType)
|
||||
targetExchange.payload.referenceParent = exchange
|
||||
}
|
||||
let nodesArray = targetExchange[arrayPropertyName]
|
||||
nodesArray.push(templateClone)
|
||||
functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, targetExchange, targetExchange)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function deleteNode (node) {
|
||||
functionLibraryNodeDeleter.deleteUIObject(node, rootNodes)
|
||||
}
|
||||
function deleteNode(node) {
|
||||
functionLibraryNodeDeleter.deleteUIObject(node, rootNodes)
|
||||
}
|
||||
|
||||
/* Validations */
|
||||
if (executionResult === true && node.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Super Action node needs a Parent Node.')
|
||||
executionResult = false
|
||||
}
|
||||
if (executionResult === true && node.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Super Action node needs to reference a Master Script Node.')
|
||||
executionResult = false
|
||||
}
|
||||
if (executionResult === true && node.payload.referenceParent.javascriptCode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Master Script Node needs to have a child Javascript Code Node.')
|
||||
executionResult = false
|
||||
}
|
||||
/* Validations */
|
||||
if (executionResult === true && node.payload.parentNode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Super Action node needs a Parent Node.')
|
||||
executionResult = false
|
||||
}
|
||||
if (executionResult === true && node.payload.referenceParent === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Super Action node needs to reference a Master Script Node.')
|
||||
executionResult = false
|
||||
}
|
||||
if (executionResult === true && node.payload.referenceParent.javascriptCode === undefined) {
|
||||
node.payload.uiObject.setErrorMessage('Master Script Node needs to have a child Javascript Code Node.')
|
||||
executionResult = false
|
||||
}
|
||||
|
||||
let masterScript = node.payload.referenceParent
|
||||
let masterScript = node.payload.referenceParent
|
||||
|
||||
eval(masterScript.javascriptCode.code)
|
||||
eval(masterScript.javascriptCode.code)
|
||||
|
||||
let masterScriptInstance = newNewMasterScriptInstance()
|
||||
let masterScriptInstance = newNewMasterScriptInstance()
|
||||
|
||||
if (executionResult === true) {
|
||||
executionResult = masterScriptInstance.runValidations(superAction, masterScript)
|
||||
}
|
||||
if (executionResult === true) {
|
||||
executionResult = masterScriptInstance.runScript(superAction, masterScript)
|
||||
}
|
||||
if (executionResult === true) {
|
||||
superAction.payload.uiObject.setValue('Execution Completed Successfully')
|
||||
} else {
|
||||
superAction.payload.uiObject.setValue('Execution Failed')
|
||||
}
|
||||
} catch (err) {
|
||||
superAction.payload.uiObject.setErrorMessage(err.message)
|
||||
superAction.payload.uiObject.setValue('Execution Failed')
|
||||
if (executionResult === true) {
|
||||
executionResult = masterScriptInstance.runValidations(superAction, masterScript)
|
||||
}
|
||||
if (executionResult === true) {
|
||||
executionResult = masterScriptInstance.runScript(superAction, masterScript)
|
||||
}
|
||||
if (executionResult === true) {
|
||||
superAction.payload.uiObject.setValue('Execution Completed Successfully')
|
||||
} else {
|
||||
superAction.payload.uiObject.setValue('Execution Failed')
|
||||
}
|
||||
} catch (err) {
|
||||
superAction.payload.uiObject.setErrorMessage(err.message)
|
||||
superAction.payload.uiObject.setValue('Execution Failed')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user