This commit is contained in:
@@ -212,42 +212,44 @@
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>{{ $ay.t("InsertImage") }}</v-card-title>
|
||||
<div>
|
||||
<v-tabs grow color="primary">
|
||||
<v-tab>URL</v-tab>
|
||||
<v-tab>{{ $ay.t("Attachments") }}</v-tab>
|
||||
|
||||
<v-tab-item
|
||||
><div class="ma-6">
|
||||
<v-text-field
|
||||
v-model="imageUrl"
|
||||
:label="$ay.t('ImageUrl')"
|
||||
></v-text-field>
|
||||
<v-text-field
|
||||
v-model="imageText"
|
||||
:label="$ay.t('ImageDescription')"
|
||||
></v-text-field></div
|
||||
></v-tab-item>
|
||||
<v-tab-item
|
||||
><div class="ma-6">
|
||||
<v-select
|
||||
:label="$ay.t('Attachments')"
|
||||
v-model="selectedImageAttachment"
|
||||
:items="availableAttachments()"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
></v-select>
|
||||
<!--
|
||||
<div>
|
||||
<v-tabs v-model="imageTab" grow color="primary">
|
||||
<v-tab key="url">URL</v-tab>
|
||||
<v-tab key="file">{{ $ay.t("Attachments") }}</v-tab>
|
||||
<v-tabs-items v-model="imageTab">
|
||||
<v-tab-item key="url"
|
||||
><div class="ma-6">
|
||||
<v-text-field
|
||||
v-model="imageUrl"
|
||||
:label="$ay.t('ImageUrl')"
|
||||
></v-text-field>
|
||||
<v-text-field
|
||||
v-model="imageText"
|
||||
:label="$ay.t('ImageDescription')"
|
||||
></v-text-field></div
|
||||
></v-tab-item>
|
||||
<v-tab-item key="file"
|
||||
><div class="ma-6">
|
||||
<v-select
|
||||
:label="$ay.t('Attachments')"
|
||||
v-model="selectedImageAttachment"
|
||||
:items="availableAttachments()"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
></v-select>
|
||||
<!--
|
||||
<v-file-input
|
||||
:label="$ay.t('AttachFile')"
|
||||
prepend-icon="fa-paperclip"
|
||||
></v-file-input> -->
|
||||
|
||||
<v-text-field
|
||||
v-model="imageText"
|
||||
:label="$ay.t('ImageDescription')"
|
||||
></v-text-field></div
|
||||
></v-tab-item>
|
||||
<v-text-field
|
||||
v-model="imageText"
|
||||
:label="$ay.t('ImageDescription')"
|
||||
></v-text-field></div
|
||||
></v-tab-item>
|
||||
</v-tabs-items>
|
||||
</v-tabs>
|
||||
</div>
|
||||
<v-card-actions>
|
||||
@@ -256,9 +258,12 @@
|
||||
<v-btn text @click="imageMenu = false">{{
|
||||
$ay.t("Cancel")
|
||||
}}</v-btn>
|
||||
<v-btn color="primary" text @click="editClick('image')">{{
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
<v-btn
|
||||
color="primary"
|
||||
text
|
||||
@click="editClick('image', imageTab)"
|
||||
>{{ $ay.t("OK") }}</v-btn
|
||||
>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-menu>
|
||||
@@ -362,6 +367,7 @@ export default {
|
||||
linkUrl: "",
|
||||
linkText: "",
|
||||
imageMenu: false,
|
||||
imageTab: null,
|
||||
imageUrl: "",
|
||||
imageText: "",
|
||||
selectedImageAttachment: null
|
||||
@@ -727,24 +733,28 @@ export default {
|
||||
case "image":
|
||||
//")
|
||||
{
|
||||
//todo: ATTACHEDFILEMODE
|
||||
this.imageMenu = false;
|
||||
let url = this.imageUrl;
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
let txt = this.imageText;
|
||||
//force it to a full url so it doesn't attempt to open it as a SPA window
|
||||
if (!url.includes(":")) {
|
||||
url = "https://" + url;
|
||||
}
|
||||
|
||||
if (txt) {
|
||||
this.replaceSelectedText(
|
||||
" \n' + txt //keep original selected text otherwise it will vanish
|
||||
);
|
||||
if (ex == 1) {
|
||||
throw "Attachment mode TODO";
|
||||
//todo: ATTACHEDFILEMODE//attached file mode?
|
||||
} else {
|
||||
this.replaceSelectedText("");
|
||||
this.imageMenu = false;
|
||||
let url = this.imageUrl;
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
let txt = this.imageText;
|
||||
//force it to a full url so it doesn't attempt to open it as a SPA window
|
||||
if (!url.includes(":")) {
|
||||
url = "https://" + url;
|
||||
}
|
||||
|
||||
if (txt) {
|
||||
this.replaceSelectedText(
|
||||
" \n' + txt //keep original selected text otherwise it will vanish
|
||||
);
|
||||
} else {
|
||||
this.replaceSelectedText("");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user