2016-11-06 18:28:37 +00:00
|
|
|
<template>
|
2023-05-08 17:49:44 +00:00
|
|
|
<button
|
2023-04-24 20:01:29 +00:00
|
|
|
class="media-upload"
|
2023-05-08 17:49:44 +00:00
|
|
|
:class="[normalButton ? 'button-default btn' : 'button-unstyled', { disabled }]"
|
2020-11-24 10:32:42 +00:00
|
|
|
:title="$t('tool_tip.media_upload')"
|
2023-04-24 18:57:31 +00:00
|
|
|
@click="onClick"
|
2020-05-07 13:10:53 +00:00
|
|
|
>
|
2020-11-24 10:32:42 +00:00
|
|
|
<FAIcon
|
|
|
|
v-if="uploading"
|
|
|
|
class="progress-icon"
|
|
|
|
icon="circle-notch"
|
|
|
|
spin
|
|
|
|
/>
|
|
|
|
<FAIcon
|
|
|
|
v-if="!uploading"
|
|
|
|
class="new-icon"
|
|
|
|
icon="upload"
|
|
|
|
/>
|
2023-04-24 18:57:31 +00:00
|
|
|
<template v-if="normalButton">
|
|
|
|
{{ ' ' }}
|
|
|
|
{{ uploading ? $t('general.loading') : $t('tool_tip.media_upload') }}
|
|
|
|
</template>
|
2020-11-24 10:32:42 +00:00
|
|
|
<input
|
|
|
|
v-if="uploadReady"
|
2023-04-24 20:01:29 +00:00
|
|
|
ref="input"
|
2022-05-09 20:07:55 +00:00
|
|
|
class="hidden-input-file"
|
2020-11-24 10:32:42 +00:00
|
|
|
:disabled="disabled"
|
|
|
|
type="file"
|
|
|
|
multiple="true"
|
2023-04-24 18:57:31 +00:00
|
|
|
:accept="acceptTypes"
|
2023-04-24 20:01:29 +00:00
|
|
|
@change="change"
|
2019-07-05 07:17:44 +00:00
|
|
|
>
|
2023-05-08 17:49:44 +00:00
|
|
|
</button>
|
2016-11-06 18:28:37 +00:00
|
|
|
</template>
|
|
|
|
|
2022-07-31 09:35:48 +00:00
|
|
|
<script src="./media_upload.js"></script>
|
2016-11-06 18:28:37 +00:00
|
|
|
|
2019-11-11 19:45:40 +00:00
|
|
|
<style lang="scss">
|
2023-01-09 18:02:16 +00:00
|
|
|
@import "../../variables";
|
2020-05-07 13:10:53 +00:00
|
|
|
|
2019-09-15 09:28:52 +00:00
|
|
|
.media-upload {
|
2022-05-09 20:07:55 +00:00
|
|
|
.hidden-input-file {
|
2022-05-16 20:46:32 +00:00
|
|
|
display: none;
|
2022-05-09 20:07:55 +00:00
|
|
|
}
|
2019-09-15 09:28:52 +00:00
|
|
|
}
|
2023-04-24 18:57:31 +00:00
|
|
|
|
|
|
|
label.media-upload {
|
|
|
|
cursor: pointer; // We use <label> for interactivity... i wonder if it's fine
|
|
|
|
}
|
|
|
|
</style>
|