tools (common/data_objects): new OnClick class
OnClick is used to specify what do to when clicking on element. For now it only handles target URL.
This commit is contained in:
parent
158d61b84e
commit
c7984f60ec
1 changed files with 14 additions and 0 deletions
|
|
@ -195,3 +195,17 @@ class Identities(object):
|
|||
|
||||
def __contains__(self, jid_str):
|
||||
return jid_str in self.identities
|
||||
|
||||
|
||||
class OnClick(object):
|
||||
"""Class to handle clickable elements targets"""
|
||||
|
||||
def __init__(self, url=None):
|
||||
self.url = url
|
||||
|
||||
def formatUrl(self, item):
|
||||
"""Use an item to format URL
|
||||
|
||||
item will be formatted using "item=item" in format()
|
||||
"""
|
||||
return self.url.format(item=item)
|
||||
|
|
|
|||
Loading…
Reference in a new issue