First thanks for this good module. It is simple but flexible and efficient.
One question, is it possible to add some properties to image button, such as align, vspace, hspace........
First thanks for this good module. It is simple but flexible and efficient.
One question, is it possible to add some properties to image button, such as align, vspace, hspace........
Comments
Comment #1
ufku commentedI want the editor to be XHTML compatible out of the box. However, you can always extend the image dialog manually to include any attribute.
I'll consider implementing a user-friendly way of extending image and link dialogs.
Comment #2
mirex commentedchanges in: default_buttons_functions.js
changes in Image button:
js: eDefFileDialog('image', { "title": "insert/edit image", "url": "image URL", "w": "width", "h": "height", "vs": "vert. space", "hs": "hor. space", "ttl": "title", "align": "align", "alt": "alternative text", "ok": "OK", "brw": "browse" }, '/imce/browse');_________________________________________
align write manually; max 4 char in this case ;)
enjoy
Comment #3
ufku commentedThere have been a few changes in the API providing an easier way to extend current image and link dialogs.
You should call eDefFileDialog() function with additional arguments(arrays) where they will be added as rows into the dialogs.
For instance, lets add hspace, vspace elements to the image dialog (just change the return value of the image button):
As in this example, any additional array argument sent to eDefFileDialog(), will turn into a row in the dialog and form elements will be processed automatically. However there are some important points to pay attention regarding the array structure.
As in ['Hspace', eDefInputText('file_hspace', '', 25)]
array's first element is the label for your additional field.
second element is the form input html. this can be any form element. The only requirement here is that the name of the field should be 'file_' + 'attribute name'. For example, for align attribute you should set it to 'field_align' and for style, it should be 'field_style', etc.
(eDefInputText creates <input type="text"... html that requires the parameters (name, value, size))
The default img dialog can detect if the selected text is a complete image tag and writes attribute values in the default dialog fields. Unfortunately this is not true for additional fields. To have the same functionality you should detect the selected text, get attributes of it and set them in your additional fields. Here is how to do this;
Comment #4
ufku commentedthe bold ones should have been file
Comment #5
nickie commentedMy question is like previous but about "a" tag.
How can i do, that my link title will be not only in title="", but also in tag.
for example. link: http://mysite.com, title=mysite
the module generate
<a href=http://mysite.com title="mysite"></a>But i need
<a href=http://mysite.com title="mysite">mysite</a>Comment #6
ufku commentedin library/default_buttons_functions.js find the line containing:
E.tagSelection(a.substr(0, a.length-4), '</a>');and replace it with:
E.tagSelection(a.substr(0, a.length-4)+file.attributes.title, '</a>');Comment #7
ufku commented