From 0ad00a808c07b1b0a0dd02b9393933df35281401 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 13 Dec 2012 13:19:20 -0500 Subject: Room handler --- frontend/templates/room.html | 222 +++++++++++++++++++++++++++++++++++++++++++ frontend/views.py | 34 +++++++ scannerjammer/urls.py | 1 + 3 files changed, 257 insertions(+) create mode 100644 frontend/templates/room.html diff --git a/frontend/templates/room.html b/frontend/templates/room.html new file mode 100644 index 0000000..2ce2edd --- /dev/null +++ b/frontend/templates/room.html @@ -0,0 +1,222 @@ +{% load static %} +{% get_static_prefix as STATIC_PREFIX %} + + + +{{ UCROOM }} + + + + + + + + + + + + + + + + + + +

+ INSTRUCTIONS: + Paste Youtube links into the chat. + You can also paste GIFs and images. +

+
+ NOTE: SCANNERJAMMER ONLY WORKS IN FIREFOX AND CHROME. DO NOT TRY THIS WITH INTERNET EXPLORER +
+
+ please enable javascript + +
+
+ loading . . . +
+ +
+ +
+
+
+
+
+
+
+
+

+ get an account - no email required +
+ + +
+
+ +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ microphone
+ mute all
+
+
+
+
+ +
+
+

NOW ACTIVE

+ +
+ +
+ + + +
+
+ +
+ +
click to post in the room
+ +
+ +
+ + +
+ + +
+
X
+
CHANGE ROOM THEME
+
+
+
+
+ +
+ +
+
+ + + View Background History + Gallery + +
+
+ +
+ +
+
X
+
ROOMS
+ +
    +
+
+ +
+
X
+
INSTRUCTIONS
+

+ Paste YOUTUBE, VIMEO, or SOUNDCLOUD links into the chat. + You can also paste links to GIFs and images. +

+ +
+ +
+ + + + + + + + + + diff --git a/frontend/views.py b/frontend/views.py index 1b3c963..bc12b82 100644 --- a/frontend/views.py +++ b/frontend/views.py @@ -192,3 +192,37 @@ def roomlist(request): ) response['Pragma'] = 'no-cache' return response + +def room(request, roomname): + sjroom = SJRoom.objects.filter(name=roomname)[0]; + jsPath = "/js/sj6.js" + + title = sjroom.name.capitalize() + " room on ScannerJammer" + thumbnail = "http://scannerjammer.fm/img/plant.gif" + if sjroom.name == "glitter": + thumbnail = "http://scannerjammer.fm/img/glitter_flower.gif" + elif sjroom.name == "glasspopcorn": + thumbnail = "http://scannerjammer.fm/img/glasspopthumb.gif" + title = "GlassPopcorn TV" + elif room == "adult": + #serverPort = 6969 + jsPath = "/js/sandbox/sj7.js" + elif room != "main": + s = json.loads(sjroom.settings_text) + if "bg" in s: + thumbnail = s["bg"] + + response = render_to_response( + 'room.html', + { + 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_PORT': settings.SERVER_PORT, + 'JS_PATH': jsPath, + 'ROOM': sjroom.name.lower(), + 'UCROOM': sjroom.name.upper(), + 'OPENGRAPH_IMAGE': thumbnail, + 'OPENGRAPH_TITLE': title, + } + ) + response['Pragma'] = 'no-cache' + return response diff --git a/scannerjammer/urls.py b/scannerjammer/urls.py index 74852be..5e51d1b 100644 --- a/scannerjammer/urls.py +++ b/scannerjammer/urls.py @@ -25,6 +25,7 @@ urlpatterns = patterns('', url(r'^top/$', 'frontend.views.topvideos', name='topvideos'), url(r'^directory/$', 'frontend.views.directory', name='directory'), url(r'^profile/(?P[a-z0-9_]+)$', 'frontend.views.profile', name='profile'), + url(r'^(?P[a-z0-9_]+)$', 'frontend.views.room', name='room'), #url(r'.*', 'backend.views.redirect'), ) -- cgit v1.2.3-70-g09d2