aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/attachment/attachment.js2
-rw-r--r--src/components/attachment/attachment.vue2
-rw-r--r--src/components/flash/flash.js16
-rw-r--r--src/components/flash/flash.vue15
-rw-r--r--src/services/file_type/file_type.service.js4
5 files changed, 39 insertions, 0 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index 5f5779a0..8849f501 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -1,4 +1,5 @@
import StillImage from '../still-image/still-image.vue'
+import Flash from '../flash/flash.vue'
import VideoAttachment from '../video_attachment/video_attachment.vue'
import nsfwImage from '../../assets/nsfw.png'
import fileTypeService from '../../services/file_type/file_type.service.js'
@@ -43,6 +44,7 @@ const Attachment = {
}
},
components: {
+ Flash,
StillImage,
VideoAttachment
},
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue
index 2c1c1682..2102127d 100644
--- a/src/components/attachment/attachment.vue
+++ b/src/components/attachment/attachment.vue
@@ -117,6 +117,8 @@
<!-- eslint-enable vue/no-v-html -->
</div>
</div>
+
+ <Flash v-if="type === 'flash'" :src="attachment.large_thumb_url || attachment.url" />
</div>
</template>
diff --git a/src/components/flash/flash.js b/src/components/flash/flash.js
new file mode 100644
index 00000000..f768ead8
--- /dev/null
+++ b/src/components/flash/flash.js
@@ -0,0 +1,16 @@
+const Flash = {
+ props: [
+ 'src'
+ ],
+ created: function () {
+ this.$nextTick(function () {
+ const ruffle = window.RufflePlayer.newest()
+ const player = ruffle.createPlayer()
+ const container = this.$refs.cunt
+ container.appendChild(player)
+ player.load(this.src)
+ })
+ }
+}
+
+export default Flash
diff --git a/src/components/flash/flash.vue b/src/components/flash/flash.vue
new file mode 100644
index 00000000..510fe6d2
--- /dev/null
+++ b/src/components/flash/flash.vue
@@ -0,0 +1,15 @@
+<template>
+ <div
+ class="Flash"
+ ref="cunt"
+ />
+</template>
+
+<script src="./flash.js"></script>
+
+<style lang="scss">
+@import '../../_variables.scss';
+.Flash {
+ display: block;
+}
+</style>
diff --git a/src/services/file_type/file_type.service.js b/src/services/file_type/file_type.service.js
index 2a046bec..5182ecd1 100644
--- a/src/services/file_type/file_type.service.js
+++ b/src/services/file_type/file_type.service.js
@@ -2,6 +2,10 @@
// or the entire service could be just mimetype service that only operates
// on mimetypes and not files. Currently the naming is confusing.
const fileType = mimetype => {
+ if (mimetype.match(/flash/)) {
+ return 'flash'
+ }
+
if (mimetype.match(/text\/html/)) {
return 'html'
}