Giter VIP home page Giter VIP logo

ENDER-CORE

This is the home of Ender's client code. It's what provides the glue for pulling together otherwise independent modules into a single cohesive library.

API

To create top level methods, like for example $.myUtility(...), you can hook into Ender by calling the ender method:

!function ($) {
  $.ender({
    myUtility: myLibFn
  });
}(ender);

(note - this is the default integration if no bridge is supplied)

The Internal chain

Another common case for Plugin developers is to be able hook into the internal collection chain. To do this, simply call the same ender method but pass true as the second argument:

!function ($) {
  $.ender(myExtensions, true);
}(ender);

Within this scope the internal prototype is exposed to the developer with an existing elements instance property representing the node collection. Have a look at how the Bonzo DOM utility does this. Also note that the internal chain can be augmented at any time (outside of this build) during your application. For example:

<script src="ender.js"></script>
<script>
// an example of creating a utility that returns a random element from the matched set
!function ($) {

  $.ender({
    rand: function () {
      return this[Math.floor(Math.random() * (this.length))];
    }
  }, true);

}(ender);
$('p').rand();
</script>

Selector Engine API

Ender also exposes a unique privileged variable called $._select, which allows you to set the Ender selector engine. Setting the selector engine provides ender with the $ method, like this:

$('#foo .bar')

Setting the selector engine is done like so:

$._select = mySelectorEngine;

You can see it in practice inside Qwery's ender bridge

If you're building a Mobile Webkit or Android application, it may be a good idea to simply set it equal to QSA:

$._select = function (selector, root) {
  return (root || document).querySelectorAll(selector);
}

License

Ender (the wrapper) is licensed under MIT. For individual modules, see respective module licenses.

Ender's Projects

ender icon ender

the no-library library: open module JavaScript framework

ender-minify icon ender-minify

Bundled minifier utilities for Node, designed primarily for use with the Ender CLI.

jeesh icon jeesh

The official starter pack for Ender.

learn icon learn

a learning repo for Ender development

website icon website

the source running the ender website

when icon when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.