From 0e316aabdc9a8ab2d6234e037aaecccfa3df54fa Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 9 Jun 2018 14:42:35 -0600 Subject: [PATCH] Add activity.js, infinite scroll for notifications --- public/js/activity.js | 1 + public/js/timeline.js | 2 +- public/mix-manifest.json | 3 ++- resources/assets/js/activity.js | 10 ++++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 public/js/activity.js create mode 100644 resources/assets/js/activity.js diff --git a/public/js/activity.js b/public/js/activity.js new file mode 100644 index 000000000..be031f9af --- /dev/null +++ b/public/js/activity.js @@ -0,0 +1 @@ +!function(t){var n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="/",e(e.s=1)}({1:function(t,n,e){t.exports=e("nr3X")},nr3X:function(t,n){$(document).ready(function(){$(".pagination").hide();var t=document.querySelector(".notification-page .list-group");new InfiniteScroll(t,{path:".pagination__next",append:".notification-page .list-group",status:".page-load-status",history:!0})})}}); \ No newline at end of file diff --git a/public/js/timeline.js b/public/js/timeline.js index 1faa1ef12..4b14bcf4c 100644 --- a/public/js/timeline.js +++ b/public/js/timeline.js @@ -1 +1 @@ -!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/",t(t.s=1)}({1:function(e,n,t){e.exports=t("uOOV")},uOOV:function(e,n){$(document).ready(function(){$(".pagination").hide();var e=document.querySelector(".timeline-feed");new InfiniteScroll(e,{path:".pagination__next",append:".timeline-feed",status:".page-load-status",history:!0}).on("append",function(e,n,t){pixelfed.hydrateLikes()})})}}); \ No newline at end of file +!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/",t(t.s=2)}({2:function(e,n,t){e.exports=t("uOOV")},uOOV:function(e,n){$(document).ready(function(){$(".pagination").hide();var e=document.querySelector(".timeline-feed");new InfiniteScroll(e,{path:".pagination__next",append:".timeline-feed",status:".page-load-status",history:!1}).on("append",function(e,n,t){pixelfed.hydrateLikes()})})}}); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index d6414f784..3598c8dc7 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,6 @@ { "/js/app.js": "/js/app.js?id=3cc7b07981e8b77e0db0", "/css/app.css": "/css/app.css?id=da55888f5d943a4a3407", - "/js/timeline.js": "/js/timeline.js?id=fd75ed1fd763eb407607" + "/js/timeline.js": "/js/timeline.js?id=d9a3145c0cd21ca09172", + "/js/activity.js": "/js/activity.js?id=723dfb98bbbc96a9d39f" } \ No newline at end of file diff --git a/resources/assets/js/activity.js b/resources/assets/js/activity.js new file mode 100644 index 000000000..b1b72d1b8 --- /dev/null +++ b/resources/assets/js/activity.js @@ -0,0 +1,10 @@ +$(document).ready(function() { + $('.pagination').hide(); + let elem = document.querySelector('.notification-page .list-group'); + let infScroll = new InfiniteScroll( elem, { + path: '.pagination__next', + append: '.notification-page .list-group', + status: '.page-load-status', + history: true, + }); +});