pixelfed/public/js/discover.js
2020-08-01 19:00:31 -06:00

1 line
No EOL
12 KiB
JavaScript
Vendored

(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")},"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 r,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:(r=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:s+a.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}},"A/ye":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.discover-bar[data-v-5d20116e]::-webkit-scrollbar { \n\tdisplay: none;\n}\n.card-disc[data-v-5d20116e] {\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-5d20116e] {\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",""])},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 r=(i=s,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=s.sources.map((function(t){return"/*# sourceURL="+s.sourceRoot+t+" */"}));return[n].concat(a).concat([r]).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 s={},r=0;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(s[a]=!0)}for(r=0;r<t.length;r++){var i=t[r];"number"==typeof i[0]&&s[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 s(t,e,n,s,r,a,i,o){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),s&&(l.functional=!0),a&&(l._scopeId="data-v-"+a),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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},l._ssrRegister=c):r&&(c=o?function(){r.call(this,this.$root.$options.shadowRoot)}:r),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 d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:l}}n.d(e,"a",(function(){return s}))},RlRG:function(t,e,n){"use strict";n.r(e);var s={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)}}},r=(n("m/XJ"),n("KHd+")),a=Object(r.a)(s,(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(" "),t._m(0),t._v(" "),t.categories.length>0?n("section",{staticClass:"d-none d-md-flex mb-md-2 pt-5 discover-bar",staticStyle:{width:"auto",overflow:"auto hidden"}},t._l(t.categories,(function(e,s){return n("a",{key:s+"_cat_",staticClass:"bg-dark rounded d-inline-flex align-items-end justify-content-center mr-3 box-shadow card-disc text-decoration-none",style:"background: linear-gradient(rgba(0, 0, 0, 0.3),rgba(0, 0, 0, 0.3)),url("+e.thumb+");",attrs:{href:e.url}},[n("p",{staticClass:"text-white font-weight-bold",staticStyle:{"text-shadow":"3px 3px 16px #272634"}},[t._v(t._s(e.name))])])})),0):t._e(),t._v(" "),n("section",{staticClass:"mb-5 section-explore"},[n("div",{staticClass:"profile-timeline"},[n("div",{staticClass:"row p-0 mt-5"},[n("div",{staticClass:"col-12 col-md-6"},[n("div",{staticClass:"mb-4"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:t.posts[0].url}},[n("div",{staticClass:"square"},["photo:album"==t.posts[0].type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==t.posts[0].type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==t.posts[0].type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"square-content",style:{"background-image":"url("+t.posts[0].thumb+")"}})])])])]),t._v(" "),n("div",{staticClass:"col-12 col-md-6 row p-0 m-0"},t._l(t.posts.slice(1,5),(function(e,s){return n("div",{staticClass:"col-6",staticStyle:{"margin-bottom":"1.8rem"}},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[n("div",{staticClass:"square"},["photo:album"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"square-content",style:{"background-image":"url("+e.thumb+")"}})])])])})),0)]),t._v(" "),n("div",{staticClass:"row p-0",staticStyle:{display:"flex"}},t._l(t.posts.slice(5),(function(e,s){return n("div",{staticClass:"col-3 p-1 p-sm-2 p-md-3"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[n("div",{staticClass:"square"},["photo:album"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.type?n("span",{staticClass:"float-right mr-3 post-icon"},[n("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),n("div",{staticClass:"square-content",style:{"background-image":"url("+e.thumb+")"}})])])])})),0)])]),t._v(" "),t._m(1)]):n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"70vh"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("p",{staticClass:"display-4 font-weight-bold pt-5 text-lighter"},[e("i",{staticClass:"far fa-compass"}),this._v(" DISCOVER")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("section",{staticClass:"mb-5"},[e("p",{staticClass:"lead text-center"},[this._v("To view more posts, check the "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/"}},[this._v("home")]),this._v(" or "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/timeline/public"}},[this._v("local")]),this._v(" timelines.")])])}],!1,null,"5d20116e",null);e.default=a.exports},"aET+":function(t,e,n){var s,r,a={},i=(s=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=s.apply(this,arguments)),r}),o=function(t,e){return e?e.querySelector(t):document.querySelector(t)},c=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var s=o.call(this,t,n);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(t){s=null}e[t]=s}return e[t]}}(),l=null,f=0,d=[],u=n("9tPo");function p(t,e){for(var n=0;n<t.length;n++){var s=t[n],r=a[s.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](s.parts[i]);for(;i<s.parts.length;i++)r.parts.push(y(s.parts[i],e))}else{var o=[];for(i=0;i<s.parts.length;i++)o.push(y(s.parts[i],e));a[s.id]={id:s.id,refs:1,parts:o}}}}function h(t,e){for(var n=[],s={},r=0;r<t.length;r++){var a=t[r],i=e.base?a[0]+e.base:a[0],o={css:a[1],media:a[2],sourceMap:a[3]};s[i]?s[i].parts.push(o):n.push(s[i]={id:i,parts:[o]})}return n}function v(t,e){var n=c(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var s=d[d.length-1];if("top"===t.insertAt)s?s.nextSibling?n.insertBefore(e,s.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),d.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=c(t.insertAt.before,n);n.insertBefore(e,r)}}function m(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=d.indexOf(t);e>=0&&d.splice(e,1)}function b(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var s=function(){0;return n.nc}();s&&(t.attrs.nonce=s)}return g(e,t.attrs),v(t,e),e}function g(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,s,r,a;if(e.transform&&t.css){if(!(a="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=a}if(e.singleton){var i=f++;n=l||(l=b(e)),s=_.bind(null,n,i,!1),r=_.bind(null,n,i,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),v(t,e),e}(e),s=R.bind(null,n,e),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(e),s=w.bind(null,n),r=function(){m(n)});return s(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;s(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=i()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return p(n,e),function(t){for(var s=[],r=0;r<n.length;r++){var i=n[r];(o=a[i.id]).refs--,s.push(o)}t&&p(h(t,e),e);for(r=0;r<s.length;r++){var o;if(0===(o=s[r]).refs){for(var c=0;c<o.parts.length;c++)o.parts[c]();delete a[o.id]}}}};var C,x=(C=[],function(t,e){return C[t]=e,C.filter(Boolean).join("\n")});function _(t,e,n,s){var r=n?"":s.css;if(t.styleSheet)t.styleSheet.cssText=x(e,r);else{var a=document.createTextNode(r),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(a,i[e]):t.appendChild(a)}}function w(t,e){var n=e.css,s=e.media;if(s&&t.setAttribute("media",s),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function R(t,e,n){var s=n.css,r=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||a)&&(s=u(s)),r&&(s+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([s],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}},f5RO:function(t,e,n){var s=n("A/ye");"string"==typeof s&&(s=[[t.i,s,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(s,r);s.locals&&(t.exports=s.locals)},"m/XJ":function(t,e,n){"use strict";var s=n("f5RO");n.n(s).a}},[[3,0]]]);