pixelfed/public/js/hashtag.js

1 line
12 KiB
JavaScript
Raw Normal View History

2019-12-05 06:33:58 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{16:function(t,e,n){t.exports=n("gqTO")},"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 a,r=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?t:(a=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:s+r.replace(/^\.\//,""),"url("+JSON.stringify(a)+")")}))}},HVjR:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.tag-header[data-v-7f9b7575] {\n\tfont-size: 28px;\n\tfont-weight: 300;\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 a=(o=s,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),r=s.sources.map((function(t){return"/*# sourceURL="+s.sourceRoot+t+" */"}));return[n].concat(r).concat([a]).join("\n")}var o;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={},a=0;a<this.length;a++){var r=this[a][0];"number"==typeof r&&(s[r]=!0)}for(a=0;a<t.length;a++){var o=t[a];"number"==typeof o[0]&&s[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),e.push(o))}},e}},"KHd+":function(t,e,n){"use strict";function s(t,e,n,s,a,r,o,i){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),s&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),o?(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__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=l):a&&(l=i?function(){a.call(this,this.$root.$options.shadowRoot)}:a),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(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}))},L3EV:function(t,e,n){var s=n("HVjR");"string"==typeof s&&(s=[[t.i,s,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(s,a);s.locals&&(t.exports=s.locals)},Pvfc:function(t,e,n){"use strict";n.r(e);function s(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(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 a={props:["hashtag","hashtagCount"],data:function(){return{loaded:!1,page:1,authenticated:!1,following:!1,tags:[],top:[]}},beforeMount:function(){this.authenticated=$("body").hasClass("loggedIn"),this.getResults(),this.hashtagCount=window.App.util.format.count(this.hashtagCount)},methods:{getResults:function(){var t=this;axios.get("/api/v2/discover/tag",{params:{hashtag:this.hashtag,page:this.page}}).then((function(e){var n=e.data,s=n.tags.filter((function(t){return!(!t||0==t.length)}));t.tags=s,t.loaded=!0,t.following=n.follows,t.page++}))},infiniteLoader:function(t){var e=this;this.page>(this.authenticated?29:10)?t.complete():axios.get("/api/v2/discover/tag",{params:{hashtag:this.hashtag,page:this.page}}).then((function(n){var a=n.data;if(a.tags.length){var r,o=a.tags.filter((function(t){return!(!t||0==t.length)}));if((r=e.tags).push.apply(r,s(o)),o.length>9)return void t.complete();e.page++,t.loaded()}else t.complete()}))},followHashtag:function(){var t=this;axios.post("/api/local/discover/tag/subscribe",{name:this.hashtag}).then((function(e){t.followi