Add popup within the ckeditor dialog box? Here is the scenario. I had added a custom plugin in ckeditor. The plugin provide a button on the editor menu and when we click on that button ckeditor dialog box opens up with a text field and and a link attached to it. Now, when I click on the link a form with some list items should pop up using CTOOLS and when I select any items it's value should be placed in the dialog box text field. 

I had created the dialog box but now when I try to click on the link it redirects me to another page instead of opens up another pop up block.
I don't know a custom module that can do this, I'll do like this:


Create a new content-type with an  entity reference, a trigger
string and a dialog text area.
In the referenced node, query for any referencing entities from the new content type. Most likely with a preprocess function and preferably in a newly created custom module.
Load referencing entities if found and attach a JS file that will receive the triggers and dialogue values through the settings array.
If all is well then JS file will have triggers in selectors and
dialogues to display.