Mercurial > libervia-web
comparison libervia.py @ 336:629c99bbd031
browser + server side: refactored menus:
- getMenus is added to Register class, so it can be used before being logged
- dynamic menus are added to main menu bar
- security limit is used
- menus use i18n
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 04 Feb 2014 16:49:20 +0100 |
parents | 835a8ae799e7 |
children | 2067d6241927 |
comparison
equal
deleted
inserted
replaced
335:e8c26e24a6c7 | 336:629c99bbd031 |
---|---|
111 | 111 |
112 | 112 |
113 class RegisterCall(LiberviaJsonProxy): | 113 class RegisterCall(LiberviaJsonProxy): |
114 def __init__(self): | 114 def __init__(self): |
115 LiberviaJsonProxy.__init__(self, "/register_api", | 115 LiberviaJsonProxy.__init__(self, "/register_api", |
116 ["isRegistered", "isConnected", "connect", "registerParams"]) | 116 ["isRegistered", "isConnected", "connect", "registerParams", "getMenus"]) |
117 | 117 |
118 | 118 |
119 class BridgeCall(LiberviaJsonProxy): | 119 class BridgeCall(LiberviaJsonProxy): |
120 def __init__(self): | 120 def __init__(self): |
121 LiberviaJsonProxy.__init__(self, "/json_api", | 121 LiberviaJsonProxy.__init__(self, "/json_api", |
125 "inviteMUC", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", | 125 "inviteMUC", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", |
126 "tarotGameContratChoosed", "tarotGamePlayCards", "launchRadioCollective", | 126 "tarotGameContratChoosed", "tarotGamePlayCards", "launchRadioCollective", |
127 "getWaitingSub", "subscription", "delContact", "updateContact", "getCard", | 127 "getWaitingSub", "subscription", "delContact", "updateContact", "getCard", |
128 "getEntityData", "getParamsUI", "asyncGetParamA", "setParam", "launchAction", | 128 "getEntityData", "getParamsUI", "asyncGetParamA", "setParam", "launchAction", |
129 "disconnect", "chatStateComposing", "getNewAccountDomain", "confirmationAnswer", | 129 "disconnect", "chatStateComposing", "getNewAccountDomain", "confirmationAnswer", |
130 "syntaxConvert" | 130 "syntaxConvert", |
131 ]) | 131 ]) |
132 | 132 |
133 | 133 |
134 class BridgeSignals(LiberviaJsonProxy): | 134 class BridgeSignals(LiberviaJsonProxy): |
135 RETRY_BASE_DELAY = 1000 | 135 RETRY_BASE_DELAY = 1000 |
182 self._register_box = None | 182 self._register_box = None |
183 RootPanel().add(self.panel) | 183 RootPanel().add(self.panel) |
184 self.notification = Notification() | 184 self.notification = Notification() |
185 DOM.addEventPreview(self) | 185 DOM.addEventPreview(self) |
186 self._register = RegisterCall() | 186 self._register = RegisterCall() |
187 self._register.call('getMenus', self.panel.menu.createMenus) | |
187 self._register.call('registerParams', None) | 188 self._register.call('registerParams', None) |
188 self._register.call('isRegistered', self._isRegisteredCB) | 189 self._register.call('isRegistered', self._isRegisteredCB) |
189 self.initialised = False | 190 self.initialised = False |
190 self.init_cache = [] # used to cache events until initialisation is done | 191 self.init_cache = [] # used to cache events until initialisation is done |
191 # define here the parameters that have an incidende to UI refresh | 192 # define here the parameters that have an incidende to UI refresh |