This repository has been archived by the owner on Mar 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
41 lines (41 loc) · 5.11 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
"name": "bonzo",
"description": "Library agnostic, extensible DOM utility",
"version": "1.2.7-1",
"homepage": "https://github.com/ded/bonzo",
"author": {
"name": "Dustin Diaz",
"email": "dustin@dustindiaz.com",
"url": "http://dustindiaz.com"
},
"contributors": [
{
"name": "Rod Vagg",
"email": "rod@vagg.org",
"url": "https://github.com/rvagg"
}
],
"keywords": [
"ender",
"dom",
"nodes",
"jquery",
"iteration",
"css"
],
"main": "./bonzo.js",
"ender": "./src/ender.js",
"repository": {
"type": "git",
"url": "https://github.com/ded/bonzo.git"
},
"devDependencies": {
"qwery": "*",
"bowser": "*",
"sink-test": "*",
"smoosh": "*"
},
"readme": "Bonzo\n-----\na library agnostic extensible DOM utility. Nothing else.\nBonzo is designed to live in any host library, or simply as a stand-alone tool for the majority of your DOM-related tasks.\n\n<h3>It looks like this</h3>\n\n``` js\nbonzo(elements)\n .hide()\n .addClass('foo')\n .append('<p>the happs</p>')\n .css({\n color: 'red',\n 'background-color': 'white'\n })\n .show()\n```\n\nPaired with a Selector Engine\n-----------------------------\nA great way to use Bonzo is with a selector engine (like [Qwery](https://github.com/ded/qwery) for example). You could wrap bonzo up and augment your wrapper to inherit the same methods. That looks like this:\n\n``` js\nfunction $(selector) {\n return bonzo(qwery(selector));\n}\n```\n\nThis now allows you to write the following code:\n\n``` js\n$('#content a[rel~=\"bookmark\"]').after('√').css('text-decoration', 'none');\n```\n\nBonzo Extension API\n-------------------\nOne of the greatest parts about Bonzo is its simplicity to hook into the internal chain to create custom methods. For example you can create a method called **color** like this:\n\n``` js\nbonzo.aug({\n color: function (c) {\n return this.css('color', c);\n }\n})\n\n// you can now do the following\n$('p').color('aqua')\n```\n\nBonzo Full API\n---------------------\n\n * each(callback)\n - callback (element, index)\n * map(callback, reject)\n - callback (element, index)\n - reject (element)\n * html\n - html() get\n - html(str) set\n * text\n - text() get\n - text(str) set\n * addClass(c)\n * removeClass(c)\n * hasClass(c)\n * toggleClass(c)\n * show()\n * hide()\n * first()\n * last()\n * focus()\n * blur()\n * next()\n * previous()\n * parent()\n * append(html || node)\n * appendTo(target || selector)\n * prepend(html || node)\n * prependTo(target || selector)\n * before(html || node)\n * insertBefore(target || selector)\n * after(html || node)\n * insertAfter(target || selector)\n * replaceWith(html || node)\n * css()\n - css(prop) get\n - css(prop, val) set\n - css({properties}) set\n * offset()\n - offset(x, y) set\n - offset() get\n - top\n - left\n - width\n - height\n * dim()\n - width\n - height\n * attr\n - attr(k) get\n - attr(k, v) set\n - attr(obj) set\n * removeAttr(k)\n * val\n - val() get\n - val(s) set\n * data\n - data() get all\n - data(k) get\n - data(k, v) set\n * remove()\n * empty()\n * detach()\n * scrollLeft\n - scrollLeft() get\n - scrollLeft(x) set\n * scrollTop\n - scrollTop() get\n - scrollTop(y) set\n * bonzo.aug({ properties })\n * bonzo.doc()\n - width\n - height\n * bonzo.viewport()\n - width\n - height\n * bonzo.isAncestor(container, child)\n * bonzo.noConflict\n\nAdded in the Ender bridge\n\n * parents(selector)\n * closest(selector)\n * siblings()\n * children()\n * width()\n * height()\n\nSetting a query engine host\n------------------\nFor the insertion methods you can set a query selector host (like [qwery](https://github.com/ded/qwery)).\n\n``` js\nbonzo.setQueryEngine(qwery)\nbonzo(bonzo.create('<div>')).insertAfter('.boosh a')\n```\n\nThe name Bonzo\n--------------\nBonzo Madrid was a malicious battle school commander of whom eventually is killed by [Ender Wiggin](http://en.wikipedia.org/wiki/Ender_Wiggin). Bonzo represents the DOM, of whom we'd all love to slay.\n\nBuilding\n--------\n\n $ npm install -d\n $ make\n\nTests\n-----\n\n $ open tests/tests.html\n\nBrowser support\n---------------\n * IE6+\n * Chrome\n * Safari 4+\n * Firefox 3+\n * Opera\n\nEnder integration\n----------\nBonzo is a registered npm package and fits in nicely with the [Ender](http://ender.no.de) framework. If you don't have Ender, you should install now, and never look back, ever. As a side note the *query engine host* is set for you when you include it with Ender.\n\n $ npm install ender -g\n\nTo combine Bonzo to your Ender build, you can add it as such:\n\n $ ender build bonzo[,modb, modc,...]\n\nor, add it to your existing ender package\n\n $ ender add bonzo\n\nContributors\n-----\n\n * [Dustin Diaz](https://github.com/ded/bonzo/commits/master?author=ded)\n * [Rod Vagg](https://github.com/ded/bonzo/commits/master?author=rvagg)\n * [Jacob Thornton](https://github.com/ded/bonzo/commits/master?author=fat)\n",
"_id": "bonzo@1.2.7-1",
"_from": "bonzo@*"
}