[Kss-devel] Global state

Godefroid Chapelle gotcha at bubblenet.be
Fri Feb 23 15:52:46 CET 2007


jeroen.vloothuis at pareto.nl wrote:
> Hi,
> 
> For a script I am developing I need some global state. The first thing I
> need is to know wheter the shift key is currently pressed.
> 
> Right now I am doing this using a normal Javascript global variable and
> document.onkey(up/down). This works but it would be nice do this using
> more of the KSS framework. One problem I had with this is that it does
> not seem possible to bind events to document using KSS.

AFAIK, there is document:load

I suppose you have tried document:keydown.

Do you get an error ?

> 
> The next thing I need is a globalish variable to store a reference to a
> selected checkbox. I am now using normal Javascript code for this.
> 
> To see the code of which I speak go to this url:
> 
> http://dev.plone.org/plone/changeset/12975/plone.app.kss/branches/folder-contents/plone/app/kss/plugins/plone/plugin.js
> 
> Maybe a KSS wizard can enlighten me on the right way to store such state
> using the framework?

At the end of http://kukit.org/documentation/cheat-sheet :

'''
Miscellaneous

     * stateVar(varname): Procudes the value of a state variable, that 
is, the same that can be set via the setStateVar command.
'''

HTH

> 
> Cheers,
> 	Jeroen
> _______________________________________________
> Kss-devel mailing list
> Kss-devel at codespeak.net
> http://codespeak.net/mailman/listinfo/kss-devel


-- 
Godefroid Chapelle (aka __gotcha)- BubbleNet  http://bubblenet.be



More information about the Kss-devel mailing list