@ -18,36 +18,41 @@
< div >
< div >
< div class = "text-center mt-8" >
< div class = "text-center mt-8" >
< div >
< template v-if ="isRegistered" >
< font -awesome
< div >
icon = "camera"
class = "bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-2 rounded-md"
@ click = "openPhotoDialog()"
/ >
< / div >
< div class = "mt-4" >
< input type = "file" @change ="uploadImageFile" / >
< / div >
< div class = "mt-4" >
< span class = "mt-2" >
... or paste a URL :
< input v -model = " imageUrl " type = "text" class = "border-2" / >
< / span >
< span class = "ml-2" >
< font -awesome
< font -awesome
v - if = "imageUrl"
icon = "camera"
icon = "check"
class = "bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-2 rounded-md"
class = "bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-2 rounded-md cursor-pointer"
@ click = "openPhotoDialog()"
@ click = "acceptUrl"
/ >
/ >
<!-- so that there ' s no shifting when it becomes visible -- >
< / div >
< font -awesome
< div class = "mt-4" >
v - else
< input type = "file" @change ="uploadImageFile" / >
icon = "check"
< / div >
class = "text-white bg-white px-2 py-2"
< div class = "mt-4" >
/ >
< span class = "mt-2" >
< / span >
... or paste a URL :
< / div >
< input v -model = " imageUrl " type = "text" class = "border-2" / >
< / span >
< span class = "ml-2" >
< font -awesome
v - if = "imageUrl"
icon = "check"
class = "bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-2 py-2 rounded-md cursor-pointer"
@ click = "acceptUrl"
/ >
<!-- so that there ' s no shifting when it becomes visible -- >
< font -awesome
v - else
icon = "check"
class = "text-white bg-white px-2 py-2"
/ >
< / span >
< / div >
< / template >
< template v-else >
< div class = "text-center text-lg text-slate-500 py-12" > Register to Upload a Photo < / div >
< / template >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
@ -67,6 +72,12 @@ const inputImageFileNameRef = ref<Blob>();
@ Component ( {
@ Component ( {
components : { PhotoDialog } ,
components : { PhotoDialog } ,
props : {
isRegistered : {
type : Boolean ,
default : true ,
} ,
} ,
} )
} )
export default class ImageMethodDialog extends Vue {
export default class ImageMethodDialog extends Vue {
$notify ! : ( notification : NotificationIface , timeout ? : number ) => void ;
$notify ! : ( notification : NotificationIface , timeout ? : number ) => void ;