Merge pull request #108 from genexp/master

Adds AMD wrapper
This commit is contained in:
Ryan McGeary 2013-01-24 14:37:32 -05:00
commit 8425e598c3

View file

@ -13,7 +13,16 @@
*
* Copyright (c) 2008-2013, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
*/
(function($) {
(function(factory) {
// Add jQuery via AMD registration or browser globals
if (typeof define === 'function' && define.amd) {
define([ 'jquery' ], factory);
}
else {
factory(jQuery);
}
}(function($) {
$.timeago = function(timestamp) {
if (timestamp instanceof Date) {
return inWords(timestamp);
@ -150,4 +159,4 @@
// fix for IE6 suckage
document.createElement("abbr");
document.createElement("time");
}(jQuery));
}));