summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rwxr-xr-xfrontend/static/js/sj_compiled.js4
-rw-r--r--frontend/static/js/src/chat.js4
-rwxr-xr-xfrontend/views.py137
3 files changed, 73 insertions, 72 deletions
diff --git a/frontend/static/js/sj_compiled.js b/frontend/static/js/sj_compiled.js
index 76421f7..50fef75 100755
--- a/frontend/static/js/sj_compiled.js
+++ b/frontend/static/js/sj_compiled.js
@@ -2599,9 +2599,9 @@ var Chat =
s +=
'<a href="'+word+'" target="_blank" class="pic">'+
'<img src="'+word+'" />'+
- '</a><br>';
+ '</a>';
if(id){
- s+='<span id="like_'+id+'" class="like img_like" onClick="Like.likeContent({id:'+id+'})">like</span>';
+ // s+='<span id="like_'+id+'" class="like img_like" onClick="Like.likeContent({id:'+id+'})">like</span>';
}
}
else if (word.indexOf("scannerjammer.com/profile") !== -1)
diff --git a/frontend/static/js/src/chat.js b/frontend/static/js/src/chat.js
index c0b04be..324678b 100644
--- a/frontend/static/js/src/chat.js
+++ b/frontend/static/js/src/chat.js
@@ -101,9 +101,9 @@ var Chat =
s +=
'<a href="'+word+'" target="_blank" class="pic">'+
'<img src="'+word+'" />'+
- '</a><br>';
+ '</a>';
if(id){
- s+='<span id="like_'+id+'" class="like img_like" onClick="Like.likeContent({id:'+id+'})">like</span>';
+ // s+='<span id="like_'+id+'" class="like img_like" onClick="Like.likeContent({id:'+id+'})">like</span>';
}
}
else if (word.indexOf("scannerjammer.com/profile") !== -1)
diff --git a/frontend/views.py b/frontend/views.py
index 9a97402..629c7d5 100755
--- a/frontend/views.py
+++ b/frontend/views.py
@@ -103,7 +103,7 @@ def directory(request):
"""
r = []
for u in SJUserProfile.objects.order_by('-score'):
- r.append({ 'id': u.id, 'name': u.nickname, 'score': u.score })
+ r.append({ 'id': u.id, 'name': u.nickname, 'score': u.score })
response = render_to_response(
'directory.html',
@@ -111,34 +111,34 @@ def directory(request):
'SERVER_HOST': request.get_host(),
'SERVER_PORT': settings.SERVER_PORT,
'directory': json.dumps(r),
- }
+ }
)
response['Pragma'] = 'no-cache'
return response
def get_thumbnail(user):
- STOCK_THUMBNAIL = 'http://scannerjammer.com/static/img/runner.gif'
- """
- FIXME
- if user.access and 'http' in user.access: # what was those fields?
- linez = user.access.split("\n")
- for l in linez:
- if "avatar" in l:
- pair = l.split("\t")
- if pair[1] is not None and "http" in pair[1]:
- if db.is_image(pair[1]):
- return pair[1]
- if user[8] and 'http' in user[8]:
- linez = user[8].split("\n")
- for l in linez:
- if "http" in l:
- wordz = l.split(" ")
- for word in wordz:
- if "http" in word:
- if db.is_image(word):
- return word
- """
- return STOCK_THUMBNAIL
+ STOCK_THUMBNAIL = 'http://scannerjammer.com/static/img/runner.gif'
+ """
+ FIXME
+ if user.access and 'http' in user.access: # what was those fields?
+ linez = user.access.split("\n")
+ for l in linez:
+ if "avatar" in l:
+ pair = l.split("\t")
+ if pair[1] is not None and "http" in pair[1]:
+ if db.is_image(pair[1]):
+ return pair[1]
+ if user[8] and 'http' in user[8]:
+ linez = user[8].split("\n")
+ for l in linez:
+ if "http" in l:
+ wordz = l.split(" ")
+ for word in wordz:
+ if "http" in word:
+ if db.is_image(word):
+ return word
+ """
+ return STOCK_THUMBNAIL
def profile(request, username):
@@ -154,7 +154,7 @@ def profile(request, username):
profile = [ userprofile.user.id, userprofile.nickname, userprofile.score, 3, 4, 5, userprofile.bio, json.loads(userprofile.settings_text), userprofile.user.email ]
vidz = []
for a in tvidz:
- vidz.insert(0,a)
+ vidz.insert(0,a)
response = render_to_response(
'profile.html',
@@ -162,17 +162,17 @@ def profile(request, username):
'SERVER_HOST': request.get_host(),
'SERVER_PORT': settings.SERVER_PORT,
'NAME': userprofile.nickname,
- 'UCNAME': userprofile.nickname.upper(),
- 'SCORE': userprofile.score,
- 'THUMBNAIL': thumbnail,
-
- 'VIDZ': json.dumps(videos_response_list(vidz)),
- 'TOPZ': json.dumps(videos_response_list(topz)),
- 'LIKEZ': json.dumps(videos_response_list(likez)),
- 'PROFILE': json.dumps(profile),
-
- 'NOW': str(int(time.time())),
- }
+ 'UCNAME': userprofile.nickname.upper(),
+ 'SCORE': userprofile.score,
+ 'THUMBNAIL': thumbnail,
+
+ 'VIDZ': json.dumps(videos_response_list(vidz)),
+ 'TOPZ': json.dumps(videos_response_list(topz)),
+ 'LIKEZ': json.dumps(videos_response_list(likez)),
+ 'PROFILE': json.dumps(profile),
+
+ 'NOW': str(int(time.time())),
+ }
)
response['Pragma'] = 'no-cache'
return response
@@ -195,15 +195,15 @@ def profile_img(request, username):
'SERVER_HOST': request.get_host(),
'SERVER_PORT': settings.SERVER_PORT,
'NAME': userprofile.nickname,
- 'UCNAME': userprofile.nickname.upper(),
- 'SCORE': userprofile.score,
- 'THUMBNAIL': thumbnail,
-
- 'LIKEZ': json.dumps(text_response_list(likez)),
- 'PROFILE': json.dumps(profile),
-
- 'NOW': str(int(time.time())),
- }
+ 'UCNAME': userprofile.nickname.upper(),
+ 'SCORE': userprofile.score,
+ 'THUMBNAIL': thumbnail,
+
+ 'LIKEZ': json.dumps(text_response_list(likez)),
+ 'PROFILE': json.dumps(profile),
+
+ 'NOW': str(int(time.time())),
+ }
)
response['Pragma'] = 'no-cache'
return response
@@ -217,18 +217,19 @@ def roomlist(request):
roomlist = []
sjrooms = SJRoom.objects.all()
for r in sjrooms:
- s = json.loads(r.settings_text)
- video_count = r.sjcontent_set.filter(datetime__gt=recenttime).count()
- if 'bg' in s:
- roomlist.append([r.id, r.name, int(r.datetime.strftime("%s")), video_count, s["bg"]])
-
- response = render_to_response(
- 'roomlist.html',
- {
- 'SERVER_HOST': request.get_host(),
- 'SERVER_PORT': settings.SERVER_PORT,
- 'ROOM_LIST': json.dumps(roomlist),
- }
+ s = json.loads(r.settings_text)
+ video_count = r.sjcontent_set.filter(datetime__gt=recenttime).count()
+ if 'bg' in s:
+ timestr = str(r.datetime) #FIXME and inline
+ roomlist.append([r.id, r.name, timestr, video_count, s["bg"]])
+
+ response = render_to_response(
+ 'roomlist.html',
+ {
+ 'SERVER_HOST': request.get_host(),
+ 'SERVER_PORT': settings.SERVER_PORT,
+ 'ROOM_LIST': json.dumps(roomlist),
+ }
)
response['Pragma'] = 'no-cache'
return response
@@ -248,9 +249,9 @@ def room(request, roomname):
#serverPort = 6969
jsPath = "/js/sandbox/sj7.js"
elif room != "main":
- s = json.loads(sjroom.settings_text)
- if "bg" in s:
- thumbnail = s["bg"]
+ s = json.loads(sjroom.settings_text)
+ if "bg" in s:
+ thumbnail = s["bg"]
response = render_to_response(
'room.html',
@@ -259,10 +260,10 @@ def room(request, roomname):
'SERVER_PORT': settings.SERVER_PORT,
'JS_PATH': jsPath,
'ROOM': sjroom.name.lower(),
- 'UCROOM': sjroom.name.upper(),
- 'OPENGRAPH_IMAGE': thumbnail,
- 'OPENGRAPH_TITLE': title,
- }
+ 'UCROOM': sjroom.name.upper(),
+ 'OPENGRAPH_IMAGE': thumbnail,
+ 'OPENGRAPH_TITLE': title,
+ }
)
response['Pragma'] = 'no-cache'
return response
@@ -273,7 +274,7 @@ def faq(request):
{
'SERVER_HOST': request.get_host(),
'SERVER_PORT': settings.SERVER_PORT,
- }
+ }
)
response['Pragma'] = 'no-cache'
return response
@@ -284,7 +285,7 @@ def calendar(request):
{
'SERVER_HOST': request.get_host(),
'SERVER_PORT': settings.SERVER_PORT,
- }
+ }
)
response['Pragma'] = 'no-cache'
return response
@@ -295,7 +296,7 @@ def register(request):
{
'SERVER_HOST': request.get_host(),
'SERVER_PORT': settings.SERVER_PORT,
- }
+ }
)
response['Pragma'] = 'no-cache'
return response
@@ -306,7 +307,7 @@ def admin(request, roomname):
{
'SERVER_HOST': request.get_host(),
'SERVER_PORT': settings.SERVER_PORT,
- }
+ }
)
response['Pragma'] = 'no-cache'
return response