From 34e3fd45b9fb788a86a2ad5dfa78d7cac3d54802 Mon Sep 17 00:00:00 2001 From: Toks Date: Sat, 18 Oct 2014 16:15:07 -0400 Subject: [PATCH] Improve ugoira controls --- .../stylesheets/specific/posts.css.scss | 11 ++++++++ .../posts/partials/show/_ugoira.html.erb | 25 +++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/specific/posts.css.scss b/app/assets/stylesheets/specific/posts.css.scss index 25eb1853e..e88b14cbd 100644 --- a/app/assets/stylesheets/specific/posts.css.scss +++ b/app/assets/stylesheets/specific/posts.css.scss @@ -521,3 +521,14 @@ div#unapprove-dialog { width: 100%; } } + +#ugoira-controls { + button { + height: 2em; + width: 5em; + } + + #progressbar { + height: 1.5em; + } +} diff --git a/app/views/posts/partials/show/_ugoira.html.erb b/app/views/posts/partials/show/_ugoira.html.erb index 38cbdae14..14d1fccb5 100644 --- a/app/views/posts/partials/show/_ugoira.html.erb +++ b/app/views/posts/partials/show/_ugoira.html.erb @@ -16,15 +16,13 @@ "data-score" => post.score, "data-fav-count" => post.fav_count) %> -
- -

- <%= 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 %> -

+
+
+ <%= 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 %> +
<% 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(); - }); }); <% end %>