diff options
Diffstat (limited to 'examples/rails_app-2.3.4/app/views/files/new.html.erb')
-rw-r--r-- | examples/rails_app-2.3.4/app/views/files/new.html.erb | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/examples/rails_app-2.3.4/app/views/files/new.html.erb b/examples/rails_app-2.3.4/app/views/files/new.html.erb new file mode 100644 index 0000000..42f5f27 --- /dev/null +++ b/examples/rails_app-2.3.4/app/views/files/new.html.erb @@ -0,0 +1,56 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<!-- example taken from git://github.com/drogus/jquery-upload-progress --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>ajaxFileUpload</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <script src="/javascripts/jquery.js"></script> + <script src="/javascripts/jquery.uploadProgress.js"></script> + <script type="text/javascript"> + $(function() { + $('form').uploadProgress({ + /* scripts locations for safari */ + jqueryPath: "/javascripts/jquery.js", + uploadProgressPath: "/javascripts/jquery.uploadProgress.js", + start:function(){}, + uploading: function(upload) {$('#percents').html(upload.percents+'%');}, + interval: 500 + }); + }); + </script> + <style type="text/css"> + .bar { + width: 300px; + } + + #progress { + background: #eee; + border: 1px solid #222; + margin-top: 20px; + } + #progressbar { + width: 0px; + height: 24px; + background: #333; + } + </style> + </head> + + <body> + <% if flash[:notice] %> + <h1><%= flash[:notice] %></h1> + <% end %> + <form id="upload" enctype="multipart/form-data" action="/files/new" method="post"> + <input name="data" type="file"/> + <input type="submit" value="Upload"/> + </form> + + <div id="uploading"> + <div id="progress" class="bar"> + <div id="progressbar"> </div> + </div> + </div> + <div id="percents"></div> + </body> +</html> |