From 9de617a7a48c80f9126cc85d90b9f9ed80b8680e Mon Sep 17 00:00:00 2001 From: Vincent Loy Date: Sun, 5 Jul 2015 14:37:13 +0200 Subject: [PATCH] resolve #9 - Wrap tweetParser and the jQuery compatibility file in the same file --- LICENSE | 2 +- README.md | 4 ++++ bower.json | 2 +- dev/jquery.tweetParser.js | 21 --------------------- dev/tweetParser.js | 19 +++++++++++++++++-- dist/tweetParser.min.js | 8 ++++---- index.html | 9 ++++----- package.json | 2 +- 8 files changed, 32 insertions(+), 35 deletions(-) delete mode 100644 dev/jquery.tweetParser.js diff --git a/LICENSE b/LICENSE index 82189f1..a96f68f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Vincent Loy +Copyright (c) 2015 Vincent Loy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7c3783d..3fd862b 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,10 @@ you can customize your tweet with css classes used in parameters #### Changelog + ++ v2.1.1 + * resolve [issue #9](https://github.com/VincentLoy/tweetParser.js/issues/9) - Wrap tweetParser and the jQuery compatibility file in the same file. + + v2.1.0 * Add a jQuery compatibility file. * You can now use Both VanillaJS or jQuery. diff --git a/bower.json b/bower.json index 00a0f46..003ef1e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tweetparser.js", - "version": "2.1.0", + "version": "2.1.1", "homepage": "https://github.com/VincentLoy/tweetParser.js", "authors": [ "VincentLoy " diff --git a/dev/jquery.tweetParser.js b/dev/jquery.tweetParser.js deleted file mode 100644 index 38b6f40..0000000 --- a/dev/jquery.tweetParser.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * tweetParser.js jQuery compatibility file - * Small Javascript Library that parse an element containing a tweet and turn URLS, @user & #hashtags into urls - * License : MIT - * author Vincent Loy - * http://vincent-loy.fr - */ - -/*global define, exports, require, $, tweetParser, jQuery*/ - -(function ($, tweetParser) { - 'use strict'; - - function tweetParserify(el, options) { - tweetParser(el, options); - } - - $.fn.tweetParser = function (options) { - return tweetParserify(this.selector, options); - }; -}(jQuery, tweetParser)); diff --git a/dev/tweetParser.js b/dev/tweetParser.js index 30ac0fd..db29d26 100644 --- a/dev/tweetParser.js +++ b/dev/tweetParser.js @@ -1,6 +1,6 @@ /*! - * tweetParser.js v2.1.0 - * Small Javascript Library that parse an element containing a tweet and turn URLS, @user & #hashtags into urls + * tweetParser.js v2.1.1 + * Small Javascript Library that parse an element containing a tweet and turn URLS, @user & #hashtags into working urls * License : MIT * author Vincent Loy * http://vincent-loy.fr @@ -117,3 +117,18 @@ exports.tweetParser = tweetParser; }(window)); + +/*global $, jQuery, tweetParser*/ +if (window.jQuery) { + (function ($, tweetParser) { + 'use strict'; + + function tweetParserify(el, options) { + tweetParser(el, options); + } + + $.fn.tweetParser = function (options) { + return tweetParserify(this.selector, options); + }; + }(jQuery, tweetParser)); +} diff --git a/dist/tweetParser.min.js b/dist/tweetParser.min.js index 754dc18..9a429b1 100644 --- a/dist/tweetParser.min.js +++ b/dist/tweetParser.min.js @@ -1,9 +1,9 @@ /*! - * tweetParser.js v2.1.0 - * Small Javascript Library that parse an element containing a tweet and turn URLS, @user & #hashtags into urls + * tweetParser.js v2.1.1 + * Small Javascript Library that parse an element containing a tweet and turn URLS, @user & #hashtags into working urls * License : MIT * author Vincent Loy * http://vincent-loy.fr */ -!function(t){"use strict";var r,e,a;e=function(t){var r,e;for(t=t||{},r=1;rtweetParser.js

Small Javascript Library easy-to-use that parse Twitter Usernames, Hashtags and URLs

-

V2.1.0

+

V2.1.1