If you can't read please download the document
Introduction to KSS
Embed Size (px)
DESCRIPTION
What is it about? Why KSS? KSS: Quick Overview, Short KSS Reference, Advantages, Drawbacks
Citation preview
-
- Vitaliy Podoba, Developer
2. Table of contents
3. What is it about?
- KSS is an Ajax framework that allowsUI development without
writing any Javascript
-
AJAX?http://www.adaptivepath.com/ideas/essays/archives/000385.php
- First Ajaxes:Google Suggest Yahoo News
4. The traditional model vs Ajax model 5. Why KSS?
- Preserve from writing Javascript
- Overcome browser incompatibilities
- No Javascript on the page
- Provide server side for Zope and Plone
6. No Javascript on the page
- onclick="javascript:clicked();">
7. Quick Overview
- Power of Javascript, syntax of CSS
- Kinetic Style Sheets Syntax
8. KSS Environment
- Browser compatibility Firefox Internet Explorer Opera Konqueror
Safari Mozilla
- Supported server platforms Zope 2.10, 2.11 Zope 3 Grok Plone
3.0 Pylons Django
9. Architecture 10. KSS Syntax
- #kss-spinner:spinneroff {
11. KSS Syntax
- alert-message: "Clicked";
12. KSS Syntax
- a:click {css selector : event
- action-client: alert;client action 'alert'
- alert-message: "Clicked";parameter for 'alert'
13. KSS Syntax
- evt-click-preventdefault: true;parameter for event
- alert-message: "Clicked";
14. KSS Syntax
- evt-click-preventdefault: true;
- alert-message: "Clicked";
- action-server: add;call server action
- add-url: nodeAttr('href');parameter for 'add'
15. Server Side
16. Server Side : Template
17. Server Side: KSS
- evt-click-preventdefault: True;
18. Server Side : Script
- # import Through-The-Web(TTW) API
- from kss.core.ttwapi import startKSSCommands,getKSSCommandSet,
renderKSSCommands
- # start a view for commands
- startKSSCommands(context, context.REQUEST)
- core = getKSSCommandSet('core')
- core.replaceInnerHTML('#kss-container', 'We did it!')
- return renderKSSCommands()
19. Server Side : Response
20. Server Side: Browser View
- from kss.core import KSSView, kssaction
- class DemoView(KSSView): @kssaction def response(self): core =
self.getCommandSet('core')
core.replaceInnerHTML('#kss-container',
21. Server Side: Browser View
22. Server Side: KSS Action
- evt-click-preventdefault: True;
23. Server Side: KSS Action
- evt-click-preventdefault: True;
- alert-message: "Error on server";
24. Tying it all together
- Register kss source file with portal_kss
- Extend kss with your own plugins: client actions command
actions parameter providers event types selector types
25. Short KSS Reference
26. Basic Events
27. Mouse Events
28. Form Events
29. Automatic Events
- timeout evt-timeout-delay evt-timeout-repeat
30. Changing HTML Actions
31. Changing Attributes Actions
32. Form Actions
33. Debugging Actions
34. Parameter Providers
- formVar(formname, varname)
35. Command Sets
36. Advantages
- Work can be easily divided betweendifferent specialists
37. Drawbacks
- Writing javascript plugins
- Too many rules can freeze page loading
38. Links
- KSS Site http://kssproject.org
- AJAX
http://www.adaptivepath.com/publications/essays/archives/000385.php
- kss.core repository
http://codespeak.net/svn/kukit/kss.core/trunk
- plone.app.kss repository
https://svn.plone.org/svn/plone/plone.app.kss/trunk