2019-06-03 20:58:07 +00:00
|
|
|
!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);e<t.length;e++)a[e]=t[e];return a}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var o={data:function(){return{notifications:{},notificationCursor:2,notificationMaxId:0}},mounted:function(){this.fetchNotifications()},updated:function(){$('[data-toggle="tooltip"]').tooltip()},methods:{fetchNotifications:function(){var t=this;axios.get("/api/v1/notifications").then(function(e){var a=e.data.filter(function(t){return!("share"==t.type&&!status)}),o=e.data.map(function(t){return t.id});t.notificationMaxId=Math.max.apply(Math,n(o)),t.notifications=a,$(".notification-card .loader").addClass("d-none"),$(".notification-card .contents").removeClass("d-none")})},infiniteNotifications:function(t){var e=this;this.notificationCursor>10?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:"conta
|