comparison libervia.py @ 318:c12c9a1acf2f

server_side: added support for paramsRegisterApp to define frontend's specific parameters like "Enable unibox"
author souliane <souliane@mailoo.org>
date Fri, 03 Jan 2014 14:19:01 +0100
parents bbadd490e63c
children bfbd9d6eb901
comparison
equal deleted inserted replaced
317:bbadd490e63c 318:c12c9a1acf2f
108 108
109 109
110 class RegisterCall(LiberviaJsonProxy): 110 class RegisterCall(LiberviaJsonProxy):
111 def __init__(self): 111 def __init__(self):
112 LiberviaJsonProxy.__init__(self, "/register_api", 112 LiberviaJsonProxy.__init__(self, "/register_api",
113 ["isRegistered", "isConnected", "connect"]) 113 ["isRegistered", "isConnected", "connect", "registerParams"])
114 114
115 115
116 class BridgeCall(LiberviaJsonProxy): 116 class BridgeCall(LiberviaJsonProxy):
117 def __init__(self): 117 def __init__(self):
118 LiberviaJsonProxy.__init__(self, "/json_api", 118 LiberviaJsonProxy.__init__(self, "/json_api",
178 self.avatars_cache = {} # keep track of jid's avatar hash (key=jid, value=file) 178 self.avatars_cache = {} # keep track of jid's avatar hash (key=jid, value=file)
179 self._register_box = None 179 self._register_box = None
180 RootPanel().add(self.panel) 180 RootPanel().add(self.panel)
181 DOM.addEventPreview(self) 181 DOM.addEventPreview(self)
182 self._register = RegisterCall() 182 self._register = RegisterCall()
183 self._register.call('registerParams', None)
183 self._register.call('isRegistered', self._isRegisteredCB) 184 self._register.call('isRegistered', self._isRegisteredCB)
184 self.initialised = False 185 self.initialised = False
185 self.init_cache = [] # used to cache events until initialisation is done 186 self.init_cache = [] # used to cache events until initialisation is done
186 187
187 def addSelectedListener(self, callback): 188 def addSelectedListener(self, callback):
345 self._register_box._form.onLogin(None) 346 self._register_box._form.onLogin(None)
346 return True 347 return True
347 else: 348 else:
348 # this would eventually set the browser saved password 349 # this would eventually set the browser saved password
349 Timer(5, lambda: self._register_box._form.login_pass_box.setFocus(True)) 350 Timer(5, lambda: self._register_box._form.login_pass_box.setFocus(True))
350
351 351
352 def _actionCb(self, data): 352 def _actionCb(self, data):
353 if not data: 353 if not data:
354 # action was a one shot, nothing to do 354 # action was a one shot, nothing to do
355 pass 355 pass