Skip to content

Commit

Permalink
1.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
kupriyanenko committed Feb 12, 2015
1 parent 7f874d3 commit 308e206
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jbone",
"repo": "kupriyanenko/jbone",
"description": "JavaScript Library for DOM manipulation. Replacement jQuery for Backbone in browsers (2.5kb gzipped)",
"version": "1.0.21",
"version": "1.0.22",
"keywords": [
"jquery",
"jbone",
Expand Down
34 changes: 31 additions & 3 deletions dist/jbone.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*!
* jBone v1.0.21 - 2014-12-12 - Library for DOM manipulation
* jBone v1.0.22 - 2015-02-12 - Library for DOM manipulation
*
* https://github.com/kupriyanenko/jbone
*
* Copyright 2014 Alexey Kupriyanenko
* Copyright 2015 Alexey Kupriyanenko
* Released under the MIT license.
*/

Expand Down Expand Up @@ -249,6 +249,22 @@ jBone.makeArray = function(arr, results) {
return ret;
};

jBone.unique = function(array) {
if (array == null) {
return [];
}

var result = [];

for (var i = 0, length = array.length; i < length; i++) {
var value = array[i];
if (result.indexOf(value) < 0) {
result.push(value);
}
}
return result;
};

function BoneEvent(e, data) {
var key, setter;

Expand Down Expand Up @@ -534,7 +550,13 @@ fn.find = function(selector) {
};

fn.get = function(index) {
return this[index];
return index != null ?

// Return just the one element from the set
(index < 0 ? this[index + this.length] : this[index]) :

// Return all the elements in a clean array
slice.call(this);
};

fn.eq = function(index) {
Expand Down Expand Up @@ -576,6 +598,12 @@ fn.has = function() {
});
};

fn.add = function(selector, context) {
return jBone.unique(
jBone.merge(this.get(), jBone(selector, context))
);
};

fn.attr = function(key, value) {
var args = arguments,
i = 0,
Expand Down
6 changes: 3 additions & 3 deletions dist/jbone.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jbone",
"title": "jBone",
"version": "1.0.21",
"version": "1.0.22",
"description": "Library for DOM manipulation",
"main": "dist/jbone.js",
"homepage": "https://github.com/kupriyanenko/jbone",
Expand Down

0 comments on commit 308e206

Please sign in to comment.