diff --git a/src/DotNetMashup.Web/Controllers/HomeController.cs b/src/DotNetMashup.Web/Controllers/HomeController.cs index 4073581..83b7258 100644 --- a/src/DotNetMashup.Web/Controllers/HomeController.cs +++ b/src/DotNetMashup.Web/Controllers/HomeController.cs @@ -9,15 +9,17 @@ using DotNetMashup.Web.Global; using DotNetMashup.Web.Model; using DotNetMashup.Web.ViewModel; using Microsoft.AspNet.Mvc; +using Microsoft.Framework.Caching.Memory; namespace DotNetMashup.Web.Controllers { public class HomeController : Controller { + private readonly IMemoryCache cache; private readonly ISiteSetting setting; private readonly Factory.RepositoryFactory factory; - public HomeController(Factory.RepositoryFactory factory, ISiteSetting setting) + public HomeController(Factory.RepositoryFactory factory, ISiteSetting setting, IMemoryCache cache) { if(factory == null) { @@ -29,9 +31,9 @@ namespace DotNetMashup.Web.Controllers } this.factory = factory; this.setting = setting; + this.cache = cache; } - [ResponseCache(Duration = 3600, NoStore = true, Location = ResponseCacheLocation.Any)] public async Task Index(int page = 1) { var factoryData = (await factory.GetData()); diff --git a/src/DotNetMashup.Web/Extensions/IExternalDataExtensions.cs b/src/DotNetMashup.Web/Extensions/IExternalDataExtensions.cs index 4f7158a..25a6450 100644 --- a/src/DotNetMashup.Web/Extensions/IExternalDataExtensions.cs +++ b/src/DotNetMashup.Web/Extensions/IExternalDataExtensions.cs @@ -17,7 +17,7 @@ namespace DotNetMashup.Web.Extensions Title = new TextSyndicationContent(settings.Title), Id = "DotNet Mashup", LastUpdatedTime = data.OrderByDescending(a => a.PublishedDate).FirstOrDefault().PublishedDate, - Description = new TextSyndicationContent(settings.Descriptions) + Description = new TextSyndicationContent(settings.Descriptions), }; var authors = data.Select(a => a.Author) .Distinct() @@ -25,7 +25,7 @@ namespace DotNetMashup.Web.Extensions authors.ForEach(a => feed.Authors.Add(a)); authors.ForEach(a => feed.Contributors.Add(a)); feed.Links.Add(new SyndicationLink(new Uri("http://dotnetmashup.azurewebsites.net"))); - feed.Items = data.Select(a => new SyndicationItem(a.Title, a.Content, a.OriginalLink)).ToList(); + feed.Items = data.Select(a => new SyndicationItem(a.Title, a.Content, a.OriginalLink) { PublishDate = a.PublishedDate }).ToList(); return feed; } diff --git a/src/DotNetMashup.Web/Extensions/TwitterExtensions.cs b/src/DotNetMashup.Web/Extensions/TwitterExtensions.cs index 7e83d5c..1b06b46 100644 --- a/src/DotNetMashup.Web/Extensions/TwitterExtensions.cs +++ b/src/DotNetMashup.Web/Extensions/TwitterExtensions.cs @@ -15,6 +15,7 @@ namespace DotNetMashup.Web.Extensions { PublishedDate = tweet.CreatedAt, Content = tweet.Text, + OriginalLink = new Uri($"https://twitter.com/statuses/{tweet.Id}"), tweet = new Lazy>(() => tweet.GenerateOEmbedTweetAsync()), Author = new Author { diff --git a/src/DotNetMashup.Web/Views/Home/Index.cshtml b/src/DotNetMashup.Web/Views/Home/Index.cshtml index d0a2293..842aa0a 100644 --- a/src/DotNetMashup.Web/Views/Home/Index.cshtml +++ b/src/DotNetMashup.Web/Views/Home/Index.cshtml @@ -38,8 +38,8 @@ var loading = false; $(window).on('scroll', function () { var loadingImage = $('.loadWheel'); - var tile = $('.tile').last(); - if($(window).scrollTop() + tile.height() + 150 >= tile.position().top && !loading ) { + var tile = $('.tileRow').last(); + if($(window).scrollTop() + tile.height() + 250 >= tile.position().top && !loading ) { loading = true loadingImage.show(); $.ajax('/Home/Tiles', {data:{page:page+1}}) @@ -50,7 +50,7 @@ var resd = $(data); resd.find('img').addClass('img-responsive'); $('#tilesContainer').append(resd).find('.tile').addClass('show'); - + }) .error(function(){ loadingImage.hide(); @@ -58,8 +58,6 @@ } }); - }); - } \ No newline at end of file diff --git a/src/DotNetMashup.Web/Views/Shared/DisplayTemplates/TwitterData.cshtml b/src/DotNetMashup.Web/Views/Shared/DisplayTemplates/TwitterData.cshtml index 488f911..4a312ca 100644 --- a/src/DotNetMashup.Web/Views/Shared/DisplayTemplates/TwitterData.cshtml +++ b/src/DotNetMashup.Web/Views/Shared/DisplayTemplates/TwitterData.cshtml @@ -1,9 +1,4 @@ @model DotNetMashup.Web.Model.TwitterData - - -
-
- @Html.Raw((await Model.tweet.Value)?.HTML) -
-
-
\ No newline at end of file +
+ @Html.Raw((await Model.tweet.Value)?.HTML) +
\ No newline at end of file diff --git a/src/DotNetMashup.Web/Views/Shared/ExternalData.cshtml b/src/DotNetMashup.Web/Views/Shared/ExternalData.cshtml index 39fadfa..5145262 100644 --- a/src/DotNetMashup.Web/Views/Shared/ExternalData.cshtml +++ b/src/DotNetMashup.Web/Views/Shared/ExternalData.cshtml @@ -1,3 +1,4 @@ @model DotNetMashup.Web.Model.IExternalData - -@Html.DisplayFor(a => a) \ No newline at end of file + + @Html.DisplayFor(a => a) + \ No newline at end of file diff --git a/src/DotNetMashup.Web/Views/Shared/_Layout.cshtml b/src/DotNetMashup.Web/Views/Shared/_Layout.cshtml index 9f67d50..4e5d012 100644 --- a/src/DotNetMashup.Web/Views/Shared/_Layout.cshtml +++ b/src/DotNetMashup.Web/Views/Shared/_Layout.cshtml @@ -21,7 +21,7 @@

© 2015 - DotNetMashup.Web

- + Fork me on GitHub