@@ -0,0 +1,2019 @@
+# This file is part of Moksha.%0A#%0A# Moksha is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation, either version 3 of the License, or%0A# (at your option) any later version.%0A# %0A# Moksha is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A# GNU General Public License for more details.%0A#%0A# You should have received a copy of the GNU General Public License%0A# along with Moksha.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A#%0A# Copyright 2008, Red Hat, Inc.%0A# Authors: Luke Macken %3Clmacken@redhat.com%3E%0A%0Afrom tg import config%0Afrom tw.api import Widget, JSLink, js_callback, js_function%0A%0Aorbited_js = JSLink(link='http://%25s:%25s/static/Orbited.js' %25 (config%5B'orbited_host'%5D,%0A                                                             config%5B'orbited_port'%5D))%0A%0Aclass OrbitedWidget(Widget):%0A    params = %7B%0A        'onopen': 'A javascript callback for when the connection opens',%0A        'onread': 'A javascript callback for when new data is read',%0A        'onclose': 'A javascript callback for when the connection closes',%0A    %7D%0A    onopen = onread = onclose = js_callback('function()%7B%7D')%0A    javascript = %5Borbited_js%5D%0A    template = %22%22%22%0A        %3Cscript type=%22text/javascript%22%3E%0A            Orbited.settings.port = %25(port)s%0A            Orbited.settings.hostname = '%25(host)s'%0A            document.domain = document.domain%0A            TCPSocket = Orbited.TCPSocket%0A            connect = function() %7B%0A                conn = new TCPSocket()%0A                conn.onread = $%7Bonread%7D%0A                conn.onopen = $%7Bonopen%7D%0A                conn.onclose = $%7Bonclose%7D%0A                conn.open('%25(host)s', %25(port)s)%0A            %7D%0A            $(document).ready(function() %7B%0A                connect()%0A            %7D)%0A        %3C/script%3E%0A    %22%22%22 %25 %7B'port': config%5B'orbited_port'%5D, 'host': config%5B'orbited_host'%5D%7D%0A

Move our OrbitedWidget into the moksha.orbited module