Created
February 13, 2013 19:55
-
-
Save mrvisser/4947618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When jquery is concated into oae.core, I get the output with the following code: | |
// MyModule.js | |
define(['jquery', 'oae.core', 'jquery.timeago', 'jquery.infinitescroll'], function($, oae, timeago, infiniteScroll) { | |
return function(uid, showSettings, widgetData) { | |
///////////////////////////// | |
// Configuration variables // | |
///////////////////////////// | |
var $rootel = $('#' + uid); | |
var infinityScroll = false; | |
console.log('Local $.timeago: ' + $.timeago); | |
console.log('Global jQuery.timeago: ' + jQuery.timeago); | |
... | |
}); | |
// Timeago: | |
define(['jquery'], function (jQuery) { | |
(function($) { | |
$.timeago = function(timestamp) { | |
if (timestamp instanceof Date) return inWords(timestamp); | |
else if (typeof timestamp == "string") return inWords($.timeago.parse(timestamp)); | |
else return inWords($.timeago.datetime(timestamp)); | |
}; | |
... | |
//Output: | |
Local $.timeago: function (timestamp) { | |
if (timestamp instanceof Date) return inWords(timestamp); | |
else if (typeof timestamp == "string") return inWords($.timeago.parse(timestamp)); | |
else return inWords($.timeago.datetime(timestamp)); | |
} activity.js:31 | |
Global jQuery.timeago: undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment