Skip to content

Commit

Permalink
share url for single video in modal
Browse files Browse the repository at this point in the history
  • Loading branch information
cjstewart88 committed Apr 12, 2012
1 parent e204ac8 commit f5b0ff3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/assets/javascripts/main.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ function share_single (video_id, video_title) {
$('#share-video div.facebook').data('video-title', video_title); $('#share-video div.facebook').data('video-title', video_title);
$('#share-video div.twitter').data('video-id', video_id); $('#share-video div.twitter').data('video-id', video_id);
$('#share-video div.twitter').data('video-title', video_title); $('#share-video div.twitter').data('video-title', video_title);
$('.url').val('http://www.tubalr.com/video/' + video_id);
} }


function create_new_playlist (new_playlist_name) { function create_new_playlist (new_playlist_name) {
Expand Down Expand Up @@ -749,7 +750,7 @@ $(document).ready(function () {
autoOpen: false, autoOpen: false,
width: 200, width: 200,
draggable: false, draggable: false,
height: 128, height: 158,
title: "Share Video" title: "Share Video"
}); });


Expand Down Expand Up @@ -820,6 +821,8 @@ $(document).ready(function () {
similarTo($('#q').val()); similarTo($('#q').val());
}); });


$('.url').click(function () { $(this).select(); });

$('input#q').keypress(function(e) { $('input#q').keypress(function(e) {
var code = (e.keyCode ? e.keyCode : e.which); var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) { //Enter keycode if (code == 13) { //Enter keycode
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/main.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ nav a {
background: #4099FF; background: #4099FF;
} }


#share-video .url {
width: 150px;
margin: 0 auto;
display: block;
}

#player { #player {
width: 500px; width: 500px;
padding-bottom: 3px; padding-bottom: 3px;
Expand Down
1 change: 1 addition & 0 deletions app/views/index.html.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<div id="share-video"> <div id="share-video">
<div class='facebook'>share on facebook</div> <div class='facebook'>share on facebook</div>
<div class='twitter'>tweet on twitter</div> <div class='twitter'>tweet on twitter</div>
<input type='text' class='url' readonly></div>
</div> </div>


<aside id="info"></aside> <aside id="info"></aside>
Expand Down

0 comments on commit f5b0ff3

Please sign in to comment.