I just learned how to do this yesterday (thanks to Nuno Linhares) - you need to first get acquainted with the new editor for the GUI.
The next step is to find the name of the command you want to overwrite (perhaps "UnPublish" in your case). The easiest way to do this is to use the "check item" using Chrome or FieFox in the GUI and look for something like c:command="UnPublish" on the button you want to extend.
After you set up the basic editor, you need to add a new command to overwrite the existing one, for example:
<extensions> <ext:dataextenders /> <ext:editorextensions> <ext:editorextension target="CME"> <ext:editurls /> <ext:listdefinitions /> <ext:taskbars /> <ext:commands /> <ext:commandextensions> <ext:commands> <ext:command name="UnPublish" extendingcommand="CustomUnPublishCommand"/> </ext:commands> <ext:dependencies> <cfg:dependency>CustomUnPublish.CommandSet</cfg:dependency> </ext:dependencies> </ext:commandextensions> <ext:contextmenus /> <ext:lists /> <ext:tabpages /> <ext:toolbars /> <ext:ribbontoolbars /> </ext:editorextension> </ext:editorextensions> </extensions>
Add all your dependencies (JS and CSS, etc.) and command links in the usual way.
Then write down your JS execution function in the same way as any other GUI command, and call the existing command after you have processed your popup, something like this:
CustomUnPublish.prototype._execute = function CustomUnPublish$_execute(selection, pipeline) {
source share