Working upload
This commit is contained in:
parent
66da437148
commit
3edc4c3965
1 changed files with 69 additions and 60 deletions
|
@ -12,6 +12,8 @@
|
||||||
<aside class="hook__page__content">
|
<aside class="hook__page__content">
|
||||||
<div class="inner-wrap">
|
<div class="inner-wrap">
|
||||||
|
|
||||||
|
<template v-if="!isLoading">
|
||||||
|
|
||||||
<div class="hook__page__content__meme left">
|
<div class="hook__page__content__meme left">
|
||||||
<img v-bind:src="backgroundImage" id="base-image" alt="" />
|
<img v-bind:src="backgroundImage" id="base-image" alt="" />
|
||||||
<canvas id="meme-canvas" width="400" height="300">Sorry, canvas not supported</canvas>
|
<canvas id="meme-canvas" width="400" height="300">Sorry, canvas not supported</canvas>
|
||||||
|
@ -85,6 +87,8 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
<div class="xs12" v-if="isLoading">
|
<div class="xs12" v-if="isLoading">
|
||||||
<div class="loader"></div>
|
<div class="loader"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -124,6 +128,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
valid: false,
|
valid: false,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
loadingMessage: '',
|
||||||
topLine: 'This is an example meme',
|
topLine: 'This is an example meme',
|
||||||
bottomLine: 'that I made',
|
bottomLine: 'that I made',
|
||||||
title: '',
|
title: '',
|
||||||
|
@ -169,7 +174,11 @@ export default {
|
||||||
submit () {
|
submit () {
|
||||||
var component = this;
|
var component = this;
|
||||||
component.isLoading = true;
|
component.isLoading = true;
|
||||||
component.$http.post('https://lbry.tech/upload-image', document.getElementById('meme-canvas').toDataURL('image/jpeg', 0.6)).then(function(response) {
|
component.$http.post('/upload-image', document.getElementById('meme-canvas').toDataURL('image/jpeg', 0.6), {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'text/plain'
|
||||||
|
}
|
||||||
|
}).then(function(response) {
|
||||||
component.isLoading = false;
|
component.isLoading = false;
|
||||||
console.log(response);
|
console.log(response);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue