Skip to content

Commit

Permalink
Merge pull request #72 from graingert/master
Browse files Browse the repository at this point in the history
add package.json and UMD loader
  • Loading branch information
rviscomi committed Jan 7, 2017
2 parents d27cddc + 8e76f19 commit 061ce50
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
30 changes: 30 additions & 0 deletions package.json
@@ -0,0 +1,30 @@
{
"name": "trunk8",
"version": "0.0.1",
"description": "trunk8 is an intelligent text truncation extension to jQuery",
"main": "trunk8.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git://github.com/rviscomi/trunk8.git"
},
"keywords": [
"truncate",
"trunk8",
"jquery",
"text",
"cut-off",
"spill-over"
],
"author": "Rick Viscomi (rviscomi@gmail.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/rviscomi/trunk8/issues"
},
"homepage": "https://github.com/rviscomi/trunk8#readme",
"peerDependencies": {
"jquery": ">=1.7.1"
}
}
12 changes: 10 additions & 2 deletions trunk8.js
Expand Up @@ -8,7 +8,15 @@
* Date: September 26, 2012
*/

(function ($) {
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
factory(require('jquery'));
} else {
factory(root.jQuery);
}
}(this, function ($) {
var methods,
utils,
SIDES = {
Expand Down Expand Up @@ -381,4 +389,4 @@
parseHTML: false,
onTruncate: function () {}
};
})(jQuery);
}));

4 comments on commit 061ce50

@graingert
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rviscomi what's your account on npm so I can add you?

@rviscomi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graingert
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rviscomi added you to the package. Use it wisely

@rviscomi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.