lib/client/myelements.jquery.js
function(element, options) {

    var $el = $(element);
    // React on every server/socket.io message.
    // If the element is defined with a data-react-on-event attribute
    // we take that as an eventType the user wants to be warned on this
    // element and we forward the event via jQuery events on $(this).
    this.initReactOnEveryMessage($el, options.reactOnMessage);

    // React on server message.
    // If the element is defined with a data-react-on-event attribute
    // we take that as an eventType the user wants to be warned on this
    // element and we forward the event via jQuery events on $(this).
    if (options.reactOnMessage) {
      this.initReactOnMessage($el, options.reactOnMessage);
    }
    // React on events originated from a data update in the backend
    // The user decides which object wants to be notified from with the
    // attribute data-react-on-dataupdate
    if (options.reactOnDataupdate) {
      this.initReactOnDataupdate($el, options.reactOnDataupdate);

    }
    if (options.reactOnUserinput) {
      // And make every form submit trigger the userinput message
      this.initReactOnUserInput($el, options.reactOnUserinput);
    }
    // react on routes updates using page.js 
    // the attribute  data-react-on-page holds the route 
    // that is passed to page(...);
    if (options.onRoute) {
      this.initOnRoute($el, options.onRoute);
    }
    $myelements.attachDefaultEventHandlers(element);
    // Render first time. empty. passing data- attributes
    // as locals to the EJS engine.
    // TODO: Should load from localstorage.
    // Take the innerHTML as a template.
    $myelements.updateElementScope(element);


    // Init page routing using page.js
    // multiple calls to page() are ignored 
    // so it's safe to callit on every element initialization
    page();
    $(element).trigger("init");
  }
function(element, options) {

    var $el = $(element);
    // React on every server/socket.io message.
    // If the element is defined with a data-react-on-event attribute
    // we take that as an eventType the user wants to be warned on this
    // element and we forward the event via jQuery events on $(this).
    this.initReactOnEveryMessage($el, options.reactOnMessage);

    // React on server message.
    // If the element is defined with a data-react-on-event attribute
    // we take that as an eventType the user wants to be warned on this
    // element and we forward the event via jQuery events on $(this).
    if (options.reactOnMessage) {
      this.initReactOnMessage($el, options.reactOnMessage);
    }
    // React on events originated from a data update in the backend
    // The user decides which object wants to be notified from with the
    // attribute data-react-on-dataupdate
    if (options.reactOnDataupdate) {
      this.initReactOnDataupdate($el, options.reactOnDataupdate);

    }
    if (options.reactOnUserinput) {
      // And make every form submit trigger the userinput message
      this.initReactOnUserInput($el, options.reactOnUserinput);
    }
    // react on routes updates using page.js 
    // the attribute  data-react-on-page holds the route 
    // that is passed to page(...);
    if (options.onRoute) {
      this.initOnRoute($el, options.onRoute);
    }
    $myelements.attachDefaultEventHandlers(element);
    // Render first time. empty. passing data- attributes
    // as locals to the EJS engine.
    // TODO: Should load from localstorage.
    // Take the innerHTML as a template.
    $myelements.updateElementScope(element);


    // Init page routing using page.js
    // multiple calls to page() are ignored 
    // so it's safe to callit on every element initialization
    page();
    $(element).trigger("init");
  }
function ( element , options ) { var $el = $ ( element ) ; // React on every server/socket.io message. // If the element is defined with a data-react-on-event attribute // we take that as an eventType the user wants to be warned on this // element and we forward the event via jQuery events on $(this). this . initReactOnEveryMessage ( $el , options . reactOnMessage ) ; // React on server message. // If the element is defined with a data-react-on-event attribute // we take that as an eventType the user wants to be warned on this // element and we forward the event via jQuery events on $(this). if ( options . reactOnMessage ) { this . initReactOnMessage ( $el , options . reactOnMessage ) ; } // React on events originated from a data update in the backend // The user decides which object wants to be notified from with the // attribute data-react-on-dataupdate if ( options . reactOnDataupdate ) { this . initReactOnDataupdate ( $el , options . reactOnDataupdate ) ; } if ( options . reactOnUserinput ) { // And make every form submit trigger the userinput message this . initReactOnUserInput ( $el , options . reactOnUserinput ) ; } // react on routes updates using page.js  // the attribute  data-react-on-page holds the route  // that is passed to page(...); if ( options . onRoute ) { this . initOnRoute ( $el , options . onRoute ) ; } $myelements . attachDefaultEventHandlers ( element ) ; // Render first time. empty. passing data- attributes // as locals to the EJS engine. // TODO: Should load from localstorage. // Take the innerHTML as a template. $myelements . updateElementScope ( element ) ; // Init page routing using page.js // multiple calls to page() are ignored  // so it's safe to callit on every element initialization page ( ) ; $ ( element ) . trigger ( "init" ) ; }
Initializes an element to give it the functionality
provided by the myelements library

@param {HTMLElement} element. the element to initialize
@param {Object} options. options for initReactOnDataupdate,
initReactOnUserInput and initReactOnMessage.
Initializes an element to give it the functionality provided by the myelements library