Skip to content

Commit

Permalink
working voting thanks to being able to pass thing id to blogbutton.js
Browse files Browse the repository at this point in the history
  • Loading branch information
octatone committed Feb 1, 2012
1 parent e6af15d commit 16b2237
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions js/tv.js
Expand Up @@ -498,25 +498,7 @@ function loadVideo(video) {


addListeners(globals.videos[this_chan].video[selected_video].domain); addListeners(globals.videos[this_chan].video[selected_video].domain);


var score = globals.videos[this_chan].video[selected_video].score; var reddit_string = redditButton('t3_' + globals.videos[this_chan].video[selected_video].id);
var num_comments = globals.videos[this_chan].video[selected_video].num_comments;

var reddit_string = '<a href="'+redditlink+'" target="_blank">'
+ score + ((score === 1) ? ' vote' : ' votes')
+ ' &bull; '
+ num_comments + ((num_comments === 1) ? ' comment' : ' comments')
+ '</a>';

/*
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 $vote_button = $('#vote-button'); var $vote_button = $('#vote-button');
$vote_button.stop(true,true).fadeOut('slow', function() { $vote_button.stop(true,true).fadeOut('slow', function() {
$vote_button.html(reddit_string).fadeIn('slow'); $vote_button.html(reddit_string).fadeIn('slow');
Expand Down Expand Up @@ -879,12 +861,9 @@ function checkAnchor(){
} }


/* Reddit Functions */ /* Reddit Functions */
function redditButton(permalink, title){ function redditButton(id){
var reddit_string="<iframe src=\"http://www.reddit.com/static/button/button1.html?width=120"; var reddit_string="<iframe src=\"http://www.reddit.com/static/button/button1.html?width=120";
//reddit_string += '&id=' + videos[cur_chan].video[cur_video].id; reddit_string += '&id=' + id;
reddit_string += '&url=' + permalink;
reddit_string += '&title=' + title;
//reddit_string += '&sr=' + encodeURIComponent($.unescapifyHTML(videos[cur_chan].video[cur_video].subreddit));
//reddit_string += '&css=' + encodeURIComponent(window.reddit_css); //reddit_string += '&css=' + encodeURIComponent(window.reddit_css);
//reddit_string += '&bgcolor=' + encodeURIComponent(window.reddit_bgcolor); //reddit_string += '&bgcolor=' + encodeURIComponent(window.reddit_bgcolor);
//reddit_string += '&bordercolor=' + encodeURIComponent(window.reddit_bordercolor); //reddit_string += '&bordercolor=' + encodeURIComponent(window.reddit_bordercolor);
Expand Down

0 comments on commit 16b2237

Please sign in to comment.