From baf63178dbbe44d71f1f59e6fc9bb28990447d97 Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Sat, 3 Jan 2015 19:20:59 -0600 Subject: [PATCH 1/3] Include non-minified files in npm --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index c5b03895..15c66c3f 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,9 @@ "main": "js/tablesorter.js", "files": [ "css/theme.default.css", + "js/jquery.tablesorter.js", "js/jquery.tablesorter.min.js", + "js/jquery.tablesorter.widgets.js", "js/jquery.tablesorter.widgets.min.js", "addons/pager/" ], From 773c75ee7799cc1a22244c8a5ad4b93ddd4e634e Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Sat, 3 Jan 2015 19:34:54 -0600 Subject: [PATCH 2/3] Fix main field in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15c66c3f..c98ffe2f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "natural", "jquery-plugin" ], - "main": "js/tablesorter.js", + "main": "js/jquery.tablesorter.js", "files": [ "css/theme.default.css", "js/jquery.tablesorter.js", From 15b2a789e2cffef57747e89fed82f245864ad29d Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Sat, 3 Jan 2015 20:31:14 -0600 Subject: [PATCH 3/3] Support for AMD, browserify environments --- js/jquery.tablesorter.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 22bd4358..d461370f 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -16,7 +16,15 @@ */ /*jshint browser:true, jquery:true, unused:false, expr: true */ /*global console:false, alert:false */ -!(function($) { +(function(factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof module === 'object' && typeof module.exports === 'object') { + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(function($) { "use strict"; $.extend({ /*jshint supernew:true */ @@ -1940,4 +1948,5 @@ } }); -})(jQuery); + return ts; +}));