Permalink
Browse files

added loader

  • Loading branch information...
1 parent 6e98c82 commit fe2f72ea9d5d7c9c836c489c433989f4f8c2963b @cnharris10 cnharris10 committed Mar 17, 2011
Showing with 4 additions and 1 deletion.
  1. +1 −1 app/controllers/convert_controller.rb
  2. +3 −0 app/views/convert/welcome.html.erb
  3. BIN sample.flv
@@ -42,7 +42,7 @@ def curlurl
`ffmpeg -i sample.flv -ar 44100 -ab 160k -ac 2 title.mp3;`
FileUtils.move("title.mp3","public/resources/#{title}.mp3")
- render :text => "<center><a href='/resources/#{title}.mp3'>Download: #{title}.mp3</a></center>"
+ render :text => "<center><div style='margin:10px auto;'><a href='/resources/#{title}.mp3'>Download: #{title}.mp3</a></div></center>"
end
@@ -1,17 +1,20 @@
<div class="container" style="margin:0 auto;width:500px">
<input type="text" style="width:400px" id="input_url" value="" />&nbsp;<input type="button" value="Convert!" id="button_submit" />
+ <div id="loader" style="display:none;width:400px;margin:10px 0"><img src="http://www.markitable.co.nz/images/ajaxLoader.gif" /></div>
<div>
<script>
function convert(){
+ $("loader").style.display = "block";
new Ajax.Request('/convert?url='+$('input_url').value,
{
method:'get',
onSuccess: function(transport){
var response = transport.responseText || "no response text";
+ $("loader").style.display = "none";
document.body.innerHTML += transport.responseText;
},
onFailure: function(){ alert('Something went wrong...') }
View
Binary file not shown.

0 comments on commit fe2f72e

Please sign in to comment.