\SectionedHeadJsBackend
Class SectionedHeadJsBackend
This backend is more stringent with its positioning of <link> and <script> to comply with the Soul Digital
HeadJS integration
WARNING: this will _not_ work very well if there are any inline scripts in SS template files.
Synopsis
class SectionedHeadJsBackend
extends HeadJsBackend
{
- // constants
- const SECTION_BEFORE_HEAD_CLOSE = "before_head_close";
- const SECTION_AFTER_BODY_OPEN = "after_body_open";
- const SECTION_BEFORE_BODY_CLOSE = "before_body_close";
- // Inherited members from HeadJsBackend
- public boolean $write_js_to_body;
- public static array $do_not_wrap;
- public array $callbacks;
- // methods
- public void add_to_section()
- public void get_section_id_for_include()
- public void move_to_section()
- public void get_all_in_section()
- public void get_default_section_id()
- public string includeInHTML()
- // Inherited methods from HeadJsBackend
- public bool isBackendController()
- public static void doNotWrap()
- public static boolean getNamedFiles()
- public static string getCdnSource()
- public static string getJavascriptSource()
- public static string getHeadJsUrl()
- public void add_callback()
- public void remove_callback()
- public void get_callback()
- public void add_dependency()
- public string includeInHTML()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
79+ | Calculate $prefix properly |
142 | store all css files in arrays with media param as the key, then do a headjs test for each mediaparam |
125+ | Calculate $prefix properly |
186 | store all css files in arrays with media param as the key, then do a headjs test for each mediaparam |
Constants
Name | Value |
---|---|
SECTION_BEFORE_HEAD_CLOSE | "before_head_close" |
SECTION_AFTER_BODY_OPEN | "after_body_open" |
SECTION_BEFORE_BODY_CLOSE | "before_body_close" |
Members
public
- $callbacks
—
array
Store all relevant callbacks for onLoad of files here - $default
- $do_not_wrap
- $sections
- $write_js_to_body
Methods
public
- add_to_section() — Needed to actively position the inclusion of a file in sections.
- get_all_in_section()
- get_default_section_id()
- get_section_id_for_include()
- includeInHTML() — Update the given HTML content with the appropriate include tags for the registered requirements. Needs to receive a valid HTML/XHTML template in the $content parameter, including a <head> tag. The requirements will insert before the closing <head> tag automatically.
- move_to_section()
Inherited from HeadJsBackend
public
- add_callback()
- add_dependency() — Add a dependency for a file or path
- doNotWrap() — Do not wrap in head.ready a given customScript
- getCdnSource() — Get the CDN source for headjs
- getHeadJsUrl() — Get the head js url
- getJavascriptSource() — Get the local filesystem source
- getNamedFiles() — Show the name of files in includes
- get_callback() — Get all the callbacks associated with $fileOrID
- includeInHTML() — Update the given HTML content with the appropriate include tags for the registered requirements. Needs to receive a valid HTML/XHTML template in the $content parameter, including a <head> tag. The requirements will insert before the closing <head> tag automatically.
- isBackendController() — Helper method to know if we are in the admin
- remove_callback() — Remove all the callbacks associated with $fileOrID