Giter Site home page Giter Site logo

hippojs's Introduction

Augustine of Hippo

###hippo.js

A wishful, likley naive, jQuery inspired DOM Library for use in modern ES5 browsers. (i.e. think of it similar to zepto.js with a focus on the DOM and support for ie9+)


###Project Goals

  • Be all about the DOM allowing CSS to be CSS and XHR, XHR. Native DOM first!
  • Don't try and be underscore.js or lodash. If you need that, use those.
  • Be about modern browsers (including ie9+) allowing polyfills to deal with the past.
  • Be modular so as to permit custom builds using grunt.js.
  • Be lightweight, not middleweight.
  • Be easy to update or change by keeping the code simple, readable, and heavily commented so at the very least the code teaches.
  • Be jQuery-like in its plugin architecture but with the heart and soult of zepto.js.
  • Be fixable by mere humans with some JavaScript chops
  • Be a viable solution for inclusion in other micro libraries that require sophisticated (beyond what the native dom api offers) DOM manipulation and nothing else

###API Draft (warning: API is in flux. This is less api documentation and more road map for now. * = not developed or tested yet. And yes I know its not small or fast yet.)

Hippo() Constructor, creates a set of Element nodes
hippo('li') //Selector

hippo('li','ul') //Selector & Selector context

hippo('li',document.body) //Selector & Element Node context 

hippo('<div></div>') //HTML

hippo('<div></div>','window.frames[0].document') //HTML & Document context

hippo(document.body) //Element Node

hippo([document.body,document.head]) //Array

hippo(document.body.children) //NodeList

hippo(document.all) //HTMLCollection

hippo(hippo()) //a hippo object
Hippo Helper/Utilities Functions
hippo.version
hippo.each(object/array,callback function)
hippo.type()
hippo.isArray()
hippo.isFunction()
hippo.matchesSelector()
hippo.collectElements()
hippo.uniqueElements()
*hippo.loadCss()
*hippo.loadJs()
Hippo() Set Operation Methods
//does not return hippo object, non-chainable
hippo().is()
hippo().isEmpty()
hippo().has()
hippo().total()
hippo().toArray()
hippo().get(index)
hippo().index(selectorOrNodeElement)
hippo().lastIndex()
hippo().siblingIndex()

//returns hippo object, chainable 
hippo().each()
hippo().slice()
hippo().at(index)
hippo().find(selector)
hippo().exclude(selector)
hippo().not()
hippo().filter()
hippo().add()
hippo().last()
hippo().first()
hippo().reverse()
hippo().clone()
*hippo().push()
*hippo().pop()
*hippo().shift()
*hippo().unshift()
*hippo().even()
*hippo().odd()
Hippo() Attribute Methods
hippo().attr() //gets, sets, and returns list
hippo().hasAttr() //one, or multiple
hippo().removeAttr() //remove one, multiple, or all

hippo().getClass() //gets one, or array containing all
hippo().addClass()
hippo().hasClass() //one, or multiple
hippo().removeClass() //remove one, multiple, or all
hippo().toggleClass()

hippo().data() //gets, sets, and returns list
hippo().hasData() //one, or multiple
hippo().removeData() //remove one, multiple, or all
Hippo() Manipulation Methods
hippo().replaceWith()
hippo().empty()
hippo().remove()

hippo().before()
hippo().insertBefore()

hippo().after()
hippo().insertAfter()

hippo().append()
hippo().appendTo()

hippo().prepend()
hippo().prependTo()

hippo().wrap()
hippo().wrapInner()

hippo().html()
hippo().outerHtml()

hippo().text()
Hippo() Traversing Methods
hippo().parent() //first parent element
hippo().parents(selector) //all parent elements
hippo().parentsUntil(selector)

hippo().child() //first child element
hippo().childs(selector) //all child elements
hippo().childsUntil(selector) 

hippo().nextSib() //next sibling
hippo().nextSibs(selector) //all next siblings
hippo().nextSibsUntil(selector) 

hippo().prevSib() //previous sibling
hippo().prevSibs(selector) //all previous siblings
hippo().prevSibsUntil(selector)

hippo().children(selector) //all children
hippo().childrenUntil(selector)

hippo().ancestors(selector) //all ancestors elements
hippo().ancestorsUntil(selector)
hippo().descendants(selector) //all descendants elements
hippo().descendantsUntil(selector) //all descendants elements
hippo().siblings(selector) //all sibling elements

hippojs's People

Contributors

codylindley avatar

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.