scriptsArr = application.ADF.resourceService.buildRegisterScriptsArr(dataArr=rData,source="local");
if ( attributes.outputInstallScripts )
WriteOutput("");
regData = {};
for ( i=1; i <= ArrayLen(scriptsArr); i++ ) {
regData = scriptsArr[i];
legacyLoadJSEarlyDefault = 0;
cssProps = [];
jsProps = [];
// CSS: {LoadTagType=1, SourceURL="/style/style.css", canCombine=1, canMinify=0, isCritical=0, Integrity="", Crossorigin="" }
// JS: {LoadTagType=2, SourceURL="/js/plugins.js", canCombine=1, canMinify=0, isCritical=0, Integrity="", Crossorigin="" }
// Get the Default values from the resource data
if ( StructKeyExists(regData,"legacyLoadJsEarly") )
legacyLoadJSEarlyDefault = regData.legacyLoadJsEarly;
if ( StructKeyExists(regData,"cssSourceArray") )
cssProps = regData.cssSourceArray;
if ( StructKeyExists(regData,"jsSourceArray") )
jsProps = regData.jsSourceArray;
// If enabled, use the legacyLoadJSEarlyDefault
jsLoadEarly = attributes.useLegacyEarlyJs ? legacyLoadJSEarlyDefault : 0;
// Set the Early and Late Properties
propsEarly = [];
propsLate = [];
if ( ArrayLen(cssProps) )
propsEarly = cssProps;
if ( ArrayLen(jsProps) )
{
if ( jsLoadEarly OR attributes.loadingType EQ "early" )
ArrayAppend(propsEarly,jsProps,true);
else
propsLate = jsProps;
}
if ( attributes.outputInstallScripts )
{
WriteOutput(
'application.ADF.scriptsService.registerResource(
name = "#regData.name#",
category = "#regData.category#",
earlyLoadSourceArray = #SerializeJSON(propsEarly)#,
lateLoadSourceArray = #SerializeJSON(propsLate)#,
description = "#regData.description#",
installInstructions = "#regData.installInstructions#",
aliasList = "#regData.aliasList#",
redistributable = #regData.redistributable#,
updateExisting = #attributes.updateExisting#,
silent = #regData.silent#,
preserveAliases = #attributes.preserveAliases#
);'
);
WriteOutput("
");
}
application.ADF.scriptsService.registerResource(
"#regData.name#", "#regData.category#",
propsEarly,
propsLate,
"#regData.description#", "#regData.installInstructions#", "#regData.aliasList#"
,regData.redistributable, attributes.updateExisting, regData.silent
,attributes.preserveAliases
);
WriteOutput("
");
} // END - scriptArr Loop
if ( attributes.outputInstallScripts )
WriteOutput("");