pleroma/priv/static/adminfe/static/js/chunk-c5f4.304479e7.js

2 lines
23 KiB
JavaScript
Raw Normal View History

2020-06-25 21:55:00 +02:00
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-c5f4"],{"26YS":function(e,t,a){"use strict";a.r(t);var o=a("o0o1"),s=a.n(o),i=a("yXPU"),c=a.n(i),l=a("MVZn"),n=a.n(l),r=a("mm8V"),m={props:{host:{type:String,required:!0},packName:{type:String,required:!0},shortcode:{type:String,required:!0},file:{type:String,required:!0},isLocal:{type:Boolean,required:!0}},data:function(){return{newShortcode:null,newFile:null,copyToLocalPackName:null,copyPopoverVisible:!1,copyToShortcode:"",copyToFilename:""}},computed:{emojiName:{get:function(){return null!==this.newShortcode?this.newShortcode:this.shortcode},set:function(e){this.newShortcode=e}},emojiFile:{get:function(){return null!==this.newFile?this.newFile:this.file},set:function(e){this.newFile=e}},isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device},localPacks:function(){return this.$store.state.emojiPacks.localPacks},remoteInstance:function(){return new URL(this.$store.state.emojiPacks.remoteInstance).host}},methods:{update:function(){var e=c()(s.a.mark(function e(){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.$store.dispatch("UpdateEmojiFile",{packName:this.packName,shortcode:this.shortcode,newShortcode:this.emojiName,newFilename:this.emojiFile,force:!0}),e.next=7;break;case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return");case 7:this.newShortcode=null,this.newFile=null,this.$store.dispatch("ReloadEmoji");case 10:case"end":return e.stop()}},e,this,[[0,4]])}));return function(){return e.apply(this,arguments)}}(),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("DeleteEmojiFile",{packName:e.packName,shortcode:e.shortcode}).then(function(){e.newShortcode=null,e.newFile=null,e.$store.dispatch("ReloadEmoji")})})},copyToLocal:function(){try{this.$store.dispatch("AddNewEmojiFile",{packName:this.copyToLocalPackName,file:this.addressOfEmojiInPack(this.remoteInstance,this.packName,this.file),shortcode:""!==this.copyToShortcode.trim()?this.copyToShortcode.trim():this.shortcode,filename:""!==this.copyToFilename.trim()?this.copyToFilename.trim():this.file})}catch(e){return}this.copyToLocalPackName=null,this.copyToLocalVisible=!1,this.copyToShortcode="",this.copyToFilename="",this.$store.dispatch("ReloadEmoji")},addressOfEmojiInPack:r.b}},p=(a("4ySm"),a("KHd+")),d=Object(p.a)(m,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[e.isLocal?a("div",{class:e.isMobile?"emoji-container-flex":"emoji-container-grid"},[a("img",{staticClass:"emoji-preview-img",attrs:{src:e.addressOfEmojiInPack(e.host,e.packName,e.file)}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{placeholder:e.$t("emoji.shortcode")},model:{value:e.emojiName,callback:function(t){e.emojiName=t},expression:"emojiName"}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{placeholder:e.$t("emoji.file")},model:{value:e.emojiFile,callback:function(t){e.emojiFile=t},expression:"emojiFile"}}),e._v(" "),a("div",{staticClass:"emoji-buttons"},[a("el-button",{attrs:{type:"primary"},on:{click:e.update}},[e._v(e._s(e.$t("emoji.update")))]),e._v(" "),a("el-button",{staticClass:"remove-emoji-button",on:{click:e.remove}},[e._v(e._s(e.$t("emoji.remove")))])],1)],1):e._e(),e._v(" "),e.isLocal?e._e():a("div",{class:e.isMobile?"emoji-container-flex":"remote-emoji-container-grid"},[a("img",{staticClass:"emoji-preview-img",attrs:{src:e.addressOfEmojiInPack(e.remoteInstance,e.packName,e.file)}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{value:e.emojiName,placeholder:e.$t("emoji.shortcode")}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{value:e.emojiFile,placeholder:e.$t("emoji.file")}}),e._v(" "),a("el-popover",{staticClass:"copy-pack-container",attrs:{placement:"left-start","popper-class":"copy-popover"},model:{value:e.copyPopoverVisible,callback:function(t){e.copyPopoverVisible=t},express
//# sourceMappingURL=chunk-c5f4.304479e7.js.map