django-live / live / templates / live / manage.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
#
# Copyright 2010 Nicolás Echániz
# All rights reserved.
#
# This file is part of django-live.
#
# Django-Live is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Django-Live is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us" >
<head>
<title>Django Live | Manager</title>
<meta name="robots" content="NONE,NOARCHIVE" />
   <style type="text/css">
html{
    height: 100%;
}

body{
    background-color: #9ddcab;
    font-family: Verdana, Arial;
    padding: 10px;
    font-size: 14px;
    height: 100%;
}

#status{
    background-color: #ddf5e2;
    overflow-y: scroll;
    height: 80%;
    padding: 10px;
    color: #4444;
}


    </style>

    <script src="http://{{ ORBITED_HOST }}:{{ ORBITED_PORT }}/static/Orbited.js"></script>
    <script>
      document.domain = document.domain;
      Orbited.settings.port = "{{ ORBITED_PORT }}";
      Orbited.settings.hostname = "{{ORBITED_HOST }}";
      TCPSocket = Orbited.TCPSocket;
    </script>
    <script src="http://{{ ORBITED_HOST }}:{{ ORBITED_PORT }}/static/protocols/stomp/stomp.js"></script>
    <script src="http://{{ ORBITED_HOST }}:{{ ORBITED_PORT }}/static/JSON.js"></script>

    <script>

var manage_channel = "{{ manage_channel }}";
var stomp_port = {{ STOMP_PORT }};

var send_headers = {exchange:''};
var subscribe_destination = manage_channel;
var subscribe_headers = {exchange:''};

var channels = [];

var add_channel = function(user, channel){
    if (channels.indexOf(channel)<0){
        channels = channels.concat([channel]);
        document.getElementById('status').innerHTML += 
            "<a href='/live/chat/"+ channel +"/{{ username }}' target='_blank'>new channel: "+ channel +"</a><br/>";
    }
}

    </script>

    <script>
        onload = function() {
            // set up stomp client.
            stomp = new STOMPClient();
            stomp.onopen = function() {
            };
            stomp.onclose = function(code) {
                shell.print("Transport closed (code: " + code + ")");
            };
            stomp.onerror = function(error) {
                alert("onerror: " + error);
            };
            stomp.onerrorframe = function(frame) {
                alert("onerrorframe: " + frame.body);
            };
            stomp.onconnectedframe = function() {
              stomp.subscribe(subscribe_destination, subscribe_headers);
            };
            stomp.onmessageframe = function(frame) {
                var m = JSON.parse(frame.body);
                add_channel(m.user, m.channel)
            };

            stomp.connect(document.domain, stomp_port, '{{ session_key }}', '');

        };
        onunload = function() {
            stomp.reset();
        }
    </script>


</head>

<body>
    <div id="status"><p>current channels:</p></div>
</body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.