Scripts
in package
Table of Contents
Properties
- $coreFiles : mixed
- $files : mixed
- $inline : mixed
- $libraries : mixed
- $required : mixed
Methods
- add() : mixed
- Allows caller to insert new stylesheets into our resource collector
- addCoreFiles() : mixed
- Insert all core libraries needed
- appendExtension() : mixed
- Helper method to generate extension and necessary cache bust
- getFileExtension() : mixed
- Determines if the file should use a .min.css or not
- getFiles() : mixed
- Retrieve files that are in the resource collector
- getInlineScripts() : mixed
- Retrieves inline scripts that needs to be attached on the page
- getLibrary() : mixed
- Retrieves the library for a script
- init() : mixed
- Allow the caller to initialize the script
- initializeAdmin() : mixed
- Injects classes on the body of the page to allow foundry to style accordingly
- inline() : mixed
- Allows caller to insert inline scripts into our resource collector
- isRequired() : mixed
- Determines if stylesheet needs to be loaded on the page
- load() : mixed
- Loads a known script library from Foundry and insert it into the resource collector
- required() : mixed
- Switch to determine if scripts should be rendered on the page
Properties
$coreFiles
public
static mixed
$coreFiles
= [
// The ordering of items #1 and #2 must not be changed
'jq',
// The name of this file needs to be like this to prevent conflicts by T4 which tries to remove the file "jquery.js" from the head
'bootloader',
'module',
'script',
'require',
'dialog',
'foundry',
'component',
]
$files
public
static mixed
$files
= [
// Core libraries are libraries that needs to be rendered first
'core' => [],
'base' => [],
'vendor' => [],
'others' => [],
]
$inline
public
static mixed
$inline
= []
$libraries
public
static mixed
$libraries
= ['admin' => ['path' => '/admin', 'type' => 'base'], 'shared' => ['path' => '/shared', 'type' => 'base'], 'flatpickr' => ['path' => '/vendor/flatpickr', 'type' => 'vendor'], 'popper' => ['path' => '/vendor/popper', 'type' => 'vendor'], 'tippy' => ['path' => '/vendor/tippy', 'type' => 'vendor'], 'perfectscrollbar' => ['path' => '/vendor/perfectscrollbar', 'type' => 'vendor'], 'emoji' => ['path' => '/vendor/emoji', 'type' => 'vendor'], 'raty' => ['path' => '/vendor/raty', 'type' => 'vendor'], 'mmenu' => ['path' => '/vendor/mmenu', 'type' => 'vendor'], 'select2' => ['path' => '/vendor/select2', 'type' => 'vendor'], 'tribute' => ['path' => '/vendor/tribute', 'type' => 'vendor'], 'toast' => ['path' => '/vendor/toast', 'type' => 'vendor'], 'prism' => ['path' => '/vendor/prism', 'type' => 'vendor'], 'lightbox' => ['path' => '/vendor/lightbox', 'type' => 'vendor'], 'markitup' => ['path' => '/vendor/markitup', 'type' => 'vendor']]
$required
public
static mixed
$required
= false
Methods
add()
Allows caller to insert new stylesheets into our resource collector
public
static add(mixed $file, mixed $type) : mixed
Parameters
- $file : mixed
- $type : mixed
Tags
addCoreFiles()
Insert all core libraries needed
public
static addCoreFiles() : mixed
Tags
appendExtension()
Helper method to generate extension and necessary cache bust
public
static appendExtension(mixed $filePath[, mixed $cacheBusting = true ]) : mixed
Parameters
- $filePath : mixed
- $cacheBusting : mixed = true
Tags
getFileExtension()
Determines if the file should use a .min.css or not
public
static getFileExtension(mixed $fileName) : mixed
Parameters
- $fileName : mixed
Tags
getFiles()
Retrieve files that are in the resource collector
public
static getFiles() : mixed
Tags
getInlineScripts()
Retrieves inline scripts that needs to be attached on the page
public
static getInlineScripts() : mixed
Tags
getLibrary()
Retrieves the library for a script
public
static getLibrary(mixed $library) : mixed
Parameters
- $library : mixed
Tags
init()
Allow the caller to initialize the script
public
static init() : mixed
Tags
initializeAdmin()
Injects classes on the body of the page to allow foundry to style accordingly
public
static initializeAdmin() : mixed
Tags
inline()
Allows caller to insert inline scripts into our resource collector
public
static inline(mixed $codes) : mixed
Parameters
- $codes : mixed
Tags
isRequired()
Determines if stylesheet needs to be loaded on the page
public
static isRequired() : mixed
Tags
load()
Loads a known script library from Foundry and insert it into the resource collector
public
static load(mixed $library) : mixed
since 1.1.3. Please use FD.require().script() instead in order to load the script.
Parameters
- $library : mixed
Tags
required()
Switch to determine if scripts should be rendered on the page
public
static required() : mixed