if ( StructKeyExists(request,'params') ) attributes = request.params; if ( !structKeyExists(attributes, "updateExisting") OR !IsBoolean(attributes.updateExisting) ) attributes.updateExisting = false; // Default: False if ( !structKeyExists(attributes, "preserveAliases") OR !IsBoolean(attributes.preserveAliases) ) attributes.preserveAliases = true; // Default: True if ( structKeyExists(attributes, "outputScripts") AND IsBoolean(attributes.outputScripts) ) attributes.outputInstallScripts = attributes.outputScripts; if ( !structKeyExists(attributes, "outputInstallScripts") OR !IsBoolean(attributes.outputInstallScripts) ) attributes.outputInstallScripts = true; // loadingType=early to load all js resource early if ( !structKeyExists(attributes, "loadingType") OR attributes.loadingType NEQ "early" ) attributes.loadingType = "late"; // Options: early or late - Default: late // 'useLegacyEarlyJs=true' overrides 'loadingType=late' to be 'loadingType=early' if ( !structKeyExists(attributes, "useLegacyEarlyJs") OR !IsBoolean(attributes.useLegacyEarlyJs) ) attributes.useLegacyEarlyJs = false; // Options: true or false rData = []; // FullCalendar 6.1 Resources rItem = {}; rItem.name = "FullCalendar 6.1 - Free"; rItem.aliasList = "fullcalendar_6_free,fullcalendar_6_1_free"; rItem.category = "SECONDARY"; rItem.groups = ["current","ptcalendar"]; rItem.source = { local = { css = [], js = [ { sourceurl="/ADF/apps/pt_calendar/thirdParty/fullcalendar/6.1/index.global.min.js", canminify=0, iscritical=0, cancombine=0 } ] }, external = { css = [], js = [] } }; rItem.description = "FullCalendar resources."; rItem.installInstructions = "Included in Calendar 5.0 and later."; rItem.redistributable = 0; rItem.update = 0; rItem.silent = 0; rItem.key = application.ADF.resourceService.buildResourceKey(str=rItem.name); rItem.legacyLoadJsEarly = 0; rItem.id = 0; ArrayAppend(rData, rItem); // Popper 2 Resources rItem = {}; rItem.name = "Popper 2"; rItem.aliasList = "popper_2,popper_2_11"; rItem.category = "SECONDARY"; rItem.groups = ["current","ptcalendar"]; rItem.source = { local = { css = [], js = [ { sourceurl="/ADF/apps/pt_calendar/thirdParty/popperjs/2.11/popper.min.js", canminify=0, iscritical=0, cancombine=0 } ] }, external = { css = [], js = [] } }; rItem.description = "Popper Resources."; rItem.installInstructions = "Included in Calendar 5.0 and later."; rItem.redistributable = 0; rItem.update = 0; rItem.silent = 0; rItem.key = application.ADF.resourceService.buildResourceKey(str=rItem.name); rItem.legacyLoadJsEarly = 0; rItem.id = 0; ArrayAppend(rData, rItem); // Tippy.js 6.3 Resources rItem = {}; rItem.name = "Tippy.js 6.3"; rItem.aliasList = "tippyjs_6,tippyjs_6_3"; rItem.category = "SECONDARY"; rItem.groups = ["current","ptcalendar"]; rItem.source = { local = { css = [ { sourceurl="/ADF/apps/pt_calendar/thirdParty/tippyjs/6.3/tippy.css", canminify=0, iscritical=0, cancombine=0 } ], js = [ { sourceurl="/ADF/apps/pt_calendar/thirdParty/tippyjs/6.3/tippy.umd.min.js", canminify=0, iscritical=0, cancombine=0 } ] }, external = { css = [], js = [] } }; rItem.description = "Tippy.js Resources."; rItem.installInstructions = "Included in Calendar 5.0 and later."; rItem.redistributable = 0; rItem.update = 0; rItem.silent = 0; rItem.key = application.ADF.resourceService.buildResourceKey(str=rItem.name); rItem.legacyLoadJsEarly = 0; rItem.id = 0; ArrayAppend(rData, rItem); // jQuery Context Menu 2.9 Resources rItem = {}; rItem.name = "jQuery Context Menu 2.9"; rItem.aliasList = "jQueryContextMenu_2,jQueryContextMenu_2_9"; rItem.category = "SECONDARY"; rItem.groups = ["current","ptcalendar"]; rItem.source = { local = { css = [ { canminify=0, sourceurl="/ADF/apps/pt_calendar/thirdParty/contextMenu/2.9/jquery.contextMenu.min.css", iscritical=0, cancombine=0 } ], js = [ { canminify=0, sourceurl="/ADF/apps/pt_calendar/thirdParty/contextMenu/2.9/jquery.contextMenu.min.js", iscritical=0, cancombine=0 }, { canminify=0, sourceurl="/ADF/apps/pt_calendar/thirdParty/contextMenu/2.9/jquery.ui.position.min.js", iscritical=0, cancombine=0 } ] }, external = { css = [], js = [] } }; rItem.description = "jQuery Context Menu Resources."; rItem.installInstructions = "Included in Calendar 5.0 and later."; rItem.redistributable = 0; rItem.update = 0; rItem.silent = 0; rItem.key = application.ADF.resourceService.buildResourceKey(str=rItem.name); rItem.legacyLoadJsEarly = 0; rItem.id = 0; ArrayAppend(rData, rItem); // ------------------------------------------------------------------------- // // ---------------------- ptCalendar App Resources ------------------------- // // ------------------------------------------------------------------------- // // ADF Layout CSS rItem = {}; rItem.name = "ADF Layout v1.0"; rItem.aliasList = "ADFlayout,ADFlayout_1_0"; rItem.category = "TERTIARY"; rItem.groups = ["current","adf"]; rItem.source = { local = { css = [ { canminify=0, sourceurl="/ADF/extensions/style/ADF-layout.css", iscritical=0, cancombine=0 }, { canminify=0, sourceurl="/_cs_apps/style/ADF-layout.css", iscritical=0, cancombine=0 } ], js = [] }, external = { css = [], js = [] } }; rItem.description = "ADF Layout Style Resource."; rItem.installInstructions = "Included in Calendar 5.0 and later."; rItem.redistributable = 0; rItem.update = 0; rItem.silent = 0; rItem.key = application.ADF.resourceService.buildResourceKey(str=rItem.name); rItem.legacyLoadJsEarly = 0; rItem.id = 0; ArrayAppend(rData, rItem); // PT Calendar Layout CSS rItem = {}; rItem.name = "PT Calendar Layout v1.0"; rItem.aliasList = "ptCalendarLayout,ptCalendarLayout_1_0"; rItem.category = "TERTIARY"; rItem.groups = ["current","ptcalendar"]; rItem.source = { local = { css = [ { canminify=0, sourceurl="/ADF/apps/pt_calendar/style/calendar-layout.css", iscritical=0, cancombine=0 } ], js = [] }, external = { css = [], js = [] } }; rItem.description = "Calendar Layout Style Resource."; rItem.installInstructions = "Included in Calendar 5.0 and later."; rItem.redistributable = 0; rItem.update = 0; rItem.silent = 0; rItem.key = application.ADF.resourceService.buildResourceKey(str=rItem.name); rItem.legacyLoadJsEarly = 0; rItem.id = 0; ArrayAppend(rData, rItem); // PT Calendar Layout Site Override CSS if ( fileExists(request.site.CSAPPSDIR & 'pt_calendar/style/calendar-layout.css') ) { rItem = {}; rItem.name = "PT Calendar Site Override"; rItem.aliasList = "ptCalendarLayoutSiteOverride"; rItem.category = "TERTIARY"; rItem.groups = ["current","ptcalendar"]; rItem.source = { local = { css = [ { canminify=0, sourceurl="/_cs_apps/pt_calendar/style/calendar-layout.css", iscritical=0, cancombine=0 } ], js = [] }, external = { css = [], js = [] } }; rItem.description = "Calendar Layout Site Override Style Resource."; rItem.installInstructions = "Included in Calendar 5.0 and later."; rItem.redistributable = 0; rItem.update = 0; rItem.silent = 0; rItem.key = application.ADF.resourceService.buildResourceKey(str=rItem.name); rItem.legacyLoadJsEarly = 0; rItem.id = 0; ArrayAppend(rData, rItem); } 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("
");