# HG changeset patch # User Goffi # Date 1355092928 -3600 # Node ID 8635bc9db9bf68e1640b44c7336a4f325d5018e3 # Parent 60ea800b7237ae33ba5a25e72e2dcce0dec3c3cf added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel diff -r 60ea800b7237 -r 8635bc9db9bf browser_side/menu.py --- a/browser_side/menu.py Sun Dec 09 23:38:30 2012 +0100 +++ b/browser_side/menu.py Sun Dec 09 23:42:08 2012 +0100 @@ -35,6 +35,7 @@ from pyjamas import Window from jid import JID from tools import html_sanitize +from xmlui import XMLUI import dialog import re @@ -93,6 +94,7 @@ menu_help.addItem("About", MenuCmd(self, "onAbout")) menu_settings = MenuBar(vertical=True) + #menu_settings.addItem("Parameters", MenuCmd(self, "onParameters")) menubar = LiberviaMenuBar() @@ -248,3 +250,16 @@ def onXiangqiGame(self): Window.alert("A Xiangqi game is planed, but not available yet") + + #Settings menu + + def onParameters(self): + def gotParams(xmlui): + body = XMLUI(self.host, xmlui) + _dialog = dialog.GenericDialog("Parameters", body, options=['NO_CLOSE']) + body.setCloseCb(_dialog.close) + _dialog.setSize('80%', '80%') + _dialog.show() + + self.host.bridge.call('getParamsUI', gotParams) + diff -r 60ea800b7237 -r 8635bc9db9bf browser_side/panels.py --- a/browser_side/panels.py Sun Dec 09 23:38:30 2012 +0100 +++ b/browser_side/panels.py Sun Dec 09 23:42:08 2012 +0100 @@ -931,7 +931,8 @@ TabPanel.__init__(self) self.host=host self.tabBar.setVisible(False) - self.setStyleName('mainTabPanel') + self.setStyleName('liberviaTabPanel') + self.addStyleName('mainTabPanel') Window.addWindowResizeListener(self) def onWindowResized(self, width, height): diff -r 60ea800b7237 -r 8635bc9db9bf libervia.py --- a/libervia.py Sun Dec 09 23:38:30 2012 +0100 +++ b/libervia.py Sun Dec 09 23:42:08 2012 +0100 @@ -84,7 +84,10 @@ LiberviaJsonProxy.__init__(self, "/json_api", ["getContacts", "addContact", "sendMessage", "sendMblog", "getLastMblogs", "getMassiveLastMblogs", "getProfileJid", "getHistory", "getPresenceStatus", "joinMUC", "getRoomsJoined", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", "tarotGameContratChoosed", - "tarotGamePlayCards", "launchRadioCollective", "getWaitingSub", "subscription", "delContact", "updateContact", "getEntityData"]) + "tarotGamePlayCards", "launchRadioCollective", "getWaitingSub", "subscription", "delContact", "updateContact", "getEntityData", "getParamsUI", + #"setParam", + "launchAction", + ]) class BridgeSignals(LiberviaJsonProxy): def __init__(self, host): @@ -119,6 +122,7 @@ self.room_list = set() #set of rooms self.mblog_cache = [] #used to keep our own blog entries in memory, to show them in new mblog panel self.avatars_cache = {} #keep track of jid's avatar hash (key=jid, value=file) + self.current_action_ids = set() #self.discuss_panel.addWidget(panels.EmptyPanel(self)) self.discuss_panel.addWidget(panels.MicroblogPanel(self, [])) #self.discuss_panel.addWidget(panels.EmptyPanel(self)) diff -r 60ea800b7237 -r 8635bc9db9bf libervia.tac --- a/libervia.tac Sun Dec 09 23:38:30 2012 +0100 +++ b/libervia.tac Sun Dec 09 23:42:08 2012 +0100 @@ -315,6 +315,22 @@ profile = ISATSession(self.session).profile return self.sat_host.bridge.getEntityData(jid, keys, profile) + #def jsonrpc_getParamsUI(self): + # """Return the parameters XMLUI for profile""" + # profile = ISATSession(self.session).profile + # d = defer.Deferred() + # self.sat_host.bridge.getParamsUI(profile, callback=d.callback, errback=d.errback) + # #d.addCallback(lambda result: unicode(result)) + # return d + + #def jsonrpc_setParam(self, name, value, category): + # profile = ISATSession(self.session).profile + # return self.sat_host.bridge.setParam(name, value, category, profile) + + def jsonrpc_launchAction(self, action_type, data): + profile = ISATSession(self.session).profile + return self.sat_host.bridge.launchAction(action_type, data, profile) + class Register(jsonrpc.JSONRPC): """This class manage the registration procedure with SàT It provide an api for the browser, check password and setup the web server""" diff -r 60ea800b7237 -r 8635bc9db9bf public/libervia.css --- a/public/libervia.css Sun Dec 09 23:38:30 2012 +0100 +++ b/public/libervia.css Sun Dec 09 23:42:08 2012 +0100 @@ -964,7 +964,7 @@ /* Tab panel */ -.mainTabPanel { +.liberviaTabPanel { } .gwt-TabPanel { @@ -975,14 +975,17 @@ } .gwt-TabBar { - position: fixed; - z-index: 10; - bottom: 0; font-weight: bold; text-decoration: none; border-bottom: 3px solid #a01c1c; } +.mainTabPanel .gwt-TabBar { + z-index: 10; + position: fixed; + bottom: 0; +} + .gwt-TabBar .gwt-TabBarFirst { height: 100%; } @@ -990,19 +993,19 @@ .gwt-TabBar .gwt-TabBarRest { } -.mainTabPanel .gwt-TabBar {; +.liberviaTabPanel .gwt-TabBar {; } -.mainTabPanel .gwt-TabBar .gwt-TabBarItem { +.liberviaTabPanel .gwt-TabBar .gwt-TabBarItem { cursor: pointer; margin-right: 5px; } -.mainTabPanel .gwt-TabBarItem div { +.liberviaTabPanel .gwt-TabBarItem div { color: #fff; } -.mainTabPanel .gwt-TabBarItem { +.liberviaTabPanel .gwt-TabBarItem { color: #444 !important; background-color: #222; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=’#444′, endColorstr=’#222’); @@ -1019,7 +1022,7 @@ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2); } -.mainTabPanel .gwt-TabBarItem-selected { +.liberviaTabPanel .gwt-TabBarItem-selected { color: #fff; background-color: #cf2828; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=’#cf2828′, endColorstr=’#981a1a’); @@ -1036,7 +1039,7 @@ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); } -.mainTabPanel div.gwt-TabBarItem:hover { +.liberviaTabPanel div.gwt-TabBarItem:hover { color: #fff; background-color: #cf2828; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=’#cf2828′, endColorstr=’#981a1a’); @@ -1053,7 +1056,7 @@ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); } -.mainTabPanel .gwt-TabBar .gwt-TabBarItem-selected { +.liberviaTabPanel .gwt-TabBar .gwt-TabBarItem-selected { cursor: default; }