Construye galerías de imágenes con Hive Translator 🇪🇸 🇬🇧
ENGLISH VERSION
Hello dear HiveDevs friends, today I come to present you one of the last functions I have added to HiveTranslator.com. But first let me have a small pitch.
Hive Translator is a translator and text formatter for Hive, developed by me, from Cuba 🇨🇺 for the blockchain. It is an accessibility tool that allows users to build bilingual posts for communities that allow it. And by the way, overcome the language barrier.
The feature I present to you today has little to do with the main function of the app. But it has been quite demanded by the community. It is an option of format to add image galleries to our posts. For this, it simply uses some javascript running on Flask to concatenate the markdown codes of images with those of a table and build a gallery. Next I show you the code fragment of said function.
Hola queridos amigos de HiveDevs, hoy vengo a presentarles una de las últimas funciones que he agregado a HiveTranslator.com. Pero antes permítanme un pequño pitch.
Hive Translator es un traductor y maquetador de textos para Hive, desarrollado por mí, desde Cuba 🇨🇺 para la blockchain. Se trata de una herramienta de accesibilidad que permite a los usuarios construír posts bilingues para las comunidades que así lo permitan. Y de paso, sortear la barrera lingüística.
El feature que les presento hoy no tiene mucho que ver con la función principal del app. Pero sí ha sido bastante demandada por la comunidiad. Se trata de una opción de formato para agregar galerías de imágenes a nuestros posts. Para ello, simplemente utiliza algo de javascript corriendo sobre Flask para concatenar los códigos markdown de imágenes con los de una tabla y construir una galería. A continuación les muestro el fragmento de código de dicha función.
function buildGallery() {
var textarea = document.getElementById('input-text');
var startPos = textarea.selectionStart;
var selectedText = textarea.value.substring(startPos);
var img1 = document.getElementById('image1');
var img2 = document.getElementById('image2');
var img3 = document.getElementById('image3');
var dialogo = document.getElementById("gallery");
var replacement;
if (img3.value !== "") {
replacement = '|' + img1.value + '|' + img2.value + '|' + img3.value + '|' + '\n' + '|-|-|-|' + '\n';
} else {
replacement = '|' + img1.value + '|' + img2.value + '|' + '\n' + '|-|-|' + '\n';
}
textarea.value = textarea.value.substring(0, startPos) + replacement + selectedText;
dialogo.style.display = "none";
}
Apoya este post
- Rebloguea el post 🔁
- Comparte en las redes sociales #Web2 🔗
- Comenta para debatir y gana recompensas manuales 💬
Recursos empleados
| RECURSO / RESOURCE | FUENTE / SOURCE |
|---|---|
| Edición / Edition: | |
| Texto / Text: | |
| Imágenes / Pictures: | Canva, |
▶️ 3Speak
Leave Construye galerías de imágenes con Hive Translator 🇪🇸 🇬🇧 to:
Read more #hivedevs posts
Best Posts From Kmilo Noa ♦️
We have not curated any of noakmilo's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Kmilo Noa ♦️
- UNBOXING ¿Qué vendrá dentro de la caja?
- Selfie
- Unboxing de nuevos productos en mi tienda de eBay
- Thrifting treasures
- Te presento mi nueva tienda GEEK
- 2024 ¿Qué pasó conmigo? 2025 ¿Qué viene ahora? y por supuesto, en qué ando...
- ¿Y si no debí hacer esto?
- Mi nuevo Proyecto comienza aquí!!
- Compré un iPod en $9.99 y lo vendí en $120 😱
- Me fuí de Trifting en Long Beach: Ya no gasto más de $20 en ropa
- Hive a veces tiene que cuidarse de si mismo
- Ya no soy M, soy una persona XL
- Some treasures in Goodwill
- Postcrossing Activity June 2024
- Explora el mundo y encuentra verdaderos tesoros con Geocaching
- Mi Experiencia en el Canva Create 2024 / Welcome to Los Angeles 😎
- Unboxing de Temu para decorar mi Estudio de Streaming
- Postcrossing Activity May 2024
- Y nos fuimos a celebrar el Pride 🏳️🌈
- Niko ya es el gato de esta casa