From brandon at rhodesmill.org Tue Apr 8 03:27:21 2008 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Mon, 07 Apr 2008 21:27:21 -0400 Subject: [Kss-devel] how to prevent forms from submitting when I hit Enter? Message-ID: <874padw2yu.fsf@ten22.rhodesmill.org> In my experiments so far, I have had good luck shutting down submit-button actions by saying input#my-submit-button:click { evt-click-preventdefault: True; } so that my own actions can run instead, without the whole page reloading. But my careful deactivation of the submit button, it turns out, is useless if the user tries to activate the form by simply hitting "Enter" when they are doing typing their input. What's the right way, in KSS, to prevent an field from submitting the form that it's inside of when the user hits Enter? The only way I have found so far is to say, in my form itself,
But it's embarrassing during presentations, after telling people that KSS prevents them from having to write JavaScript, for them to see that in fact I've had to write JavaScript in every form that I've created in my application. ;-) What's the correct solution? -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From ree at ree.hu Tue Apr 8 08:12:39 2008 From: ree at ree.hu (Balazs Ree) Date: Tue, 8 Apr 2008 08:12:39 +0200 Subject: [Kss-devel] how to prevent forms from submitting when I hit Enter? References: <874padw2yu.fsf@ten22.rhodesmill.org> Message-ID: On Mon, 07 Apr 2008 21:27:21 -0400, Brandon Craig Rhodes wrote: > In my experiments so far, I have had good luck shutting down > submit-button actions by saying > > input#my-submit-button:click { > evt-click-preventdefault: True; > } > What's the right way, in KSS, to prevent an > > > > field from submitting the form that it's inside of when the user hits > Enter? The only way I have found so far is to say, in my form itself, If you want to prevent a form from submitting, you would probably need to bind a "submit" event on the form tag, with evt-preventdefault. That would be, imo, equivalent to your current javascript fix. We have not noticed so far what you point out, and have probably never used this event. However, when we implemented the inline editing, we noticed that browsers behave unexpectedly with the keypress/down/up event and Enter in the submit field. In some cases preventing the form submit was rather tricky. This is not because of kss itself but because of browser madness: once we have a good pattern that works in javascript, we can improve support for it in kss as well. So first of all it would be great if you could look at the "preventdefault" demo in kss.demo. It would be interesting to see if what you see is in line with your experience. It is especially interesting to run this demo on Safari. Then, it would be great if you could create another demo that presents the solution for your current problem. You could also extend the "form_submit" demo if you like since it already has the html. This way the solution you work out could be presented publicly, and we could also test that it works on all browsers. If you could help with this, it would be great. Please let me know on irc if you need any help. -- Balazs Ree From gotcha at bubblenet.be Tue Apr 8 10:11:23 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 08 Apr 2008 10:11:23 +0200 Subject: [Kss-devel] how to prevent forms from submitting when I hit Enter? In-Reply-To: <874padw2yu.fsf@ten22.rhodesmill.org> References: <874padw2yu.fsf@ten22.rhodesmill.org> Message-ID: <47FB28AB.10904@bubblenet.be> Brandon Craig Rhodes wrote: > In my experiments so far, I have had good luck shutting down > submit-button actions by saying > > input#my-submit-button:click { > evt-click-preventdefault: True; > } > > so that my own actions can run instead, without the whole page > reloading. But my careful deactivation of the submit button, it turns > out, is useless if the user tries to activate the form by simply > hitting "Enter" when they are doing typing their input. > > What's the right way, in KSS, to prevent an > > > > field from submitting the form that it's inside of when the user hits > Enter? The only way I have found so far is to say, in my form itself, > >
> >
> > But it's embarrassing during presentations, after telling people that > KSS prevents them from having to write JavaScript, for them to see > that in fact I've had to write JavaScript in every form that I've > created in my application. ;-) What's the correct solution? > I suspect you found one of the places where KSS is still lacking the right code. Can you tell us in which browsers you experience the problem ? This way we can explore it and try to fix the stuff asap. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From gotcha at bubblenet.be Tue Apr 8 10:59:41 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 08 Apr 2008 10:59:41 +0200 Subject: [Kss-devel] how to prevent forms from submitting when I hit Enter? In-Reply-To: <47FB28AB.10904@bubblenet.be> References: <874padw2yu.fsf@ten22.rhodesmill.org> <47FB28AB.10904@bubblenet.be> Message-ID: <47FB33FD.3040308@bubblenet.be> Godefroid Chapelle wrote: > > I suspect you found one of the places where KSS is still lacking the > right code. > > Can you tell us in which browsers you experience the problem ? > > This way we can explore it and try to fix the stuff asap. > Forget about that mail answered too quickly :-S -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From gotcha at bubblenet.be Tue Apr 8 11:45:31 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 08 Apr 2008 11:45:31 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? In-Reply-To: <87bq4lw4vr.fsf@ten22.rhodesmill.org> References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> Message-ID: <47FB3EBB.5060504@bubblenet.be> Brandon Craig Rhodes wrote: > Godefroid Chapelle writes: > >> I should have corrected those tutorials. ... If you have a chance >> to fix those tutorials, please go. > > Thanks! I'll have to get this article done first, though. :-) > >> Further, you can add the info that kss.core 1.4 will go to final as >> soon Plone 3.1 does. > > Is there a "What's New" document somewhere describing what features it > gains in 1.4? There's no real documentation or description offered on > the PyPi page. We should do that documentation : In the meanwhile, you can look at http://codespeak.net/svn/kukit/kukit.js/branch/1.4/doc/HISTORY.txt > >> This mail is also a chance to thank you Brandon for the work done >> evangelizing KSS. > > You're welcome! I'm hoping that Grok could become a Web 2.0 > powerhouse for non-Javascript programmers thanks to KSS; we'll have to > see how compelling I can make my example applications. > > By the way: my examples would look much nicer if I could call jQuery > animation actions in addition to the plain-old KSS actions. Are there > modules that extend KSS with the command sets of different Javascript > libraries? > There are no effects module for now. This is definitely sthing that we should add asap. We need to improve the sexyness ;-) Further, it would be really easy to develop. The biggest problem is to decide which library to use. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ree at ree.hu Tue Apr 8 13:15:39 2008 From: ree at ree.hu (Balazs Ree) Date: Tue, 8 Apr 2008 13:15:39 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> Message-ID: On Tue, 08 Apr 2008 11:45:31 +0200, Godefroid Chapelle wrote: > Brandon Craig Rhodes wrote: >> Godefroid Chapelle >> writes: >> Is there a "What's New" document somewhere describing what features it >> gains in 1.4? There's no real documentation or description offered on >> the PyPi page. > > We should do that documentation : > > In the meanwhile, you can look at > > http://codespeak.net/svn/kukit/kukit.js/branch/1.4/doc/HISTORY.txt I attempted to do this, please take a look here: https://codespeak.net/svn/kukit/kss.core/branch/1.4/docs/NEWS.txt Maybe, we need to extend this NEWS.txt file a bit (tell about the earlier versions too) and use it as a description from setup.py, that way it would end up on the pypi page. -- Balazs Ree From gotcha at bubblenet.be Tue Apr 8 13:28:39 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 08 Apr 2008 13:28:39 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? In-Reply-To: References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> Message-ID: <47FB56E7.6020502@bubblenet.be> Balazs Ree wrote: > On Tue, 08 Apr 2008 11:45:31 +0200, Godefroid Chapelle wrote: >> Brandon Craig Rhodes wrote: >>> Godefroid Chapelle >>> writes: > >>> Is there a "What's New" document somewhere describing what features it >>> gains in 1.4? There's no real documentation or description offered on >>> the PyPi page. >> We should do that documentation : >> >> In the meanwhile, you can look at >> >> http://codespeak.net/svn/kukit/kukit.js/branch/1.4/doc/HISTORY.txt > > I attempted to do this, please take a look here: > > https://codespeak.net/svn/kukit/kss.core/branch/1.4/docs/NEWS.txt > > Maybe, we need to extend this NEWS.txt file a bit (tell about the earlier > versions too) and use it as a description from setup.py, that way it > would end up on the pypi page. > Good idea. We could concat NEWS.txt to static text in the long description -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ree at ree.hu Tue Apr 8 13:39:51 2008 From: ree at ree.hu (Balazs Ree) Date: Tue, 8 Apr 2008 13:39:51 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> <47FB56E7.6020502@bubblenet.be> Message-ID: On Tue, 08 Apr 2008 13:28:39 +0200, Godefroid Chapelle wrote: > Balazs Ree wrote: >> On Tue, 08 Apr 2008 11:45:31 +0200, Godefroid Chapelle wrote: >>> Brandon Craig Rhodes wrote: >>>> Godefroid Chapelle >>>> writes: >> >>>> Is there a "What's New" document somewhere describing what features >>>> it gains in 1.4? There's no real documentation or description >>>> offered on the PyPi page. >>> We should do that documentation : >>> >>> In the meanwhile, you can look at >>> >>> http://codespeak.net/svn/kukit/kukit.js/branch/1.4/doc/HISTORY.txt >> >> I attempted to do this, please take a look here: >> >> https://codespeak.net/svn/kukit/kss.core/branch/1.4/docs/NEWS.txt >> >> Maybe, we need to extend this NEWS.txt file a bit (tell about the >> earlier versions too) and use it as a description from setup.py, that >> way it would end up on the pypi page. >> >> > Good idea. > > We could concat NEWS.txt to static text in the long description I stole this entirely from zc.buildout: --------------------- def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() long_description=( read('README.txt') + '\n' + 'Detailed Documentation\n' '**********************\n' + '\n' + read('src', 'zc', 'buildout', 'buildout.txt') + '\n' + ... + '\n' + read('CHANGES.txt') + '\n' + 'Download\n' '**********************\n' ) ... name = "zc.buildout" setup( name = name, version = version, author = "Jim Fulton", author_email = "jim at zope.com", description = "System for managing development buildouts", long_description=long_description, ... I believe we could do the same with some additional content, NEWS.txt could be the part of it but we probably want some brief description of kss copied from the kssproject.org frontpage to an kssintro.txt, as well as a link to the project page. Afaik, the description must be in ReST so that is already what we have. -- Balazs Ree From gotcha at bubblenet.be Tue Apr 8 14:01:14 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 08 Apr 2008 14:01:14 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? In-Reply-To: References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> <47FB56E7.6020502@bubblenet.be> Message-ID: <47FB5E8A.8040407@bubblenet.be> Balazs Ree wrote: > On Tue, 08 Apr 2008 13:28:39 +0200, Godefroid Chapelle wrote: > >> Balazs Ree wrote: >>> On Tue, 08 Apr 2008 11:45:31 +0200, Godefroid Chapelle wrote: >>>> Brandon Craig Rhodes wrote: >>>>> Godefroid Chapelle >>>>> writes: >>>>> Is there a "What's New" document somewhere describing what features >>>>> it gains in 1.4? There's no real documentation or description >>>>> offered on the PyPi page. >>>> We should do that documentation : >>>> >>>> In the meanwhile, you can look at >>>> >>>> http://codespeak.net/svn/kukit/kukit.js/branch/1.4/doc/HISTORY.txt >>> I attempted to do this, please take a look here: >>> >>> https://codespeak.net/svn/kukit/kss.core/branch/1.4/docs/NEWS.txt >>> >>> Maybe, we need to extend this NEWS.txt file a bit (tell about the >>> earlier versions too) and use it as a description from setup.py, that >>> way it would end up on the pypi page. >>> >>> >> Good idea. >> >> We could concat NEWS.txt to static text in the long description > > > I stole this entirely from zc.buildout: I had guessed so ;-) > > --------------------- > > > def read(*rnames): > return open(os.path.join(os.path.dirname(__file__), *rnames)).read() > > long_description=( > read('README.txt') > + '\n' + > 'Detailed Documentation\n' > '**********************\n' > + '\n' + > read('src', 'zc', 'buildout', 'buildout.txt') > + '\n' + > ... > + '\n' + > read('CHANGES.txt') > + '\n' + > 'Download\n' > '**********************\n' > ) > > ... > > name = "zc.buildout" > setup( > name = name, > version = version, > author = "Jim Fulton", > author_email = "jim at zope.com", > description = "System for managing development buildouts", > long_description=long_description, > ... > > I believe we could do the same with some additional content, NEWS.txt > could be the part of it but we probably want some brief description > of kss copied from the kssproject.org frontpage to an kssintro.txt, I would keep it in README.txt > as well as a link to the project page. +1 > > Afaik, the description must be in ReST so that is already what we have. > Add it if you find time ;-) -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From brandon at rhodesmill.org Tue Apr 8 14:02:39 2008 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Tue, 08 Apr 2008 08:02:39 -0400 Subject: [Kss-devel] will megrok.kss ever go "live"? References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> Message-ID: <87lk3omu5c.fsf@ten22.rhodesmill.org> Godefroid Chapelle writes: > Brandon Craig Rhodes wrote: >> By the way: my examples would look much nicer if I could call >> jQuery animation actions in addition to the plain-old KSS actions. >> > There are no effects module for now. This is definitely sthing that > we should add asap. We need to improve the sexyness ;-) ... The > biggest problem is to decide which library to use. I don't think you should decide on one library, and then make KSS even larger by adding native support for that one library. Instead, keep kss.core as small as possible, and add a kss.jquery, kss.mochikit, kss.dojo, and so forth, as users need them. That way, a user who is going to need to do a few complicated things in raw JavaScript, but who wants to adopt KSS for all of the other actions on his web page, gets to choose which Javascript library gets pulled in. I suppose that there's probably not time for me to write a kss.jquery before my article is due this weekend. :-) How difficult is it to add KSS actions to core KSS from another module? The goal here, as I understand it, would be for a new action like show() to appear as an action that could be called both from a .kss file: ... { client-action: show; show-kssSelector: #magicalAppearingPanel; show-speed: 2; } and could also be called from inside of Python code: jquery = self.getCommandSet('jquery') jquery.show('#magicalAppearingPanel', 2) I'm not sure what to think of getCommandSet() taking an argument; I guess that keeps different command sets from conflicting, since there might be several that want to use the same method name? It just looks like it could be a lot of work, as I write out eight actions that need to happen, to remember which one comes from which command set: core = self.getCommandSet('core') jquery = self.getCommandSet('jquery') core.replaceInnerHTML('#magicPanelTitle', title) core.replaceInnerHTML('#magicPanelContent', content) jquery.show('#magicalAppearingPanel', 2) core.replaceInnerHTML('#myFormText', title) jquery.slideDown('#myForm', 1) Well, okay, maybe that example wound up looking not-as-bad as I'd thought. :-) -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From gotcha at bubblenet.be Tue Apr 8 14:15:23 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 08 Apr 2008 14:15:23 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? In-Reply-To: <87lk3omu5c.fsf@ten22.rhodesmill.org> References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> <87lk3omu5c.fsf@ten22.rhodesmill.org> Message-ID: <47FB61DB.5020905@bubblenet.be> Brandon Craig Rhodes wrote: > Godefroid Chapelle writes: > >> Brandon Craig Rhodes wrote: >>> By the way: my examples would look much nicer if I could call >>> jQuery animation actions in addition to the plain-old KSS actions. >>> >> There are no effects module for now. This is definitely sthing that >> we should add asap. We need to improve the sexyness ;-) ... The >> biggest problem is to decide which library to use. > > I don't think you should decide on one library, and then make KSS even > larger by adding native support for that one library. Instead, keep > kss.core as small as possible, and add a kss.jquery, kss.mochikit, > kss.dojo, and so forth, as users need them. That way, a user who is > going to need to do a few complicated things in raw JavaScript, but > who wants to adopt KSS for all of the other actions on his web page, > gets to choose which Javascript library gets pulled in. Makes sense, I like the idea. However, I think it would be nice for KSS to have a single way of expressing effects through various libraries even if their implementation differ because of underlying libraries > I suppose that there's probably not time for me to write a kss.jquery > before my article is due this weekend. :-) How difficult is it to add > KSS actions to core KSS from another module? It is easy. Look at http://codespeak.net/svn/kukit/kss.core/trunk/kss/core/plugins/effects/browser/plugin.js However, please do not add it to core... > The goal here, as I > understand it, would be for a new action like show() to appear as an > action that could be called both from a .kss file: > > ... { > client-action: show; > show-kssSelector: #magicalAppearingPanel; > show-speed: 2; > } > It would rather be client-action: jqueryeffects-show; We have namespaces... > and could also be called from inside of Python code: > > jquery = self.getCommandSet('jquery') > jquery.show('#magicalAppearingPanel', 2) > > I'm not sure what to think of getCommandSet() taking an argument; I > guess that keeps different command sets from conflicting, since there > might be several that want to use the same method name? Exactly, this is both for plugins to add their own commands. And for higher level command sets that are composed of basic commands like in Plone 3 command sets. > It just looks > like it could be a lot of work, as I write out eight actions that need > to happen, to remember which one comes from which command set: > > core = self.getCommandSet('core') > jquery = self.getCommandSet('jquery') > core.replaceInnerHTML('#magicPanelTitle', title) > core.replaceInnerHTML('#magicPanelContent', content) > jquery.show('#magicalAppearingPanel', 2) > core.replaceInnerHTML('#myFormText', title) > jquery.slideDown('#myForm', 1) > > Well, okay, maybe that example wound up looking not-as-bad as I'd > thought. :-) > I am happy, it feels ok to you... -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From brandon at rhodesmill.org Tue Apr 8 14:18:56 2008 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Tue, 08 Apr 2008 08:18:56 -0400 Subject: [Kss-devel] will megrok.kss ever go "live"? References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> <47FB56E7.6020502@bubblenet.be> <47FB5E8A.8040407@bubblenet.be> Message-ID: <87abk4mte7.fsf@ten22.rhodesmill.org> Godefroid Chapelle writes: > Balazs Ree wrote: > >> I stole this entirely from zc.buildout: > > I had guessed so ;-) Note that zc.buildout is known for traditionally having a poor documentation "presence" on PyPI. :-) Though it has gotten better - I see that it now has examples of useful buildout.cfg's at the top, before it plunges into impenetrable doctests - it's bad enough that someone just blogged about it: http://groovie.org/articles/2008/04/04/sacrificing-readability-for-automated-doc-tests So we should try to make sure that the documentation for KSS, if we copy buildout's recipe, makes more sense than buildout's horrible series of unexplained and difficult doctests that it throws across its PyPI page. :-) Remember, too, that the way PyPI currently works, users can't "see" the actual links available for download (which some people do still use) until they make it to the bottom of the documentation. For this reason, I usually limit my PyPI documentation to (a) an exciting and human-readable statement about what my package does, with one or two pieces of Python code thrown in to illustrate, and perhaps (b) a list of what's new in this particular version (not the whole history of the project, which pushes the rest of the text way to the bottom of people's scroll bars!). The one module on earth that I myself am responsible for has PyPI documentation that looks like: http://pypi.python.org/pypi/pyephem/3.7.2.3 Anyway, just a thought. -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From ree at ree.hu Tue Apr 8 14:32:37 2008 From: ree at ree.hu (Balazs Ree) Date: Tue, 8 Apr 2008 14:32:37 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> <47FB56E7.6020502@bubblenet.be> <47FB5E8A.8040407@bubblenet.be> <87abk4mte7.fsf@ten22.rhodesmill.org> Message-ID: Hi Brandon, On Tue, 08 Apr 2008 08:18:56 -0400, Brandon Craig Rhodes wrote: > Godefroid Chapelle > writes: > >> Balazs Ree wrote: >> >>> I stole this entirely from zc.buildout: >> >> I had guessed so ;-) > > Note that zc.buildout is known for traditionally having a poor > documentation "presence" on PyPI. :-) ... > So we should try to make sure that the documentation for KSS, if we copy > buildout's recipe, makes more sense than buildout's horrible series of > unexplained and difficult doctests that it throws across its PyPI page. > :-) > The one module on earth that I myself am responsible for has PyPI > documentation that looks like: > > http://pypi.python.org/pypi/pyephem/3.7.2.3 > > Anyway, just a thought. I only suggested to "steal" the pattern of generating the pypi frontpage from doc/* fragments but obvoisly not the perceived "badness" from zc.buildout. You are absoultely welcome to help improve the kss documentation and the pypi appearance better! I will try to find the time to hook in the files we have including NEWS.txt to long_description. Still, we will have time to improve it together before it actually appears live: that is when the next egg is released. Best wishes, -- Balazs Ree From ree at ree.hu Tue Apr 8 14:45:13 2008 From: ree at ree.hu (Balazs Ree) Date: Tue, 8 Apr 2008 14:45:13 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> <87lk3omu5c.fsf@ten22.rhodesmill.org> <47FB61DB.5020905@bubblenet.be> Message-ID: On Tue, 08 Apr 2008 14:15:23 +0200, Godefroid Chapelle wrote: > Brandon Craig Rhodes wrote: >> Godefroid Chapelle >> writes: >> >>> Brandon Craig Rhodes wrote: >>>> By the way: my examples would look much nicer if I could call jQuery >>>> animation actions in addition to the plain-old KSS actions. >>>> >>> There are no effects module for now. This is definitely sthing that >>> we should add asap. We need to improve the sexyness ;-) ... The >>> biggest problem is to decide which library to use. >> >> I don't think you should decide on one library, and then make KSS even >> larger by adding native support for that one library. Instead, keep >> kss.core as small as possible, and add a kss.jquery, kss.mochikit, >> kss.dojo, and so forth, as users need them. That way, a user who is >> going to need to do a few complicated things in raw JavaScript, but who >> wants to adopt KSS for all of the other actions on his web page, gets >> to choose which Javascript library gets pulled in. > > Makes sense, I like the idea. > > However, I think it would be nice for KSS to have a single way of > expressing effects through various libraries even if their > implementation differ because of underlying libraries > I second Godefroid. At present, there is an express interest in making the effects work with at least two libraries: Yahoo UI and jQuery. I believe both plugins should be done in the way choosen freely by the implementor. As a second step - only after we have more working implementations - we should look at the two implementations and come up with a unified action set from kss. That way an application should not be aware if an effect is implemented with one or the other library. Naturally, some library can offer more effects or more parameters with a given effect. For package name I would propose not kss.jquery but some name under the plugin namespace that tells that this implements the effects. Like: "kss.plugins.jquery_effects" For the action namespace, I would propose to use something like: jqeffects Naturally, you are free to choose your own way, beyond these suggestions. -- Balazs Ree From shywolf9982 at gmail.com Tue Apr 8 15:04:33 2008 From: shywolf9982 at gmail.com (Simone Deponti) Date: Tue, 08 Apr 2008 15:04:33 +0200 Subject: [Kss-devel] will megrok.kss ever go "live"? References: <87d4p2gugm.fsf@ten22.rhodesmill.org> <47FA271D.10107@bubblenet.be> <87bq4lw4vr.fsf@ten22.rhodesmill.org> <47FB3EBB.5060504@bubblenet.be> Message-ID: Hi all, Godefroid Chapelle wrote: > There are no effects module for now. > > This is definitely sthing that we should add asap. We need to improve > the sexyness ;-) > > Further, it would be really easy to develop. The biggest problem is to > decide which library to use. > I have been giving a look at Yahho UI Library in the hope to add effects for a project I have to develop. However, YUI's API for effects is rather generic, as it doesn't provide per-se a set of effects, but rather provides the following facilities: * An animation facility to move DOM elements around (even along a Bezier path) * A transition utility that helps into defining how the transition should happen (very fast at the beginning and slowing down toward the end, etc) * A generic facility to modify the CSS of an element and transition from a CSS "state" to another: ex. if I want a fade, I can go var myAnim = new YAHOO.util.Anim(el, { opacity: { from: 1.0, to: 0.0 } }, 1, YAHOO.util.Easing.easeOut); myAnim.animate(); So with YUI we can either choose one of the two approaches: 1. Have a set of defined effects (like fade etc etc) action-client: fade; action-fade-transition: quadric; 2. Have a more general API that goes like: action-client: anim; action-anim-attribute: opacity; action-anim-from: 1.0; action-anim-to: 0.0; action-anim-transition: quadric; (Note: quadric equals easeOut in YUI) Honestly, I guess that for YUI both APIs can apply, as we can have more JS in the plugin that "composes" the basic YUI commands to have the desired effect. In my opinions, there is the choice: a more generic effects API (2) or a more effect-oriented one (1) Pros of 1: * More easy to use * Could support YUI, jQuery(?) and Scriptaculous/MooTools (all the prototype derived ones) Cons of 1: * Less flexible Pros of 2: * More flexible Cons of 2: * Probably not implementable with Scriptaculous and Mootools * Harder to master for the KSS user (where by user I mean "him who develops using KSS") I would like to receive some feedback from the list about this two API drafts I thought about, so I can direct my effort on YUI toward a common goal :) P.S. Since I work for a communication/advertising agency, effects are a must for us: I like the YUI library as of now, due to its flexibility so I will try to implement a KSS effect plugins based on it, however I have no preference on the API to expose. -- Simone Deponti (shywolf9982) From shywolf9982 at gmail.com Tue Apr 8 15:17:15 2008 From: shywolf9982 at gmail.com (Simone Deponti) Date: Tue, 08 Apr 2008 15:17:15 +0200 Subject: [Kss-devel] how to prevent forms from submitting when I hit Enter? References: <874padw2yu.fsf@ten22.rhodesmill.org> Message-ID: Balazs Ree wrote: > > If you want to prevent a form from submitting, you would probably need > to bind a "submit" event on the form tag, with evt-preventdefault. That > would be, imo, equivalent to your current javascript fix. > > We have not noticed so far what you point out, and have probably never > used this event. However, when we implemented the inline editing, we > noticed that browsers behave unexpectedly with the keypress/down/up event > and Enter in the submit field. In some cases preventing the form submit > was rather tricky. This is not because of kss itself but because of > browser madness: once we have a good pattern that works in javascript, we > can improve support for it in kss as well. > I worked on this on the Sorrento sprint 2007. Basically, you should inhibit the default behaviour for the event keypress and keyup on all the inputs inside the form. As example (taken from at.kss in Plone): form.inlineForm input[type="text"].blurrable:keypress { evt-keypress-preventdefault: true; evt-keypress-keycodes: 13; [snip] } form.inlineForm input[type="text"].blurrable:keyup { evt-keyup-preventdefault: true; evt-keyup-keycodes: 13; [snip] } This is because the default behaviour on text input boxes when a user presses enter is to submit the form. However, for some browsers this happens on keypress, for some on keyup, so you have to "kill" both. Hope I made any sense: this is however, browser madness, as every browser reacts to key events in different stages of it. The theory is: When a user depresses a key, fire keyDown While the key is kept depressed, fire keyPress at regular intervals (as defined by the user in its keyboard settings: this is very client dependant) When the key is depressed, fire keyUp The logic wants that an event such as submit form should be fired on keyUp, but apparently browsers do have a weird idea of logic. If I recall correctly, safari had the bad habit to fire it twice, on keyPress AND keyUp. So yeah, KSS spares you the burden to write Javascript, but can't fix your browser (else, everyone would be using KSS and we will forget about IE6 :D). -- Simone Deponti (shywolf9982) From christophe.bosse at ingeniweb.com Tue Apr 8 15:21:26 2008 From: christophe.bosse at ingeniweb.com (Christophe Bosse) Date: Tue, 8 Apr 2008 15:21:26 +0200 Subject: [Kss-devel] er._LateBinder and memory leaks Message-ID: Hey, I've made a plugin for kss using jQuery.draggable / droppable. I was using the 1.2.4 kss.core but now that I use 1.4 I have a problem. I was using the LaterBinder but now it is a private function, can this be turned a a public function for kukit.er ? Check how I use it: var executor = new kukit.er._LateBinder(eventBinder, name, node); return function(e, ui){ originalMethod.call(node, e, ui); if (!ui.cancel) executor.executeActions(); }; originalMethod is the client function when starting dragging or dropping, I need to call it just before the server one. In a other hand I found many memory leaks under IE6 for each kss rules. Check this to eradicate them: http://novemberborn.net/javascript/event-cache http://www.javascriptkit.com/javatutors/closuresleak/index.shtml http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx A tool to detect memory leaks: http://home.wanadoo.nl/jsrosman/ Also an other bug I found in actionreg.js there is a kukit.logerror in lowercase line 42. I can submit you my jQuery drag and drop plugin to include it (the mochi kit one is outdated and not functional). -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20080408/a6738fbd/attachment.htm From christophe.bosse at ingeniweb.com Tue Apr 8 15:21:26 2008 From: christophe.bosse at ingeniweb.com (Christophe Bosse) Date: Tue, 8 Apr 2008 15:21:26 +0200 Subject: [Kss-devel] er._LateBinder and memory leaks Message-ID: Hey, I've made a plugin for kss using jQuery.draggable / droppable. I was using the 1.2.4 kss.core but now that I use 1.4 I have a problem. I was using the LaterBinder but now it is a private function, can this be turned a a public function for kukit.er ? Check how I use it: var executor = new kukit.er._LateBinder(eventBinder, name, node); return function(e, ui){ originalMethod.call(node, e, ui); if (!ui.cancel) executor.executeActions(); }; originalMethod is the client function when starting dragging or dropping, I need to call it just before the server one. In a other hand I found many memory leaks under IE6 for each kss rules. Check this to eradicate them: http://novemberborn.net/javascript/event-cache http://www.javascriptkit.com/javatutors/closuresleak/index.shtml http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx A tool to detect memory leaks: http://home.wanadoo.nl/jsrosman/ Also an other bug I found in actionreg.js there is a kukit.logerror in lowercase line 42. I can submit you my jQuery drag and drop plugin to include it (the mochi kit one is outdated and not functional). -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20080408/a6738fbd/attachment-0001.htm From ree at ree.hu Tue Apr 8 15:55:32 2008 From: ree at ree.hu (Balazs Ree) Date: Tue, 8 Apr 2008 15:55:32 +0200 Subject: [Kss-devel] er._LateBinder and memory leaks References: Message-ID: On Tue, 08 Apr 2008 15:21:26 +0200, Christophe Bosse wrote: > Hey, > > I've made a plugin for kss using jQuery.draggable / droppable. I was > using the 1.2.4 kss.core but now that I use 1.4 I have a problem. > > I was using the LaterBinder but now it is a private function, can this > be turned a a public function for kukit.er ? Don't use late binder any more. The solution is to choose a "binding stragegy". With this, you can specify which set of bindings your bind method receives together and in what grouping. Ie, you can receive the drag and drop bindings together and decide how you handle them. As we have binding strategies, we will not need the late binder any more. I believe it will even be removed at one point. You may want to look at the Yahoo dnd implementation (kss.plugin.yuidnd, in the collective repository) which is working quite good and see how the binding is done there. Maybe Guido, the author could give you a help in the jQuery implementation. Documentation is still sparse in this topic. -- Balazs Ree From gotcha at bubblenet.be Tue Apr 8 15:57:41 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 08 Apr 2008 15:57:41 +0200 Subject: [Kss-devel] er._LateBinder and memory leaks In-Reply-To: References: Message-ID: <47FB79D5.7050904@bubblenet.be> Christophe Bosse wrote: > In a other hand I found many memory leaks under IE6 for each kss rules. > Check this to eradicate them: > http://novemberborn.net/javascript/event-cache > http://www.javascriptkit.com/javatutors/closuresleak/index.shtml > http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx > > A tool to detect memory leaks: http://home.wanadoo.nl/jsrosman/ Will you join the Plone 3 sprint in Paris ? I'd be pleased if you could show me how to use those tools ad/or hint me how to fix them... And obviously, if you feel like doing it, you are welcome... just need to ask for a codespeak account. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From steve at dcn.org Mon Apr 14 01:51:35 2008 From: steve at dcn.org (Steve McMahon) Date: Sun, 13 Apr 2008 23:51:35 +0000 (UTC) Subject: [Kss-devel] Changes in action-cancel? Message-ID: Greetings KSS folks! Somewhere between Plone 3.0 and 3.1 some I used to cancel a blur server action has stopped working. The Archetypes KSS support includes: input.blurrable:blur { action-server: kssValidateField; kssValidateField-fieldname: kssAttr('atfieldname', true); kssValidateField-value: currentFormVar(); kssValidateField-uid: kssAttr('atuid', true); } PloneFormGen, which reuses the Archetypes fields, needs to avoid the inline validation, and I've used the code: .pfg-form input.blurrable:blur { action-cancel: kssValidateField; } I'm pretty sure that was working in Plone 3.0, but the server event is occurring in Plone 3.1. If I use: .pfg-form input.blurrable:blur { action-client: alert; alert-message: "from ploneformgen.kss"; } I do get the expected alert. Please let me know if I completely off base, or if there's any more I could do to track this down. Thanks! Steve From brandon at rhodesmill.org Tue Apr 15 05:40:11 2008 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Mon, 14 Apr 2008 23:40:11 -0400 Subject: [Kss-devel] how to remove focus from text ? Message-ID: <87y77fkcpw.fsf@ten22.rhodesmill.org> I have an app with a text field that, once I'm done saving the value the user entered, I hide with an appropriate adjustment of the form's class. The problem is that, once the form has its "visibility: hidden", Firefox still keeps the text cursor in the text field - I can see it still sitting there, even though the form and text field around it is now invisible, and I can even see it move back and forth as I type; and by hitting Enter, I can still submit it! I see from this web page: http://codespeak.net/svn/kukit/docs/introducing_kss/trunk/3-shipped-kss-plugins.txt (which, by the way, is the most complete documentation I have found so far for KSS) that KSS supports a "focus" action that can *give* focus to a form field. But I want a "takeFocusAway" action. :-) Does KSS support anything like that? Or is the whole idea of hiding a form, when the user is done with it, daft? Thanks for any advice! -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From hedleyroos at gmail.com Tue Apr 15 09:34:20 2008 From: hedleyroos at gmail.com (Hedley Roos) Date: Tue, 15 Apr 2008 09:34:20 +0200 Subject: [Kss-devel] how to remove focus from text ? In-Reply-To: <87y77fkcpw.fsf@ten22.rhodesmill.org> References: <87y77fkcpw.fsf@ten22.rhodesmill.org> Message-ID: <776caf8b0804150034n4340b5f5meb24be97ef2003bb@mail.gmail.com> What happens if you set innerHTML for say a span around your textarea to an empty string? By this I mean you have . You could also 1. Write a kss plugin which enables you to remove focus from your server side code. There are examples of this from some sprint which I cannot recall now. 2. Stick a pice of javascript on your textarea, eg. onClick=set_focus_to_something_else(). But it may be annoying if you need inline validation on the textarea since you'll keep losing focus. In some cases onX javascript events on nodes are executed even though kss bindings exist for those nodes. I think (1) is the way to go. Hedley From gotcha at bubblenet.be Tue Apr 15 18:15:46 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 15 Apr 2008 18:15:46 +0200 Subject: [Kss-devel] how to remove focus from text ? In-Reply-To: <87y77fkcpw.fsf@ten22.rhodesmill.org> References: <87y77fkcpw.fsf@ten22.rhodesmill.org> Message-ID: <4804D4B2.1050907@bubblenet.be> Brandon Craig Rhodes wrote: > I have an app with a text field that, once I'm done saving the value > the user entered, I hide with an appropriate adjustment of the form's > class. The problem is that, once the form has its "visibility: > hidden", Firefox still keeps the text cursor in the text field - I can > see it still sitting there, even though the form and text field around > it is now invisible, and I can even see it move back and forth as I > type; and by hitting Enter, I can still submit it! > > I see from this web page: > > http://codespeak.net/svn/kukit/docs/introducing_kss/trunk/3-shipped-kss-plugins.txt > > (which, by the way, is the most complete documentation I have found so > far for KSS) that KSS supports a "focus" action that can *give* focus > to a form field. But I want a "takeFocusAway" action. :-) I need to check if anything like takeFocusAway exists in browsers... If it does, we should add the ability to KSS. > Does KSS > support anything like that? Or is the whole idea of hiding a form, > when the user is done with it, daft? I do not know your use case, however, I suspect the idea of hiding the form instead of removing it is daft. I suppose that you submit the form to the server before hiding it. Ido not see why the KSS response could not remove the form. If you need the form again, just ask it to the server again and insert it... > > Thanks for any advice! > -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From gotcha at bubblenet.be Tue Apr 15 18:25:29 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 15 Apr 2008 18:25:29 +0200 Subject: [Kss-devel] Changes in action-cancel? In-Reply-To: References: Message-ID: <4804D6F9.9030000@bubblenet.be> Steve McMahon wrote: > Greetings KSS folks! > > Somewhere between Plone 3.0 and 3.1 some I used to cancel a blur server action > has stopped working. > > The Archetypes KSS support includes: > > input.blurrable:blur { > action-server: kssValidateField; > kssValidateField-fieldname: kssAttr('atfieldname', true); > kssValidateField-value: currentFormVar(); > kssValidateField-uid: kssAttr('atuid', true); > } > > PloneFormGen, which reuses the Archetypes fields, needs to avoid the inline > validation, and I've used the code: > > .pfg-form input.blurrable:blur { > action-cancel: kssValidateField; > } > > I'm pretty sure that was working in Plone 3.0, but the server event is occurring > in Plone 3.1. If I use: > > .pfg-form input.blurrable:blur { > action-client: alert; > alert-message: "from ploneformgen.kss"; > } > > I do get the expected alert. > > Please let me know if I completely off base, or if there's any more I could do > to track this down. > > Thanks! Steve > > I wonder if we have any test for action-cancel. I suspect there are none. One of us should add a test, check if it does work in kss.core 1.2 and 1.4 and fix whatever is needed. I'll try to do that asap. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From sgillies at frii.com Tue Apr 15 23:20:09 2008 From: sgillies at frii.com (Sean Gillies) Date: Tue, 15 Apr 2008 15:20:09 -0600 Subject: [Kss-devel] zope.View permission from zope.app.security In-Reply-To: <47E270A2.7030800@bubblenet.be> References: <47E20520.9000208@bubblenet.be> <47E270A2.7030800@bubblenet.be> Message-ID: Godefroid Chapelle wrote: > Sean Gillies wrote: >> Godefroid Chapelle wrote: >>> Sean Gillies wrote: >>>> Could kss.core include zope.app.security instead of separately defining >>>> a zope.View permission? If so, I have the patch ready to go, all >>>> kss.core tests pass. >>>> >>>> Sean >>> kss.core is supposed to work both with Z2 and Z3. >>> >>> What is your setup ? >>> >>> Can you send the patch ? >>> >>> >> I'm using Plone 3.1 beta and Zope 2.10.5. Patch for kss.core is attached. >> >> I'm developing a Plone 3 product around a working Zope (3.4) package >> that includes zope.app.security and have found that the zope.View >> permission defined in kss.core conflicts. >> >> Sean > > Thanks for the patch. > > Balazs, could that permission.zcml file be a remainder of Zope 2.8 > compatibility ? > Following up: is the patch acceptable? Sean From brandon at rhodesmill.org Wed Apr 16 03:21:02 2008 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Tue, 15 Apr 2008 21:21:02 -0400 Subject: [Kss-devel] how to remove focus from text ? References: <87y77fkcpw.fsf@ten22.rhodesmill.org> <4804D4B2.1050907@bubblenet.be> Message-ID: <87r6d6y4qp.fsf@ten22.rhodesmill.org> Godefroid Chapelle writes: > Brandon Craig Rhodes wrote: >> I have an app with a text field that ... I hide with an appropriate >> adjustment of the form's class. > > I do not know your use case, however, I suspect the idea of hiding > the form instead of removing it is daft. But if I remove the form, then the page is disrupted by everything having to be laid out again, and everything on the page moves around. Whereas, if I simply hide the form, then everything on the page stays where it is. Are there techniques for keeping a page stable when removing a large element like a form? -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From gotcha at bubblenet.be Wed Apr 16 08:57:19 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Wed, 16 Apr 2008 08:57:19 +0200 Subject: [Kss-devel] how to remove focus from text ? In-Reply-To: <87r6d6y4qp.fsf@ten22.rhodesmill.org> References: <87y77fkcpw.fsf@ten22.rhodesmill.org> <4804D4B2.1050907@bubblenet.be> <87r6d6y4qp.fsf@ten22.rhodesmill.org> Message-ID: <4805A34F.2000605@bubblenet.be> Brandon Craig Rhodes wrote: > Godefroid Chapelle writes: > >> Brandon Craig Rhodes wrote: > >>> I have an app with a text field that ... I hide with an appropriate >>> adjustment of the form's class. >> I do not know your use case, however, I suspect the idea of hiding >> the form instead of removing it is daft. > > But if I remove the form, then the page is disrupted by everything > having to be laid out again, and everything on the page moves around. > Whereas, if I simply hide the form, then everything on the page stays > where it is. Are there techniques for keeping a page stable when > removing a large element like a form? > I am not good enough to understand what the difference is between hiding a form and removing it on the browser side. I guess it is a CSS related problem. IOW, tuning the CSS should allow to solve those moves you see... -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From gotcha at bubblenet.be Wed Apr 16 09:08:19 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Wed, 16 Apr 2008 09:08:19 +0200 Subject: [Kss-devel] zope.View permission from zope.app.security In-Reply-To: References: <47E20520.9000208@bubblenet.be> <47E270A2.7030800@bubblenet.be> Message-ID: Sean Gillies wrote: > Godefroid Chapelle wrote: >> Sean Gillies wrote: >>> Godefroid Chapelle wrote: >>>> Sean Gillies wrote: >>>>> Could kss.core include zope.app.security instead of separately defining >>>>> a zope.View permission? If so, I have the patch ready to go, all >>>>> kss.core tests pass. >>>>> >>>>> Sean >>>> kss.core is supposed to work both with Z2 and Z3. >>>> >>>> What is your setup ? >>>> >>>> Can you send the patch ? >>>> >>>> >>> I'm using Plone 3.1 beta and Zope 2.10.5. Patch for kss.core is attached. >>> >>> I'm developing a Plone 3 product around a working Zope (3.4) package >>> that includes zope.app.security and have found that the zope.View >>> permission defined in kss.core conflicts. >>> >>> Sean >> Thanks for the patch. >> >> Balazs, could that permission.zcml file be a remainder of Zope 2.8 >> compatibility ? >> > > Following up: is the patch acceptable? > > Sean > I still found no time to get around the patch. I'll look at it a last at the Grokkerdam sprint. Sorry :-S -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ggozad at qiweb.net Wed Apr 16 20:27:18 2008 From: ggozad at qiweb.net (George Gozadinos) Date: Wed, 16 Apr 2008 21:27:18 +0300 Subject: [Kss-devel] polling substitute Message-ID: Hey, I am the author of qi.LiveChat which gives live chat functionality to plone using kss. For that and other projects I rely naively to polling the server with an event-timeout. Do we have currently an alternative to polling with kss? If not and supposing that would be a good thing to have in kss what are the best alternatives to polling that other frameworks use? Anybody else interested in helping out with that? gg Dr. G. Gozadinos ggozad at qiweb.net http://qiweb.net From gotcha at bubblenet.be Wed Apr 16 22:36:41 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Wed, 16 Apr 2008 22:36:41 +0200 Subject: [Kss-devel] polling substitute In-Reply-To: References: Message-ID: <48066359.5050406@bubblenet.be> George Gozadinos wrote: > Hey, > > I am the author of qi.LiveChat which gives live chat functionality to > plone using kss. For that and other projects I rely naively to polling > the server with an event-timeout. > Do we have currently an alternative to polling with kss? > If not and supposing that would be a good thing to have in kss what > are the best alternatives to polling that other frameworks use? > Anybody else interested in helping out with that? > > gg Jean-Nicolas Bes started to code some comet-like solution back at Snow Sprint 2007. Since then, he got help from various persons including Balazs... I think he can explain much better than I would... -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From christophe.bosse at ingeniweb.com Thu Apr 17 17:13:11 2008 From: christophe.bosse at ingeniweb.com (Christophe Bosse) Date: Thu, 17 Apr 2008 17:13:11 +0200 Subject: [Kss-devel] Memory leaks Message-ID: So here's the trick to avoid memory leaks: For each node bound to an event there are 2 attributes (_kukitMark and uniqueID) set to a node, that's what it causes leaks. We must track those nodes to clean them on document unload. To clean attributes we must set them to null. Those leaks are very important. I've done a folder_contents which has many rules for every single row and my IE grow by 5megs on each page !!! -- Christophe BOSSE - Fonction INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632 Bureaux de la Colline - 1 rue Royal - B?timent D - 9?me ?tage 92210 Saint Cloud - France Phone : 01 78 15 24 02 / Fax : 01 46 02 44 04 http://www.ingeniweb.com - une soci?t? du groupe Alter Way -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20080417/4d091f0d/attachment.htm From christophe.bosse at ingeniweb.com Thu Apr 17 17:14:31 2008 From: christophe.bosse at ingeniweb.com (Christophe Bosse) Date: Thu, 17 Apr 2008 17:14:31 +0200 Subject: [Kss-devel] Memory leaks In-Reply-To: References: Message-ID: Check jQuery().data(key, value), it is clean when unloading. 2008/4/17, Christophe Bosse : > > So here's the trick to avoid memory leaks: > For each node bound to an event there are 2 attributes (_kukitMark and > uniqueID) set to a node, that's what it causes leaks. > > We must track those nodes to clean them on document unload. > To clean attributes we must set them to null. > > Those leaks are very important. I've done a folder_contents which has many > rules for every single row and my IE grow by 5megs on each page !!! > > > -- > Christophe BOSSE - Fonction > INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632 > Bureaux de la Colline - 1 rue Royal - B?timent D - 9?me ?tage > 92210 Saint Cloud - France > Phone : 01 78 15 24 02 / Fax : 01 46 02 44 04 > http://www.ingeniweb.com - une soci?t? du groupe Alter Way -- Christophe BOSSE - Fonction INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632 Bureaux de la Colline - 1 rue Royal - B?timent D - 9?me ?tage 92210 Saint Cloud - France Phone : 01 78 15 24 02 / Fax : 01 46 02 44 04 http://www.ingeniweb.com - une soci?t? du groupe Alter Way -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20080417/47587161/attachment.htm From ree at ree.hu Thu Apr 17 18:09:41 2008 From: ree at ree.hu (Balazs Ree) Date: Thu, 17 Apr 2008 18:09:41 +0200 Subject: [Kss-devel] Memory leaks References: Message-ID: Hi Christophe, thanks for your investigation. On Thu, 17 Apr 2008 17:13:11 +0200, Christophe Bosse wrote: > So here's the trick to avoid memory leaks: For each node bound to an > event there are 2 attributes (_kukitMark and uniqueID) set to a node, > that's what it causes leaks. > > We must track those nodes to clean them on document unload. To clean > attributes we must set them to null. Instead of tracking them down, we should not set them at first. If this is true, We probably need to change the way the _kukitmark is handled. uniqueId cannot likely cause leaks on IE, because it is a builtin on IE, and we only set those attributes on FF. In addition, I am worried if setting a normal attribute causes a problem on IE as well? Or are those deleted for sure when a node is deleted? > Those leaks are very important. I've done a folder_contents which has > many rules for every single row and my IE grow by 5megs on each page !!! Is this only on IE? And what version exactly? Best wishes, -- Balazs Ree From ree at ree.hu Thu Apr 17 19:26:31 2008 From: ree at ree.hu (Balazs Ree) Date: Thu, 17 Apr 2008 19:26:31 +0200 Subject: [Kss-devel] Memory leaks References: Message-ID: On Thu, 17 Apr 2008 18:09:41 +0200, Balazs Ree wrote: > Hi Christophe, > > thanks for your investigation. > > On Thu, 17 Apr 2008 17:13:11 +0200, Christophe Bosse wrote: >> Those leaks are very important. I've done a folder_contents which has >> many rules for every single row and my IE grow by 5megs on each page >> !!! > > Is this only on IE? And what version exactly? > p.s. it just occured to me, folder_contents does not use KSS on the rows, afaik. -- Balazs Ree From gotcha at bubblenet.be Fri Apr 18 09:35:38 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Fri, 18 Apr 2008 09:35:38 +0200 Subject: [Kss-devel] Memory leaks In-Reply-To: References: Message-ID: <48084F4A.1030800@bubblenet.be> Balazs Ree wrote: > On Thu, 17 Apr 2008 18:09:41 +0200, Balazs Ree wrote: > >> Hi Christophe, >> >> thanks for your investigation. >> >> On Thu, 17 Apr 2008 17:13:11 +0200, Christophe Bosse wrote: > >>> Those leaks are very important. I've done a folder_contents which has >>> many rules for every single row and my IE grow by 5megs on each page >>> !!! >> Is this only on IE? And what version exactly? >> > > p.s. it just occured to me, folder_contents does not use KSS on the rows, > afaik. > I think Christophe has built his own folder_contents with his own KSS rules. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From jnbes at atreal.net Thu Apr 17 10:57:37 2008 From: jnbes at atreal.net (=?ISO-8859-1?Q?Jean-Nicolas_B=E8s?=) Date: Thu, 17 Apr 2008 10:57:37 +0200 Subject: [Kss-devel] polling substitute In-Reply-To: <48066359.5050406@bubblenet.be> References: <48066359.5050406@bubblenet.be> Message-ID: <48071101.2020508@atreal.net> Godefroid Chapelle wrote: > > > George Gozadinos wrote: >> Hey, >> >> I am the author of qi.LiveChat which gives live chat functionality >> to plone using kss. For that and other projects I rely naively to >> polling the server with an event-timeout. >> Do we have currently an alternative to polling with kss? >> If not and supposing that would be a good thing to have in kss what >> are the best alternatives to polling that other frameworks use? >> Anybody else interested in helping out with that? >> >> gg > > Jean-Nicolas Bes started to code some comet-like solution back at Snow > Sprint 2007. Yeah, and we've improved it at Snow Sprint 2008. I'm gonna work on it at the Paris Sprint, next week. I'm planning to make the fileupload fully working and broaden the use of the tools we already written to make people able to write apps like qi.LiveChat that use eventPush as a backend to push messages to the client. In the meantime, I'm gonna take a look at qi.LiveChat to see how we could integrate eventPush in the picture. Best regards, Jean-Nicolas B?s. From ree at ree.hu Fri Apr 18 15:59:56 2008 From: ree at ree.hu (Balazs Ree) Date: Fri, 18 Apr 2008 15:59:56 +0200 Subject: [Kss-devel] Memory leaks References: <48084F4A.1030800@bubblenet.be> Message-ID: On Fri, 18 Apr 2008 09:35:38 +0200, Godefroid Chapelle wrote: > Balazs Ree wrote: >> On Thu, 17 Apr 2008 18:09:41 +0200, Balazs Ree wrote: >> >>> Hi Christophe, >>> >>> thanks for your investigation. >>> >>> On Thu, 17 Apr 2008 17:13:11 +0200, Christophe Bosse wrote: >> >>>> Those leaks are very important. I've done a folder_contents which has >>>> many rules for every single row and my IE grow by 5megs on each page >>>> !!! >>> Is this only on IE? And what version exactly? >>> >>> >> p.s. it just occured to me, folder_contents does not use KSS on the >> rows, afaik. >> > I think Christophe has built his own folder_contents with his own KSS > rules. Ah, sorry. I may have skipped this information from the beginning of the thread. Dear Cristophe, can you help us with tracking down this issue, let me re- formulate the questions I asked in my previous post! It would be essential to get the answers from you. - Does this only happen on IE, and if yes, on which versions exactly? - What makes you believe that uniqueId can be a problem? (Afaik uniqueId is a builtin node attribute on IE, so we never set it on IE, but I may be wrong.) - Can you please check on one of the standard Plone pages instead of a page customized by you (possibly not folder_contents that contains lots of non-kss code), and confirm if the leak happens again? - Can you confirm that when you talk about memory leaks, you talk about memory leaks that survive the next static page load? This is important because this way we do not need to look for our internal data structures, since there is no way they could cause this kind of leak. Thanks for your replies in advance. -- Balazs Ree From christophe.bosse at ingeniweb.com Fri Apr 18 18:19:05 2008 From: christophe.bosse at ingeniweb.com (Christophe Bosse) Date: Fri, 18 Apr 2008 18:19:05 +0200 Subject: [Kss-devel] Memory leaks In-Reply-To: References: <48084F4A.1030800@bubblenet.be> Message-ID: My IE version is 6.0.2900.2180 but I guess it happens on all IE6 versions, don't know about IE7. Here, uniqueID does not seems to be a problem since it is a builtin attribute but kukitmark might be a problem. I forgot to mention that we also have to clean up events that have been declared. Which mean we must have an array which stores node, type, and func. Memory leaks also happens on standart plone page and yes they survide after next static page load (I've tested to go to the 'Zope Quick Start' page). In fact I could resolve those memory leaks by using jQuery events registration and data management. I've tried to act like jQuery does (unregistering all events and removing custom node attribute) but those leaks are still there. There must be something I missed. I'll continue to investigates and at worst I'll see Godefroid at the Paris Sprint to show him. I've used this tool to detect them, it also show you nodes which cause leaks: http://home.wanadoo.nl/jsrosman/sIEve-0.0.8.exe 2008/4/18, Balazs Ree : > > On Fri, 18 Apr 2008 09:35:38 +0200, Godefroid Chapelle wrote: > > > Balazs Ree wrote: > >> On Thu, 17 Apr 2008 18:09:41 +0200, Balazs Ree wrote: > >> > >>> Hi Christophe, > >>> > >>> thanks for your investigation. > >>> > >>> On Thu, 17 Apr 2008 17:13:11 +0200, Christophe Bosse wrote: > >> > >>>> Those leaks are very important. I've done a folder_contents which has > >>>> many rules for every single row and my IE grow by 5megs on each page > >>>> !!! > >>> Is this only on IE? And what version exactly? > >>> > >>> > >> p.s. it just occured to me, folder_contents does not use KSS on the > >> rows, afaik. > >> > > I think Christophe has built his own folder_contents with his own KSS > > rules. > > > Ah, sorry. I may have skipped this information from the beginning of the > thread. > > Dear Cristophe, can you help us with tracking down this issue, let me re- > formulate the questions I asked in my previous post! It would be > essential to get the answers from you. > > - Does this only happen on IE, and if yes, on which versions exactly? > > - What makes you believe that uniqueId can be a problem? (Afaik uniqueId > is a builtin node attribute on IE, so we never set it on IE, but I may be > wrong.) > > - Can you please check on one of the standard Plone pages instead of a > page customized by you (possibly not folder_contents that contains lots > of non-kss code), and confirm if the leak happens again? > > - Can you confirm that when you talk about memory leaks, you talk about > memory leaks that survive the next static page load? This is important > because this way we do not need to look for our internal data structures, > since there is no way they could cause this kind of leak. > > Thanks for your replies in advance. > > > > > > -- > > Balazs Ree > > > _______________________________________________ > Kss-devel mailing list > Kss-devel at codespeak.net > http://codespeak.net/mailman/listinfo/kss-devel > -- Christophe BOSSE - Fonction INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632 Bureaux de la Colline - 1 rue Royal - B?timent D - 9?me ?tage 92210 Saint Cloud - France Phone : 01 78 15 24 02 / Fax : 01 46 02 44 04 http://www.ingeniweb.com - une soci?t? du groupe Alter Way -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20080418/9686f2f1/attachment-0001.htm From gotcha at bubblenet.be Sat Apr 19 08:21:39 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Sat, 19 Apr 2008 08:21:39 +0200 Subject: [Kss-devel] Memory leaks In-Reply-To: References: <48084F4A.1030800@bubblenet.be> Message-ID: <48098F73.1090905@bubblenet.be> Christophe Bosse wrote: > My IE version is 6.0.2900.2180 but I guess it happens on all IE6 > versions, don't know about IE7. > > Here, uniqueID does not seems to be a problem since it is a builtin > attribute but kukitmark might be a problem. > I forgot to mention that we also have to clean up events that have been > declared. Which mean we must have an array which stores node, type, and > func. You are definitely right ! > > Memory leaks also happens on standart plone page and yes they survide > after next static page load (I've tested to go to the 'Zope Quick > Start' page). > > In fact I could resolve those memory leaks by using jQuery events > registration and data management. > I've tried to act like jQuery does (unregistering all events and > removing custom node attribute) but those leaks are still there. There > must be something I missed. Well, AFAIK, garbage collection is really bad in browsers in general and in IE6 more specifically. There are a lot of places where we could be leaking memory. > I'll continue to investigates and at worst > I'll see Godefroid at the Paris Sprint to show him. I am definitely better when meeting face to face than when communicating over written media. I'd be enthusisast if you felt like working on this during the sprint. I'll be working on "grokkers for Zope2" as well so we will try manage as well as possible ! Bertrand did send a patch for KSS as well. Is he sprinting with us ? Would you two sprint on chasing memory leaks ? > > I've used this tool to detect them, it also show you nodes which cause > leaks: > http://home.wanadoo.nl/jsrosman/sIEve-0.0.8.exe Until now, I do not have Windows installed :-S -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From gotcha at bubblenet.be Sat Apr 19 08:27:12 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Sat, 19 Apr 2008 08:27:12 +0200 Subject: [Kss-devel] Memory leaks In-Reply-To: References: <48084F4A.1030800@bubblenet.be> Message-ID: <480990C0.2020709@bubblenet.be> Christophe Bosse wrote: > Memory leaks also happens on standart plone page and yes they survide > after next static page load (I've tested to go to the 'Zope Quick > Start' page). Some of those leaks could come from the JS code which is not KSS... I mean the Plone legacy code. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From brandon at rhodesmill.org Wed Apr 23 18:59:32 2008 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Wed, 23 Apr 2008 12:59:32 -0400 Subject: [Kss-devel] can KSS bindings become dynamic by borring livequery algorithm? Message-ID: <87k5ioik23.fsf@ten22.rhodesmill.org> My JavaScript competency is not yet great enough for me to determine this on my own, so I will ask here on the KSS list and hope that someone who knows KSS far better can spend a few minutes coming up with the answer. :-) I notice three facts: - People would like KSS to rebind events dynamically as the DOM changes, just like CSS does, so that as classes and properties come and go on objects, the KSS event bindings adjust to compensate. - This has not been implemented because, among other things, it looks very costly and confusing: http://kssproject.org/notes/plan-to-make-events-rebindable/ - But a friend just told me about LiveQuery, which looks to my untrained eyes as though it does for jQuery what we would like to do for KSS: allow on-the-fly event rebinding as DOM attributes change. Someone who's used it says it's not at all slow, which makes me wonder if its author has done something clever that KSS could do as well. (But then again, maybe its selectors are far more restricted than KSS selectors or something, and I just haven't seen that yet?) - LiveQuery is distributed under the MIT license (as well as the GPL), which I think means that we could borrow what of its code we need? Because I'm not suggesting that KSS become dependent on all of jQuery, just that this bit of its code could show us the way to do this in KSS. Anyway, a Google search for KSS and LiveQuery together returned nothing, so I hope that if this suggestion is impractical, it's at least not something that's already been suggested and rejected. :-) -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From brandon at rhodesmill.org Wed Apr 23 19:37:51 2008 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Wed, 23 Apr 2008 13:37:51 -0400 Subject: [Kss-devel] can KSS bindings become dynamic by borring livequery algorithm? References: <87k5ioik23.fsf@ten22.rhodesmill.org> Message-ID: <87d4ogiia8.fsf@ten22.rhodesmill.org> I wrote: > My JavaScript competency is not yet great enough for me to determine > this on my own ... [has the author of LiveQuery] done something > clever that KSS could do as well? Ahem. Never mind. I did wind up doing a bit more reading, and LiveQuery works by specifically intercepting jQuery calls that modify the DOM so that it can recompute its bindings. Obviously this will not work with KSS since we can't guarantee by what means the user of KSS will be modifying his DOM. -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From ree at ree.hu Thu Apr 24 08:27:33 2008 From: ree at ree.hu (Balazs Ree) Date: Thu, 24 Apr 2008 08:27:33 +0200 Subject: [Kss-devel] can KSS bindings become dynamic by borring livequery algorithm? References: <87k5ioik23.fsf@ten22.rhodesmill.org> <87d4ogiia8.fsf@ten22.rhodesmill.org> Message-ID: On Wed, 23 Apr 2008 13:37:51 -0400, Brandon Craig Rhodes wrote: > I wrote: > >> My JavaScript competency is not yet great enough for me to determine >> this on my own ... [has the author of LiveQuery] done something clever >> that KSS could do as well? > > Ahem. Never mind. I did wind up doing a bit more reading, and > LiveQuery works by specifically intercepting jQuery calls that modify > the DOM so that it can recompute its bindings. Obviously this will not > work with KSS since we can't guarantee by what means the user of KSS > will be modifying his DOM. I am sure that at one point, we will arrive to KSS being able to rebind on the events. I also tried to summarize what's needed here: https://blueprints.launchpad.net/kukit.js/+spec/unbind-events So first we must make the kss architecture capable of unbinding events at all. Which means kss event binders must provide an unbind method as well. About the difficulty of recognizing what has changed in the dom: it is possible to do this without patching the dom. From every place from kss (like addClass or setAttribute) we can call the "change hook" programatically; from every non-kss code where classes or attributes change, this hook needs to be called to make kss "aware" of the changes. So this is not the largest challange in the story imo, although truly it would be more confortable to have a node.onChange and node.onUnload event. However there is a bigger challenge. Because a change in a node may invalidate all the events in the subtree, due to the nature of css selection, in the most pessimistic case, a single change in the DOM may invalidate all the rules bound to the page (think of a class change on the body tag). With the current cssquery algorithm we use, this may be very time consuming to detect. If we could modify the css selection in a way that we can speed this up, would be great but I cannot estimate how much work this would be. -- Balazs Ree From briang at webcollective.coop Sat Apr 26 01:34:47 2008 From: briang at webcollective.coop (Brian Gershon) Date: Fri, 25 Apr 2008 16:34:47 -0700 Subject: [Kss-devel] KSS: Inline editing on multiple rows of data In-Reply-To: <47CDD7F4.6@xs4all.nl> References: <47CDD7F4.6@xs4all.nl> Message-ID: <164A97A0-717A-4E0C-AC00-A1E54FEDE6D2@webcollective.coop> Hi Jeroen, I finally posted a blog entry about applying KSS to the task of editing multiple rows of data: Let me know if you have recommendations or suggestions. Thanks, -Bri On Mar 4, 2008, at 3:15 PM, Jeroen Vloothuis wrote: > Brian Gershon wrote: >> When I click, the forms open up for ALL rows. Each row has a >> field like this, and by default
is hidden >> via .hiddenform style: >> >>
>> 2008/02/25 >>
>> >> >> >>
>>
>> > You could do something like: > > > /* show edit form when label clicked */ > div.action-due-section span.label:click { > evt-click-preventdefault: true; > action-client: toggleClass; > toggleClass-kssSelector: parentnode("div.editform"); > toggleClass-value: hiddenform; > } > > > Then you should make your CSS something like: > > .hiddenform .editform { > display: none; > } > > > The trick here is that you are actually toggling the class name on > the outer div but you let the CSS rule apply through that. So after > (and you probably want to have this a page load time as well) > toggling the HTML would become: > >
> 2008/02/25 >
> ... > Now if you look at the CSS snippet above you can see how it first > selects .hiddenform and than any node below with the editform class > name.