Improve ugoira controls

This commit is contained in:
Toks
2014-10-18 16:15:07 -04:00
committed by r888888888
parent b1d5bb8272
commit 34e3fd45b9
2 changed files with 23 additions and 13 deletions

View File

@@ -521,3 +521,14 @@ div#unapprove-dialog {
width: 100%;
}
}
#ugoira-controls {
button {
height: 2em;
width: 5em;
}
#progressbar {
height: 1.5em;
}
}

View File

@@ -16,15 +16,13 @@
"data-score" => post.score,
"data-fav-count" => post.fav_count) %>
<div id="progressbar"></div>
<p>
<%= link_to "Play", "#", :id => "ugoira-play" %>
| <%= link_to "Pause", "#", :id => "ugoira-pause" %>
| <%= link_to "Rewind", "#", :id => "ugoira-rewind" %>
| <%= link_to "Stop", "#", :id => "ugoira-stop" %>
| <%= link_to "Save as video (right click and save)", post.large_file_url %>
</p>
<div id="ugoira-controls">
<div id="progressbar" style="width: <%= post.image_width %>px;"></div>
<%= button_tag "Play", :id => "ugoira-play", :style => "display: none;" %>
<%= button_tag "Pause", :id => "ugoira-pause" %>
<%= button_tag "Rewind", :id => "ugoira-rewind" %>
<%= link_to "Save as video (right click and save)", post.large_file_url %>
</div>
<% content_for(:html_header) do %>
<%= javascript_include_tag "ugoira_player" %>
@@ -60,22 +58,23 @@
$("#progressbar").remove();
}
});
$("#ugoira-play").click(function(e) {
Danbooru.Ugoira.player.play();
$(this).hide();
$("#ugoira-pause").show();
e.preventDefault();
})
$("#ugoira-pause").click(function(e) {
Danbooru.Ugoira.player.pause();
$(this).hide();
$("#ugoira-play").show();
e.preventDefault();
});
$("#ugoira-rewind").click(function(e) {
Danbooru.Ugoira.player.rewind();
e.preventDefault();
});
$("#ugoira-stop").click(function(e) {
Danbooru.Ugoira.player.stop();
e.preventDefault();
});
});
</script>
<% end %>