diff options
| -rw-r--r-- | backend/views.py | 4 | ||||
| -rw-r--r-- | 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 = '<a href="/profile/' + row[2] + '" class="u">' + row[2] + "</a> <span>" - s += Chat.parseWords(row[3]) + s += Chat.parseWords(row[3],row[0]) s += "</span><br />" 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 += '<a href="'+word+'" target="_blank" class="pic"><img src="'+word+'" /></a>' + s += + '<a href="'+word+'" target="_blank" class="pic">'+ + '<img src="'+word+'" />'+ + '</a><br><span id="like_'+id+'" class="like img_like" onClick="Like.likeVideo({id:'+id+'})">like</span>' } else if (word.indexOf("scannerjammer.com/profile") !== -1) { |
