anpassungen nach rebase
This commit is contained in:
parent
a441f3b515
commit
48e724f4e4
|
|
@ -174,7 +174,9 @@
|
||||||
case 'image_url_block':
|
case 'image_url_block':
|
||||||
el = {
|
el = {
|
||||||
...el,
|
...el,
|
||||||
|
value: {
|
||||||
url: ''
|
url: ''
|
||||||
|
}
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="image-form">
|
<div class="image-form">
|
||||||
<div v-if="!url" ref="uploadcare-panel"></div>
|
<div v-if="!value.url" ref="uploadcare-panel"></div>
|
||||||
<div v-if="url">
|
<div v-if="value.url">
|
||||||
<img :src="previewUrl">
|
<img :src="previewUrl">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
props: ['url', 'index'],
|
props: ['value', 'index'],
|
||||||
mounted() {
|
mounted() {
|
||||||
let uploadcarePanel = openImagePanel(this.$refs['uploadcare-panel']);
|
let uploadcarePanel = openImagePanel(this.$refs['uploadcare-panel']);
|
||||||
|
|
||||||
|
|
@ -37,14 +37,15 @@
|
||||||
function openImagePanel(panelElement) {
|
function openImagePanel(panelElement) {
|
||||||
return uploadcare.openPanel(panelElement, null, {
|
return uploadcare.openPanel(panelElement, null, {
|
||||||
tabs: ['file'],
|
tabs: ['file'],
|
||||||
publicKey: 'ad89e9f42d4f5532d176',
|
publicKey: '78212ff39934a59775ac',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
previewUrl: function() {
|
previewUrl: function() {
|
||||||
if (this.url) {
|
console.log(this.value);
|
||||||
return this.url + '-/preview/200x200/';
|
if (this.value && this.value.url) {
|
||||||
|
return this.value.url + '-/preview/200x200/';
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -29,7 +29,7 @@ def handle_content_blocks(content_data):
|
||||||
new_contents.append({
|
new_contents.append({
|
||||||
'type': 'image_url_block',
|
'type': 'image_url_block',
|
||||||
'value': {
|
'value': {
|
||||||
'url': bleach.clean(content['url'])
|
'url': bleach.clean(content['value']['url'])
|
||||||
}})
|
}})
|
||||||
elif content['type'] == 'link_block':
|
elif content['type'] == 'link_block':
|
||||||
new_contents.append({
|
new_contents.append({
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,10 @@ class NewContentBlockMutationTest(TestCase):
|
||||||
"contents": [
|
"contents": [
|
||||||
{
|
{
|
||||||
"type": "image_url_block",
|
"type": "image_url_block",
|
||||||
|
'value': {
|
||||||
"url": "/test.png"
|
"url": "/test.png"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"after": self.sibling_id
|
"after": self.sibling_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue