From 16b2237f24fcda4db8318407efd19f99ead1ef3a Mon Sep 17 00:00:00 2001 From: octatone Date: Tue, 31 Jan 2012 21:25:39 -0500 Subject: [PATCH] working voting thanks to being able to pass thing id to blogbutton.js --- js/tv.js | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/js/tv.js b/js/tv.js index cdd12fa..095ab83 100644 --- a/js/tv.js +++ b/js/tv.js @@ -498,25 +498,7 @@ function loadVideo(video) { addListeners(globals.videos[this_chan].video[selected_video].domain); - var score = globals.videos[this_chan].video[selected_video].score; - var num_comments = globals.videos[this_chan].video[selected_video].num_comments; - - var reddit_string = '' - + score + ((score === 1) ? ' vote' : ' votes') - + ' • ' - + num_comments + ((num_comments === 1) ? ' comment' : ' comments') - + ''; - - /* - console.log("video URL: " + videos[cur_chan].video[cur_video].url); - console.log("as send to reddit: " + encodeURIComponent(videos[cur_chan].video[cur_video].url)); - - var reddit_string = redditButton( - encodeURIComponent(videos[cur_chan].video[cur_video].url), - encodeURIComponent($.unescapifyHTML(videos[cur_chan].video[cur_video].title)) - ); - */ - + var reddit_string = redditButton('t3_' + globals.videos[this_chan].video[selected_video].id); var $vote_button = $('#vote-button'); $vote_button.stop(true,true).fadeOut('slow', function() { $vote_button.html(reddit_string).fadeIn('slow'); @@ -879,12 +861,9 @@ function checkAnchor(){ } /* Reddit Functions */ -function redditButton(permalink, title){ +function redditButton(id){ var reddit_string="