+
@@ -97,7 +109,7 @@
class="button button-default btn"
type="button"
:disabled="saveButtonDisabled"
- @click="(newUpload || this.remote !== undefined) ? uploadEmoji() : saveEditedEmoji()"
+ @click="(newUpload || remote !== undefined) ? uploadEmoji() : saveEditedEmoji()"
>
{{ $t('admin_dash.emoji.save') }}
@@ -137,10 +149,10 @@
import Popover from 'components/popover/popover.vue'
import ConfirmModal from 'components/confirm_modal/confirm_modal.vue'
import StillImage from 'components/still-image/still-image.vue'
-import Select from 'components/select/select.vue'
+import SelectComponent from 'components/select/select.vue'
export default {
- components: { Popover, ConfirmModal, StillImage, Select },
+ components: { Popover, ConfirmModal, StillImage, SelectComponent },
inject: ['emojiAddr'],
props: {
placement: {
@@ -171,16 +183,19 @@ export default {
// Only exists for emojis from remote packs
remote: {
- type: Object
+ type: Object,
+ default: undefined
},
knownLocalPacks: {
- type: Object
+ type: Object,
+ default: undefined
}
},
emits: ['updatePackFiles', 'displayError'],
data () {
return {
uploadFile: [],
+ uploadURL: "",
editedShortcode: this.shortcode,
editedFile: this.file,
deleteModalVisible: false,
@@ -191,6 +206,8 @@ export default {
emojiPreview () {
if (this.newUpload && this.uploadFile.length > 0) {
return URL.createObjectURL(this.uploadFile[0])
+ } else if (this.newUpload && this.uploadURL != "") {
+ return this.uploadURL
} else if (!this.newUpload) {
return this.emojiAddr(this.file)
}
@@ -202,7 +219,7 @@ export default {
},
saveButtonDisabled() {
if (this.remote === undefined)
- return this.newUpload ? this.uploadFile.length == 0 : !this.isEdited
+ return this.newUpload ? (this.uploadURL === "" && this.uploadFile.length == 0) : !this.isEdited
else
return this.copyToPack === ""
}
@@ -226,7 +243,8 @@ export default {
let packName = this.remote === undefined ? this.packName : this.copyToPack
this.$store.state.api.backendInteractor.addNewEmojiFile({
packName: packName,
- file: this.remote === undefined ? this.uploadFile[0] : this.emojiAddr(this.file),
+ file: this.remote === undefined ?
+ (this.uploadURL !== "" ? this.uploadURL : this.uploadFile[0]) : this.emojiAddr(this.file),
shortcode: this.editedShortcode,
filename: this.editedFile
}).then(resp => resp.json()).then(resp => {
@@ -271,13 +289,22 @@ export default {
padding-right: 0.5em;
padding-bottom: 0.5em;
+ .emoji-tab-popover-new-upload {
+ margin-bottom: 2em;
+ }
+
.emoji {
width: 32px;
height: 32px;
}
- .Select {
+ .SelectComponent {
display: inline-block;
}
+
+ h4 {
+ margin-bottom: 1em;
+ margin-top: 1em;
+ }
}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 39d0978a2..8bf3a9bc7 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -1205,6 +1205,8 @@
"adding_new": "Adding new emoji",
"shortcode": "Shortcode",
"filename": "Filename",
+ "emoji_source": "Emoji file source",
+ "upload_url": "Upload from URL",
"new_shortcode": "Shortcode, leave blank to infer",
"new_filename": "Filename, leave blank to infer",
"delete_confirm": "Are you sure you want to delete {0}?",