Comments (17)
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.
Hmm. Was just checking this again and now I get undefined for $(document).data('events'); ...
from visualevent.
Just found out that you need to use this for jQuery 1.8+
$._data(document, 'events');
from visualevent.
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.
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.
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.
Sounds great - thanks for looking into this!
from visualevent.
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.
Can you update the main hosted code with my additions?
Including the 2 other changes?
Thanks in advance, and happy new year!
from visualevent.
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.
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.
Yup - whenever I get time - sorry. Completely overwhelmed here...
from visualevent.
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.
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.
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.
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.
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)
- Not working anymore HOT 8
- [question] Get the script directly from github HOT 2
- Zepto.js support
- Build with grunt.js watch HOT 3
- Hover Events HOT 1
- Differentiate between delegated events and their host event HOT 2
- elements[elements.length-1] sometimes undefined HOT 6
- Bookmarklet builder calls invalid URL HOT 1
- Standalone distribution HOT 1
- Hover dialog mostly not showing when element is at the bottom of browser window HOT 4
- Same event is reported multiple times (duplication) HOT 1
- If an event is detected in an inline script, the words "inline script" are converted to a broken link HOT 1
- Refused to load the script 'https://www.sprymedia.co.uk/VisualEvent/VisualEvent_Loader.js?rand=1422735185563' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' https://ajax.googleapis.com". HOT 3
- Script won't load with HTTPS HOT 2
- Finding events inside a shadow element HOT 2
- website is down HOT 4
- scroll event support HOT 1
- How can I find out EXACTLY what is being triggered from Visual Event? HOT 2
- support for polymer components? HOT 1
- Export all events, trigger and the data captured HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visualevent.