Skip to content

Commit

Permalink
Merge branch 'pr/3'
Browse files Browse the repository at this point in the history
  • Loading branch information
julianshapiro committed Aug 8, 2014
2 parents 34c174b + c79f445 commit 81cb359
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.md
test/
test/
*.log
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,33 @@ http://julian.com/research/blast
Both jQuery and Zepto are fully supported.

**Browsers**
All browsers. Back to IE6.
All browsers. Back to IE6.

**Credits**
Development sponsored by Stripe: https://stripe.com/blog/open-source-retreat-grantees.

**Package Managers**

You may also install Blast through the package manager of your choice.

With npm:

```sh
npm install --save julianshapiro/blast
```

With Component:

```sh
component install julianshapiro/blast
```

With Bower:

```sh
bower install blast
```

====

[MIT License](LICENSE). © Julian Shapiro (http://twitter.com/shapiro).
37 changes: 37 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "blast-text",
"version": "1.1.1",
"homepage": "http://julian.com/research/blast",
"authors": [{
"name" : "Julian Shapiro",
"homepage" : "http://julian.com/"
}],
"description": "Blast text apart to make it manipulable.",
"main": "./jquery.blast.js",
"keywords": [
"text",
"parse",
"typography",
"search",
"animation",
"jquery",
"zepto",
"character",
"word",
"sentence"
],
"license": "MIT",
"ignore": [
"*.json",
"LICENSE",
"*.md"
],
"dependencies": {
"jquery": "jquery/jquery"
},
"repository" :
{
"type" : "git",
"url" : "http://github.com/julianshapiro/velocity.git"
}
}
26 changes: 26 additions & 0 deletions component.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "blast",
"repository": "julianshapiro/blast",
"version": "1.1.1",
"description": "Blast text apart to make it manipulable.",
"keywords": [
"text",
"parse",
"typography",
"search",
"animation",
"jquery",
"zepto",
"character",
"word",
"sentence"
],
"license" : "MIT",
"main": "jquery.blast.js",
"scripts": [
"jquery.blast.js"
],
"dependencies": {
"jquery/jquery": "*"
}
}
14 changes: 10 additions & 4 deletions jquery.blast.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/*!
* Blast.js: Blast text apart to make it manipulable.
* @version 1.1.0
* @version 1.1.1
* @dependency Works with both jQuery and Zepto.
* @docs julian.com/research/blast
* @license Copyright 2014 Julian Shapiro. MIT License: http://en.wikipedia.org/wiki/MIT_License
Expand Down Expand Up @@ -230,7 +230,7 @@
***********************/

/* Ensure that the opts.delimiter search variable is a non-empty string. */
if (opts.search.length && ($.type(opts.search) === "string" || $.type(opts.search) === "number")) {
if (opts.search.length && (typeof opts.search === "string" || /^\d/.test(parseFloat(opts.search)))) {
/* Since the search is performed as a Regex (see below), we escape the string's Regex meta-characters. */
opts.delimiter = opts.search.toString().replace(/[-[\]{,}(.)*+?|^$\\\/]/g, "\\$&");

Expand All @@ -242,7 +242,7 @@
delimiterRegex = new RegExp("(?:^|[^-" + characterRanges.latinLetters + "])(" + opts.delimiter + "('s)?)(?![-" + characterRanges.latinLetters + "])", "i");
} else {
/* Normalize the string's case for the delimiter switch check below. */
if ($.type(opts.delimiter) === "string") {
if (typeof opts.delimiter === "string") {
opts.delimiter = opts.delimiter.toLowerCase();
}

Expand Down Expand Up @@ -397,7 +397,6 @@

$this
.removeClass(NAME + "-root")
.data(NAME, undefined)
.removeAttr("aria-label")
.find("." + NAME)
.each(function () {
Expand All @@ -419,6 +418,13 @@
}
});

/* Zepto core doesn't include cache-based $.data(), so we mimic data-attr removal by setting it to undefined. */
if (window.Zepto) {
$this.data(NAME, undefined);
} else {
$this.removeData(NAME);
}

if (opts.debug) {
console.log(NAME + ": Reversed Blast" + ($this.attr("id") ? " on #" + $this.attr("id") + "." : ".") + (skippedDescendantRoot ? " Skipped reversal on the children of one or more descendant root elements." : ""));
console.timeEnd("blast reversal");
Expand Down
4 changes: 2 additions & 2 deletions jquery.blast.min.js

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

34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "blast-text",
"version": "1.1.1",
"description": "Blast text apart to make it manipulable.",
"homepage": "http://julian.com/research/blast",
"license": "MIT",
"authors": [
{
"name": "Julian Shapiro",
"url": "http://julian.com/"
}
],
"main": "jquery.blast.js",
"repository": "julianshapiro/blast",
"keywords": [
"text",
"parse",
"typography",
"search",
"animation",
"jquery",
"zepto",
"character",
"word",
"sentence"
],
"files": [
"jquery.blast.js",
"jquery.blast.min.js"
],
"dependencies": {
"jquery": ">= 1.3.0"
}
}

0 comments on commit 81cb359

Please sign in to comment.