[Kss-devel] will megrok.kss ever go "live"?

Godefroid Chapelle gotcha at bubblenet.be
Tue Apr 8 14:15:23 CEST 2008


Brandon Craig Rhodes wrote:
> Godefroid Chapelle <gotcha at bubblenet.be> 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


More information about the Kss-devel mailing list