-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathjquery.genealogy.min.js
8 lines (8 loc) · 1.39 KB
/
jquery.genealogy.min.js
1
2
3
4
5
6
7
8
/*
* jQuery Genealogy
* https://github.com/spicyj/jquery-genealogy
*
* Copyright (c) 2011 Ben Alpert
* Released under the MIT License
*/
(function(a){a.fn.extend({grandchildren:function(){return this.children().children()},greatGrandchildren:function(){return this.grandchildren().children()},grandparent:function(){return this.parent().parent()},greatGrandparent:function(){return this.grandparent().parent()},aunts:function(){return this.parent().siblings()},prevAunt:function(){return this.parent().prev()},prevAunts:function(){return this.parent().prevAll()},nextAunt:function(){return this.parent().next()},nextAunts:function(){return this.parent().nextAll()},cousins:function(){return this.aunts().children()},prevCousins:function(){return this.prevAunts().map(function(){return a(this).children().get().reverse()})},nextCousins:function(){return this.nextAunts().children()},nieces:function(){return this.siblings().children()},prevNieces:function(){return this.prevAll().map(function(){return a(this).children().get().reverse()})},nextNieces:function(){return this.nextAll().children()}}),a.fn.uncles=a.fn.aunts,a.fn.prevUncle=a.fn.prevAunt,a.fn.prevUncles=a.fn.prevAunts,a.fn.nextUncle=a.fn.nextAunt,a.fn.nextUncles=a.fn.nextAunts,a.fn.nephews=a.fn.nieces,a.fn.prevNephews=a.fn.prevNieces,a.fn.nextNephews=a.fn.nextNieces,a.fn.brothers=a.fn.sisters=a.fn.siblings,a.fn.father=a.fn.mother=a.fn.parent})(jQuery)