Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / priv / static / adminfe / static / js / chunk-1a7d.8173d81f.js
1 (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1a7d"],{"3XKG":function(e,t,a){},"5BBj":function(e,t,a){"use strict";var o=a("mK29");a.n(o).a},"8YcG":function(e,t,a){"use strict";var o=a("H3Pu");a.n(o).a},BHDh:function(e,t,a){"use strict";var o=a("JR8x");a.n(o).a},D45k:function(e,t,a){},H3Pu:function(e,t,a){},JR8x:function(e,t,a){},eGqU:function(e,t,a){"use strict";var o=a("D45k");a.n(o).a},mK29:function(e,t,a){},rCuO:function(e,t,a){"use strict";a.r(t);var o={props:{name:{type:String,required:!0}}},i=(a("vB9w"),a("KHd+")),n=Object(i.a)(o,function(){var e=this.$createElement,t=this._self._c||e;return t("el-row",{staticClass:"prop-row",attrs:{gutter:20}},[t("el-col",{attrs:{span:4}},[t("b",[this._v(this._s(this.name))])]),this._v(" "),t("el-col",{attrs:{span:10}},[this._t("default")],2)],1)},[],!1,null,null,null);n.options.__file="PropertyEditingRow.vue";var c=n.exports,s=a("qh4k"),l={props:{host:{type:String,required:!0},packName:{type:String,required:!0},name:{type:String,required:!0},file:{type:String,required:!0},isLocal:{type:Boolean,required:!0}},data:function(){return{newName:null,newFile:null,copyToLocalPackName:null,copyToLocalVisible:!1,copyToShortcode:"",copyToFilename:""}},computed:{modifyingName:{get:function(){return null!==this.newName?this.newName:this.name},set:function(e){this.newName=e}},modifyingFile:{get:function(){return null!==this.newFile?this.newFile:this.file},set:function(e){this.newFile=e}}},methods:{update:function(){var e=this;this.$store.dispatch("UpdateAndSavePackFile",{action:"update",packName:this.packName,oldName:this.name,newName:this.modifyingName,newFilename:this.modifyingFile}).then(function(){e.newName=null,e.newFile=null,e.$store.dispatch("ReloadEmoji")})},remove:function(){var e=this;this.$confirm("This will delete the emoji, are you sure?","Warning",{confirmButtonText:"Yes, delete the emoji",cancelButtonText:"No, leave it be",type:"warning"}).then(function(){e.$store.dispatch("UpdateAndSavePackFile",{action:"remove",packName:e.packName,name:e.name}).then(function(){e.newName=null,e.newFile=null,e.$store.dispatch("ReloadEmoji")})})},copyToLocal:function(){var e=this;this.$store.dispatch("UpdateAndSavePackFile",{action:"add",packName:this.copyToLocalPackName,shortcode:""!==this.copyToShortcode.trim()?this.copyToShortcode.trim():this.name,fileName:""!==this.copyToFilename.trim()?this.copyToFilename.trim():this.file,file:this.addressOfEmojiInPack(this.host,this.packName,this.file)}).then(function(){e.copyToLocalPackName=null,e.copyToLocalVisible=!1,e.copyToShortcode="",e.copyToFilename="",e.$store.dispatch("ReloadEmoji")})},addressOfEmojiInPack:s.a}},r=(a("BHDh"),Object(i.a)(l,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:4}},[e.isLocal?a("el-input",{attrs:{placeholder:"Name/Shortcode"},model:{value:e.modifyingName,callback:function(t){e.modifyingName=t},expression:"modifyingName"}}):a("el-input",{attrs:{value:e.modifyingName,placeholder:"Name/Shortcode"}})],1),e._v(" "),a("el-col",{attrs:{span:6}},[e.isLocal?a("el-input",{attrs:{placeholder:"File"},model:{value:e.modifyingFile,callback:function(t){e.modifyingFile=t},expression:"modifyingFile"}}):a("el-input",{attrs:{value:e.modifyingFile,placeholder:"File"}})],1),e._v(" "),e.isLocal?a("el-col",{attrs:{span:2}},[a("el-button",{attrs:{type:"primary"},on:{click:e.update}},[e._v("Update")])],1):e._e(),e._v(" "),e.isLocal?a("el-col",{attrs:{span:2}},[a("el-button",{attrs:{type:"danger"},on:{click:e.remove}},[e._v("Remove")])],1):e._e(),e._v(" "),e.isLocal?e._e():a("el-col",{attrs:{span:4}},[a("el-popover",{attrs:{placement:"bottom"},model:{value:e.copyToLocalVisible,callback:function(t){e.copyToLocalVisible=t},expression:"copyToLocalVisible"}},[a("p",[e._v("Select the local pack to copy to")]),e._v(" "),a("el-select",{attrs:{placeholder:"Local pack"},model:{value:e.copyToLocalPackName,callback:function(t){e.copyToLocalPackName=t},expression:"copyToLocalPackName"}},e._l(e.$store.state.emoji_packs.localPacks,function(e,t){return a("el-option",{key:t,attrs:{label:t,value:t}})}),1),e._v(" "),a("p",[e._v("Specify a custom shortcode (leave empty to use the same shortcode)")]),e._v(" "),a("el-input",{attrs:{placeholder:"Shortcode (optional)"},model:{value:e.copyToShortcode,callback:function(t){e.copyToShortcode=t},expression:"copyToShortcode"}}),e._v(" "),a("p",[e._v("Specify a custom filename (leavy empty to use the same filename)")]),e._v(" "),a("el-input",{attrs:{placeholder:"Filename (optional)"},model:{value:e.copyToFilename,callback:function(t){e.copyToFilename=t},expression:"copyToFilename"}}),e._v(" "),a("el-button",{staticClass:"copy-to-local-button",attrs:{disabled:!e.copyToLocalPackName,type:"success"},on:{click:e.copyToLocal}},[e._v("Copy")]),e._v(" "),a("el-button",{attrs:{slot:"reference",type:"primary"},slot:"reference"},[e._v("Copy to local pack...")])],1)],1),e._v(" "),a("el-col",{attrs:{span:2}},[a("img",{staticClass:"emoji-preview-img",attrs:{src:e.addressOfEmojiInPack(e.host,e.packName,e.file)}})])],1)},[],!1,null,null,null));r.options.__file="SingleEmojiEditor.vue";var p=r.exports,m={props:{packName:{type:String,required:!0}},data:function(){return{shortcode:"",imageUploadURL:"",customFileName:""}},methods:{upload:function(){var e=this,t=null;this.$refs.fileUpload.files.length>0?t=this.$refs.fileUpload.files[0]:""!==this.imageUploadURL.trim()&&(t=this.imageUploadURL),null!==t&&this.$store.dispatch("UpdateAndSavePackFile",{action:"add",packName:this.packName,shortcode:this.shortcode,file:t,fileName:this.customFileName}).then(function(){e.shortcode="",e.imageUploadURL="",e.$store.dispatch("ReloadEmoji")})}}},d=(a("8YcG"),Object(i.a)(m,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("h4",[e._v("Add new emoji to the pack")]),e._v(" "),a("el-row",{attrs:{gutter:20}},[a("el-col",{staticClass:"new-emoji-col",attrs:{span:4}},[a("el-input",{attrs:{placeholder:"Shortcode"},model:{value:e.shortcode,callback:function(t){e.shortcode=t},expression:"shortcode"}})],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("div",[a("h5",[e._v("Upload a file")])]),e._v("\n File name\n "),a("el-input",{attrs:{size:"mini",placeholder:"Custom file name (optional)"},model:{value:e.customFileName,callback:function(t){e.customFileName=t},expression:"customFileName"}}),e._v(" "),a("input",{ref:"fileUpload",attrs:{type:"file",accept:"image/*"}}),e._v(" "),a("div",{staticClass:"or"},[e._v("\n or\n ")]),e._v(" "),a("div",[a("h5",[e._v("Enter a URL")])]),e._v(" "),a("el-input",{attrs:{placeholder:"Image URL"},model:{value:e.imageUploadURL,callback:function(t){e.imageUploadURL=t},expression:"imageUploadURL"}}),e._v(" "),a("small",[e._v("\n (If both are filled, the file is used)\n ")])],1),e._v(" "),a("el-col",{staticClass:"new-emoji-col",attrs:{span:4}},[a("el-button",{attrs:{disabled:""==e.shortcode.trim()},on:{click:e.upload}},[e._v("Upload")])],1)],1)],1)},[],!1,null,null,null));d.options.__file="NewEmojiUploader.vue";var u={components:{PropEditingRow:c,SingleEmojiEditor:p,NewEmojiUploader:d.exports},props:{name:{type:String,required:!0},pack:{type:Object,required:!0},host:{type:String,required:!0},isLocal:{type:Boolean,required:!0}},data:function(){return{shownPackEmoji:[],downloadSharedAs:""}},computed:{share:{get:function(){return this.pack.pack["share-files"]},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"share-files",value:e})}},homepage:{get:function(){return this.pack.pack.homepage},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"homepage",value:e})}},description:{get:function(){return this.pack.pack.description},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"description",value:e})}},license:{get:function(){return this.pack.pack.license},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"license",value:e})}},fallbackSrc:{get:function(){return this.pack.pack["fallback-src"]},set:function(e){""!==e.trim()?this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src",value:e}):(this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src",value:null}),this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src-sha256",value:null}))}}},methods:{downloadFromInstance:function(){var e=this;this.$store.dispatch("DownloadFrom",{instanceAddress:this.host,packName:this.name,as:this.downloadSharedAs}).then(function(){return e.$store.dispatch("ReloadEmoji")}).then(function(){return e.$store.dispatch("SetLocalEmojiPacks")})},deletePack:function(){var e=this;this.$confirm("This will delete the pack, are you sure?","Warning",{confirmButtonText:"Yes, delete the pack",cancelButtonText:"No, leave it be",type:"warning"}).then(function(){e.$store.dispatch("DeletePack",{name:e.name}).then(function(){return e.$store.dispatch("ReloadEmoji")}).then(function(){return e.$store.dispatch("SetLocalEmojiPacks")})}).catch(function(){})},savePackMetadata:function(){this.$store.dispatch("SavePackMetadata",{packName:this.name})}}},h=(a("eGqU"),Object(i.a)(u,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("h2",[e._v(e._s(e.name))]),e._v(" "),a("prop-editing-row",{attrs:{name:"Share pack"}},[a("el-switch",{attrs:{disabled:!e.isLocal},model:{value:e.share,callback:function(t){e.share=t},expression:"share"}})],1),e._v(" "),a("prop-editing-row",{attrs:{name:"Homepage"}},[e.isLocal?a("el-input",{model:{value:e.homepage,callback:function(t){e.homepage=t},expression:"homepage"}}):a("el-input",{attrs:{value:e.homepage}})],1),e._v(" "),a("prop-editing-row",{attrs:{name:"Description"}},[e.isLocal?a("el-input",{attrs:{rows:2,type:"textarea"},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}}):a("el-input",{attrs:{rows:2,value:e.description,type:"textarea"}})],1),e._v(" "),a("prop-editing-row",{attrs:{name:"License"}},[e.isLocal?a("el-input",{model:{value:e.license,callback:function(t){e.license=t},expression:"license"}}):a("el-input",{attrs:{value:e.license}})],1),e._v(" "),a("prop-editing-row",{attrs:{name:"Fallback source"}},[e.isLocal?a("el-input",{model:{value:e.fallbackSrc,callback:function(t){e.fallbackSrc=t},expression:"fallbackSrc"}}):a("el-input",{attrs:{value:e.fallbackSrc}})],1),e._v(" "),e.fallbackSrc&&""!==e.fallbackSrc.trim()?a("prop-editing-row",{attrs:{name:"Fallback source SHA"}},[e._v("\n "+e._s(e.pack.pack["fallback-src-sha256"])+"\n ")]):e._e(),e._v(" "),e.isLocal?a("el-button",{attrs:{type:"success"},on:{click:e.savePackMetadata}},[e._v("Save pack metadata")]):e._e(),e._v(" "),a("el-collapse",{staticClass:"contents-collapse",model:{value:e.shownPackEmoji,callback:function(t){e.shownPackEmoji=t},expression:"shownPackEmoji"}},[a("el-collapse-item",{attrs:{name:e.name,title:"Show pack contents"}},[e.isLocal?a("new-emoji-uploader",{staticClass:"new-emoji-uploader",attrs:{"pack-name":e.name}}):e._e(),e._v(" "),a("h4",[e._v("Manage existing emoji")]),e._v(" "),e._l(e.pack.files,function(t,o){return a("single-emoji-editor",{key:o,attrs:{host:e.host,"pack-name":e.name,name:o,file:t,"is-local":e.isLocal}})})],2)],1),e._v(" "),e.isLocal?e._e():a("div",{staticClass:"shared-pack-dl-box"},[a("div",[e._v('\n This will download the "'+e._s(e.name)+'" pack to the current instance under the name\n "'+e._s(""===e.downloadSharedAs.trim()?e.name:e.downloadSharedAs)+'" (can be changed below).\n It will then be usable and shareable from the current instance.\n ')]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.downloadFromInstance}},[e._v("\n Download shared pack to current instance\n ")]),e._v(" "),a("el-input",{staticClass:"dl-as-input",attrs:{placeholder:"Download as (optional)"},model:{value:e.downloadSharedAs,callback:function(t){e.downloadSharedAs=t},expression:"downloadSharedAs"}})],1),e._v(" "),e.pack.pack["can-download"]?a("el-link",{attrs:{href:"//"+e.host+"/api/pleroma/emoji/packs/"+e.name+"/download_shared",type:"primary",target:"_blank"}},[e._v("\n Download pack archive\n ")]):e._e(),e._v(" "),e.isLocal?a("div",{staticClass:"pack-actions"},[a("el-button",{attrs:{type:"danger"},on:{click:e.deletePack}},[e._v("\n Delete the local pack\n ")])],1):e._e()],1)},[],!1,null,null,null));h.options.__file="EmojiPack.vue";var k={components:{EmojiPack:h.exports},data:function(){return{activeName:"local",remoteInstanceAddress:"",downloadFromState:null,newPackName:"",createNewPackVisible:!1}},mounted:function(){this.refreshLocalPacks()},methods:{createLocalPack:function(){var e=this;this.createNewPackVisible=!1,this.$store.dispatch("CreatePack",{name:this.newPackName}).then(function(){e.newPackName="",e.$store.dispatch("SetLocalEmojiPacks"),e.$store.dispatch("ReloadEmoji")})},refreshLocalPacks:function(){this.$store.dispatch("SetLocalEmojiPacks")},refreshRemotePacks:function(){this.$store.dispatch("SetRemoteEmojiPacks",{remoteInstance:this.remoteInstanceAddress})},reloadEmoji:function(){this.$store.dispatch("ReloadEmoji")},importFromFS:function(){var e=this;this.$store.dispatch("ImportFromFS").then(function(){e.$store.dispatch("SetLocalEmojiPacks"),e.$store.dispatch("ReloadEmoji")})}}},v=(a("5BBj"),Object(i.a)(k,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-container",{staticClass:"emoji-packs-container"},[a("el-header",[a("h1",[e._v("\n Emoji packs\n ")])]),e._v(" "),a("el-row",{staticClass:"local-packs-actions"},[a("el-button",{attrs:{type:"primary"},on:{click:e.reloadEmoji}},[e._v("\n Reload emoji\n ")]),e._v(" "),a("el-tooltip",{attrs:{effects:"dark",content:"Importing from the filesystem will scan the directories and import those without pack.json but with emoji.txt or without neither",placement:"bottom"}},[a("el-button",{attrs:{type:"success"},on:{click:e.importFromFS}},[e._v("\n Import packs from the server filesystem\n ")])],1)],1),e._v(" "),a("el-tabs",{model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"Local packs",name:"local"}},[a("div",[e._v("\n Local packs can be viewed and downloaded for backup here.\n ")]),e._v(" "),a("div",{staticClass:"local-packs-actions"},[a("el-popover",{attrs:{placement:"bottom",trigger:"click"},model:{value:e.createNewPackVisible,callback:function(t){e.createNewPackVisible=t},expression:"createNewPackVisible"}},[a("el-input",{attrs:{placeholder:"Name"},model:{value:e.newPackName,callback:function(t){e.newPackName=t},expression:"newPackName"}}),e._v(" "),a("el-button",{staticClass:"create-pack-button",attrs:{disabled:""===e.newPackName.trim(),type:"success"},on:{click:e.createLocalPack}},[e._v("\n Create\n ")]),e._v(" "),a("el-button",{attrs:{slot:"reference",type:"success"},slot:"reference"},[e._v("\n Create a new local pack\n ")])],1),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.refreshLocalPacks}},[e._v("\n Refresh local packs\n ")])],1),e._v(" "),e._l(e.$store.state.emoji_packs.localPacks,function(t,o){return a("div",{key:o},[a("emoji-pack",{attrs:{name:o,pack:t,host:e.$store.getters.authHost,"is-local":!0}}),e._v(" "),a("el-divider")],1)})],2),e._v(" "),a("el-tab-pane",{attrs:{label:"Remote packs",name:"remote"}},[a("el-input",{staticClass:"remote-instance-input",attrs:{placeholder:"Remote instance address"},model:{value:e.remoteInstanceAddress,callback:function(t){e.remoteInstanceAddress=t},expression:"remoteInstanceAddress"}}),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.refreshRemotePacks}},[e._v("\n Refresh remote packs\n ")]),e._v(" "),e._l(e.$store.state.emoji_packs.remotePacks,function(t,o){return a("div",{key:o},[a("emoji-pack",{attrs:{name:o,pack:t,host:e.remoteInstanceAddress,"is-local":!1}}),e._v(" "),a("el-divider")],1)})],2)],1)],1)},[],!1,null,null,null));v.options.__file="index.vue";t.default=v.exports},vB9w:function(e,t,a){"use strict";var o=a("3XKG");a.n(o).a}}]);
2 //# sourceMappingURL=chunk-1a7d.8173d81f.js.map