pixelfed/public/js/discover.js

1 line
16 KiB
JavaScript
Raw Normal View History

2020-12-10 05:05:42 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{"+nCD":function(t,e,n){Vue.component("discover-component",n("RlRG").default)},"/5oI":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.discover-bar[data-v-67532657]::-webkit-scrollbar { \n\tdisplay: none;\n}\n.card-disc[data-v-67532657] {\n\t-webkit-box-flex: 0;\n\t flex: 0 0 160px;\n\twidth:160px;\n\theight:100px;\n\tbackground-size: cover !important;\n}\n.post-icon[data-v-67532657] {\n\tcolor: #fff;\n\tposition:relative;\n\tmargin-top: 10px;\n\tz-index: 9;\n\topacity: 0.6;\n\ttext-shadow: 3px 3px 16px #272634;\n}\n",""])},3:function(t,e,n){t.exports=n("+nCD")},"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,s=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var i,a=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?t:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:s+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},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]||"",s=t[3];if(!s)return n;if(e&&"function"==typeof btoa){var i=(r=s,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),a=s.sources.map((function(t){return"/*# sourceURL="+s.sourceRoot+t+" */"}));return[n].concat(a).concat([i]).join("\n")}var r;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 s={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(s[a]=!0)}for(i=0;i<t.length;i++){var r=t[i];"number"==typeof r[0]&&s[r[0]]||(n&&!r[2]?r[2]=n:n&&(r[2]="("+r[2]+") and ("+n+")"),e.push(r))}},e}},"KHd+":function(t,e,n){"use strict";function s(t,e,n,s,i,a,r,o){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),s&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),r?(l=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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=l):i&&(l=o?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(t,e){return l.call(e),d(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:c}}n.d(e,"a",(function(){return s}))},MxLl:function(t,e,n){"use strict";var s=n("z3Hk");n.n(s).a},RlRG:function(t,e,n){"use strict";n.r(e);var s={data:function(){return{loaded:!1,config:window.App.config,posts:{},hashtags:{},places:{},trending:{},trendingDaily:{},trendingMonthly:{},categories:{},allCategories:{},searchTerm:"",trendingRange:"daily"}},mounted:function(){this.fetchData(),this.fetchCategories(),this.loadTrending(),this.loadTrendingHashtags(),this.loadTrendingPlaces()},methods:{fetchData:function(){var t=this;axios.get("/api/pixelfed/v2/discover/posts").then((function(e){t.posts=e.data.posts,t.loaded=!0})),axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(t){window._sharedData.curUser=t.data,window.App.util.navatar()}))},fetchCategories:function(){var t=this;axios.get("/api/v2/discover/categories").then((function(e){t.allCategories=e.data,t.categories=e.data}))},searchSubmit:function(){this.searchTerm.length>1&&(window.location.href="/i/results?q="+this.searchTerm)},loadTrending:function(){var t=this;"daily"==this.trendingRange&&this.trendingDaily.length?this.trending=this.trendingDaily:"monthly"==this.trendingRange&&this.trendingMonthly.length?this.trending=this.trendingMonthly:axios.get("/api/pixelfed/v2/discove