Provide the input plugin system
Provide the input plugin system

Each input should check for the existance of the PureAdmin object
at the beginning of its JavaScript file:

if (!PureAdmin) {
  console.error('You must load the PureAdmin JavaScript first before loading this JavaScript.');
}

Then it can build itself into PureAdmin.inputs like so:

PureAdmin.inputs.autocompleter = {
  init: function(context) {
    ...
  }
};

Every input must have an init function and this will be called on page load
and ajaxSuccess. It is up to the input JavaScript itself to detect if an element
has already been initialised.

blaknite/pure-admin-rails,blaknite/pure-admin-rails,blaknite/pure-admin-rails