Code Monkey home page Code Monkey logo

Comments (17)

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

I see that you can access this with the following code, at least for the delegated events for 'document' which I always use:

$(document).data('events');

Still need to find a good way to get all 'data' for 'events' for all tags.. It also looks like you cannot do this the same for every jQuery version:
http://bugs.jquery.com/ticket/10589

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Hmm. Was just checking this again and now I get undefined for $(document).data('events'); ...

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Just found out that you need to use this for jQuery 1.8+

$._data(document, 'events');

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

I think this will list all events added with jQuery. The 'old' / normal ones, and the delegated ones with the .on().

$(document).each(function(index1, element) {
  var events = $._data(element, 'events');

  if (events !== undefined) {
    $.each(events, function(index2, eventtypes) {
      $.each(eventtypes, function(index3, event) {
        //console.log(event);
        console.log('delegated ' + event.type + ' on ' + event.selector);
      });
    });
  }
});
$('*').each(function(index1, element) {
  var events = $._data(element, 'events');

  if (events !== undefined) {
    $.each(events, function(index2, eventtypes) {
      $.each(eventtypes, function(index3, event) {
        //console.log(element);
        //console.log(event);
        console.log(event.type + ' on ' + element.nodeName + ', element #' + $(element).index('*') + ' in DOM');
      });
    });
  }
});

Now only 'merge' this with the current code. I dont know if there already is a loop over all elements in the code where we can add this so it will not get much slower than now.

I also see that none of the events listed with these loops are currently returned by Visual Event 1 and 2. That's why it has gotten useless for me. :P

Maybe the author can integrate? Else I will look another time if I can add it.

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Maybe you can do something like this:

var events = $._data(element, 'events') || $.fn('events');

This way the new jQuery 1.8+ method will be used first, and as fallback the old method.

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

I finally succeeded in integrating this into Visual Event. It's not yet pretty because I had to change the jQueryGeneric method a bit, to make it work with the old and new method without completely duplicating 90% of the method.

Can't continue now, but will 'redo' it better and then see how to contribute on Github (first time).

from visualevent.

 avatar commented on August 28, 2024

Sounds great - thanks for looking into this!

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

I guess I've succeeded in editing the parser to make it work with jQuery 1.8+:
#34

Please review and 'merge' or how that works here on GitHub.

Also please look the other 2 welcome changes. And after that, please compile and place the new version on website.

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Can you update the main hosted code with my additions?

Including the 2 other changes?

Thanks in advance, and happy new year!

from visualevent.

 avatar commented on August 28, 2024

Yes - sorry for the long delay! I will try to look at this next week. Been tied up with my DataTables work of late.

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Hi Allan,

Have a new predection? :)

Kind regards,
Bas

On Thu, Jan 2, 2014 at 10:10 PM, Allan Jardine [email protected]:

Yes - sorry for the long delay! I will try to look at this next week. Been
tied up with my DataTables work of late.


Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-31484924
.

from visualevent.

 avatar commented on August 28, 2024

Yup - whenever I get time - sorry. Completely overwhelmed here...

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Haha. Sounds familiair! Good luck!

On Tue, Jan 14, 2014 at 12:34 PM, Allan Jardine [email protected]:

Yup - whenever I get time - sorry. Completely overwhelmed here...


Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-32257575
.

from visualevent.

 avatar commented on August 28, 2024

Brilliant fix - thanks for this. I've just pull it in, and your other changes and it appears to work very well. I've made a number of other changes such as adding jQuery 1.10 support and I'll be deploying the updates shortly.

Sorry for the delay in getting this in :-)

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Haha. You're welcome.

Thanks for the 'merging' and hope to see it soon on 'production'.

Our lives these days can get very busy easily.. :)

Is there some sort of newsletter of update mail? Or how will I know it's
live?

On Wed, Jan 15, 2014 at 11:55 AM, Allan Jardine [email protected]:

Brilliant fix - thanks for this. I've just pull it in, and your other
changes and it appears to work very well. I've made a number of other
changes such as adding jQuery 1.10 support and I'll be deploying the
updates shortly.

Sorry for the delay in getting this in :-)


Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-32351555
.

from visualevent.

 avatar commented on August 28, 2024

It should be live now - although it is possibly you might need to clear your browser's cache if it has bookmarked the loader.

There isn't an update feed for Visual Event at the moment. its not really a popular enough library to warrant that (yet?...)

from visualevent.

KoalaBear84 avatar KoalaBear84 commented on August 28, 2024

Ok, thanks.

It should be more popular! Very handy sometimes! :)

I understand that you do not have it, no problem.

On Wed, Jan 15, 2014 at 12:08 PM, Allan Jardine [email protected]:

It should be live now - although it is possibly you might need to clear
your browser's cache if it has bookmarked the loader.

There isn't an update feed for Visual Event at the moment. its not really
a popular enough library to warrant that (yet?...)


Reply to this email directly or view it on GitHubhttps://github.com//issues/33#issuecomment-32352323
.

from visualevent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.