This is the core module of the page framework. It is required for all the other page framework modules.
The purpose of this module is to ensure all sub-modules are initialized, including a call to a possible implementer-provided $p.init() method. In order to do this, it uses the .onReady event method to call pre-init functions in each module. After this, it checks if $p.init() exists, and calls it if it does.
Pre-init methods should be provided by the developer of sub-modules. these are simply function definitions named _init in the root of each module – for example: $p.gui._init().
The way that the call to these sub-items’ _init() methods is implemented, it binds this object to the object they belong to. This allows the developer to simply refer to object members using this (e.g. this.myFunction(), etc.).
The global init method is called after the pre-initialisation phase is finished. This function can be implemented as follows:
$p.init = function() { … }