pixelfed/public/js/compose.js

28 lines
79 KiB
JavaScript
Raw Normal View History

2024-07-10 06:11:42 +00:00
(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([["/js/compose"],{"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=script&lang=js":
/*!*************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=script&lang=js ***!
\*************************************************************************************************************************************************************************************************************/(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>c});var i=s(/*! vue-cropperjs */"./node_modules/vue-cropperjs/dist/VueCropper.js"),a=(s(/*! cropperjs/dist/cropper.css */"./node_modules/cropperjs/dist/cropper.css"),s(/*! @trevoreyre/autocomplete-vue */"./node_modules/@trevoreyre/autocomplete-vue/dist/autocomplete.esm.js")),o=(s(/*! @trevoreyre/autocomplete-vue/dist/style.css */"./node_modules/@trevoreyre/autocomplete-vue/dist/style.css"),s(/*! vue-tribute */"./node_modules/vue-tribute/dist/vue-tribute.es.js")),l=s(/*! jquery */"./node_modules/jquery/dist/jquery.js");function n(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var s=Object.prototype.toString.call(t).slice(8,-1);"Object"===s&&t.constructor&&(s=t.constructor.name);if("Map"===s||"Set"===s)return Array.from(t);if("Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return r(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=t[s];return i}const c={components:{VueCropper:i.default,Autocomplete:a.default,VueTribute:o.default},data:function(){return{config:window.App.config,pageLoading:!1,profile:window._sharedData.curUser,composeText:"",composeTextLength:0,nsfw:!1,filters:[],currentFilter:!1,ids:[],media:[],carouselCursor:0,uploading:!1,uploadProgress:100,mode:"photo",modes:["photo","video","plain"],page:1,composeState:"publish",visibility:"public",visibilityTag:"Public",place:!1,commentsDisabled:!1,optimizeMedia:!0,mediaCropped:!1,pageTitle:"",cropper:{aspectRatio:1,viewMode:1,zoomable:!0,zoom:0},namedPages:["filteringMedia","cropPhoto","tagPeople","addLocation","advancedSettings","visibility","altText","addToCollection","schedulePost","mediaMetadata","addToStory","editMedia","cameraRoll","tagPeopleHelp","textOptions","licensePicker"],cameraRollMedia:[],taggedUsernames:[],taggedPeopleSearch:null,textMode:!1,tributeSettings:{noMatchTemplate:function(){return null},collection:[{trigger:"@",menuShowMinLength:2,values:function(t,e){axios.get("/api/compose/v0/search/mention",{params:{q:t}}).then((function(t){e(t.data)})).catch((function(t){}))}},{trigger:"#",menuShowMinLength:2,values:function(t,e){axios.get("/api/compose/v0/search/hashtag",{params:{q:t}}).then((function(t){e(t.data)})).catch((function(t){}))}}]},availableLicenses:[{id:1,name:"All Rights Reserved",title:""},{id:5,name:"Public Domain Work",title:""},{id:6,name:"Public Domain Dedication (CC0)",title:"CC0"},{id:11,name:"Attribution",title:"CC BY"},{id:12,name:"Attribution-ShareAlike",title:"CC BY-SA"},{id:13,name:"Attribution-NonCommercial",title:"CC BY-NC"},{id:14,name:"Attribution-NonCommercial-ShareAlike",title:"CC BY-NC-SA"},{id:15,name:"Attribution-NoDerivs",title:"CC BY-ND"},{id:16,name:"Attribution-NonCommercial-NoDerivs",title:"CC BY-NC-ND"}],licenseIndex:0,video:{title:"",description:""},composeSettings:{default_license:null,media_descriptions:!1},licenseId:1,licenseTitle:null,maxAltTextLength:140,pollOptionModel:null,pollOptions:[],pollExpiry:1440,postingPoll:!1,collections:[],collectionsSelected:[],collectionsLoaded:!1,collectionsPage:1,collectionsCanLoadMore:!1,spoilerText:void 0,isFilteringMedia:!1,filteringMediaTimeout:void 0,filteringRemainingCount:0,isPosting:!1}},computed:{spoilerTextLength:function(){return this.spoilerText?this.spoilerText.length:0}},beforeMount:function(){var t=this;this.filters=window.App.util.filters.sort(),axios.get("/api/compose/v0/settings").then((function(e){t.composeSettings=e.data,t.licenseId=t.composeSettings.default_license,t.maxAltT
/*!************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=template&id=4ec34072 ***!
\************************************************************************************************************************************************************************************************************************************************************************************************/(t,e,s)=>{"use strict";s.r(e),s.d(e,{render:()=>i,staticRenderFns:()=>a});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"compose-modal-component"},[e("input",{staticClass:"w-100 h-100 d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",multiple:"",accept:t.config.uploader.media_types}}),t._v(" "),e("canvas",{staticClass:"d-none",attrs:{id:"pr_canvas"}}),t._v(" "),e("img",{staticClass:"d-none",attrs:{id:"pr_img"}}),t._v(" "),e("div",{staticClass:"timeline"},[t.uploading?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0 w-100 h-100 bg-light py-3",staticStyle:{"border-bottom":"1px solid #f1f1f1"}},[e("div",{staticClass:"p-5 mt-2"},[e("b-progress",{attrs:{value:t.uploadProgress,max:100,striped:"",animated:!0}}),t._v(" "),e("p",{staticClass:"text-center mb-0 font-weight-bold"},[t._v("Uploading ... ("+t._s(t.uploadProgress)+"%)")])],1)])]):"cameraRoll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[t._m(0),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[t.cameraRollMedia.length>0?e("div",{staticClass:"row p-0 m-0"},t._l(t.cameraRollMedia,(function(t,s){return e("div",{class:[0==s?"col-12 p-0":"col-3 p-0"]},[e("div",{staticClass:"card info-overlay p-0 rounded-0 shadow-none border"},[e("div",{staticClass:"square"},[e("img",{staticClass:"square-content",attrs:{src:t.preview_url}})])])])})),0):e("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[e("span",{staticClass:"w-100 h-100"},[e("button",{staticClass:"btn btn-primary",attrs:{type:"button"}},[t._v("Upload")]),t._v(" "),e("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){return t.fetchCameraRollDrafts()}}},[t._v("Load Camera Roll")])])])])])]):"poll"==t.page?e("div",[e("div",{staticClass:"card status-card card-md-rounded-0",staticStyle:{display:"flex"}},[e("div",{staticClass:"card-header d-inline-flex align-items-center justify-content-between bg-white"},[t._m(1),t._v(" "),e("span",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tNew Poll\n\t\t\t\t\t")]),t._v(" "),t.postingPoll?e("span",[t._m(2)]):!t.postingPoll&&t.pollOptions.length>1&&t.composeText.length?e("button",{staticClass:"btn btn-primary btn-sm font-weight-bold",on:{click:t.postNewPoll}},[e("span",[t._v("Create Poll")])]):e("span",{staticClass:"font-weight-bold text-lighter"},[t._v("\n\t\t\t\t\t\tCreate Poll\n\t\t\t\t\t")])]),t._v(" "),e("div",{staticClass:"h-100 card-body p-0 border-top",staticStyle:{width:"100%","min-height":"400px"}},[e("div",{staticClass:"border-bottom mt-2"},[e("div",{staticClass:"media px-3"},[e("img",{staticClass:"rounded-circle",attrs:{src:t.profile.avatar,width:"42px",height:"42px"}}),t._v(" "),e("div",{staticClass:"media-body"},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted small d-none"},[t._v("Caption")]),t._v(" "),e("vue-tribute",{attrs:{options:t.tributeSettings}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.composeText,expression:"composeText"}],staticClass:"form-control border-0 rounded-0 no-focus",attrs:{rows:"3",placeholder:"Write a poll question..."},domProps:{value:t.composeText},on:{keyup:function(e){t.composeTextLength=t.composeText.length},input:function(e){e.target.composing||(t.composeText=e.target.value)}}})]),t._v(" "),e("p",{staticClass:"help-text small text-right text-muted mb-0"},[t._v(t._s(t.composeTextLength)+"/"+t._s(t.config.uploader.max_caption_length))])],1)])])]),t._v(" "),e("div",{staticClass:"p-3"},[e("p",{staticClass:"font-weight-bold text-muted small"},[t._v("\n\t\t\t\t\t\t\tPoll Options\n\t\t\t\t\t\t")]),t._v(" "),t.pollOptions.length<4?e("div",{staticClass:"form-grou
/*!****************************************!*\
!*** ./resources/assets/js/compose.js ***!
\****************************************/(t,e,s)=>{Vue.component("compose-modal",s(/*! ./components/ComposeModal.vue */"./resources/assets/js/components/ComposeModal.vue").default)},"./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss":
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss ***!
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>o});var i=s(/*! ../../../../node_modules/laravel-mix/node_modules/css-loader/dist/runtime/api.js */"./node_modules/laravel-mix/node_modules/css-loader/dist/runtime/api.js"),a=s.n(i)()((function(t){return t[1]}));a.push([t.id,".compose-modal-component .media-drawer-filters {\n overflow-x: auto;\n flex-wrap: unset;\n}\n.compose-modal-component .media-drawer-filters .nav-link {\n min-width: 100px;\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.compose-modal-component .media-drawer-filters .active {\n color: #fff;\n font-weight: bold;\n}\n@media (hover: none) and (pointer: coarse) {\n.compose-modal-component .media-drawer-filters::-webkit-scrollbar {\n display: none;\n}\n}\n.compose-modal-component .no-focus {\n border-color: none;\n outline: 0;\n box-shadow: none;\n}\n.compose-modal-component a.list-group-item {\n text-decoration: none;\n}\n.compose-modal-component a.list-group-item:hover {\n text-decoration: none;\n background-color: #f8f9fa;\n}\n.compose-modal-component .compose-action:hover {\n cursor: pointer;\n background-color: #f8f9fa;\n}\n.compose-modal-component .collections-list-group {\n max-height: 500px;\n overflow-y: auto;\n}\n.compose-modal-component .collections-list-group .list-group-item.active {\n color: #212529;\n border-color: #60a5fa !important;\n background-color: #dbeafe !important;\n}",""]);const o=a},"./node_modules/style-loader/dist/cjs.js!./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss":
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/style-loader/dist/cjs.js!./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss ***!
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>n});var i=s(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),a=s.n(i),o=s(/*! !!../../../../node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss */"./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss"),l={insert:"head",singleton:!1};a()(o.default,l);const n=o.default.locals||{}},"./resources/assets/js/components/ComposeModal.vue":
/*!*********************************************************!*\
!*** ./resources/assets/js/components/ComposeModal.vue ***!
\*********************************************************/(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>n});var i=s(/*! ./ComposeModal.vue?vue&type=template&id=4ec34072 */"./resources/assets/js/components/ComposeModal.vue?vue&type=template&id=4ec34072"),a=s(/*! ./ComposeModal.vue?vue&type=script&lang=js */"./resources/assets/js/components/ComposeModal.vue?vue&type=script&lang=js"),o={};for(const t in a)"default"!==t&&(o[t]=()=>a[t]);s.d(e,o);s(/*! ./ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss */"./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss");var l=(0,s(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */"./node_modules/vue-loader/lib/runtime/componentNormalizer.js").default)(a.default,i.render,i.staticRenderFns,!1,null,null,null);l.options.__file="resources/assets/js/components/ComposeModal.vue";const n=l.exports},"./resources/assets/js/components/ComposeModal.vue?vue&type=script&lang=js":
/*!*********************************************************************************!*\
!*** ./resources/assets/js/components/ComposeModal.vue?vue&type=script&lang=js ***!
\*********************************************************************************/(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>o});var i=s(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ComposeModal.vue?vue&type=script&lang=js */"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=script&lang=js"),a={};for(const t in i)"default"!==t&&(a[t]=()=>i[t]);s.d(e,a);const o=i.default},"./resources/assets/js/components/ComposeModal.vue?vue&type=template&id=4ec34072":
/*!***************************************************************************************!*\
!*** ./resources/assets/js/components/ComposeModal.vue?vue&type=template&id=4ec34072 ***!
\***************************************************************************************/(t,e,s)=>{"use strict";s.r(e);var i=s(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ComposeModal.vue?vue&type=template&id=4ec34072 */"./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=template&id=4ec34072"),a={};for(const t in i)"default"!==t&&(a[t]=()=>i[t]);s.d(e,a)},"./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss":
/*!******************************************************************************************************!*\
!*** ./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss ***!
\******************************************************************************************************/(t,e,s)=>{"use strict";s.r(e);var i=s(/*! -!../../../../node_modules/style-loader/dist/cjs.js!../../../../node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss */"./node_modules/style-loader/dist/cjs.js!./node_modules/laravel-mix/node_modules/css-loader/dist/cjs.js??clonedRuleSet-17.use[1]!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-17.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-17.use[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/assets/js/components/ComposeModal.vue?vue&type=style&index=0&id=4ec34072&lang=scss"),a={};for(const t in i)"default"!==t&&(a[t]=()=>i[t]);s.d(e,a)}},t=>{t.O(0,["/js/vendor"],(()=>{return e="./resources/assets/js/compose.js",t(t.s=e);var e}));t.O()}]);