quita el type=text de un textarea que no tiene que tenerlo

esther
Borja Robert 2 years ago
parent a0f3a24c89
commit 598b9e27cd

@ -1,8 +1,8 @@
<script> <script>
import { onMount } from 'svelte'; import { onMount } from "svelte";
import html2canvas from 'html2canvas'; import html2canvas from "html2canvas";
import Organized from '$lib/form/Organized.svelte'; import Organized from "$lib/form/Organized.svelte";
import Colabs from './Colabs.svelte'; import Colabs from "./Colabs.svelte";
import { import {
title, title,
heading, heading,
@ -13,18 +13,18 @@
weekday, weekday,
address, address,
city, city,
canvas canvas,
} from '$lib/stores/store'; } from "$lib/stores/store";
/** @type {HTMLDivElement} */ let editor; /** @type {HTMLDivElement} */ let editor;
const handleSubmit = async () => { const handleSubmit = async () => {
console.log('submit'); console.log("submit");
}; };
const getContent = () => { const getContent = () => {
if (!editor) { if (!editor) {
console.log('no hay editor'); console.log("no hay editor");
return; return;
} }
if (editor && editor.firstChild !== null) { if (editor && editor.firstChild !== null) {
@ -35,11 +35,11 @@
const saveCanvas = async () => { const saveCanvas = async () => {
if ($canvas !== undefined) { if ($canvas !== undefined) {
const img = await html2canvas($canvas, { scale: 2 }); const img = await html2canvas($canvas, { scale: 2 });
const image = img.toDataURL('image/png'); const image = img.toDataURL("image/png");
const data = new FormData(); const data = new FormData();
data.append('image', image); data.append("image", image);
data.append( data.append(
'content', "content",
JSON.stringify({ JSON.stringify({
title: $title, title: $title,
heading: $heading, heading: $heading,
@ -49,13 +49,13 @@
time: $time, time: $time,
weekday: $weekday, weekday: $weekday,
address: $address, address: $address,
city: $city city: $city,
}) })
); );
const req = await fetch('/admin', { const req = await fetch("/admin", {
method: 'POST', method: "POST",
body: data body: data,
}); });
console.log(req); console.log(req);
} }
@ -64,11 +64,11 @@
const downloadCanvas = async () => { const downloadCanvas = async () => {
if ($canvas !== undefined) { if ($canvas !== undefined) {
const res = await html2canvas($canvas, { scale: 2 }); const res = await html2canvas($canvas, { scale: 2 });
const image = res.toDataURL('image/png'); const image = res.toDataURL("image/png");
const link = document.createElement('a'); const link = document.createElement("a");
link.download = `${$date.split('-')[0]}-${$date.split('-')[1]}-${ link.download = `${$date.split("-")[0]}-${$date.split("-")[1]}-${
$date.split('-')[2].split('T')[0] $date.split("-")[2].split("T")[0]
}-${$city.replace(' ', '_')}-cartel.png`; }-${$city.replace(" ", "_")}-cartel.png`;
link.href = image; link.href = image;
link.click(); link.click();
} }
@ -76,21 +76,21 @@
const quillOptions = { const quillOptions = {
modules: { modules: {
toolbar: [['bold', 'italic']] toolbar: [["bold", "italic"]],
}, },
theme: 'snow' theme: "snow",
}; };
onMount(async () => { onMount(async () => {
const { default: Quill } = await import('quill'); const { default: Quill } = await import("quill");
let quill = new Quill(editor, { let quill = new Quill(editor, {
modules: { modules: {
toolbar: quillOptions toolbar: quillOptions,
}, },
theme: 'snow', theme: "snow",
placeholder: placeholder:
'Participan:\nFernando Marín (DMD)\nPresenta:\nFernanda del Castillo (DMD Asturias)' "Participan:\nFernando Marín (DMD)\nPresenta:\nFernanda del Castillo (DMD Asturias)",
}); });
}); });
</script> </script>
@ -113,7 +113,12 @@
<div class="form-group"> <div class="form-group">
<label for="subtitle">Subtítulo</label> <label for="subtitle">Subtítulo</label>
<input bind:value={$subtitle} type="text" name="subtitle" placeholder="Subtítulo" /> <input
bind:value={$subtitle}
type="text"
name="subtitle"
placeholder="Subtítulo"
/>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -134,7 +139,12 @@
</div> </div>
<div class="dayname"> <div class="dayname">
<label for="weekday">Día de la semana</label> <label for="weekday">Día de la semana</label>
<input bind:value={$weekday} type="text" name="weekday" placeholder="Ej. Lunes" /> <input
bind:value={$weekday}
type="text"
name="weekday"
placeholder="Ej. Lunes"
/>
</div> </div>
</div> </div>
@ -142,7 +152,6 @@
<label for="address">Dirección</label> <label for="address">Dirección</label>
<textarea <textarea
bind:value={$address} bind:value={$address}
type="text"
name="address" name="address"
placeholder="Ej. Calle del Abeto, 4" placeholder="Ej. Calle del Abeto, 4"
/> />

Loading…
Cancel
Save