comparison browser_side/contact.py @ 19:e8e3704eb97f

Added basic chat panel - the chat panel show history, timestamp, and nickname (pretty similar to primitivus and wix chat window) - JID has be rewritten to work with pyjamas, and is now in browser_side directory - a widget can now be selected: the message send in uniBox will be sent to it if there is no explicit target prefix ("@something") - a basic status panel is added under the uniBox, but not used yet
author Goffi <goffi@goffi.org>
date Sat, 16 Apr 2011 01:46:01 +0200
parents c725b702e927
children 77c2e48efa29
comparison
equal deleted inserted replaced
18:795d144fc1d2 19:e8e3704eb97f
27 from pyjamas import Window 27 from pyjamas import Window
28 from pyjamas import DOM 28 from pyjamas import DOM
29 29
30 from pyjamas.dnd import makeDraggable 30 from pyjamas.dnd import makeDraggable
31 from pyjamas.ui.DragWidget import DragWidget, DragContainer 31 from pyjamas.ui.DragWidget import DragWidget, DragContainer
32 from tools.jid import JID 32 from jid import JID
33 33
34 class DragLabel(DragWidget): 34 class DragLabel(DragWidget):
35 35
36 def __init__(self, text, type): 36 def __init__(self, text, type):
37 DragWidget.__init__(self) 37 DragWidget.__init__(self)
68 Label.__init__(self, group) #, Element=DOM.createElement('div') 68 Label.__init__(self, group) #, Element=DOM.createElement('div')
69 self.setStyleName('group') 69 self.setStyleName('group')
70 DragLabel.__init__(self, group, "GROUP") 70 DragLabel.__init__(self, group, "GROUP")
71 71
72 72
73 class ContactLabel(Label): 73 class ContactLabel(DragLabel, Label):
74 def __init__(self, jid, name=None): 74 def __init__(self, jid, name=None):
75 if not name: 75 if not name:
76 name=jid 76 name=jid
77 Label.__init__(self, name) 77 Label.__init__(self, name)
78 self.jid=jid 78 self.jid=jid
79 self.setStyleName('contact') 79 self.setStyleName('contact')
80 DragLabel.__init__(self, jid, "CONTACT")
80 81
81 class GroupList(VerticalPanel): 82 class GroupList(VerticalPanel):
82 83
83 def __init__(self, parent): 84 def __init__(self, parent):
84 VerticalPanel.__init__(self) 85 VerticalPanel.__init__(self)
107 108
108 class ContactTitleLabel(DragLabel, Label): 109 class ContactTitleLabel(DragLabel, Label):
109 def __init__(self, text): 110 def __init__(self, text):
110 Label.__init__(self, text) #, Element=DOM.createElement('div') 111 Label.__init__(self, text) #, Element=DOM.createElement('div')
111 self.setStyleName('contactTitle') 112 self.setStyleName('contactTitle')
112 DragLabel.__init__(self, text, "CONTACT") 113 DragLabel.__init__(self, text, "CONTACT_TITLE")
113 114
114 class ContactPanel(SimplePanel): 115 class ContactPanel(SimplePanel):
115 """Manage the contacts and groups""" 116 """Manage the contacts and groups"""
116 117
117 def __init__(self, host): 118 def __init__(self, host):