Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85805327
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/sticker_picker/sticker_picker.js b/src/components/sticker_picker/sticker_picker.js
index 894f5396ca..a920745584 100644
--- a/src/components/sticker_picker/sticker_picker.js
+++ b/src/components/sticker_picker/sticker_picker.js
@@ -1,67 +1,61 @@
/* eslint-env browser */
import statusPosterService from "../../services/status_poster/status_poster.service.js"
const StickerPicker = {
props: [
'visible',
],
data() {
return {
meta: {
stickers: []
},
path: ''
}
},
computed: {
pack () {
return this.$store.state.instance.stickers || []
}
},
methods: {
clear () {
this.meta = {
stickers: []
}
},
selectTab (tab) {
- this.path = '/static/' + tab.path
+ this.path = tab.path
const self = this;
- window.fetch(this.path + 'productInfo.meta')
+ window.fetch(this.path + 'pack.json')
.then((res) => {
if (res.ok) {
res.json().then((json) => {
self.meta = json
- for (var i in self.meta.stickers) {
- self.meta.stickers[i].previewImageUrl =
- this.path + self.meta.stickers[i].id + '_key@2x.png'
- self.meta.stickers[i].imageUrl =
- this.path + self.meta.stickers[i].id + '@2x.png'
- }
})
}
})
},
pick (sticker) {
const self = this;
const store = this.$store;
- window.fetch(sticker.imageUrl)
+ window.fetch(this.path + sticker)
.then((res) => {
res.blob().then((blob) => {
- var file = new File([blob], sticker.id + '.png', {mimetype: 'image/png'})
+ var file = new File([blob], sticker, {mimetype: 'image/png'})
var formData = new FormData()
formData.append('file', file)
statusPosterService.uploadMedia({ store, formData })
.then((fileData) => {
self.$emit('uploaded', fileData)
self.clear()
}, (error) => {
self.$emit('upload-failed', 'default')
})
})
})
}
}
}
export default StickerPicker
diff --git a/src/components/sticker_picker/sticker_picker.vue b/src/components/sticker_picker/sticker_picker.vue
index 88aa3a41aa..cd80b068c0 100644
--- a/src/components/sticker_picker/sticker_picker.vue
+++ b/src/components/sticker_picker/sticker_picker.vue
@@ -1,88 +1,88 @@
<template>
<div
v-if="visible"
class="sticker-picker"
>
<div
class="sticker-picker-panel"
>
<div
class="tab-switcher"
>
<div
class="tabs sticker-picker-tabs"
>
<div
v-for="tab in pack"
:key="tab.path"
class="tab-wrapper"
>
<button
class="tab tab-sticker"
@click="selectTab(tab)"
>
<img
- :src="'/static/'+tab.path+'tab_on@2x.png'"
+ :src="tab.path+'tab.png'"
>
</button>
</div>
</div>
<div
v-if="meta.stickers.length > 0"
class="sticker-picker-content"
>
<div
v-for="sticker in meta.stickers"
- :key="sticker.id"
+ :key="sticker"
class="sticker"
@click="pick(sticker)"
>
<img
- :src="sticker.previewImageUrl"
+ :src="path + sticker"
>
</div>
</div>
</div>
</div>
</div>
</template>
<script src="./sticker_picker.js"></script>
<style lang="scss">
.sticker-picker {
.sticker-picker-panel {
display: inline-block;
width: 100%;
.tabs {
.tab-wrapper {
height: 38px;
.tab {
img {
width: 40px;
}
}
}
}
.sticker-picker-content {
max-height: 300px;
overflow-y: scroll;
overflow-x: auto;
.sticker {
display: inline-block;
width: 71px;
height: 71px;
img {
width: 71px;
mix-blend-mode: luminosity;
&:hover {
mix-blend-mode: normal;
}
}
}
}
}
}
</style>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Oct 11, 7:26 AM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1785659
Default Alt Text
(4 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment