home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from gui.imwin.styles import MessageStyle
-
- class BasicMessageStyle(MessageStyle):
- template = '<html>\n<head>\n <meta http-equiv="content-type" content="text/html; charset=utf-8" />\n <script type="text/ecmascript" defer="defer">\n\n //Appending new content to the message view\n function appendMessage(html) {\n shouldScroll = nearBottom();\n\n //Append the new message to the bottom of our chat block\n chat = document.getElementById("Chat");\n range = document.createRange();\n range.selectNode(chat);\n documentFragment = range.createContextualFragment(html);\n chat.appendChild(documentFragment);\n\n alignChat(shouldScroll);\n }\n\n function alignChat(shouldScroll) {\n var windowHeight = window.innerHeight;\n\n if (windowHeight > 0) {\n var contentElement = document.getElementById(\'Chat\');\n var contentHeight = contentElement.offsetHeight;\n if (windowHeight - contentHeight > 0) {\n contentElement.style.position = \'relative\';\n contentElement.style.top = (windowHeight - contentHeight - 10) + \'px\';\n } else {\n contentElement.style.position = \'static\';\n }\n }\n\n if (shouldScroll) scrollToBottom();\n }\n\n function nearBottom() {\n return ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );\n }\n function scrollToBottom() {\n document.body.scrollTop = document.body.offsetHeight;\n }\n\n function windowDidResize(){\n alignChat(true/*nearBottom()*/); //nearBottom buggy with inactive tabs\n }\n\n window.onresize = windowDidResize;\n </script>\n <style type="text/css">\n span.buddyname { font-size: 60%; font-family: Verdana; background-color: #efefef; }\n </style>\n </head>\n<body>\n<div id="Chat">\n</div>\n</body>\n</html>\n\n'
- theme_name = 'basic'
- variant = None
- baseUrl = 'file:///'
- allow_text_colors = True
-
- def initialContents(self, chatName, buddy, show_header):
- return self.template
-
-
- def show_header_script(self, show):
- return ''
-
-
- def format_message(self, messagetype, messageobj, next, context, **extra):
- if messageobj.buddy is not None:
- return ('appendMessage', u'<div><span class="buddyname">%s</span>: %s</div>' % (messageobj.buddy.name, messageobj.message))
- else:
- return ('appendMessage', u'<div>%s</div>' % messageobj.message)
-
-
-