Contruye galerías de imágenes con Hive Translator 🇪🇸 🇬🇧

16

  • 66
  • 0
  • 0.458
  • Reply

  • Open in the desktop app ADD TO PLAYLIST

    noakmilo

    Published on May 22, 2023
    About :

    gallery.png


    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 / RESOURCEFUENTE / SOURCE
    Edición / Edition:@noakmilo
    Texto / Text:@noakmilo
    Imágenes / Pictures:Canva, @noakmilo, Hive Translator, Google Analytics, OpenAI

    Tags :

    hivedevs devs cuba python buildinpublic javascript mvp html css frontend translation

    Woo! This creator can upvote comments using 3speak's stake today because they are a top performing creator! Leave a quality comment relating to their content and you could receive an upvote worth at least a dollar.

    Their limit for today is $0!
    Comments:
    Time until noakmilo can give away $0 to their commenters.
    0 Days 0 Hours 0 Minutes 0 Seconds
    Reply:

    To comment on this video please connect a HIVE account to your profile: Connect HIVE Account

    06:00
    23 views 5 months ago $
    01:10
    12 views 8 months ago $

    More Videos

    00:44
    12 views 2 years ago $
    01:47
    19 views 7 months ago $
    01:22
    25 views 4 weeks ago $
    04:45
    6 views 2 years ago $
    01:22
    19 views 2 months ago $