In a related issue, a user requests the inclusion of View/Edit Scald Atom links in an Atom Reference field widget. Someone in the queue adds a request to have the same in the CKEditor.

Then, of course, it was mentioned that request needs its own issue, but it appears no one has created that feature request, so here I am, officially asking for said feature.

Please add View/Edit atom links in the contextual menu for the CKEditor widgets provided by the DnD submodule.

Thanks!

Comments

nagy.balint’s picture

Status: Active » Needs review
StatusFileSize
new6.13 KB

Here is a patch to achieve that.

The only thing missing is to somehow update the atom displayed in wysiwyg after an edit if the user edited something that changes the look.

nagy.balint’s picture

And updating all existing atoms on the page is not so easy, as basically when i change the image in the edit in either an atom reference or in a wysiwyg i would need to update all instances of that atom in all wysiwygs and atom references on that page.

I believe even the code in atom reference that does that wont do that for other atom reference fields and other wysiwygs on the same form.

nagy.balint’s picture

Maybe we dont have to deal with that problem here, cause the same is true for the DND library, if i edit the image in an existing image in the dnd library, it wont auto change all instances of it in the current form.
And if thats normal then this will be normal as well.

Of course it would be better if it did update, but that then could be a global problem solved in another issue?

gifad’s picture

The only thing missing ...

As a workaround, I added a "Refresh Atom" menu item, which obviously calls refreshAtom(), and IMHO should satisfy the user's expectation...

nagy.balint’s picture

I checked if we really cannot remove the cut, copy, and paste menu items from the contextual menu (clipboard plugin). And it seems like it.

I managed to delete them from all contextual menus, whith code like
delete editor._.menuItems.paste;
But then of course it will also be gone from other contextual menus.

Seems there was a patch for ckeditor back then that would have solved the problem: http://dev.ckeditor.com/ticket/8759
Because with that patch its possible in the addListener to return something like
menu.cut = null;
And then it would have ignored it.

Unfortunately it never got in :(

Seems like we cannot do anything with that.

nagy.balint’s picture

Actually I managed to do a workaround that works for me on both the old and new plugin.

Basically I can manipulate the entries at editor.contextMenu.items

The only fault could be if the clipboard somehow would assign its menu items after our dnd plugin. But it does not seem to be the case.

This of course led to some simplification, as then we don't need the "atom" word all the time in the menu entries.
Also added some icons to the cut, copy, and paste actions.

Also I added the refresh atom for the focused widget after the user closes the ctools modal.

nagy.balint’s picture

Status: Needs review » Fixed

Committed.

  • nagy.balint committed 3c34146 on 7.x-1.x
    Issue #2453363 by nagy.balint, gifad: Adding edit and view links in the...
ccshannon’s picture

Wow! This is stupendous.

I had to make sure I cleared my Firefox cache to get the new contextual menus to appear, but once it did, incredible. So much easier to access atom editing.

Thanks!!! :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ccshannon’s picture

Title: Adding edit and view links in the CKEditor widget contet menu » Adding edit and view links in the CKEditor widget context menu