Back to index

plone3  3.1.7
commandaction.py
Go to the documentation of this file.
00001 from kss.core import KSSView
00002 
00003 class ActionsView(KSSView):
00004 
00005     def toggleClass(self):
00006         core = self.getCommandSet('core')
00007         selector = core.getSameNodeSelector()
00008         core.toggleClass(selector, 'selected')
00009         return self.render()
00010 
00011     def addClass(self):
00012         core = self.getCommandSet('core')
00013         selector = core.getSameNodeSelector()
00014         core.addClass(selector, 'selected')
00015         return self.render()
00016 
00017     def removeClass(self):
00018         core = self.getCommandSet('core')
00019         selector = core.getSameNodeSelector()
00020         core.removeClass(selector, 'selected')
00021         return self.render()
00022     
00023     #focus
00024 
00025     def focus(self, id):
00026         self.getCommandSet('core').focus('#' + id)
00027         return self.render()
00028 
00029     #action-cancel
00030 
00031     def toCancel(self):
00032         core = self.getCommandSet('core')
00033         core.insertHTMLAsLastChild('#logger', 'action')
00034         return self.render()
00035 
00036     #setKssAttribute
00037 
00038     def echo(self, value):
00039         core = self.getCommandSet('core')
00040         core.insertHTMLAsLastChild('#logger', value)
00041         return self.render()
00042     
00043     def setKssAttribute(self):
00044         core = self.getCommandSet('core')
00045         core.setKssAttribute('#command', 'name', 'value-from-command')
00046         return self.render()
00047