Have a look at ComponentPresentations.js, which does this to open that popup:
Tridion.Cme.ComponentPresentationsTab.prototype.onInsertClick =
function ComponentPresentationsTab$onInsertClick()
{
var p = this.properties;
if (p.insertDialog.isOpen())
{
p.insertDialog.focus();
}
else
{
p.insertDialog.open();
}
};
Before that it of course needs to ensure that p.insertDialog
has been properly initialized, which it does in its _initializeInsertDialog
method. I won't reproduce the code for that here, since you can look it up and it is copyrighted material (I'll assume that just reproducing the snippet above somehow falls under fair-use).
Note: I got this answer by:
- right clicking on the Insert button on the Component Presentations tab of a Page popup
- selecting "Inspect element"
- recording the id of the element (
buttonComponentInsert
in this case)
- searching the
web\WebUI
subdirectory of my Tridion installation folder for that value
This led to a single hit in a file called ComponentPresentations.js:
buttons.Insert = $controls.getControl($("#buttonComponentInsert"),
"Tridion.Controls.Button");
Given that this is where the button from the HTML is turned into a functional control, the rest of it was just a matter of following what happens to that button inside ComponentPresentation.js.