I noticed that in the scald_atom_fetch_atoms function in includes/scald.pages.inc it doesn't grab the scald_atom data array. I am saving some data that associates a scald atom with a node id, and that's stored in the data array, but I can't access that in JS.
I see that when you load a page with the scald dnd library, it actually gets all the atoms from a JSON view because they are loaded by the library. If, however, there is an atom in the WYSIWYG that is not currently in the library, (or the page viewed by the library), then when you load the atomProperties dialog it will call Drupal.dnd.scaldFetch.
At least that's how I understand it - in that scaldFetch function is where I would like to have access to data. I created a small patch.
Thank you very much for your time!
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | add-data-2433885-7.patch | 1.54 KB | nagy.balint |
| #4 | add-data-2433885-4.patch | 970 bytes | gifad |
| add-data.patch | 502 bytes | asherry |
Comments
Comment #1
nagy.balint commentedI see no issues here so far, since it just adds extra information.
Comment #2
gifad commentedWhile we are at it, we could insert the very same line in mee.module,
function mee_ajax_widget_expand($atom), line #546, for the benefit of dndck4's atomProperties.Thanks,
Comment #3
nagy.balint commentedComment #4
gifad commentedthis is a combined patch, for both environments
Comment #5
nagy.balint commented@gifad
Thanks!
Should we add the 'provider' => $atom->provider, at the fetch function as well?
Comment #6
gifad commented@nagy.bálint
The 'provider' meta data was added in the context of option 'applicability' to the current atom (ie option handled by a provider); as the options are poorly handled in ckeditor/plugin.js (compared to dndck4/plugin.js), I think this is not really usefull...
BTW, the first important thing to improve in ckeditor/plugin.js would have been to have a 'options' argument in dnd.fetchAtom(), that would allow
scald_atom_fetch_atoms(), and later,Drupal.theme.prototype.scaldEmbed(), to render a fully optionned atom; This has been considered in the past, but never implemented, and is now totally obsoleted by the (overridable)theme_mee_widget_embed()function (IMHO).But it doesn't hurt, of course...
Comment #7
nagy.balint commentedActually there is one more place to add it, as it should also get there when the library gets displayed initially.
Comment #8
asherry commentedAdding it to the initial library load is great, I had to use hook_scald_dnd_library_item_alter otherwise. Thank you very much!
Comment #10
nagy.balint commentedCommitted, Thanks!