Hi there,
my name is Marc and I try to create an image-plugin for my cms. I apologize for my poor english in advance.
The problem I have is, when I save an image (new src), the preview in the editor displays the image with the new source correctly but when I save the data or switch to the sourcecode, the new src changes the the previous one. The alt- and the title-attribute are working correctly indeed. I really don't know what to do..
This is the js-function I use to set the new attributes to the image:
I would be pleased to get a solution for this f... problem.
my name is Marc and I try to create an image-plugin for my cms. I apologize for my poor english in advance.
The problem I have is, when I save an image (new src), the preview in the editor displays the image with the new source correctly but when I save the data or switch to the sourcecode, the new src changes the the previous one. The alt- and the title-attribute are working correctly indeed. I really don't know what to do..
This is the js-function I use to set the new attributes to the image:
function Ok() { if (GetE('mgxcms_link_url').value.search(/^(.+)(\.+)([jpg|jpeg|gif|png|bmp]+)$/i) == -1) { alert('Es wurde kein Bild ausgewählt.'); return false; } oEditor.FCKUndo.SaveUndoStep() ; if (oImage) { //oImage.src = sFile; SetAttribute(oImage, 'src', GetE('mgxcms_link_url').value); //SetAttribute(oImage, 'src', sFile); SetAttribute(oImage, 'alt', GetE('mgxcms_link_alt').value); SetAttribute(oImage, 'title', GetE('mgxcms_link_title').value); } else { var img = FCK.EditorDocument.createElement('img'); SetAttribute(img, 'src', GetE('mgxcms_link_urlt').value); SetAttribute(img, 'alt', GetE('mgxcms_link_alt').value); SetAttribute(img, 'title', GetE('mgxcms_link_title').value); SetAttribute(img, 'border', 0); FCK.InsertElement( img ) ; } oEditor.FCKSelection.SelectNode(oImage); //dialog.CloseDialog(); return true; }
I would be pleased to get a solution for this f... problem.
Re: Issues with custom image-plugin
This line was missing (Don't know why I need this one):