Inline module button provides a user interface for adding inline files and images.
It opens an inline syntax dialog requesting three properties; inline type(inline, file, attachment), file name or id, and title.
If the selected text is a proper inline syntax, properties are extracted for editing.
A demo is available for testing. Note that you won't see here how inline syntax is converted to a link or an image. You must use drupal's preview in your own site.
js:
var regExp = new RegExp('^\\[(inline|file|attachment):([^=\\]]+)=?([^\\]]*)?\\]$', 'i');
var M = regExp.exec(E.getSelection()) || ['', '', '', ''];
var form = [
{name: 'type', type: 'select', options: {inline: 'inline', file: 'file', attachment: 'attachment'}, value: M[1]},
{name: 'name', title: 'File name/id', value: M[2]},
{name: 'title', value: M[3]}
];
E.tagDialog('inline', form, {title: 'Inline Syntax', submit: function(tag, form){
var type = form.elements['attr_type'].value;
var title = form.elements['attr_title'].value;
var name = form.elements['attr_name'].value;
var str = '['+ type +':'+ name + (title ? '=' : '') + title +']';
E.dialog.close();
E.replaceSelection(str);
}});
I'm afraid I don't understand
I'm afraid I don't understand what this button does. Can you clarify?
For instance, it asks for a filename but doesn't supply a browser.
Still trying to Grok this
Are you using inline
Are you using inline module?
A common use case is inserting the files uploaded by upload.module into content body. That's why it only asks for file's name or id, which is already available in the page(node editing page).
Here's a description from inline.module:
Thanks for your support, by the way ;)
Hi First of all, I would like
Hi
First of all, I would like to thank you for developing this wonderful module. It's the best editor I've seen so far.
About this specific button I have a doubt, which inline module are you using? I'm using version 5.x 1.1 and I don't have the options "file" and "attachment".
Kind regards.