Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects

Upload files

Merged Pierre Jarriges requested to merge upload_files into master
23 files
+ 1070
73
Compare changes
  • Side-by-side
  • Inline
Files
23
"use strict";
const Article = require("../article");
const { images_url } = require("../constants");
const { fetch_post_article, fetch_article, fetch_update_article } = require("../xhr");
class CreateArticleForm {
@@ -23,6 +22,7 @@ class CreateArticleForm {
const metadata = Object.assign(this.state.output.metadata, {
[field]: e.target.value,
});
this.state.output.metadata = metadata;
}
@@ -166,22 +166,26 @@ class CreateArticleForm {
{
tag: "img",
style_rules: { minWidth: "100%", minHeight: "100%" },
src: img ? `${images_url}/${img}` : "",
src: img || "",
}
],
},
{
tag: "input",
type: "text",
placeholder: "image file name",
value: img,
oninput: e => {
tag: "select",
contents: [
{ tag: "option", value: "", contents: "choose", disabled: true, selected: !this.state.output.images[i] }
].concat((this.params.files_index.images || []).map(url => {
return {
tag: "option",
value: url,
selected: this.state.output.images[i] && this.state.output.images[i] === url,
contents: url.split("/").reverse()[0],
}
})),
onchange: e => {
this.state.output.images[i] = e.target.value;
}
},
{
tag: "button", contents: "OK",
onclick: this.refresh_images.bind(this)
this.refresh_images();
},
},
{
tag: "button", contents: "DEL",
@@ -234,7 +238,7 @@ class CreateArticleForm {
return {
tag: "img",
style_rules: { height: "100px", width: "auto" },
src: `${images_url}/${img}`
src: img
}
})
},
Loading