I want to have a custom version of the ItemSelectDialogView (The pop up when including a MultimediaLink) when it is called from a component with a preset schema.
For example: I have component X which is based on schema 'activity' and I want to include an image. I click the 'browse' button and get the ItemSelectDialogView which is customised for this particular schema id. So the ItemSelectDialogView has some buttons less because it is called from a component based on that 'activity' schema.
I have a script that runs and checks which view it is (ItemSelectDialogView) and than hides some buttons. But I now want to add a check so that I know that it is called from my 'activity' component.
I was able to solve it using the answer of Alex Klock with some adjustments. I needed to add some checks in the JavaScript file that was included when the ItemSelectDialog was loaded.
In our case we could add certain users to a group on which we checked. These users were the only ones that needed the custom popup. How to do this you can find here.
Another solution that we considered is using cookies. You use the example of johnwinter down below and create your own listener which creates a cookie and call the standard pop up. This cookie lives just a few seconds. Long enough for your popup JavaScript to get it and read it which than could be used as the condition to load the customizations.