Girobusan · IMP! · Helpers

Autoload helpers (upcoming feature)


What it is

It will possible to autoload and engage helpers on page load, which makes possible to:

How?

There must be file autoload.js in the helpers directory, which will be automatically load with IMP! page, if this page has helpers enabled.

autoload.js

The script must define window.ImpAutoLoadModules with object with certain structure:

//autoload
window.ImpAutoLoadModules = {
  modules: [
  ["<helper-name>", "<method to call>" , <parameters>],
  // you can skip method, 
  // "animate" will be called by default
  ["<helper2-name>",, <parameters object>],
  // you can skip method and params, 
  // only "init" will be called 
  // ("init" is always called)
  ["<helper2-name>"]
  	...
  	]
};

Restrictions