JS Frontendcore Javascript setup

1. Personalize the Global Settings

The Global Settings are the Vars you need to personalize for each project. Most of them are Paths to found files but there are also some general options. This is because core.js will access them, but it's not necessary to define them because all they have default values

These are the settings you can personalize and the default values:

<script>
var oGlobalSettings = {
	// Defines the path of the Javascript
	sPathJs : '/js/',

	// Defines the path of the Javascript Core path (Where the core.js can be found)
	sPathJsCore: this.sPathJs + '../../',

	// Defines the path where the Javascript Modules can be found
	sPathJsModules : this.sPathJs + 'modules',

	// Defines the path where the Javascript Libs can be found
	sPathJsLibs : this.sPathJs + '../../',

	// Defines the path where the CSS files can be found
	sPathCss: './css/',

	// Defines the path where the ui.css file can be found
	sPathCssUi: this.sPathCss + 'ui.css',

	// Sends google analytics a call to get starts of calls an executions of the modules
	bTrackModules: false,

	// Defines the hash used to call all the static files ( example.js?v=).
	// This is to avoid browser cache. The ideal is to update this number each deploy you do.
	sHash: '1',

	// Add or overwrite definitions to the RequireJS modules config.
	// For example concatenate modals & tips to avoid too many requests and define them as one file.
	oPaths: {},

	// This list of css and medias to load Asynchronously on init.
	// For example: 'main.css' : 'all'
	// Another example: 'desktop.scss' : 'screen and (min-width:900px)'
	oCss: {},

	// Set this to force always the mobile or desktop Javascript mode
	sDevice: isMobile.any() ? 'mobile' : 'desktop',

	// Activate or deactivate the responsive images module
	bResponsiveImages: true,
}
</script>

You must declare them before the inclusion of the "core.js" file between script tags in your head.

2. Include the Core.js

Includes the core js with the minimum scripts, from here is all async and depending on the DOM boot.

<script src="components/frontendcore-js/core.js"></script>

3. Activate the Polyfills (optional)

If you need to give suppor for IE9 or below this is a good idea, just call the module in the body Tag.

<body data-fc-modules="polyfills">