From 06a01eb199dd8564c5efa0316e727f2a85afceb5 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 23 Dec 2012 13:51:44 -0500 Subject: images likes --- backend/views.py | 4 ++-- frontend/static/js/chat.js | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/views.py b/backend/views.py index a926c18..7cfbe98 100644 --- a/backend/views.py +++ b/backend/views.py @@ -932,7 +932,7 @@ def api_video_like(request): if response: return response try: - video = SJContent.objects.get(id=request.POST['video'], content_type='video') + video = SJContent.objects.get(id=request.POST['video']) if not SJLike.objects.filter(user=user, content=video): settings = video.settings if 'likes' not in settings: @@ -961,7 +961,7 @@ def api_video_unlike(request): if response: return response try: - video = SJContent.objects.get(id=request.POST['video'], content_type='video') + video = SJContent.objects.get(id=request.POST['video']) likes = SJLike.objects.filter(user=user, content=video) if likes: settings = video.settings diff --git a/frontend/static/js/chat.js b/frontend/static/js/chat.js index 822e1ee..0c0656e 100644 --- a/frontend/static/js/chat.js +++ b/frontend/static/js/chat.js @@ -13,11 +13,11 @@ var Chat = parse: function (row) { var s = '' + row[2] + " " - s += Chat.parseWords(row[3]) + s += Chat.parseWords(row[3],row[0]) s += "
" return s }, - parseWords: function (raw) + parseWords: function (raw,id) { if (! raw) return "" @@ -97,7 +97,10 @@ var Chat = word.indexOf(".gif") !== -1 || word.indexOf(".png") !== -1) { - s += '' + s += + ''+ + ''+ + '
like' } else if (word.indexOf("scannerjammer.com/profile") !== -1) { -- cgit v1.2.3-70-g09d2