<?php include 'sesion.php';?>
<?php include 'concha.php';?>
<!DOCTYPE html>
<html lang="es">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<!-- Required meta tags -->

	<meta name="description" content="Panel de Administracion">
	<meta name="author" content="<?php echo $nombresitio ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?php echo $nombresitio ?> - Panel de Administracion</title>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>

<link rel="shortcut icon" href="" type="image/x-icon">
	<link rel="apple-touch-icon" href="">

	<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
	<!-- Link to your css file -->
	<link rel="stylesheet" href="">

  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>

  <style type="text/css">
       *{
          border-radius: 0!important;
                 }
       body {
          background-image: url(../fondeux.jpg);
      }
      .navbar {
          position: relative;
      min-height: 50px;
      padding-bottom:  20px;
      /* border: 1px solid transparent; */
                 }

          .btn-primary {
      color: #fff!important;
      background-color: #0066FF;
      border-color: #0066FF;
          }

             .page-header{
          margin: 0;
          padding: 1em;
          background-color: #0066FF;
          border: 0;
          text-align:center;
      }

             .page-header h2{
                     color: #ffffff;
          font-weight: bold;
      }

             .bloqueAzul{
        /*  background-color: #0066FF;*/
        /* border: 1px solid #e4e4e4;*/
        /*  padding: 1em;*/
          text-align: center;
      }

             .bloqueAzul .div {
        border: 1px solid #e4e4e4;
            background-color: #fff;
      }

             ul{
          list-style: none;
          padding: 0;
      }

             .far{
          color:#0066FF;
      }
       .faso {
          color:#0066FF;
      }

          .colorAzul h3{
          color:#0066FF;
                 }

      /* ====== POPUP GALERIA (modo cine) ====== */
      .modal-backdrop.show{ opacity:.90; }
      .modal-galeria .modal-dialog{
        max-width: 96vw;
        width: 96vw;
        margin: 1.5rem auto;
      }
      .modal-galeria .modal-content{
        height: 88vh;
        border: 0;
      }
      .modal-galeria .modal-body{
        padding: 0;
        height: calc(88vh - 56px);
        overflow: hidden;
        background:#fff;
      }
      .modal-galeria iframe{
        width: 100%;
        height: 100%;
        border: 0;
        display:block;
        background:#fff;
      }
         </style>

   <script language=javascript>
function ventanaSecundaria (URL){
   window.open(URL,"ventana1","width=550,height=450,scrollbars=NO")
}
  </script>

      </head>

 <body>

   <div class="container" style="background-color:#F1F2ED;max-width:960px;">
                                   <?php include 'menu.php';  ?>
                </div>


         <div role="main" style="background-color:#fff;max-width:960px;" class="container pt-3">

     <div class="page-header" style="text-align:center;">
             <h2><? echo $asdasd ?>Editar nota</h2>
     </div>

     <div class="col-12 my-3 text-center">
           <script type="text/javascript" src="//recursos.radiosnethosting.com/ckeditor/ckeditor.js"></script>
           <?
          $ID = (int)$_GET['ID'];
           //echo $ID;
                    $sql = "SELECT * FROM notas WHERE ID = '$ID'";
         $consulta = $conn->query($sql);
          while ($row = $consulta->fetch_assoc())
          {
          $IDs = $row["ID"];
          $titulo = utf8_decode($row["titulo"]);
          $texto = $row["texto"];
          
           $texto = str_replace('Ã¯Â¿Â½','',$texto); 
           $texto = str_replace('ï¿½','',$texto); 
           
          $bajada = utf8_decode($row["bajada"]);
          $goear = $row["goear"];
          $listengo = $row["listengo"];
          $d = $row["d"];
          $m = $row["m"];
          $a = $row["a"];
          $cat = $row["cat"];
          }
          //echo $ID;
         $consulta->free_result();
          ?>



                                            <div class="col-12">
                       <h4><?php echo $titulo ?></h4>
          </div>


            <div class="col-12">
               <form id="form1" name="form1" method="post" action="formeditarnota.php?ID=<?php echo $IDs ?>">

                                  <div class="col-12 p-3">
                         <div class="col-12">
                          <p>CATEGORIA</p>
                        </div>

                         <div class="form-group">

                           <select name="cat" class="form-control" id="cat">
                                  <option value="0" selected="selected">SIN CATEGORIA</option>
                                  <?php
                                                                     $sql = "SELECT * FROM categorias";
                                  $consulta = $conn->query($sql);
                                  while ($row = $consulta->fetch_assoc())
                                  {
                                  $ID_C = $row["ID"];
                                  $nombre = $row["nombre"];
                                  ?>
                                  <option <?php if ($cat == $ID_C) {?> selected="selected" <? }?>  value="<?php echo $ID_C ?>"> <?php echo $nombre ?> </option>
                                  <?
                                  }
                                  $consulta->free_result();
                                  ?>
                              </select>
                           <a class="btn btn-outline-primary" href="agregar_cat.php">¿LA CATEGORIA QUE BUSCAS NO APARECE EN LA LISTA? PUEDES AGREGAR UNA CATEGORIA</a>

                           </div>

                                     </div>


                                                                                <div class="col-12 p-3">
                                             <label>TITULO</label>
                         <input name="titulo" type="text" class="form-control" id="titulo" value="<?php echo $titulo ?>"/>

                                            </div>

                     <div class="col-12 p-3">
                                             <label>BAJADA</label>
                        <textarea name="bajada" cols="60" rows="13" class="form-control" id="bajada"><?php echo $bajada ?></textarea>

                                                                      </div>

                                                                               <div class="col-12 p-3">
                    <label>TEXTO COMPLETO (SALE CUANDO SE INGRESA A LA NOTA)</label>




                     <textarea name="texto" cols="60" rows="13" class="form-control ckeditor" id="texto"><?php echo $texto ?></textarea>

                  </div>


                                          <!-- =========================
     INSERTAR CONTENIDO + SUBIR IMAGEN
     Pegalo debajo del textarea id="texto"
========================= -->

 <style>
  .embed-tools{
    background:#f8f9fa;
    border:1px solid #e4e4e4;
    padding:14px 14px 10px 14px;
    margin:10px 0 18px 0;
  }
  .embed-tools .titulo{
    margin:0 0 6px 0;
    font-size:18px;
    font-weight:700;
    color:#0066FF;
  }
  .embed-tools .sub{
    margin:0 0 10px 0;
    font-size:13px;
    color:#6c757d;
    line-height:1.45;
  }
  .embed-tools .sub b{ color:#343a40; }
  .embed-tools code{
    background:#ffffff;
    border:1px solid #e9ecef;
    padding:2px 6px;
    font-size:12px;
    color:#111;
  }
  .embed-tools .botonera{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
  }
  .embed-tools .btn{ border-radius:0!important; }

  .sc-modal .modal-header{ color:#fff; border-radius:0!important; }
  .sc-youtube   .modal-header{ background:#dc3545; }
  .sc-xpost     .modal-header{ background:#111111; }
  .sc-facebook  .modal-header{ background:#1877f2; }
  .sc-instagram .modal-header{ background:#c13584; }
  .sc-tiktok    .modal-header{ background:#00bcd4; }
  .sc-spotify   .modal-header{ background:#1db954; }
  .sc-soundcloud .modal-header{ background:#ff5500; }
  .sc-map       .modal-header{ background:#2e7d32; }
  .sc-hr        .modal-header{ background:#6c757d; }
  .sc-alert     .modal-header{ background:#17a2b8; }
  .sc-image     .modal-header{ background:#6f42c1; }

  .sc-help{ font-size:13px; line-height:1.4; color:#6c757d; }
  .sc-help code{ background:#f3f3f3; padding:2px 6px; border:1px solid #e9ecef; }
  .sc-status{ font-size:13px; }
</style>

 <div class="embed-tools">
  <div class="titulo">Insertar contenido</div>

  <div class="sub">
    <b>¿Qué hace esto?</b> Te permite insertar videos, posts, imágenes y mapas dentro de la nota.<br>
    <b>Cómo usar:</b> colocá el cursor donde querés insertarlo, tocá el botón y pegá el link o subí la imagen.<br>
    Se insertará un shortcode (ej: <code>[youtube]URL[/youtube]</code>) y luego en el portal se mostrará embebido.
  </div>

  <div class="botonera">
    <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="modal" data-target="#scModalYoutube">YouTube</button>
    <button type="button" class="btn btn-outline-dark btn-sm" data-toggle="modal" data-target="#scModalX">Post de X</button>
    <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="modal" data-target="#scModalFacebook">Post de Facebook</button>
    <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="modal" data-target="#scModalInstagram">Post de Instagram</button>

    <button type="button" class="btn btn-outline-info btn-sm" data-toggle="modal" data-target="#scModalTikTok">TikTok</button>
    <button type="button" class="btn btn-outline-success btn-sm" data-toggle="modal" data-target="#scModalSpotify">Spotify</button>
    <button type="button" class="btn btn-outline-warning btn-sm" data-toggle="modal" data-target="#scModalSoundCloud">SoundCloud</button>
    <button type="button" class="btn btn-outline-success btn-sm" data-toggle="modal" data-target="#scModalMap">Google Maps</button>

    <button type="button" class="btn btn-outline-secondary btn-sm" data-toggle="modal" data-target="#scModalHR">Separador</button>
    <button type="button" class="btn btn-outline-info btn-sm" data-toggle="modal" data-target="#scModalAlert">Caja destacada</button>

    <button type="button" class="btn btn-outline-secondary btn-sm" data-toggle="modal" data-target="#scModalImage">Subir imagen</button>
  </div>
</div>

 <!-- ========================= MODALES ========================= -->

 <!-- YOUTUBE -->
<div class="modal fade sc-modal sc-youtube" id="scModalYoutube" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar video de YouTube</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá un link. Se insertará: <code>[youtube]URL[/youtube]</code></div>
      <input type="url" class="form-control" id="sc_youtube_url" placeholder="https://www.youtube.com/watch?v=XXXXXXXXXXX">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-danger" onclick="scInsertUrl('youtube','sc_youtube_url','#scModalYoutube')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- X -->
<div class="modal fade sc-modal sc-xpost" id="scModalX" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar post de X</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá el link. Se insertará: <code>[xpost]URL[/xpost]</code></div>
      <input type="url" class="form-control" id="sc_x_url" placeholder="https://x.com/usuario/status/1234567890">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-dark" onclick="scInsertUrl('xpost','sc_x_url','#scModalX')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- FACEBOOK -->
<div class="modal fade sc-modal sc-facebook" id="scModalFacebook" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar post de Facebook</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá el link público. Se insertará: <code>[facebook]URL[/facebook]</code></div>
      <input type="url" class="form-control" id="sc_facebook_url" placeholder="https://www.facebook.com/.../posts/...">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-primary" onclick="scInsertUrl('facebook','sc_facebook_url','#scModalFacebook')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- INSTAGRAM -->
<div class="modal fade sc-modal sc-instagram" id="scModalInstagram" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar post de Instagram</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá el link. Se insertará: <code>[instagram]URL[/instagram]</code></div>
      <input type="url" class="form-control" id="sc_instagram_url" placeholder="https://www.instagram.com/p/XXXXXXXXXXX/">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn" style="background:#c13584;color:#fff;" onclick="scInsertUrl('instagram','sc_instagram_url','#scModalInstagram')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- TIKTOK -->
<div class="modal fade sc-modal sc-tiktok" id="scModalTikTok" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar TikTok</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá el link. Se insertará: <code>[tiktok]URL[/tiktok]</code></div>
      <input type="url" class="form-control" id="sc_tiktok_url" placeholder="https://www.tiktok.com/@usuario/video/123...">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-info" onclick="scInsertUrl('tiktok','sc_tiktok_url','#scModalTikTok')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- SPOTIFY -->
<div class="modal fade sc-modal sc-spotify" id="scModalSpotify" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar Spotify</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá link. Se insertará: <code>[spotify]URL[/spotify]</code></div>
      <input type="url" class="form-control" id="sc_spotify_url" placeholder="https://open.spotify.com/track/... o /playlist/...">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-success" onclick="scInsertUrl('spotify','sc_spotify_url','#scModalSpotify')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- SOUNDCLOUD -->
<div class="modal fade sc-modal sc-soundcloud" id="scModalSoundCloud" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar SoundCloud</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá el link. Se insertará: <code>[soundcloud]URL[/soundcloud]</code></div>
      <input type="url" class="form-control" id="sc_soundcloud_url" placeholder="https://soundcloud.com/.../...">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-warning" onclick="scInsertUrl('soundcloud','sc_soundcloud_url','#scModalSoundCloud')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- MAP -->
<div class="modal fade sc-modal sc-map" id="scModalMap" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar Google Maps</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Pegá el link. Se insertará: <code>[map]URL[/map]</code></div>
      <input type="url" class="form-control" id="sc_map_url" placeholder="https://www.google.com/maps?...">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-success" onclick="scInsertUrl('map','sc_map_url','#scModalMap')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- HR -->
<div class="modal fade sc-modal sc-hr" id="scModalHR" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar separador</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help">Inserta: <code>[hr][/hr]</code></div>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-secondary" onclick="scInsert('hr',''); scCloseModal('#scModalHR');">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- ALERT -->
<div class="modal fade sc-modal sc-alert" id="scModalAlert" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Insertar caja destacada</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">Texto. Se insertará: <code>[alert]TEXTO[/alert]</code></div>
      <textarea class="form-control" id="sc_alert_text" rows="4" placeholder="Texto destacado..."></textarea>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn btn-info" onclick="scInsertAlert('sc_alert_text','#scModalAlert')">Insertar</button>
    </div>
  </div></div>
</div>

 <!-- IMAGEN -->
<div class="modal fade sc-modal sc-image" id="scModalImage" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog" role="document"><div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title">Subir imagen e insertarla</h5>
      <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
    </div>
    <div class="modal-body">
      <div class="sc-help mb-2">
        Seleccioná una imagen. Se convierte a JPG y se guarda en <code>MM-AAAA</code>.
        Se insertará: <code>[img]URL[/img]</code>
      </div>

      <input type="file" class="form-control" id="sc_img_file" accept="image/*">
      <div class="mt-2 sc-status" id="sc_img_status" style="color:#6c757d;"></div>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-light" data-dismiss="modal">Cancelar</button>
      <button type="button" class="btn" style="background:#6f42c1;color:#fff;" onclick="scUploadAndInsertImage()">Subir e insertar</button>
    </div>
  </div></div>
</div>

 <script>
  // Endpoint uploader (debe estar en la misma carpeta que este archivo)
  var SC_UPLOAD_ENDPOINT = 'upload_embed_img.php';

  // Asegurar que exista la instancia del editor "texto"
  if (window.CKEDITOR) {
    try {
      if (!CKEDITOR.instances || !CKEDITOR.instances.texto) {
        CKEDITOR.replace('texto');
      }
    } catch(e) {}
  }

  function scNormalizeUrl(u){
    u = (u || '').trim();
    if (!u) return '';
    if (!/^https?:\/\//i.test(u)) u = 'https://' + u.replace(/^\/+/, '');
    return u;
  }

  function scGetEditor(){
    if (!window.CKEDITOR) return null;
    if (CKEDITOR.instances && CKEDITOR.instances.texto) return CKEDITOR.instances.texto;
    if (CKEDITOR.currentInstance) return CKEDITOR.currentInstance;
    return null;
  }

  function scInsert(tag, value){
    var code = '[' + tag + ']' + (value || '') + '[/' + tag + ']';
    var ed = scGetEditor();
    if (ed) {
      ed.focus();
      ed.insertText(code);
      return true;
    }
    return false;
  }

  function scCloseModal(selector){
    try { $(selector).modal('hide'); } catch(e) {}
  }

  function scInsertUrl(tag, inputId, modalSelector){
    var el = document.getElementById(inputId);
    var url = el ? scNormalizeUrl(el.value) : '';
    if (!url) { if (el) el.focus(); return; }
    scInsert(tag, url);
    if (el) el.value = '';
    scCloseModal(modalSelector);
  }

  function scInsertAlert(textareaId, modalSelector){
    var el = document.getElementById(textareaId);
    var txt = el ? (el.value || '').trim() : '';
    if (!txt) { if (el) el.focus(); return; }
    scInsert('alert', txt);
    if (el) el.value = '';
    scCloseModal(modalSelector);
  }

  async function scUploadAndInsertImage(){
    var input = document.getElementById('sc_img_file');
    var status = document.getElementById('sc_img_status');

    status.style.color = '#6c757d';
    status.innerHTML = '';

    if (!input || !input.files || !input.files[0]) {
      status.style.color = '#dc3545';
      status.innerHTML = 'Seleccioná una imagen.';
      return;
    }

    var file = input.files[0];
    if (!/^image\//i.test(file.type)) {
      status.style.color = '#dc3545';
      status.innerHTML = 'El archivo no parece ser una imagen.';
      return;
    }

    status.innerHTML = 'Subiendo...';

    var fd = new FormData();
    fd.append('file', file);

    try {
      var res = await fetch(SC_UPLOAD_ENDPOINT, {
        method: 'POST',
        body: fd,
        credentials: 'same-origin'
      });

      var txt = await res.text();
      var data = null;
      try { data = JSON.parse(txt); } catch(e) {}

      if (!res.ok) {
        status.style.color = '#dc3545';
        status.innerHTML = 'Error HTTP ' + res.status + '. ' + (txt ? txt.substring(0,200) : '');
        return;
      }

      if (!data || !data.ok || !data.url) {
        status.style.color = '#dc3545';
        status.innerHTML = (data && data.error) ? data.error : ('Respuesta inválida: ' + (txt ? txt.substring(0,200) : ''));
        return;
      }

      scInsert('img', data.url);

      input.value = '';
      scCloseModal('#scModalImage');

      status.style.color = '#28a745';
      status.innerHTML = 'Imagen insertada.';
      setTimeout(function(){ status.innerHTML=''; }, 1200);

    } catch (e) {
      status.style.color = '#dc3545';
      status.innerHTML = 'Error de red: no se pudo conectar con el uploader.';
    }
  }
</script>

                    <div class="col-12 p-3">

                           <div class="border col-12">

                                 <label>GALERIA DE MEDIOS</label>

                                <a class="btn btn-outline-secondary" href="javascript:void(0)" data-toggle="modal" data-target="#modalGaleriaMedios">ABRIR GALERIA</a>

                                                     </div>
                    </div>

<!-- ====== MODAL GALERIA DE MEDIOS (POPUP INTERNO) ====== -->
<div class="modal fade modal-galeria" id="modalGaleriaMedios" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header" style="background:#111;color:#fff;">
        <h5 class="modal-title">Galería de medios (copiá y pegá en la nota)</h5>
        <button type="button" class="close text-white" data-dismiss="modal"><span>&times;</span></button>
      </div>
      <div class="modal-body">
        <iframe src="galeria_de_medios.php" allowfullscreen></iframe>
      </div>
      <div class="modal-footer" style="justify-content:space-between;">
        <a class="btn btn-outline-primary" href="../uploadfotosfull_galeria_de_medios.php" target="_blank">CARGAR UNA IMAGEN NUEVA</a>
        <button type="button" class="btn btn-light" data-dismiss="modal">CERRAR</button>
      </div>
    </div>
  </div>
</div>
<!-- ====== /MODAL GALERIA ====== -->


                                       <div class="col-12 text-center">
                        <h4>LAS FOTOS, VIDEOS Y AUDIOS SE CARGAN DESPUÉS</h4>
                    </div>


                                    <div class="col-12 text-center">
                   <ul class="d-flex justify-content-center">
                  <li><input name="button" type="submit" class="btn btn-primary" id="button" value="<? echo $idioma_editar?>" /></li>
                  <li><a href="notas.php" class="btn btn-outline-primary"><? echo $idioma_volver ?></a></li>
                  </ul>

                                                                  </div>


                                                      </form>

           </div>

           <div class="col-12 text-center pb-3 mb-3">

                       </div>

     </div>
  </div>



   <!-- jQuery first, then Popper.js, then Bootstrap JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>

     <script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.js"></script>
<script type="text/javascript">
window.setInterval(function(){
  $('.grid').isotope({
  itemSelector: '.grid-item'
});
}, 500);
</script>

 <script defer src="https://use.fontawesome.com/releases/v5.8.1/js/all.js" integrity="sha384-g5uSoOSBd7KkhAMlnQILrecXvzst9TdC09/VM+pjDTCM+1il8RHz5fKANTFFb+gQ" crossorigin="anonymous"></script>

   </body>
</html>