[wp-hackers] JavaScript events on media popup

Adam Silverstein hosting at earthbound.com
Tue Nov 26 18:29:53 UTC 2013


Currently WordPress does not offer a specific way to hook into JavaScript
events - this is being considered for a future release -
http://core.trac.wordpress.org/ticket/21170.

for now you will need to bind to specific DOM events, such as the same
event WordPress hooks into to open the media modal when you click on the
insert media button:

$(document.body).on( 'click', '.insert-media', function( event ) {
// Add your functionality here
});


On Mon, Nov 25, 2013 at 6:00 AM, <wp-hackers-request at lists.automattic.com>wrote:

> Send wp-hackers mailing list submissions to
>         wp-hackers at lists.automattic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.automattic.com/mailman/listinfo/wp-hackers
> or, via email, send a message with subject or body 'help' to
>         wp-hackers-request at lists.automattic.com
>
> You can reach the person managing the list at
>         wp-hackers-owner at lists.automattic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of wp-hackers digest..."
>
>
> Today's Topics:
>
>    1. Are there any events on media popup,      that we could hook up
>       onto? (Davit Barbakadze)
>    2. Tracking memory usage without turning plugins on/off
>       one-by-one (David Anderson)
>    3. Re: Tracking memory usage without turning plugins on/off
>       one-by-one (Azizur Rahman)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 24 Nov 2013 16:51:57 +0400
> From: Davit Barbakadze <jayarjo at gmail.com>
> To: wp-hackers at lists.automattic.com
> Subject: [wp-hackers] Are there any events on media popup,      that we
>         could hook up onto?
> Message-ID:
>         <
> CAM0WtjeNDZViQqTQixKELzF4-8xmkM-Q19ixOWO_6W6hbqYz_g at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Suppose we would like to run some JavaScript when media popup opens
> up. Is there any way we could hook up onto it? onto an event of some
> kind, like - open?
>
> Davit Barbakadze
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 25 Nov 2013 07:40:21 +0000
> From: David Anderson <david at wordshell.net>
> To: wp-hackers at lists.automattic.com
> Subject: [wp-hackers] Tracking memory usage without turning plugins
>         on/off  one-by-one
> Message-ID: <5292FEE5.5000809 at wordshell.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> Is there a good, efficient way to track the memory usage of
> plugins/themes in WordPress other than "turn them on/off one by one"?
> Not just final memory usage (after everything's loaded), but peak memory
> usage too?
>
> e.g. Can is there a good way to answer questions like "when the peak
> memory usage during load is hit, which parts of WordPress were the main
> culprits?"
>
> Many thanks,
> David
>
> --
> WordShell - WordPress fast from the CLI - www.wordshell.net
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 25 Nov 2013 09:16:46 +0000
> From: Azizur Rahman <prodevstudio+wordpress at gmail.com>
> To: "wp-hackers at lists.automattic.com"
>         <wp-hackers at lists.automattic.com>
> Subject: Re: [wp-hackers] Tracking memory usage without turning
>         plugins on/off one-by-one
> Message-ID:
>         <CAAYGKatwmFRVjACQkRRjowt6V_X_Y76VWh0btWBU=
> 6afHrwe8Q at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> You can use PHP: Xhprof to profile everything and get some useful details.
> http://us2.php.net/xhprof
>
> Kind Regards,
> Azizur Rahman
>
> ----
> Do you need cost-effective web hosting solution and Domain name try
> http://prodevstudio.com
>
> Missed the last Friday Khutbah, try catchup a Khutbah on-line now at
> http://fridaykhutbah.com
>
>
> On Mon, Nov 25, 2013 at 7:40 AM, David Anderson <david at wordshell.net>
> wrote:
>
> > Hi,
> >
> > Is there a good, efficient way to track the memory usage of
> plugins/themes
> > in WordPress other than "turn them on/off one by one"? Not just final
> > memory usage (after everything's loaded), but peak memory usage too?
> >
> > e.g. Can is there a good way to answer questions like "when the peak
> > memory usage during load is hit, which parts of WordPress were the main
> > culprits?"
> >
> > Many thanks,
> > David
> >
> > --
> > WordShell - WordPress fast from the CLI - www.wordshell.net
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
> ------------------------------
>
> End of wp-hackers Digest, Vol 106, Issue 36
> *******************************************
>



-- 
Adam Silverstein
Website Development & Hosting
Earthbound.com * 970.872.4421 * 800.399.4085


More information about the wp-hackers mailing list