scriptsArr = application.ADF.resourceService.buildRegisterScriptsArr(dataArr=rData,source="local");
if ( attributes.outputInstallScripts )
WriteOutput("");
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 = "#rItem.name#",
category = "#rItem.category#",
earlyLoadSourceArray = #SerializeJSON(propsEarly)#,
lateLoadSourceArray = #SerializeJSON(propsLate)#,
description = "#rItem.description#",
installInstructions = "#rItem.installInstructions#",
aliasList = "#rItem.aliasList#",
redistributable = #rItem.redistributable#,
updateExisting = #attributes.updateExisting#,
silent = #rItem.silent#,
preserveAliases = #attributes.preserveAliases#
);'
);
WriteOutput("
");
}
application.ADF.scriptsService.registerResource(
"#rItem.name#", "#rItem.category#",
propsEarly,
propsLate,
"#rItem.description#", "#rItem.installInstructions#", "#rItem.aliasList#"
,rItem.redistributable, attributes.updateExisting, rItem.silent
,attributes.preserveAliases
);
} // END - scriptArr Loop
if ( attributes.outputInstallScripts )
WriteOutput("");