Skip to content

Commit 7084521

Browse files
committed
update dist
1 parent 99c700a commit 7084521

30 files changed

+386
-101
lines changed

dist/jqlight.lazyloadxt.js

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
/*! Lazy Load XT v1.1.0 2016-01-12
2+
* http://ressio.github.io/lazy-load-xt
3+
* (C) 2016 RESS.io
4+
* Licensed under MIT */
5+
6+
(function (window, document, Element, undefined) {
7+
function Wrapper(collection) {
8+
if (collection) {
9+
for (var i = 0, length = collection.length; i < length; i++) {
10+
this[i] = collection[i];
11+
}
12+
this.length = length;
13+
}
14+
}
15+
16+
function $(selector) {
17+
if (selector instanceof Wrapper) {
18+
return selector;
19+
}
20+
return new Wrapper((typeof selector === 'string') ? document.querySelectorAll(selector)
21+
: (selector && (selector === window || selector.nodeType) ? [selector] : selector));
22+
}
23+
24+
$.fn = {
25+
constructor: Wrapper,
26+
length: 0
27+
};
28+
Wrapper.prototype = $.fn;
29+
30+
$.extend = function (target) {
31+
var options, name, copy, i = 0, length = arguments.length;
32+
if (length <= 1) {
33+
target = this;
34+
} else {
35+
i = 1;
36+
}
37+
for (; i < length; i++) {
38+
options = arguments[i];
39+
for (name in options) {
40+
copy = options[name];
41+
if (copy !== undefined && copy !== target) {
42+
target[name] = copy;
43+
}
44+
}
45+
}
46+
return target;
47+
};
48+
$.fn.extend = $.extend;
49+
50+
var prev_$ = window.$;
51+
window.$ = $;
52+
53+
$.extend({
54+
noConflict: function () {
55+
window.$ = prev_$;
56+
return $;
57+
},
58+
isFunction: function (obj) {
59+
return (typeof obj === 'function');
60+
},
61+
contains: function (a, b) {
62+
if (b) {
63+
while ((b = b.parentNode)) {
64+
if (b === a) {
65+
return true;
66+
}
67+
}
68+
}
69+
return false;
70+
},
71+
each: function (array, callback) {
72+
var value, i = 0, length = array.length;
73+
for (; i < length; i++) {
74+
value = array[i];
75+
if (callback.call(value, i, value) === false) {
76+
return false;
77+
}
78+
}
79+
return true;
80+
},
81+
grep: function (elems, callback, invert) {
82+
var callbackInverse,
83+
matches = [],
84+
i = 0,
85+
length = elems.length,
86+
callbackExpect = !invert;
87+
for (; i < length; i++) {
88+
callbackInverse = !callback(i, elems[i]);
89+
if (callbackInverse !== callbackExpect) {
90+
matches.push(elems[i]);
91+
}
92+
}
93+
return matches;
94+
},
95+
map: function (elems, callback) {
96+
var value,
97+
i = 0,
98+
length = elems.length,
99+
ret = [];
100+
for (; i < length; i++) {
101+
value = callback(i, elems[i]);
102+
if (value != null) {
103+
ret.push(value);
104+
}
105+
}
106+
return ret;
107+
}
108+
});
109+
110+
var DATAKEYPROP = '__jqlight_data__';
111+
$.fn.extend({
112+
each: function (callback, args) {
113+
$.each(this, callback, args);
114+
return this;
115+
},
116+
ready: function (fn) {
117+
if (/complete|loaded|interactive/.test(document.readyState) && document.body) {
118+
fn();
119+
} else {
120+
$(document).on('DOMContentLoaded', fn);
121+
}
122+
return this;
123+
},
124+
addClass: function (value) {
125+
return eachClass(this, value, function (cur, clazz, found) {
126+
return found ? cur : cur + clazz + ' ';
127+
});
128+
},
129+
removeClass: function (value) {
130+
return eachClass(this, value, function (cur, clazz, found) {
131+
return found ? cur.replace(' ' + clazz + ' ', ' ') : cur;
132+
});
133+
},
134+
on: function (types, selector, fn) {
135+
if (fn == null) {
136+
// ( types, fn )
137+
fn = selector;
138+
selector = undefined;
139+
}
140+
types = types.split(' ');
141+
return this.each(function (i, elem) {
142+
var listener = selector ? delegateHandler.bind(elem, selector, fn) : fn;
143+
$.each(types, function (j, eventName) {
144+
if (eventName) {
145+
elem.addEventListener(eventName, listener);
146+
}
147+
});
148+
});
149+
},
150+
off: function (types, selector, fn) {
151+
if (selector === false || $.isFunction(selector)) {
152+
// ( types [, fn] )
153+
fn = selector;
154+
selector = undefined;
155+
}
156+
types = types.split(' ');
157+
return this.each(function (i, elem) {
158+
$.each(types, function (j, eventName) {
159+
if (eventName) {
160+
elem.removeEventListener(eventName, fn);
161+
}
162+
});
163+
});
164+
},
165+
trigger: function (type, data) {
166+
return this.each(function () {
167+
var evt;
168+
if (window.CustomEvent) {
169+
evt = new CustomEvent(type, {detail: data});
170+
} else {
171+
evt = document.createEvent('CustomEvent');
172+
evt.initCustomEvent(type, true, true, data);
173+
}
174+
this.dispatchEvent(evt);
175+
});
176+
},
177+
data: function (key, value) {
178+
if (typeof key === 'string' && value === undefined) {
179+
var elem = this[0];
180+
return elem && elem[DATAKEYPROP] ? elem[DATAKEYPROP][key] : undefined;
181+
}
182+
this.each(function (i, elem) {
183+
elem[DATAKEYPROP] = elem[DATAKEYPROP] || {};
184+
elem[DATAKEYPROP][key] = value;
185+
});
186+
return this;
187+
},
188+
map: function (callback) {
189+
return $($.map(this, callback));
190+
},
191+
filter: function (callback) {
192+
return $($.grep(this, callback));
193+
},
194+
attr: function (name, value) {
195+
if (value === undefined) {
196+
return this.length ? this[0].getAttribute(name) : undefined;
197+
}
198+
$.each(this, function (i, elem) {
199+
elem.setAttribute(name, value + '');
200+
});
201+
return this;
202+
}
203+
});
204+
205+
function eachClass(obj, value, callback) {
206+
var classes = ( value || '' ).match(/\S+/g) || [],
207+
elem, cur, clazz, j, origValue, finalValue,
208+
i = 0,
209+
len = obj.length;
210+
while (i < len) {
211+
elem = obj[i++];
212+
if (elem.nodeType === 1) {
213+
origValue = elem.className;
214+
cur = origValue ? ( ' ' + origValue + ' ' ).replace(/[\t\r\n\f]/g, ' ') : ' ';
215+
j = 0;
216+
while ((clazz = classes[j++])) {
217+
cur = callback(cur, clazz, cur.indexOf(' ' + clazz + ' ') >= 0);
218+
}
219+
finalValue = cur.slice(1, -1);
220+
if (origValue !== finalValue) {
221+
elem.className = finalValue;
222+
}
223+
}
224+
}
225+
return obj;
226+
}
227+
228+
function delegateHandler(selector, handler, event) {
229+
var currentTarget = closest.call([event.target], selector, this)[0];
230+
if (currentTarget && currentTarget !== this) {
231+
handler.call(currentTarget, event);
232+
}
233+
}
234+
235+
var matches = Element.matches || Element.matchesSelector || Element.mozMatchesSelector || Element.msMatchesSelector || Element.oMatchesSelector || Element.webkitMatchesSelector;
236+
237+
function closest(selector, context) {
238+
var nodes = [];
239+
$.each(this, function (i, node) {
240+
while (node && node !== context) {
241+
if (matches.call(node, selector)) {
242+
nodes.push(node);
243+
break;
244+
}
245+
node = node.parentElement;
246+
}
247+
});
248+
return $($.grep(nodes, function (index, item) {
249+
return nodes.indexOf(item) === index;
250+
}));
251+
}
252+
})(window, document, Element.prototype);

dist/jqlight.lazyloadxt.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.lazyloadxt.autoload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*! Lazy Load XT v1.0.6 2014-11-19
1+
/*! Lazy Load XT v1.1.0 2016-01-12
22
* http://ressio.github.io/lazy-load-xt
3-
* (C) 2014 RESS.io
3+
* (C) 2016 RESS.io
44
* Licensed under MIT */
55

66
(function ($) {

dist/jquery.lazyloadxt.autoload.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.lazyloadxt.bg.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*! Lazy Load XT v1.0.6 2014-11-19
1+
/*! Lazy Load XT v1.1.0 2016-01-12
22
* http://ressio.github.io/lazy-load-xt
3-
* (C) 2014 RESS.io
3+
* (C) 2016 RESS.io
44
* Licensed under MIT */
55

66
(function ($) {
@@ -10,10 +10,14 @@
1010
options.selector += ',[' + bgAttr + ']';
1111

1212
$(document).on('lazyshow', function (e) {
13-
var $this = $(e.target);
14-
$this
15-
.css('background-image', "url('" + $this.attr(bgAttr) + "')")
16-
.removeAttr(bgAttr);
13+
var $this = $(e.target),
14+
url = $this.attr(bgAttr);
15+
if (!!url) {
16+
$this
17+
.css('background-image', "url('" + url + "')")
18+
.removeAttr(bgAttr)
19+
.triggerHandler('load');
20+
}
1721
});
1822

1923
})(window.jQuery || window.Zepto || window.$);

dist/jquery.lazyloadxt.bg.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.lazyloadxt.bootstrap.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*! Lazy Load XT v1.1.0 2016-01-12
2+
* http://ressio.github.io/lazy-load-xt
3+
* (C) 2016 RESS.io
4+
* Licensed under MIT */
5+
6+
(function ($) {
7+
$.lazyLoadXT.updateEvent += ' shown.bs.modal shown.bs.dropdown shown.bs.tab shown.bs.tooltip shown.bs.popover shown.bs.collapse slid.bs.carousel';
8+
})(window.jQuery || window.Zepto || window.$);

dist/jquery.lazyloadxt.bootstrap.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)