Commit 783cecb5 by Bridger Maxwell

Added a 'find collaborators' xmodule mockup.

parent 5aa2ad84
......@@ -7,11 +7,10 @@ from xmodule.raw_module import RawDescriptor
import json
class CollaborateModule(XModule):
# js = {'coffee':
# [resource_string(__name__, 'js/src/time.coffee'),
# resource_string(__name__, 'js/src/discussion/display.coffee')]
# }
# js_module_name = "FindCollaborators"
js = {'coffee':
[resource_string(__name__, 'js/src/collaborate/display.coffee')]
}
js_module_name = "FindCollaborator"
def get_html(self):
context = {
'collaborate_room': self.collaborate_room,
......
class @FindCollaborator
constructor: (element) ->
@socket = io.connect('http://127.0.0.1:3000/pair')
@statusElement = $(element).find(".collaborate-status")
@roomName = @statusElement.data('collaborate-room')
@listen()
@socket.emit("watch_pair_room", {'room-name' : @roomName});
listen: ->
@socket.on 'status_updated', (data) =>
if @roomName == data['room-name']
@statusElement.text(data['status'])
......@@ -36,7 +36,7 @@
display: block;
height: 22px;
border-radius: 3px;
background-color: #10242E;
background-color: #064666;
color: #fff;
margin: -10px 10px;
padding: 12px 15px 0px;
......
......@@ -7,7 +7,8 @@
<link rel="icon" type="image/x-icon" href="${static.url('images/favicon.ico')}" />
<%static:css group='application'/>
<script src="http://127.0.0.1:3000/socket.io/socket.io.js"></script>
<%static:js group='main_vendor'/>
<%block name="headextra"/>
......
......@@ -4,5 +4,5 @@
<div class="collaborate_module">
<a class="find_collaborator" href="#" onclick="window.open('http://127.0.0.1:3000/pair/${collaborate_room | urllib.quote}', 'collaborate_window', 'width=780, height=590'); return false;">Collaborate on ${collaborate_room | h}</a>
<span class="collaborate-status">Connecting...</span>
<span class="collaborate-status" data-collaborate-room="${collaborate_room | h}">Connecting...</span>
</div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment