adobe-webplatform / eve Goto Github PK
View Code? Open in Web Editor NEWCustom events…
Home Page: http://dmitry.baranovskiy.com/eve/
License: Apache License 2.0
Custom events…
Home Page: http://dmitry.baranovskiy.com/eve/
License: Apache License 2.0
The repository is listed as the one from @DmitryBaranovskiy, which causes the linking on component.io to fail.
(Speficially the "repo" parameter in the component.json)
I fire an Event with Eve:
eve("test.a");
if I have an Eve EventHandler in which Element.attr() is called:
eve.on("test.*",function(){
console.log('#1',evt.nt());
circle.attr('r',20); // circle is defined somewhere else
console.log('#2',evt.nt());
});
in the console:
#1, "test.a"
#2, "attr..."
the original Eventname is overwritten.
I found in the source code of Raphael, that when caling elproto.attr(),
a new Event is fired, which is the cause for this bug.
The problem is now, if you have a second EventHandler which also listens for "test.*",
and you want to elaborate inside which subname the Event has, you can't do this.
The original Problem may be in Eve..
if a Event is fired inside a Handler the original Event seems to be overwritten
I would be thankful for any respond / solution.
There have been no releases tagged since 0.2.4, and as it would be nice to be able to use eve from npm webjars, could somebody please put in a tag or two, maybe on 0.4.2 and 0.5.0?
Hi Guys,
Can you register eve with bower, please ?
It will be very helpful since Bower is integrated with Visual Studio and other library based on eve are available via bower.
Please find information here:
Please note that you need to mark version by git tag.
I have prepared bower file for you - but please double check before using: eve-bower.zip
Also it's recommended to add moduleType section - I skipped this because I wasn't sure about that.
Hey Dimitry,
I do highly respect your JavaScripts and maybe my suggestion is nonsense, I'd be happy for a hint what you would do.
Here's my scenario:
I have several models that subscribe to events from a socket. With eve, the binding would look like:
eve.on('change/Model_xyz', function() { ... })
There are tons of bindings all around the place. My understanding is that I could not simply unbind the particular event above, I'd need to wrap the anonymous function into some method (e.g. Model.make_stuff
) and then pass this method when I do an unbind, correct?
eve.unbind('change/Model_xyz', Model.make_stuff)
I wonder if it would make sense to extend the implementation of eve, so that I could use a simple string to scope a bind/unbind. It my example, it would look like:
eve.on('change/Model_xyz', function() { ... }, 'unique_id_here')
eve.unbind('change/Model_xyz', 'unique_id_here')
What do you think? Does that make any sense to you?
hi, this is git address git://github.com/adobe-webplatform/eve.git is not avalible,but have so much program dependency this address,
then my very program not npm install.I come from china developer,i have a vue-admin program ,this program use eve. Is there a way to replace this address
I can't find the previous version of the package with bower, I mean this one https://github.com/DmitryBaranovskiy/eve , could you please leave there or make an redirect to this lib from previous repo?
npm ERR! D:\Software\git[cmd](https://so.csdn.net/so/search?q=cmd&spm=1001.2101.3001.7020)\git.EXE ls-remote -h -t git://github.com/adobe-webplatform/eve.git
what?
eve.js line # 68
indexed.sort( numsort ) ;
perhaps should be
if ( indexed.length > 1) indexed.sort( numsort ) ;
Thanks
Couldn't find a clean way to do it so my approach is to pass in a third variable ( array or pointer ) then modify eve.once to assign f2 to that variable, so i can unsub with eve.off("evt", f2).
eve.once = function (name, f, unbinder) {
var f2 = function () {
eve.unbind(name, f2);
return f.apply(this, arguments);
};
if(unbinder) unbinder.push(f2);
return eve.on(name, f2);
};
It's absolutely ugly but does the job for now. Does anyone have a cleaner way to implement ?
return function (zIndex) {
if (+zIndex == +zIndex) {
f.zIndex = +zIndex;
}
};
I'm curious about why did U write like that? Isn't the condition ‘if’ always be true?
In strict mode the script causes a ReferenceError: assignment to undeclared variable eve when the eve function is assigned to the (undeclared) eve variable. This is a relatively new issue, caused by the declaration of variables being terminated after the "isArray" function.
It was not present in version 0.4.2, when the list was only terminated after the (then named) functioneve declaration.
Fix seems to be as simple as changing the semicolon in line 52 to a comma:
isArray = Array.isArray || function (ar) {
return ar instanceof Array || objtos.call(ar) == "[object Array]";
}, //<---
eve = function (name, scope) {
https://github.com/adobe-webplatform/eve/blob/master/eve.js#L52
https://github.com/adobe-webplatform/eve/blob/master/eve.js#L65
Eve references the global scope using this
. But in browserify this
doesn't refer to window
browserify/browserify#372, so eve isn't attached to the global object.
Could be fixed by passing in (window || this)
to the closure.
E.g.
> eve.on('thing.constructor.hi', function() {})
TypeError: Cannot read property 'hi' of undefined
This is because your recursive traversal through the events object sees that e[names[i]]
exists, and then tries to read e[names[i]].n
.
We hit this with "watch" in Firefox where there's an Object.prototype.watch()
Hi Dmitry,
The documentation for eve.js says that the eve() function will return an array of errors if any are found, but the code for the function will only ever return false or undefined.
Should the function be changed to match the documentation, or the other way around?
Cheers,
Gil
Hi,
could you tell me how to create a proper jar file so that i can use in my project dependecies?
Unfortunately, i have no idea of what lib is using it as dependency(Looks like a chain of dependencies), so i really need this.
The jar is missing from bower and mvn repositories and the only source i found was this github project.
Thanks in advance.
Memory leak in adobe-webplatform/Snap.svg#369 is from eve.
From my post on the issue:
I found another accumulation of references within the event library "Eve". I think these might be the last of them: The event constructor / destructor are asymmetrical, the constructor walks the event tree creating any absent i-nodes in the event path before creating it's target event; the destructor removes it's target event from the tree but does not remove empty nodes in the event path above. For most events this results in a trail of redundant parent nodes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.