pixelfed/public/js/discover.js

1 line
11 KiB
JavaScript
Raw Normal View History

2019-09-27 01:45:28 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"+nCD":function(t,e,n){Vue.component("discover-component",n("RlRG").default)},3:function(t,e,n){t.exports=n("+nCD")},"9fdm":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.discover-bar[data-v-73c53a24]::-webkit-scrollbar { \n\tdisplay: none;\n}\n.card-disc[data-v-73c53a24] {\n\tflex: 0 0 160px;\n\twidth:160px;\n\theight:100px;\n\tbackground-size: cover !important;\n}\n.post-icon[data-v-73c53a24] {\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",""])},"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,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},D4M1:function(t,e,n){"use strict";var r=n("q/ZE");n.n(r).a},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=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),i=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(i).concat([o]).join("\n")}var s;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 i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var s=t[o];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))}},e}},"KHd+":function(t,e,n){"use strict";function r(t,e,n,r,o,i,s,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),i&&(l._scopeId="data-v-"+i),s?(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(s)},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})},RlRG:function(t,e,n){"use strict";n.r(e);var r={data:function(){return{loaded:!1,config:window.App.config,posts:{},trending:{},categories:{},allCategories:{},searchTerm:""}},mounted:function(){this.fetchData(),this.fetchCategories()},methods:{fetchData:function(){var t=this;axios.get("/api/pixelfed/v2/discover/posts").then(function(e){t.posts=e.data.posts,t.loaded=!0})},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)}}},o=(n("D4M1"),n("KHd+")),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.loaded?n("div",[n("div",{staticClass:"d-block d-md-none px-0 border-top-0 mx-n3"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.searchTerm,expression:"searchTerm"}],staticClass:"form-control rounded-0",attrs:{placeholder:"Search"},domProps:{value:t.searchTerm},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchSubmit(e)},input:function(e){e.target.composing||(t.searchTerm=e.target.value)}}})]),t._v("