Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
Support for older versions of jQuery.

JSON additions.
  • Loading branch information
julianshapiro committed Aug 8, 2014
1 parent 7445a38 commit c79f445
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blast",
"version": "1.1.0",
"name": "blast-text",
"version": "1.1.1",
"homepage": "http://julian.com/research/blast",
"authors": [{
"name" : "Julian Shapiro",
Expand All @@ -15,6 +15,7 @@
"search",
"animation",
"jquery",
"zepto",
"character",
"word",
"sentence"
Expand All @@ -33,4 +34,4 @@
"type" : "git",
"url" : "http://github.com/julianshapiro/velocity.git"
}
}
}
5 changes: 3 additions & 2 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "blast",
"repository": "julianshapiro/blast",
"version": "1.1.0",
"version": "1.1.1",
"description": "Blast text apart to make it manipulable.",
"keywords": [
"text",
Expand All @@ -10,6 +10,7 @@
"search",
"animation",
"jquery",
"zepto",
"character",
"word",
"sentence"
Expand All @@ -22,4 +23,4 @@
"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.

19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
{
"name": "blast",
"version": "1.1.0",
"name": "blast-text",
"version": "1.1.1",
"description": "Blast text apart to make it manipulable.",
"homepage": "http://julian.com/research/blast",
"license": "MIT",
"author": "Julian Shapiro (http://julian.com)",
"main": "jquery.velocity.js",
"authors": [
{
"name": "Julian Shapiro",
"url": "http://julian.com/"
}
],
"main": "jquery.blast.js",
"repository": "julianshapiro/blast",
"private": true,
"keywords": [
"text",
"parse",
"typography",
"search",
"animation",
"jquery",
"zepto",
"character",
"word",
"sentence"
Expand All @@ -24,6 +29,6 @@
"jquery.blast.min.js"
],
"dependencies": {
"jquery": ">= 1.4.3"
"jquery": ">= 1.3.0"
}
}
}

0 comments on commit c79f445

Please sign in to comment.