]>
iEval git - gruntmaster-page.git/blob - js/05-ki.js
2 * ki.js - jQuery-like API super-tiny JavaScript library
3 * Copyright (c) 2014 Denis Ciccale (@tdecs)
4 * Released under MIT license
6 !function (b
, c
, d
, e
) {
9 * init function (internal use)
10 * a = selector, dom element or function
13 c
.push
.apply(this, a
&& a
.nodeType
? [a
] : '' + a
=== a
? b
.querySelectorAll(a
) : e
)
18 * a = css selector, dom object, or function
19 * http://www.dustindiaz.com/smallest-domready-ever
20 * returns instance or executes function on ready
23 return /^f/.test(typeof a
) ? /c
/.test(b
.readyState
) ? a() : $(b
).on('DOMContentLoaded', a
) : new i(a
)
34 * a = string event type i.e 'click'
39 return this.each(function (c
) {
40 c
.addEventListener(a
, b
)
46 * a = string event type i.e 'click'
50 off: function (a
, b
) {
51 return this.each(function (c
) {
52 c
.removeEventListener(a
, b
)
58 * use native forEach to iterate collection
59 * a = the function to call on each iteration
60 * b = the this value for that function
62 each: function (a
, b
) {
63 c
.forEach
.call(this, a
, b
)
67 // for some reason is needed to get an array-like
68 // representation instead of an object
71 }(document
, [], 'prototype');
This page took 0.045582 seconds and 4 git commands to generate.