From f20393bda8ad67204bbf76cf5b98a47065798ffa Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Sun, 20 Jan 2013 18:33:50 +0100 Subject: [PATCH] Fix loading moment.min.js from non-root path Site deployed at directories like /blog/ can't load moment.min.js properly because twitter.js always expect to load it from /js, should use config.root/js instead. --- layout/_widget/twitter.ejs | 3 ++- source/js/twitter.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/layout/_widget/twitter.ejs b/layout/_widget/twitter.ejs index 376998d..732ac85 100644 --- a/layout/_widget/twitter.ejs +++ b/layout/_widget/twitter.ejs @@ -6,6 +6,7 @@ -<% } %> \ No newline at end of file +<% } %> diff --git a/source/js/twitter.js b/source/js/twitter.js index c130e24..c7fd995 100644 --- a/source/js/twitter.js +++ b/source/js/twitter.js @@ -1,5 +1,5 @@ (function($){ - $.getScript('/js/moment.min.js', function(){ + $.getScript(moment_js_path, function(){ var url = 'https://api.twitter.com/1/statuses/user_timeline/' + twitter_stream[0] + '.json?count=' + twitter_stream[1] + '&exclude_replies=' + (twitter_stream[2] ? 0 : 1) + '&trim_user=true&callback=?'; var linkify = function(text){ @@ -22,4 +22,4 @@ $('#tweets').html(result); }); }); -})(jQuery); \ No newline at end of file +})(jQuery);