Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
How to retrieve data from CKEDITOR property popup

I need to retrieve the width from CKEDITOR image property popup when i add the image.

The reason i need to get the width is that i am using CKEDITOR to construct campaign mails.

CKEDITOR sets the prpoerties in a style tag. That is a problem for Outlook because Outlook wats the width of an image as an attribute.

I am pretty new to js and CKEDITOR, but i have found some code that could edit how CKEDITOR inserts the image element. But i still want to be able to set an image size in the CKEDITOR property window.

CKEDITOR.on('dialogDefinition', function(ev) {
  var dialogName = ev.data.name;
  var dialogDefinition = ev.data.definition;
  var editor = ev.editor;
    
  if (dialogName == 'image') {
      dialogDefinition.onOk = function(e) {
                var width = e.sender.originalElement.$.width;
                console.log(width);
                if (width >= 600) {
                    console.log("in");
                    width = "100%";
                } else {
                    width = width + "px";
                }
        var imageSrcUrl = e.sender.originalElement.$.src;
        var imgHtml = CKEDITOR.dom.element.createFromHtml("<img src=" + imageSrcUrl + " alt='' width='100%' style='width: " + width + "'/> " );
        editor.insertElement(imgHtml);
      };
  }
});

So i want to be able to retrieve the width insrted in the property window when the image is inserted. Can anyone help?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda