diff --git a/public/js/compose.js b/public/js/compose.js index 35f5e1def..42e341f59 100644 --- a/public/js/compose.js +++ b/public/js/compose.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"6wO3":function(t,e,i){(t.exports=i("I1BE")(!1)).push([t.i,"\n.media-drawer-filters[data-v-6a8c0d62] {\n\toverflow-x: scroll;\n\tflex-wrap:unset;\n}\n.media-drawer-filters .nav-link[data-v-6a8c0d62] {\n\tmin-width:100px;\n\tpadding-top: 1rem;\n\tpadding-bottom: 1rem;\n}\n.media-drawer-filters .active[data-v-6a8c0d62] {\n\tcolor: #fff;\n\tfont-weight: bold;\n}\n.media-drawer-filters[data-v-6a8c0d62]::-webkit-scrollbar {\n display: none;\n}\n",""])},7:function(t,e,i){t.exports=i("K0g3")},"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 i=e.protocol+"//"+e.host,o=i+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var s,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:(s=0===a.indexOf("//")?a:0===a.indexOf("/")?i+a:o+a.replace(/^\.\//,""),"url("+JSON.stringify(s)+")")})}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i=function(t,e){var i=t[1]||"",o=t[3];if(!o)return i;if(e&&"function"==typeof btoa){var s=(n=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),a=o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"});return[i].concat(a).concat([s]).join("\n")}var n;return[i].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+i+"}":i}).join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},s=0;s=0&&d.splice(e,1)}function h(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return i.nc}();o&&(t.attrs.nonce=o)}return b(e,t.attrs),m(t,e),e}function b(t,e){Object.keys(e).forEach(function(i){t.setAttribute(i,e[i])})}function g(t,e){var i,o,s,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 n=c++;i=l||(l=h(e)),o=_.bind(null,i,n,!1),s=_.bind(null,i,n,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),m(t,e),e}(e),o=function(t,e,i){var o=i.css,s=i.sourceMap,a=void 0===e.convertToAbsoluteUrls&&s;(e.convertToAbsoluteUrls||a)&&(o=u(o));s&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */");var n=new Blob([o],{type:"text/css"}),r=t.href;t.href=URL.createObjectURL(n),r&&URL.revokeObjectURL(r)}.bind(null,i,e),s=function(){v(i),i.href&&URL.revokeObjectURL(i.href)}):(i=h(e),o=function(t,e){var i=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}.bind(null,i),s=function(){v(i)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else s()}}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=n()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var i=f(t,e);return p(i,e),function(t){for(var o=[],s=0;s=t.config.uploader.album_limit)swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error");else{var o=e.type,s=t.config.uploader.media_types.split(",");if(-1!=$.inArray(o,s)){var a=new FormData;a.append("file",e);var n={onUploadProgress:function(e){var i=Math.round(100*e.loaded/e.total);t.uploadProgress=i}};axios.post("/api/v1/media",a,n).then(function(e){t.uploadProgress=100,t.ids.push(e.data.id),t.media.push(e.data),setTimeout(function(){t.uploading=!1},1e3)}).catch(function(i){t.uploading=!1,e.value=null,swal("Oops, something went wrong!","An unexpected error occurred.","error")}),e.value=null,t.uploadProgress=0}else swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.config.uploader.media_types+" only.","error")}})})},toggleFilter:function(t,e){this.media[this.carouselCursor].filter_class=e},updateMedia:function(){this.mediaDrawer=!1},deleteMedia:function(){var t=this;if(0!=window.confirm("Are you sure you want to delete this photo?")){var e=this.media[this.carouselCursor].id;axios.delete("/api/v1/media",{params:{id:e}}).then(function(e){1==t.media.length&&(t.mediaDrawer=!1,t.ids=[],t.media=[],t.carouselCursor=0),t.ids.splice(t.carouselCursor,1),t.media.splice(t.carouselCursor,1)}).catch(function(t){swal("Whoops!","An error occured when attempting to delete this, please try again","error")})}},mediaAltText:function(){},mediaLicense:function(){},compose:function(){var t=this.composeState;if(100==this.uploadProgress&&0!=this.ids.length)switch(t){case"publish":if(0==this.media.length)return void swal("Whoops!","You need to add media before you can save this!","warning");"Add optional caption..."==this.composeText&&(this.composeText="");var e={media:this.media,caption:this.composeText,visibility:this.visibility,cw:this.nsfw};return void axios.post("/api/v2/status/compose",e).then(function(t){var e=t.data;window.location.href=e}).catch(function(t){swal("Oops, something went wrong!","An unexpected error occurred.","error")});case"delete":return this.mediaDrawer=!1,this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void $("#composeModal").modal("hide")}},about:function(){var t=document.createElement("div");t.innerHTML='\n\t\t\t\t

Please visit the Sharing Media page for more info.

\n\t\t\t',swal({title:"Compose UI v3",content:t,icon:"info"})},closeModal:function(){this.composeType="",$("#composeModal").modal("hide")},composeMessage:function(){var t=this.config;this.composeType;return t.uploader.media_types.includes("video/mp4")?"Click here to add photos or videos":"Click here to add photos"}}},s=(i("LpEJ"),i("KHd+")),a=Object(s.a)(o,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t.composeType?t._e():i("div",[i("div",{staticClass:"card"},[i("div",{staticClass:"card-body"},[i("button",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("Compose Post")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="loop"}}},[t._v("Create Loop")])])])]),t._v(" "),"post"==t.composeType?i("div",[i("input",{staticClass:"d-none file-input",attrs:{type:"file",name:"media",multiple:"",accept:t.config.uploader.media_types}}),t._v(" "),i("div",{staticClass:"timeline"},[i("div",{staticClass:"card status-card card-md-rounded-0"},[i("div",{staticClass:"card-header d-inline-flex align-items-center bg-white"},[i("img",{staticClass:"box-shadow",staticStyle:{"border-radius":"32px"},attrs:{src:t.profile.avatar,width:"32px",height:"32px"}}),t._v(" "),i("a",{staticClass:"username font-weight-bold pl-2 text-dark",attrs:{href:t.profile.url}},[t._v("\n\t\t\t\t\t"+t._s(t.profile.username)+"\n\t\t\t\t")]),t._v(" "),i("div",{staticClass:"text-right",staticStyle:{"flex-grow":"1"}},[i("div",{staticClass:"dropdown"},[t._m(0),t._v(" "),i("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.media.length>0,expression:"media.length > 0"}],staticClass:"dropdown-item small font-weight-bold",on:{click:function(e){t.mediaDrawer=!t.mediaDrawer}}},[t._v(t._s(t.mediaDrawer?"Hide":"Show")+" Media Toolbar")]),t._v(" "),i("div",{staticClass:"dropdown-item small font-weight-bold",on:{click:t.about}},[t._v("About")]),t._v(" "),i("a",{staticClass:"dropdown-item small font-weight-bold",attrs:{href:"/i/compose"}},[t._v("Classic Compose UI")]),t._v(" "),i("div",{staticClass:"dropdown-divider"}),t._v(" "),i("div",{staticClass:"dropdown-item small font-weight-bold",on:{click:t.closeModal}},[t._v("Close")])])])])]),t._v(" "),i("div",{staticClass:"postPresenterContainer"},[t.uploading?i("div",[i("div",{staticClass:"w-100 h-100 bg-light py-5",staticStyle:{"border-bottom":"1px solid #f1f1f1"}},[i("div",{staticClass:"p-5"},[i("b-progress",{attrs:{value:t.uploadProgress,max:100,striped:"",animated:!0}}),t._v(" "),i("p",{staticClass:"text-center mb-0 font-weight-bold"},[t._v("Uploading ... ("+t._s(t.uploadProgress)+"%)")])],1)])]):i("div",[t.ids.length>0&&t.ids.length!=t.config.uploader.album_limit?i("div",{staticClass:"card-header py-2 bg-primary m-2 rounded cursor-pointer",on:{click:function(e){return t.addMedia(e)}}},[t._m(1)]):t._e(),t._v(" "),0==t.ids.length?i("div",{staticClass:"w-100 h-100 bg-light py-5 cursor-pointer",staticStyle:{"border-bottom":"1px solid #f1f1f1"},on:{click:function(e){return t.addMedia(e)}}},[i("p",{staticClass:"text-center mb-0 font-weight-bold p-5"},[t._v(t._s(t.composeMessage()))])]):t._e(),t._v(" "),t.ids.length>0?i("div",[i("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333"},attrs:{id:"p-carousel",controls:"",indicators:"",background:"#ffffff",interval:0},model:{value:t.carouselCursor,callback:function(e){t.carouselCursor=e},expression:"carouselCursor"}},t._l(t.media,function(e,o){return t.ids.length>0?i("b-carousel-slide",{key:"preview_media_"+o},[i("div",{class:[t.media[o].filter_class?t.media[o].filter_class:""],staticStyle:{display:"flex","min-height":"320px","align-items":"center"},attrs:{slot:"img"},slot:"img"},[i("img",{staticClass:"d-block img-fluid w-100",attrs:{src:e.url,alt:e.description,title:e.description}})])]):t._e()}),1)],1):t._e(),t._v(" "),t.ids.length>0?i("div",{staticClass:"bg-dark align-items-center"},[i("ul",{staticClass:"nav media-drawer-filters text-center"},[i("li",{staticClass:"nav-item"},[i("div",{staticClass:"p-1 pt-3"},[i("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),i("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-white active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,function(e,o){return i("li",{staticClass:"nav-item"},[i("div",{staticClass:"p-1 pt-3"},[i("img",{class:e[1],attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(i){return i.preventDefault(),t.toggleFilter(i,e[1])}}})]),t._v(" "),i("a",{class:[t.media[t.carouselCursor].filter_class==e[1]?"nav-link text-white active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(i){return i.preventDefault(),t.toggleFilter(i,e[1])}}},[t._v(t._s(e[0]))])])})],2)]):t._e()]),t._v(" "),t.mediaDrawer?i("div",{staticClass:"bg-lighter p-2 row"},[i("div",{staticClass:"col-12"},[i("div",{staticClass:"form-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].alt,expression:"media[carouselCursor].alt"}],staticClass:"form-control",attrs:{type:"text",placeholder:"Optional image description"},domProps:{value:t.media[t.carouselCursor].alt},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"alt",e.target.value)}}})]),t._v(" "),i("div",{staticClass:"form-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].license,expression:"media[carouselCursor].license"}],staticClass:"form-control",attrs:{type:"text",placeholder:"Optional media license"},domProps:{value:t.media[t.carouselCursor].license},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"license",e.target.value)}}})])]),t._v(" "),i("div",{staticClass:"col-12 text-right pt-2"},[i("button",{staticClass:"btn btn-outline-danger btn-sm font-weight-bold mr-1",on:{click:function(e){return t.deleteMedia()}}},[t._v("Delete Photo")]),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-sm font-weight-bold",on:{click:function(e){return t.updateMedia()}}},[t._v("Hide Media Toolbar")])])]):t._e()]),t._v(" "),i("div",{staticClass:"card-body p-0"},[i("div",{staticClass:"caption"},[i("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control mb-0 border-0 rounded-0",attrs:{rows:"3",placeholder:"Add an optional caption"},domProps:{value:t.composeText},on:{input:function(e){e.target.composing||(t.composeText=e.target.value)}}})])]),t._v(" "),i("div",{staticClass:"card-footer"},[i("div",{staticClass:"d-flex justify-content-between align-items-center"},[i("div",[i("div",{staticClass:"custom-control custom-switch d-inline mr-3"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"nsfwToggle"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var i=t.nsfw,o=e.target,s=!!o.checked;if(Array.isArray(i)){var a=t._i(i,null);o.checked?a<0&&(t.nsfw=i.concat([null])):a>-1&&(t.nsfw=i.slice(0,a).concat(i.slice(a+1)))}else t.nsfw=s}}}),t._v(" "),i("label",{staticClass:"custom-control-label small font-weight-bold text-muted pt-1",attrs:{for:"nsfwToggle"}},[t._v("NSFW")])]),t._v(" "),i("div",{staticClass:"dropdown d-inline"},[i("button",{staticClass:"btn btn-outline-secondary btn-sm py-0 dropdown-toggle",attrs:{type:"button",id:"visibility","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(t.visibility[0].toUpperCase()+t.visibility.slice(1))+"\n\t\t\t\t\t\t\t")]),t._v(" "),i("div",{staticClass:"dropdown-menu",staticStyle:{width:"200px"},attrs:{"aria-labelledby":"visibility"}},[i("a",{class:["public"==t.visibility?"dropdown-item active":"dropdown-item"],attrs:{href:"#","data-id":"public","data-title":"Public"},on:{click:function(e){e.preventDefault(),t.visibility="public"}}},[t._m(2)]),t._v(" "),i("a",{class:["private"==t.visibility?"dropdown-item active":"dropdown-item"],attrs:{href:"#","data-id":"private","data-title":"Followers Only"},on:{click:function(e){e.preventDefault(),t.visibility="private"}}},[t._m(3)]),t._v(" "),i("a",{class:["unlisted"==t.visibility?"dropdown-item active":"dropdown-item"],attrs:{href:"#","data-id":"private","data-title":"Unlisted"},on:{click:function(e){e.preventDefault(),t.visibility="unlisted"}}},[t._m(4)])])])]),t._v(" "),i("div",{staticClass:"small text-muted font-weight-bold"},[t._v("\n\t\t\t\t\t\t"+t._s(t.composeText.length)+" / "+t._s(t.config.uploader.max_caption_length)+"\n\t\t\t\t\t")]),t._v(" "),i("div",{staticClass:"pl-md-5"},[i("div",{staticClass:"btn-group"},[i("button",{staticClass:"btn btn-primary btn-sm font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.compose()}}},[t._v(t._s(t.composeState[0].toUpperCase()+t.composeState.slice(1)))]),t._v(" "),t._m(5),t._v(" "),i("div",{staticClass:"dropdown-menu dropdown-menu-right"},[i("a",{class:["publish"==t.composeState?"dropdown-item font-weight-bold active":"dropdown-item font-weight-bold "],attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.composeState="publish"}}},[t._v("Publish now")])])])])])]),t._v(" "),t._m(6)])])]):t._e(),t._v(" "),"loop"==t.composeType?i("div",[i("div",{staticClass:"card"},[i("div",{staticClass:"card-body"},[i("button",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("Upload Loop")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType=""}}},[t._v("Back")])])])]):t._e(),t._v(" "),"story"==t.composeType?i("div",[i("div",{staticClass:"card"},[i("div",{staticClass:"card-body"},[i("button",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("Add to Story")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("New Story")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType=""}}},[t._v("Back")])])])]):t._e()])},[function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-link text-dark no-caret dropdown-toggle",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",title:"Post options"}},[e("span",{staticClass:"fas fa-ellipsis-v fa-lg text-muted"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-center mb-0 font-weight-bold text-white"},[e("i",{staticClass:"fas fa-plus mr-1"}),this._v(" Add Photo")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row"},[e("div",{staticClass:"d-none d-block-sm col-sm-2 px-0 text-center"},[e("i",{staticClass:"fas fa-globe"})]),this._v(" "),e("div",{staticClass:"col-12 col-sm-10 pl-2"},[e("p",{staticClass:"font-weight-bold mb-0"},[this._v("Public")]),this._v(" "),e("p",{staticClass:"small mb-0"},[this._v("Anyone can see")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row"},[e("div",{staticClass:"d-none d-block-sm col-sm-2 px-0 text-center"},[e("i",{staticClass:"fas fa-lock"})]),this._v(" "),e("div",{staticClass:"col-12 col-sm-10 pl-2"},[e("p",{staticClass:"font-weight-bold mb-0"},[this._v("Followers Only")]),this._v(" "),e("p",{staticClass:"small mb-0"},[this._v("Only followers can see")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row"},[e("div",{staticClass:"d-none d-block-sm col-sm-2 px-0 text-center"},[e("i",{staticClass:"fas fa-lock"})]),this._v(" "),e("div",{staticClass:"col-12 col-sm-10 pl-2"},[e("p",{staticClass:"font-weight-bold mb-0"},[this._v("Unlisted")]),this._v(" "),e("p",{staticClass:"small mb-0"},[this._v("Not listed on public timelines")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-primary btn-sm dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[e("span",{staticClass:"sr-only"},[this._v("Toggle Dropdown")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"card-footer py-1"},[e("p",{staticClass:"text-center mb-0 font-weight-bold text-muted small"},[this._v("Having issues? You can also use the "),e("a",{attrs:{href:"/i/compose"}},[this._v("Classic Compose UI")]),this._v(".")])])}],!1,null,"6a8c0d62",null);e.default=a.exports}},[[7,0]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"6xxe":function(t,e,i){var o=i("tMzE");"string"==typeof o&&(o=[[t.i,o,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};i("aET+")(o,s);o.locals&&(t.exports=o.locals)},7:function(t,e,i){t.exports=i("K0g3")},"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 i=e.protocol+"//"+e.host,o=i+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var s,n=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(n)?t:(s=0===n.indexOf("//")?n:0===n.indexOf("/")?i+n:o+n.replace(/^\.\//,""),"url("+JSON.stringify(s)+")")})}},ByOI:function(t,e,i){"use strict";var o=i("6xxe");i.n(o).a},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i=function(t,e){var i=t[1]||"",o=t[3];if(!o)return i;if(e&&"function"==typeof btoa){var s=(a=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),n=o.sources.map(function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"});return[i].concat(n).concat([s]).join("\n")}var a;return[i].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+i+"}":i}).join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},s=0;s=0&&d.splice(e,1)}function h(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return i.nc}();o&&(t.attrs.nonce=o)}return b(e,t.attrs),m(t,e),e}function b(t,e){Object.keys(e).forEach(function(i){t.setAttribute(i,e[i])})}function g(t,e){var i,o,s,n;if(e.transform&&t.css){if(!(n="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=n}if(e.singleton){var a=c++;i=l||(l=h(e)),o=_.bind(null,i,a,!1),s=_.bind(null,i,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),m(t,e),e}(e),o=function(t,e,i){var o=i.css,s=i.sourceMap,n=void 0===e.convertToAbsoluteUrls&&s;(e.convertToAbsoluteUrls||n)&&(o=u(o));s&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */");var a=new Blob([o],{type:"text/css"}),r=t.href;t.href=URL.createObjectURL(a),r&&URL.revokeObjectURL(r)}.bind(null,i,e),s=function(){v(i),i.href&&URL.revokeObjectURL(i.href)}):(i=h(e),o=function(t,e){var i=e.css,o=e.media;o&&t.setAttribute("media",o);if(t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}.bind(null,i),s=function(){v(i)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else s()}}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=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var i=f(t,e);return p(i,e),function(t){for(var o=[],s=0;s=t.config.uploader.album_limit)swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error");else{var o=e.type,s=t.config.uploader.media_types.split(",");if(-1!=$.inArray(o,s)){var n=new FormData;n.append("file",e);var a={onUploadProgress:function(e){var i=Math.round(100*e.loaded/e.total);t.uploadProgress=i}};axios.post("/api/v1/media",n,a).then(function(e){t.uploadProgress=100,t.ids.push(e.data.id),t.media.push(e.data),setTimeout(function(){t.uploading=!1},1e3)}).catch(function(i){t.uploading=!1,e.value=null,swal("Oops, something went wrong!","An unexpected error occurred.","error")}),e.value=null,t.uploadProgress=0}else swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.config.uploader.media_types+" only.","error")}})})},toggleFilter:function(t,e){this.media[this.carouselCursor].filter_class=e},updateMedia:function(){this.mediaDrawer=!1},deleteMedia:function(){var t=this;if(0!=window.confirm("Are you sure you want to delete this photo?")){var e=this.media[this.carouselCursor].id;axios.delete("/api/v1/media",{params:{id:e}}).then(function(e){1==t.media.length&&(t.mediaDrawer=!1,t.ids=[],t.media=[],t.carouselCursor=0),t.ids.splice(t.carouselCursor,1),t.media.splice(t.carouselCursor,1)}).catch(function(t){swal("Whoops!","An error occured when attempting to delete this, please try again","error")})}},mediaAltText:function(){},mediaLicense:function(){},compose:function(){var t=this.composeState;if(100==this.uploadProgress&&0!=this.ids.length)switch(t){case"publish":if(0==this.media.length)return void swal("Whoops!","You need to add media before you can save this!","warning");"Add optional caption..."==this.composeText&&(this.composeText="");var e={media:this.media,caption:this.composeText,visibility:this.visibility,cw:this.nsfw};return void axios.post("/api/v2/status/compose",e).then(function(t){var e=t.data;window.location.href=e}).catch(function(t){swal("Oops, something went wrong!","An unexpected error occurred.","error")});case"delete":return this.mediaDrawer=!1,this.ids=[],this.media=[],this.carouselCursor=0,this.composeText="",this.composeTextLength=0,void $("#composeModal").modal("hide")}},about:function(){var t=document.createElement("div");t.innerHTML='\n\t\t\t\t

Please visit the Sharing Media page for more info.

\n\t\t\t',swal({title:"Compose UI v3",content:t,icon:"info"})},closeModal:function(){this.composeType="",$("#composeModal").modal("hide")},composeMessage:function(){var t=this.config;this.composeType;return t.uploader.media_types.includes("video/mp4")?"Click here to add photos or videos":"Click here to add photos"}}},s=(i("ByOI"),i("KHd+")),n=Object(s.a)(o,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t.composeType?t._e():i("div",[i("div",{staticClass:"card"},[i("div",{staticClass:"card-body"},[i("button",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("Compose Post")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="loop"}}},[t._v("Create Loop")])])])]),t._v(" "),"post"==t.composeType?i("div",[i("input",{staticClass:"d-none file-input",attrs:{type:"file",name:"media",multiple:"",accept:t.config.uploader.media_types}}),t._v(" "),i("div",{staticClass:"timeline"},[i("div",{staticClass:"card status-card card-md-rounded-0"},[i("div",{staticClass:"card-header d-inline-flex align-items-center bg-white"},[i("img",{staticClass:"box-shadow",staticStyle:{"border-radius":"32px"},attrs:{src:t.profile.avatar,width:"32px",height:"32px"}}),t._v(" "),i("a",{staticClass:"username font-weight-bold pl-2 text-dark",attrs:{href:t.profile.url}},[t._v("\n\t\t\t\t\t"+t._s(t.profile.username)+"\n\t\t\t\t")]),t._v(" "),i("div",{staticClass:"text-right",staticStyle:{"flex-grow":"1"}},[i("div",{staticClass:"dropdown"},[t._m(0),t._v(" "),i("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.media.length>0,expression:"media.length > 0"}],staticClass:"dropdown-item small font-weight-bold",on:{click:function(e){t.mediaDrawer=!t.mediaDrawer}}},[t._v(t._s(t.mediaDrawer?"Hide":"Show")+" Media Toolbar")]),t._v(" "),i("div",{staticClass:"dropdown-item small font-weight-bold",on:{click:t.about}},[t._v("About")]),t._v(" "),i("a",{staticClass:"dropdown-item small font-weight-bold",attrs:{href:"/i/compose"}},[t._v("Classic Compose UI")]),t._v(" "),i("div",{staticClass:"dropdown-divider"}),t._v(" "),i("div",{staticClass:"dropdown-item small font-weight-bold",on:{click:t.closeModal}},[t._v("Close")])])])])]),t._v(" "),i("div",{staticClass:"postPresenterContainer"},[t.uploading?i("div",[i("div",{staticClass:"w-100 h-100 bg-light py-5",staticStyle:{"border-bottom":"1px solid #f1f1f1"}},[i("div",{staticClass:"p-5"},[i("b-progress",{attrs:{value:t.uploadProgress,max:100,striped:"",animated:!0}}),t._v(" "),i("p",{staticClass:"text-center mb-0 font-weight-bold"},[t._v("Uploading ... ("+t._s(t.uploadProgress)+"%)")])],1)])]):i("div",[t.ids.length>0&&t.ids.length!=t.config.uploader.album_limit?i("div",{staticClass:"card-header py-2 bg-primary m-2 rounded cursor-pointer",on:{click:function(e){return t.addMedia(e)}}},[t._m(1)]):t._e(),t._v(" "),0==t.ids.length?i("div",{staticClass:"w-100 h-100 bg-light py-5 cursor-pointer",staticStyle:{"border-bottom":"1px solid #f1f1f1"},on:{click:function(e){return t.addMedia(e)}}},[i("p",{staticClass:"text-center mb-0 font-weight-bold p-5"},[t._v(t._s(t.composeMessage()))])]):t._e(),t._v(" "),t.ids.length>0?i("div",[i("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333"},attrs:{id:"p-carousel",controls:"",indicators:"",background:"#ffffff",interval:0},model:{value:t.carouselCursor,callback:function(e){t.carouselCursor=e},expression:"carouselCursor"}},t._l(t.media,function(e,o){return t.ids.length>0?i("b-carousel-slide",{key:"preview_media_"+o},[i("div",{class:[t.media[o].filter_class?t.media[o].filter_class:""],staticStyle:{display:"flex","min-height":"320px","align-items":"center"},attrs:{slot:"img"},slot:"img"},[i("img",{staticClass:"d-block img-fluid w-100",attrs:{src:e.url,alt:e.description,title:e.description}})])]):t._e()}),1)],1):t._e(),t._v(" "),t.ids.length>0?i("div",{staticClass:"bg-dark align-items-center"},[i("ul",{staticClass:"nav media-drawer-filters text-center"},[i("li",{staticClass:"nav-item"},[i("div",{staticClass:"p-1 pt-3"},[i("img",{staticClass:"cursor-pointer",attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}})]),t._v(" "),i("a",{class:[null==t.media[t.carouselCursor].filter_class?"nav-link text-white active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleFilter(e,null)}}},[t._v("No Filter")])]),t._v(" "),t._l(t.filters,function(e,o){return i("li",{staticClass:"nav-item"},[i("div",{staticClass:"p-1 pt-3"},[i("img",{class:e[1],attrs:{src:t.media[t.carouselCursor].url,width:"100px",height:"60px"},on:{click:function(i){return i.preventDefault(),t.toggleFilter(i,e[1])}}})]),t._v(" "),i("a",{class:[t.media[t.carouselCursor].filter_class==e[1]?"nav-link text-white active":"nav-link text-muted"],attrs:{href:"#"},on:{click:function(i){return i.preventDefault(),t.toggleFilter(i,e[1])}}},[t._v(t._s(e[0]))])])})],2)]):t._e()]),t._v(" "),t.mediaDrawer?i("div",{staticClass:"bg-lighter p-2 row"},[i("div",{staticClass:"col-12"},[i("div",{staticClass:"form-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].alt,expression:"media[carouselCursor].alt"}],staticClass:"form-control",attrs:{type:"text",placeholder:"Optional image description"},domProps:{value:t.media[t.carouselCursor].alt},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"alt",e.target.value)}}})]),t._v(" "),i("div",{staticClass:"form-group"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.media[t.carouselCursor].license,expression:"media[carouselCursor].license"}],staticClass:"form-control",attrs:{type:"text",placeholder:"Optional media license"},domProps:{value:t.media[t.carouselCursor].license},on:{input:function(e){e.target.composing||t.$set(t.media[t.carouselCursor],"license",e.target.value)}}})])]),t._v(" "),i("div",{staticClass:"col-12 text-right pt-2"},[i("button",{staticClass:"btn btn-outline-danger btn-sm font-weight-bold mr-1",on:{click:function(e){return t.deleteMedia()}}},[t._v("Delete Photo")]),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-sm font-weight-bold",on:{click:function(e){return t.updateMedia()}}},[t._v("Hide Media Toolbar")])])]):t._e()]),t._v(" "),i("div",{staticClass:"card-body p-0"},[i("div",{staticClass:"caption"},[i("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control mb-0 border-0 rounded-0",attrs:{rows:"3",placeholder:"Add an optional caption"},domProps:{value:t.composeText},on:{input:function(e){e.target.composing||(t.composeText=e.target.value)}}})])]),t._v(" "),i("div",{staticClass:"card-footer"},[i("div",{staticClass:"d-flex justify-content-between align-items-center"},[i("div",[i("div",{staticClass:"custom-control custom-switch d-inline mr-3"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.nsfw,expression:"nsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"nsfwToggle"},domProps:{checked:Array.isArray(t.nsfw)?t._i(t.nsfw,null)>-1:t.nsfw},on:{change:function(e){var i=t.nsfw,o=e.target,s=!!o.checked;if(Array.isArray(i)){var n=t._i(i,null);o.checked?n<0&&(t.nsfw=i.concat([null])):n>-1&&(t.nsfw=i.slice(0,n).concat(i.slice(n+1)))}else t.nsfw=s}}}),t._v(" "),i("label",{staticClass:"custom-control-label small font-weight-bold text-muted pt-1",attrs:{for:"nsfwToggle"}},[t._v("NSFW")])]),t._v(" "),i("div",{staticClass:"dropdown d-inline"},[i("button",{staticClass:"btn btn-outline-secondary btn-sm py-0 dropdown-toggle",attrs:{type:"button",id:"visibility","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(t.visibility[0].toUpperCase()+t.visibility.slice(1))+"\n\t\t\t\t\t\t\t")]),t._v(" "),i("div",{staticClass:"dropdown-menu",staticStyle:{width:"200px"},attrs:{"aria-labelledby":"visibility"}},[i("a",{class:["public"==t.visibility?"dropdown-item active":"dropdown-item"],attrs:{href:"#","data-id":"public","data-title":"Public"},on:{click:function(e){e.preventDefault(),t.visibility="public"}}},[t._m(2)]),t._v(" "),i("a",{class:["private"==t.visibility?"dropdown-item active":"dropdown-item"],attrs:{href:"#","data-id":"private","data-title":"Followers Only"},on:{click:function(e){e.preventDefault(),t.visibility="private"}}},[t._m(3)]),t._v(" "),i("a",{class:["unlisted"==t.visibility?"dropdown-item active":"dropdown-item"],attrs:{href:"#","data-id":"private","data-title":"Unlisted"},on:{click:function(e){e.preventDefault(),t.visibility="unlisted"}}},[t._m(4)])])])]),t._v(" "),i("div",{staticClass:"small text-muted font-weight-bold"},[t._v("\n\t\t\t\t\t\t"+t._s(t.composeText.length)+" / "+t._s(t.config.uploader.max_caption_length)+"\n\t\t\t\t\t")]),t._v(" "),i("div",{staticClass:"pl-md-5"},[i("div",{staticClass:"btn-group"},[i("button",{staticClass:"btn btn-primary btn-sm font-weight-bold",attrs:{type:"button"},on:{click:function(e){return t.compose()}}},[t._v(t._s(t.composeState[0].toUpperCase()+t.composeState.slice(1)))]),t._v(" "),t._m(5),t._v(" "),i("div",{staticClass:"dropdown-menu dropdown-menu-right"},[i("a",{class:["publish"==t.composeState?"dropdown-item font-weight-bold active":"dropdown-item font-weight-bold "],attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.composeState="publish"}}},[t._v("Publish now")])])])])])]),t._v(" "),t._m(6)])])]):t._e(),t._v(" "),"loop"==t.composeType?i("div",[i("div",{staticClass:"card"},[i("div",{staticClass:"card-body"},[i("button",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("Upload Loop")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType=""}}},[t._v("Back")])])])]):t._e(),t._v(" "),"story"==t.composeType?i("div",[i("div",{staticClass:"card"},[i("div",{staticClass:"card-body"},[i("button",{staticClass:"btn btn-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("Add to Story")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-primary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType="post"}}},[t._v("New Story")]),t._v(" "),i("hr"),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-block font-weight-bold",attrs:{type:"button"},on:{click:function(e){t.composeType=""}}},[t._v("Back")])])])]):t._e()])},[function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-link text-dark no-caret dropdown-toggle",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",title:"Post options"}},[e("span",{staticClass:"fas fa-ellipsis-v fa-lg text-muted"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-center mb-0 font-weight-bold text-white"},[e("i",{staticClass:"fas fa-plus mr-1"}),this._v(" Add Photo")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row"},[e("div",{staticClass:"d-none d-block-sm col-sm-2 px-0 text-center"},[e("i",{staticClass:"fas fa-globe"})]),this._v(" "),e("div",{staticClass:"col-12 col-sm-10 pl-2"},[e("p",{staticClass:"font-weight-bold mb-0"},[this._v("Public")]),this._v(" "),e("p",{staticClass:"small mb-0"},[this._v("Anyone can see")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row"},[e("div",{staticClass:"d-none d-block-sm col-sm-2 px-0 text-center"},[e("i",{staticClass:"fas fa-lock"})]),this._v(" "),e("div",{staticClass:"col-12 col-sm-10 pl-2"},[e("p",{staticClass:"font-weight-bold mb-0"},[this._v("Followers Only")]),this._v(" "),e("p",{staticClass:"small mb-0"},[this._v("Only followers can see")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"row"},[e("div",{staticClass:"d-none d-block-sm col-sm-2 px-0 text-center"},[e("i",{staticClass:"fas fa-lock"})]),this._v(" "),e("div",{staticClass:"col-12 col-sm-10 pl-2"},[e("p",{staticClass:"font-weight-bold mb-0"},[this._v("Unlisted")]),this._v(" "),e("p",{staticClass:"small mb-0"},[this._v("Not listed on public timelines")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-primary btn-sm dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[e("span",{staticClass:"sr-only"},[this._v("Toggle Dropdown")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"card-footer py-1"},[e("p",{staticClass:"text-center mb-0 font-weight-bold text-muted small"},[this._v("Having issues? You can also use the "),e("a",{attrs:{href:"/i/compose"}},[this._v("Classic Compose UI")]),this._v(".")])])}],!1,null,"305388b0",null);e.default=n.exports}},[[7,0]]]); \ No newline at end of file diff --git a/public/js/search.js b/public/js/search.js index c9d3c67a4..ff8d6be2d 100644 --- a/public/js/search.js +++ b/public/js/search.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{8:function(t,s,e){t.exports=e("EnJJ")},EnJJ:function(t,s,e){Vue.component("search-results",e("IpYn").default)},IpYn:function(t,s,e){"use strict";e.r(s);var a={props:["query","profileId"],data:function(){return{loading:!0,networkError:!1,results:{hashtags:[],profiles:[],statuses:[]},filters:{hashtags:!0,profiles:!0,statuses:!0}}},beforeMount:function(){this.fetchSearchResults()},mounted:function(){$(".search-bar input").val(this.query)},updated:function(){},methods:{fetchSearchResults:function(){var t=this;axios.get("/api/search",{params:{q:this.query,src:"metro",v:1}}).then(function(s){var e=s.data;t.results.hashtags=e.hashtags,t.results.profiles=e.profiles,t.results.statuses=e.posts,t.loading=!1}).catch(function(s){t.loading=!1})},followProfile:function(t){axios.post("/i/follow",{item:t}).then(function(t){window.location.href=window.location.href}).catch(function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")})}}},r=e("KHd+"),i=Object(r.a)(a,function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"container"},[t.loading?e("div",{staticClass:"pt-5 text-center"},[t._m(0)]):t._e(),t._v(" "),t.networkError?e("div",{staticClass:"pt-5 text-center"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.networkError?t._e():e("div",{staticClass:"mt-5 row"},[e("div",{staticClass:"col-12 col-md-3 mb-4"},[t.results.hashtags||t.results.profiles||t.results.statuses?e("div",[e("p",{staticClass:"font-weight-bold"},[t._v("Filters")]),t._v(" "),e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.hashtags,expression:"filters.hashtags"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"filter1"},domProps:{checked:Array.isArray(t.filters.hashtags)?t._i(t.filters.hashtags,null)>-1:t.filters.hashtags},on:{change:function(s){var e=t.filters.hashtags,a=s.target,r=!!a.checked;if(Array.isArray(e)){var i=t._i(e,null);a.checked?i<0&&t.$set(t.filters,"hashtags",e.concat([null])):i>-1&&t.$set(t.filters,"hashtags",e.slice(0,i).concat(e.slice(i+1)))}else t.$set(t.filters,"hashtags",r)}}}),t._v(" "),e("label",{staticClass:"custom-control-label text-muted font-weight-light",attrs:{for:"filter1"}},[t._v("Show Hashtags")])]),t._v(" "),e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.profiles,expression:"filters.profiles"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"filter2"},domProps:{checked:Array.isArray(t.filters.profiles)?t._i(t.filters.profiles,null)>-1:t.filters.profiles},on:{change:function(s){var e=t.filters.profiles,a=s.target,r=!!a.checked;if(Array.isArray(e)){var i=t._i(e,null);a.checked?i<0&&t.$set(t.filters,"profiles",e.concat([null])):i>-1&&t.$set(t.filters,"profiles",e.slice(0,i).concat(e.slice(i+1)))}else t.$set(t.filters,"profiles",r)}}}),t._v(" "),e("label",{staticClass:"custom-control-label text-muted font-weight-light",attrs:{for:"filter2"}},[t._v("Show Profiles")])]),t._v(" "),e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.statuses,expression:"filters.statuses"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"filter3"},domProps:{checked:Array.isArray(t.filters.statuses)?t._i(t.filters.statuses,null)>-1:t.filters.statuses},on:{change:function(s){var e=t.filters.statuses,a=s.target,r=!!a.checked;if(Array.isArray(e)){var i=t._i(e,null);a.checked?i<0&&t.$set(t.filters,"statuses",e.concat([null])):i>-1&&t.$set(t.filters,"statuses",e.slice(0,i).concat(e.slice(i+1)))}else t.$set(t.filters,"statuses",r)}}}),t._v(" "),e("label",{staticClass:"custom-control-label text-muted font-weight-light",attrs:{for:"filter3"}},[t._v("Show Statuses")])])]):t._e()]),t._v(" "),e("div",{staticClass:"col-12 col-md-9"},[e("p",{staticClass:"h5 font-weight-bold"},[t._v("Showing results for "),e("i",[t._v(t._s(t.query))])]),t._v(" "),e("hr"),t._v(" "),t.filters.hashtags&&t.results.hashtags?e("div",{staticClass:"row mb-4"},[e("p",{staticClass:"col-12 font-weight-bold text-muted"},[t._v("Hashtags")]),t._v(" "),t._l(t.results.hashtags,function(s,a){return e("a",{staticClass:"col-12 col-md-3 mb-3",staticStyle:{"text-decoration":"none"},attrs:{href:s.url}},[e("div",{staticClass:"card card-body text-center"},[e("p",{staticClass:"lead mb-0 text-truncate text-dark",attrs:{"data-toggle":"tooltip",title:s.value}},[t._v("\n\t\t\t\t\t\t\t#"+t._s(s.value)+"\n\t\t\t\t\t\t")]),t._v(" "),e("p",{staticClass:"lead mb-0 small font-weight-bold text-dark"},[t._v("\n\t\t\t\t\t\t\t"+t._s(s.count)+" posts\n\t\t\t\t\t\t")])])])})],2):t._e(),t._v(" "),t.filters.profiles&&t.results.profiles?e("div",{staticClass:"row mb-4"},[e("p",{staticClass:"col-12 font-weight-bold text-muted"},[t._v("Profiles")]),t._v(" "),t._l(t.results.profiles,function(s,a){return e("a",{staticClass:"col-12 col-md-4 mb-3",staticStyle:{"text-decoration":"none"},attrs:{href:s.url}},[e("div",{staticClass:"card card-body text-center"},[e("p",{staticClass:"text-center"},[e("img",{staticClass:"rounded-circle box-shadow",attrs:{src:s.entity.thumb,width:"32px",height:"32px"}})]),t._v(" "),e("p",{staticClass:"font-weight-bold text-truncate text-dark"},[t._v("\n\t\t\t\t\t\t\t"+t._s(s.value)+"\n\t\t\t\t\t\t")]),t._v(" "),e("p",{staticClass:"mb-0 text-center"},[e("button",{class:[s.entity.following?"btn btn-secondary btn-sm py-1 font-weight-bold":"btn btn-primary btn-sm py-1 font-weight-bold"],on:{click:function(e){return t.followProfile(s.entity.id)}}},[t._v("\n\t\t\t\t\t\t\t \t"+t._s(s.entity.following?"Unfollow":"Follow")+"\n\t\t\t\t\t\t\t ")])])])])})],2):t._e(),t._v(" "),t.filters.statuses&&t.results.statuses?e("div",{staticClass:"row mb-4"},[e("p",{staticClass:"col-12 font-weight-bold text-muted"},[t._v("Statuses")]),t._v(" "),t._l(t.results.statuses,function(s,a){return e("a",{staticClass:"col-12 col-md-4 mb-3",staticStyle:{"text-decoration":"none"},attrs:{href:s.url}},[e("div",{staticClass:"card"},[e("img",{staticClass:"card-img-top img-fluid",staticStyle:{height:"180px"},attrs:{src:s.thumb}}),t._v(" "),e("div",{staticClass:"card-body text-center "},[e("p",{staticClass:"mb-0 small text-truncate font-weight-bold text-muted",domProps:{innerHTML:t._s(s.value)}})])])])})],2):t._e(),t._v(" "),t.results.hashtags||t.results.profiles||t.results.statuses?t._e():e("div",[e("p",{staticClass:"text-center lead"},[t._v("No results found!")])])])])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"spinner-border",attrs:{role:"status"}},[s("span",{staticClass:"sr-only"},[this._v("Loading…")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",{staticClass:"lead font-weight-lighter"},[this._v("An error occured, results could not be loaded."),s("br"),this._v(" Please try again later.")])}],!1,null,"245503ce",null);s.default=i.exports},"KHd+":function(t,s,e){"use strict";function a(t,s,e,a,r,i,l,o){var n,c="function"==typeof t?t.options:t;if(s&&(c.render=s,c.staticRenderFns=e,c._compiled=!0),a&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),l?(n=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(l)},c._ssrRegister=n):r&&(n=o?function(){r.call(this,this.$root.$options.shadowRoot)}:r),n)if(c.functional){c._injectStyles=n;var u=c.render;c.render=function(t,s){return n.call(s),u(t,s)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,n):[n]}return{exports:t,options:c}}e.d(s,"a",function(){return a})}},[[8,0]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{8:function(t,s,e){t.exports=e("EnJJ")},EnJJ:function(t,s,e){Vue.component("search-results",e("IpYn").default)},IpYn:function(t,s,e){"use strict";e.r(s);var a={props:["query","profileId"],data:function(){return{loading:!0,networkError:!1,results:{hashtags:[],profiles:[],statuses:[]},filters:{hashtags:!0,profiles:!0,statuses:!0}}},beforeMount:function(){this.fetchSearchResults()},mounted:function(){$(".search-bar input").val(this.query)},updated:function(){},methods:{fetchSearchResults:function(){var t=this;axios.get("/api/search",{params:{q:this.query,src:"metro",v:1}}).then(function(s){var e=s.data;t.results.hashtags=e.hashtags,t.results.profiles=e.profiles,t.results.statuses=e.posts,t.loading=!1}).catch(function(s){t.loading=!1})},followProfile:function(t){axios.post("/i/follow",{item:t}).then(function(t){window.location.href=window.location.href}).catch(function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")})}}},r=e("KHd+"),i=Object(r.a)(a,function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"container"},[t.loading?e("div",{staticClass:"pt-5 text-center"},[t._m(0)]):t._e(),t._v(" "),t.networkError?e("div",{staticClass:"pt-5 text-center"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.networkError?t._e():e("div",{staticClass:"mt-5 row"},[e("div",{staticClass:"col-12 col-md-3 mb-4"},[t.results.hashtags||t.results.profiles||t.results.statuses?e("div",[e("p",{staticClass:"font-weight-bold"},[t._v("Filters")]),t._v(" "),e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.hashtags,expression:"filters.hashtags"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"filter1"},domProps:{checked:Array.isArray(t.filters.hashtags)?t._i(t.filters.hashtags,null)>-1:t.filters.hashtags},on:{change:function(s){var e=t.filters.hashtags,a=s.target,r=!!a.checked;if(Array.isArray(e)){var i=t._i(e,null);a.checked?i<0&&t.$set(t.filters,"hashtags",e.concat([null])):i>-1&&t.$set(t.filters,"hashtags",e.slice(0,i).concat(e.slice(i+1)))}else t.$set(t.filters,"hashtags",r)}}}),t._v(" "),e("label",{staticClass:"custom-control-label text-muted font-weight-light",attrs:{for:"filter1"}},[t._v("Show Hashtags")])]),t._v(" "),e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.profiles,expression:"filters.profiles"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"filter2"},domProps:{checked:Array.isArray(t.filters.profiles)?t._i(t.filters.profiles,null)>-1:t.filters.profiles},on:{change:function(s){var e=t.filters.profiles,a=s.target,r=!!a.checked;if(Array.isArray(e)){var i=t._i(e,null);a.checked?i<0&&t.$set(t.filters,"profiles",e.concat([null])):i>-1&&t.$set(t.filters,"profiles",e.slice(0,i).concat(e.slice(i+1)))}else t.$set(t.filters,"profiles",r)}}}),t._v(" "),e("label",{staticClass:"custom-control-label text-muted font-weight-light",attrs:{for:"filter2"}},[t._v("Show Profiles")])]),t._v(" "),e("div",{staticClass:"custom-control custom-checkbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.statuses,expression:"filters.statuses"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"filter3"},domProps:{checked:Array.isArray(t.filters.statuses)?t._i(t.filters.statuses,null)>-1:t.filters.statuses},on:{change:function(s){var e=t.filters.statuses,a=s.target,r=!!a.checked;if(Array.isArray(e)){var i=t._i(e,null);a.checked?i<0&&t.$set(t.filters,"statuses",e.concat([null])):i>-1&&t.$set(t.filters,"statuses",e.slice(0,i).concat(e.slice(i+1)))}else t.$set(t.filters,"statuses",r)}}}),t._v(" "),e("label",{staticClass:"custom-control-label text-muted font-weight-light",attrs:{for:"filter3"}},[t._v("Show Statuses")])])]):t._e()]),t._v(" "),e("div",{staticClass:"col-12 col-md-9"},[e("p",{staticClass:"h5 font-weight-bold"},[t._v("Showing results for "),e("i",[t._v(t._s(t.query))])]),t._v(" "),e("hr"),t._v(" "),t.filters.hashtags&&t.results.hashtags?e("div",{staticClass:"row mb-4"},[e("p",{staticClass:"col-12 font-weight-bold text-muted"},[t._v("Hashtags")]),t._v(" "),t._l(t.results.hashtags,function(s,a){return e("a",{staticClass:"col-12 col-md-3 mb-3",staticStyle:{"text-decoration":"none"},attrs:{href:s.url}},[e("div",{staticClass:"card card-body text-center"},[e("p",{staticClass:"lead mb-0 text-truncate text-dark",attrs:{"data-toggle":"tooltip",title:s.value}},[t._v("\n\t\t\t\t\t\t\t#"+t._s(s.value)+"\n\t\t\t\t\t\t")]),t._v(" "),e("p",{staticClass:"lead mb-0 small font-weight-bold text-dark"},[t._v("\n\t\t\t\t\t\t\t"+t._s(s.count)+" posts\n\t\t\t\t\t\t")])])])})],2):t._e(),t._v(" "),t.filters.profiles&&t.results.profiles?e("div",{staticClass:"row mb-4"},[e("p",{staticClass:"col-12 font-weight-bold text-muted"},[t._v("Profiles")]),t._v(" "),t._l(t.results.profiles,function(s,a){return e("a",{staticClass:"col-12 col-md-4 mb-3",staticStyle:{"text-decoration":"none"},attrs:{href:s.url}},[e("div",{staticClass:"card card-body text-center"},[e("p",{staticClass:"text-center"},[e("img",{staticClass:"rounded-circle box-shadow",attrs:{src:s.entity.thumb,width:"32px",height:"32px"}})]),t._v(" "),e("p",{staticClass:"font-weight-bold text-truncate text-dark"},[t._v("\n\t\t\t\t\t\t\t"+t._s(s.value)+"\n\t\t\t\t\t\t")]),t._v(" "),e("p",{staticClass:"mb-0 text-center"},[e("button",{class:[s.entity.following?"btn btn-secondary btn-sm py-1 font-weight-bold":"btn btn-primary btn-sm py-1 font-weight-bold"],on:{click:function(e){return t.followProfile(s.entity.id)}}},[t._v("\n\t\t\t\t\t\t\t \t"+t._s(s.entity.following?"Unfollow":"Follow")+"\n\t\t\t\t\t\t\t ")])])])])})],2):t._e(),t._v(" "),t.filters.statuses&&t.results.statuses?e("div",{staticClass:"row mb-4"},[e("p",{staticClass:"col-12 font-weight-bold text-muted"},[t._v("Statuses")]),t._v(" "),t._l(t.results.statuses,function(s,a){return e("a",{staticClass:"col-12 col-md-4 mb-3",staticStyle:{"text-decoration":"none"},attrs:{href:s.url}},[e("div",{staticClass:"card"},[e("img",{staticClass:"card-img-top img-fluid",attrs:{src:s.thumb}}),t._v(" "),e("div",{staticClass:"card-body text-center "},[e("p",{staticClass:"mb-0 small text-truncate font-weight-bold text-muted",domProps:{innerHTML:t._s(s.value)}})])])])})],2):t._e(),t._v(" "),t.results.hashtags||t.results.profiles||t.results.statuses?t._e():e("div",[e("p",{staticClass:"text-center lead"},[t._v("No results found!")])])])])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"spinner-border",attrs:{role:"status"}},[s("span",{staticClass:"sr-only"},[this._v("Loading…")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",{staticClass:"lead font-weight-lighter"},[this._v("An error occured, results could not be loaded."),s("br"),this._v(" Please try again later.")])}],!1,null,"f2044b98",null);s.default=i.exports},"KHd+":function(t,s,e){"use strict";function a(t,s,e,a,r,i,l,o){var n,c="function"==typeof t?t.options:t;if(s&&(c.render=s,c.staticRenderFns=e,c._compiled=!0),a&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),l?(n=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(l)},c._ssrRegister=n):r&&(n=o?function(){r.call(this,this.$root.$options.shadowRoot)}:r),n)if(c.functional){c._injectStyles=n;var u=c.render;c.render=function(t,s){return n.call(s),u(t,s)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,n):[n]}return{exports:t,options:c}}e.d(s,"a",function(){return a})}},[[8,0]]]); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 4861a2bef..297dd213b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -7,12 +7,12 @@ "/css/appdark.css": "/css/appdark.css?id=34cd81dd9c8bc68cfd51", "/css/landing.css": "/css/landing.css?id=1ea686af4c64df5018fc", "/js/components.js": "/js/components.js?id=97c7f6876bb4e5c9ffd8", - "/js/compose.js": "/js/compose.js?id=3e59092826085624eec5", + "/js/compose.js": "/js/compose.js?id=7077e64f269d90f9543b", "/js/developers.js": "/js/developers.js?id=4dba6abdc3ae8ec8c222", "/js/discover.js": "/js/discover.js?id=b9b5d3d054cadf63aed2", "/js/loops.js": "/js/loops.js?id=d5c7e9d0d6a44553dd0d", "/js/profile.js": "/js/profile.js?id=def2cef049018dddfa02", - "/js/search.js": "/js/search.js?id=17415228e1fb52528d0c", + "/js/search.js": "/js/search.js?id=95c893b755e132a1d7e1", "/js/status.js": "/js/status.js?id=9cfc5c6a05070fad66e8", "/js/timeline.js": "/js/timeline.js?id=c8346c0cf7265df6196e" }