Skip to content

Commit

Permalink
Bumped version to 2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed Jul 9, 2018
1 parent 2069129 commit 9096ba8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ An **85%** gain in size reduction. If you need a smaller bundle, we support [par

## Usage

Get cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/2.3.2/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/[email protected].2/dist/cash.min.js) and use it like this:
Get cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/2.3.3/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/[email protected].3/dist/cash.min.js) and use it like this:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/2.3.2/cash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/2.3.3/cash.min.js"></script>
<script>
$(function () {
$('html').addClass ( 'dom-loaded' );
Expand Down
21 changes: 17 additions & 4 deletions dist/cash.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ function find(selector, context) {


function Cash(selector, context) {
if (context === void 0) {
context = doc;
}

if (!selector) return;
if (selector.__cash) return selector;
var eles = selector;

if (isString(selector)) {
eles = idRe.test(selector) ? doc.getElementById(selector.slice(1)) : htmlRe.test(selector) ? parseHTML(selector) : find(selector, context);
if (context.__cash) context = context[0];
eles = idRe.test(selector) ? context.getElementById(selector.slice(1)) : htmlRe.test(selector) ? parseHTML(selector) : find(selector, context);
if (!eles) return;
} else if (isFunction(selector)) {
return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality
Expand Down Expand Up @@ -924,15 +929,23 @@ fn.serialize = function () {
});
return query.substr(1);
}; // @require core/cash.js
// @require core/each.js
// @require core/type_checking.js
// @require collection/each.js
// @require ./helpers/get_value.js


fn.val = function (value) {
if (value === undefined) return this[0] && getValue(this[0]);
return this.each(function (i, ele) {
ele.value = value;
}); //TODO: Does it work for select[multiple] too?
if (selectMultipleRe.test(ele.type) && isArray(value)) {
each(ele.options, function (option) {
option.selected = value.indexOf(option.value) >= 0;
});
} else {
ele.value = value;
}
});
}; // @optional ./serialize.js
// @optional ./val.js
// @require core/cash.js
Expand Down Expand Up @@ -1112,7 +1125,7 @@ fn.replaceWith = function (content) {
return this.each(function (i, ele) {
var parent = ele.parentNode;
if (!parent) return;
var $eles = cash(content);
var $eles = i ? cash(content).clone() : cash(content);

if (!$eles[0]) {
_this10.remove();
Expand Down
7 changes: 6 additions & 1 deletion dist/cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ function find(selector, context) {


function Cash(selector, context) {
if (context === void 0) {
context = doc;
}

if (!selector) return;
if (selector.__cash) return selector;
var eles = selector;

if (isString(selector)) {
eles = idRe.test(selector) ? doc.getElementById(selector.slice(1)) : htmlRe.test(selector) ? parseHTML(selector) : find(selector, context);
if (context.__cash) context = context[0];
eles = idRe.test(selector) ? context.getElementById(selector.slice(1)) : htmlRe.test(selector) ? parseHTML(selector) : find(selector, context);
if (!eles) return;
} else if (isFunction(selector)) {
return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality
Expand Down
4 changes: 2 additions & 2 deletions dist/cash.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-lock.json

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": "cash-dom",
"description": "An absurdly small jQuery alternative for modern browsers.",
"version": "2.3.2",
"version": "2.3.3",
"license": "MIT",
"main": "./dist/cash.js",
"module": "./dist/cash.esm.js",
Expand Down

0 comments on commit 9096ba8

Please sign in to comment.