From d793e2cff23e82750dad32a92d6b9eb558a9cab3 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 3 Jun 2019 14:57:48 -0600 Subject: [PATCH 1/2] Update Activity.vue --- resources/assets/js/components/Activity.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/resources/assets/js/components/Activity.vue b/resources/assets/js/components/Activity.vue index b584cbddf..9658dde1a 100644 --- a/resources/assets/js/components/Activity.vue +++ b/resources/assets/js/components/Activity.vue @@ -113,11 +113,7 @@ export default { methods: { fetchNotifications() { - axios.get('/api/v1/notifications', { - params: { - pg: false - } - }) + axios.get('/api/v1/notifications') .then(res => { let data = res.data.filter(n => { if(n.type == 'share' && !status) { @@ -140,8 +136,7 @@ export default { } axios.get('/api/v1/notifications', { params: { - page: this.notificationCursor, - pg: false + page: this.notificationCursor } }).then(res => { if(res.data.length > 0) { From 344b6b421dd04771f07369bdf14a8f6f7c3676d2 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 3 Jun 2019 14:58:07 -0600 Subject: [PATCH 2/2] Update compiled assets --- public/js/activity.js | 2 +- public/mix-manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/activity.js b/public/js/activity.js index 0bdcd3610..f2f160b2d 100644 --- a/public/js/activity.js +++ b/public/js/activity.js @@ -1 +1 @@ -!function(t){var e={};function a(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)a.d(n,o,function(e){return t[e]}.bind(null,o));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="/",a(a.s=1)}({1:function(t,e,a){t.exports=a("hUgz")},"KHd+":function(t,e,a){"use strict";function n(t,e,a,n,o,i,r,s){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=a,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),r?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},l._ssrRegister=c):o&&(c=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:l}}a.d(e,"a",function(){return n})},hUgz:function(t,e,a){Vue.component("activity-component",a("tXHz").default)},tXHz:function(t,e,a){"use strict";a.r(e);function n(t){return function(t){if(Array.isArray(t)){for(var e=0,a=new Array(t.length);e10?t.complete():axios.get("/api/v1/notifications",{params:{page:this.notificationCursor,pg:!1}}).then(function(a){if(a.data.length>0){var o,i=a.data.filter(function(t){return!("share"==t.type&&!status)});(o=e.notifications).push.apply(o,n(i)),e.notificationCursor++,t.loaded()}else t.complete()})},truncate:function(t){return t.length<=15?t:t.slice(0,15)+"..."},timeAgo:function(t){var e=Date.parse(t),a=Math.floor((new Date-e)/1e3),n=Math.floor(a/31536e3);return n>=1?n+"y":(n=Math.floor(a/604800))>=1?n+"w":(n=Math.floor(a/86400))>=1?n+"d":(n=Math.floor(a/3600))>=1?n+"h":(n=Math.floor(a/60))>=1?n+"m":Math.floor(a)+"s"},mentionUrl:function(t){return"/p/"+t.account.username+"/"+t.id},followProfile:function(t){var e=this,a=t.account.id;axios.post("/i/follow",{item:a}).then(function(t){e.notifications.map(function(t){t.account.id===a&&(t.relationship.following=!0)})}).catch(function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")})},viewContext:function(t){switch(t.type){case"follow":return t.account.url;case"mention":return t.status.url;case"like":case"favourite":return t.status.url}return"/"}}},i=a("KHd+"),r=Object(i.a)(o,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"container"},[a("div",{staticClass:"row my-5"},[a("div",{staticClass:"col-12 col-md-8 offset-md-2"},[t._l(t.notifications,function(e,n){return t.notifications.length>0?a("div",{staticClass:"media mb-3 align-items-center px-3 border-bottom pb-3"},[a("img",{staticClass:"mr-2 rounded-circle",staticStyle:{border:"1px solid #ccc"},attrs:{src:e.account.avatar,alt:"",width:"32px",height:"32px"}}),t._v(" "),a("div",{staticClass:"media-body font-weight-light"},["favourite"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" liked your "),a("a",{staticClass:"font-weight-bold",attrs:{href:e.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"comment"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" commented on your "),a("a",{staticClass:"font-weight-bold",attrs:{href:e.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"mention"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" "),a("a",{staticClass:"font-weight-bold",attrs:{href:t.mentionUrl(e.status)}},[t._v("mentioned")]),t._v(" you.\n\t\t\t\t\t\t\t")])]):"follow"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" followed you.\n\t\t\t\t\t\t\t")])]):"share"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" shared your "),a("a",{staticClass:"font-weight-bold",attrs:{href:e.status.reblog.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):t._e(),t._v(" "),a("div",{staticClass:"align-items-center"},[a("span",{staticClass:"small text-muted",attrs:{"data-toggle":"tooltip","data-placement":"bottom",title:e.created_at}},[t._v(t._s(t.timeAgo(e.created_at)))])])]),t._v(" "),a("div",[e.status&&e.status&&e.status.media_attachments&&e.status.media_attachments.length?a("div",[a("a",{attrs:{href:e.status.url}},[a("img",{attrs:{src:e.status.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):e.status&&e.status.parent&&e.status.parent.media_attachments&&e.status.parent.media_attachments.length?a("div",[a("a",{attrs:{href:e.status.parent.url}},[a("img",{attrs:{src:e.status.parent.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):"follow"==e.type&&0==e.relationship.following?a("div",[a("a",{staticClass:"btn btn-primary py-0 font-weight-bold",attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),t.followProfile(e)}}},[t._v("\n\t\t\t\t\t\t\t\tFollow\n\t\t\t\t\t\t\t")])]):a("div",[a("a",{staticClass:"btn btn-outline-primary py-0 font-weight-bold",attrs:{href:t.viewContext(e)}},[t._v("View")])])])]):t._e()}),t._v(" "),t.notifications.length?a("div",[a("infinite-loading",{on:{infinite:t.infiniteNotifications}},[a("div",{staticClass:"font-weight-bold",attrs:{slot:"no-results"},slot:"no-results"}),t._v(" "),a("div",{staticClass:"font-weight-bold",attrs:{slot:"no-more"},slot:"no-more"})])],1):t._e(),t._v(" "),0==t.notifications.length?a("div",{staticClass:"text-lighter text-center py-3"},[t._m(0),t._v(" "),a("p",{staticClass:"mb-0 small font-weight-bold"},[t._v("0 Notifications!")])]):t._e()],2)])])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"mb-0"},[e("i",{staticClass:"fas fa-inbox fa-3x"})])}],!1,null,null,null);e.default=r.exports}}); \ No newline at end of file +!function(t){var e={};function a(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)a.d(n,o,function(e){return t[e]}.bind(null,o));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="/",a(a.s=1)}({1:function(t,e,a){t.exports=a("hUgz")},"KHd+":function(t,e,a){"use strict";function n(t,e,a,n,o,i,r,s){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=a,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),r?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},l._ssrRegister=c):o&&(c=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:l}}a.d(e,"a",function(){return n})},hUgz:function(t,e,a){Vue.component("activity-component",a("tXHz").default)},tXHz:function(t,e,a){"use strict";a.r(e);function n(t){return function(t){if(Array.isArray(t)){for(var e=0,a=new Array(t.length);e10?t.complete():axios.get("/api/v1/notifications",{params:{page:this.notificationCursor}}).then(function(a){if(a.data.length>0){var o,i=a.data.filter(function(t){return!("share"==t.type&&!status)});(o=e.notifications).push.apply(o,n(i)),e.notificationCursor++,t.loaded()}else t.complete()})},truncate:function(t){return t.length<=15?t:t.slice(0,15)+"..."},timeAgo:function(t){var e=Date.parse(t),a=Math.floor((new Date-e)/1e3),n=Math.floor(a/31536e3);return n>=1?n+"y":(n=Math.floor(a/604800))>=1?n+"w":(n=Math.floor(a/86400))>=1?n+"d":(n=Math.floor(a/3600))>=1?n+"h":(n=Math.floor(a/60))>=1?n+"m":Math.floor(a)+"s"},mentionUrl:function(t){return"/p/"+t.account.username+"/"+t.id},followProfile:function(t){var e=this,a=t.account.id;axios.post("/i/follow",{item:a}).then(function(t){e.notifications.map(function(t){t.account.id===a&&(t.relationship.following=!0)})}).catch(function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")})},viewContext:function(t){switch(t.type){case"follow":return t.account.url;case"mention":return t.status.url;case"like":case"favourite":return t.status.url}return"/"}}},i=a("KHd+"),r=Object(i.a)(o,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"container"},[a("div",{staticClass:"row my-5"},[a("div",{staticClass:"col-12 col-md-8 offset-md-2"},[t._l(t.notifications,function(e,n){return t.notifications.length>0?a("div",{staticClass:"media mb-3 align-items-center px-3 border-bottom pb-3"},[a("img",{staticClass:"mr-2 rounded-circle",staticStyle:{border:"1px solid #ccc"},attrs:{src:e.account.avatar,alt:"",width:"32px",height:"32px"}}),t._v(" "),a("div",{staticClass:"media-body font-weight-light"},["favourite"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" liked your "),a("a",{staticClass:"font-weight-bold",attrs:{href:e.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"comment"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" commented on your "),a("a",{staticClass:"font-weight-bold",attrs:{href:e.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"mention"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" "),a("a",{staticClass:"font-weight-bold",attrs:{href:t.mentionUrl(e.status)}},[t._v("mentioned")]),t._v(" you.\n\t\t\t\t\t\t\t")])]):"follow"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" followed you.\n\t\t\t\t\t\t\t")])]):"share"==e.type?a("div",[a("p",{staticClass:"my-0"},[a("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:e.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:e.account.username}},[t._v(t._s(t.truncate(e.account.username)))]),t._v(" shared your "),a("a",{staticClass:"font-weight-bold",attrs:{href:e.status.reblog.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):t._e(),t._v(" "),a("div",{staticClass:"align-items-center"},[a("span",{staticClass:"small text-muted",attrs:{"data-toggle":"tooltip","data-placement":"bottom",title:e.created_at}},[t._v(t._s(t.timeAgo(e.created_at)))])])]),t._v(" "),a("div",[e.status&&e.status&&e.status.media_attachments&&e.status.media_attachments.length?a("div",[a("a",{attrs:{href:e.status.url}},[a("img",{attrs:{src:e.status.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):e.status&&e.status.parent&&e.status.parent.media_attachments&&e.status.parent.media_attachments.length?a("div",[a("a",{attrs:{href:e.status.parent.url}},[a("img",{attrs:{src:e.status.parent.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):"follow"==e.type&&0==e.relationship.following?a("div",[a("a",{staticClass:"btn btn-primary py-0 font-weight-bold",attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),t.followProfile(e)}}},[t._v("\n\t\t\t\t\t\t\t\tFollow\n\t\t\t\t\t\t\t")])]):a("div",[a("a",{staticClass:"btn btn-outline-primary py-0 font-weight-bold",attrs:{href:t.viewContext(e)}},[t._v("View")])])])]):t._e()}),t._v(" "),t.notifications.length?a("div",[a("infinite-loading",{on:{infinite:t.infiniteNotifications}},[a("div",{staticClass:"font-weight-bold",attrs:{slot:"no-results"},slot:"no-results"}),t._v(" "),a("div",{staticClass:"font-weight-bold",attrs:{slot:"no-more"},slot:"no-more"})])],1):t._e(),t._v(" "),0==t.notifications.length?a("div",{staticClass:"text-lighter text-center py-3"},[t._m(0),t._v(" "),a("p",{staticClass:"mb-0 small font-weight-bold"},[t._v("0 Notifications!")])]):t._e()],2)])])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"mb-0"},[e("i",{staticClass:"fas fa-inbox fa-3x"})])}],!1,null,null,null);e.default=r.exports}}); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 567fa5113..2084e4076 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,5 @@ { - "/js/activity.js": "/js/activity.js?id=3118f76a4259805903d8", + "/js/activity.js": "/js/activity.js?id=eb8c6f89120b93ddec71", "/js/app.js": "/js/app.js?id=1f05f00eec0e86f49dd4", "/css/app.css": "/css/app.css?id=3a974ff74b6b5905a73c", "/css/appdark.css": "/css/appdark.css?id=107806a000e2ca675a3c",