1
0
Fork 0
pixelfed/public/js/discover.js

1 line
11 KiB
JavaScript
Raw Normal View History

2019-06-21 02:15:53 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"+nCD":function(t,e,n){Vue.component("discover-component",n("RlRG").default)},3:function(t,e,n){t.exports=n("+nCD")},"57Sm":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.discover-bar[data-v-54e44e3a]::-webkit-scrollbar { \n display: none;\n}\n.card-disc[data-v-54e44e3a] {\n flex: 0 0 160px;\n width:160px;\n height:100px;\n background-size: cover !important;\n}\n.post-icon[data-v-54e44e3a] {\n color: #fff;\n position:relative;\n margin-top: 10px;\n z-index: 9;\n opacity: 0.6;\n text-shadow: 3px 3px 16px #272634;\n}\n",""])},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var o,s=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(s)?t:(o=0===s.indexOf("//")?s:0===s.indexOf("/")?n+s:r+s.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(i=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),s=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(s).concat([o]).join("\n")}var i;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var s=this[o][0];"number"==typeof s&&(r[s]=!0)}for(o=0;o<t.length;o++){var i=t[o];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),e.push(i))}},e}},"KHd+":function(t,e,n){"use strict";function r(t,e,n,r,o,s,i,a){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),s&&(l._scopeId="data-v-"+s),i?(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(i)},l._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var f=l.render;l.render=function(t,e){return c.call(e),f(t,e)}}else{var u=l.beforeCreate;l.beforeCreate=u?[].concat(u,c):[c]}return{exports:t,options:l}}n.d(e,"a",function(){return r})},PeFa:function(t,e,n){var r=n("57Sm");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},RlRG:function(t,e,n){"use strict";n.r(e);var r={data:function(){return{config:{},posts:{},trending:{},categories:{},allCategories:{}}},mounted:function(){this.fetchData(),this.fetchCategories()},methods:{followUser:function(t,e){axios.post("/i/follow",{item:t}).then(function(t){var n=$(e.target);n.addClass("btn-outline-secondary").removeClass("btn-primary"),n.text("Unfollow")}).catch(function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")})},fetchData:function(){var t=this;axios.get("/api/v2/config").then(function(e){var n=e.data;t.config=n}),axios.get("/api/v2/discover/posts").then(function(e){var n=e.data;t.posts=n.posts,t.posts.length>1&&($(".section-explore .loader").hide(),$(".section-explore .row.d-none").removeClass("d-none"))})},fetchCategories:function(){var t=this;axios.get("/api/v2/discover/categories").then(function(e){t.allCategories=e.data,t.categories=e.data})}}},o=(n("cyEJ"),n("KHd+")),s=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container"},[t.categories.length>0?n("section",{staticClas