Vladislav Vorobiev wrote:
> Hello all,
>
> I am interesting on return of the Javascript code on the server-side.
> Kss plug-in looks like so:
>
> ksswidth.js
> kukit.actionsGlobalRegistry.register("ksswidth", function(oper) {
> // oper.completeParms(['text'], {}, 'ksswidth action');
> // alert(oper.parms.text);
> // alert(document.body.clientWidth);
> a=document.body.clientWidth;
> // document.getElementById('inputElementOnMySite').value=b;
> return a;
> });
> kukit.commandsGlobalRegistry.registerFromAction('ksswidth',
> kukit.cr.makeSelectorCommand);
>
> ksswidth.py
> class ksswidth(CommandSet):
> interface.implements(Iksswidth)
> def demo(self, selector, text):
> command = self.commands.addCommand('ksswidth', selector)
> command.addParam('text', text)
>
> It is possible to access "a variable of javascript" in a server side
> python-script(Zope2)?
Nope
>
> core=getKSSCommandSet('ksswidth').demo('#hiddendiv', 'ok')
> return renderKSSCommands()
You need to write a plugin with a custom value provider.
Look at providerreg.js to see how default providers are registered.
>
> I wont to fetch clientWidth and return images for this width.
Makes a lot of sense !
>
> Best regards
> Vlad
--
Godefroid Chapelle (aka __gotcha) http://bubblenet.be
_______________________________________________
Kss-devel mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kss-devel