Skip to content

Commit

Permalink
Updating to SWFUpload v2.2.0 Beta 2 and Rails 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronyule committed Oct 30, 2008
1 parent 6f60bd5 commit 8e309c7
Show file tree
Hide file tree
Showing 10 changed files with 331 additions and 2,394 deletions.
2 changes: 1 addition & 1 deletion README
@@ -1,7 +1,7 @@
swfupload-rails-authentication
==============================

Demo Rails 2.1 app showing SWFUpload working in tandem with restful-authentication, CSRF protection and attachment_fu.
Demo Rails 2.1.2 app showing SWFUpload working in tandem with restful-authentication, CSRF protection and attachment_fu.


Requirements
Expand Down
22 changes: 18 additions & 4 deletions app/views/assets/new.html.erb
Expand Up @@ -6,12 +6,25 @@
window.onload = function () {
swfu = new SWFUpload({
upload_url : '<%= assets_path -%>?_swfupload_demo_session=<%= u session.session_id %>',
flash_url : '/flash/swfupload_f9.swf',
flash_url : '/flash/swfupload.swf',

// Button settings
button_image_url: "/images/TestImageNoText_65x29.png", // Relative to the Flash file
button_width: "65",
button_height: "29",
button_placeholder_id: "spanButtonPlaceHolder",
button_text: '<span class="theFont">Hello</span>',
button_text_style: ".theFont { font-size: 16; }",
button_text_left_padding: 12,
button_text_top_padding: 3,

file_size_limit : '10000',
file_types : '*.jpg',
file_types_description : 'JPG Images',
file_upload_limit : '0',
custom_settings : {
progressTarget : "fsUploadProgress"
},

file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
Expand Down Expand Up @@ -39,9 +52,10 @@

<% form_for(@asset) do |f| %>
<fieldset>
<button id="btnBrowse" type="button" style="padding: 5px;" onclick="swfu.selectFiles(); this.blur();">
Select Files <span style="font-size: 7pt;">(5 MB Max)</span>
</button>
<div id="divStatus">0 Files Uploaded</div>
<div>
<span id="spanButtonPlaceHolder"></span>
</div>
</fieldset>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion config/environment.rb
Expand Up @@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production'

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION = '2.1.2' unless defined? RAILS_GEM_VERSION

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Expand Down
2,299 changes: 0 additions & 2,299 deletions log/development.log

This file was deleted.

Binary file removed public/.DS_Store
Binary file not shown.
Binary file added public/flash/swfupload.swf
Binary file not shown.
Binary file removed public/flash/swfupload_f9.swf
Binary file not shown.
Binary file added public/images/TestImageNoText_65x29.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
345 changes: 257 additions & 88 deletions public/javascripts/swfupload.js

Large diffs are not rendered by default.

55 changes: 54 additions & 1 deletion public/stylesheets/swfupload.css
Expand Up @@ -84,7 +84,7 @@
white-space: nowrap;
}

a.progressCancel {
/*a.progressCancel {
font-size: 0;
display: block;
height: 14px;
Expand All @@ -97,4 +97,57 @@ a.progressCancel {
a.progressCancel:hover {
background-position: 0px 0px;
}*/

div.fieldset {
border: 1px solid #afe14c;
margin: 10px 0;
padding: 20px 10px;
}
div.fieldset span.legend {
position: relative;
background-color: #FFF;
padding: 3px;
top: -30px;
font: 700 14px Arial, Helvetica, sans-serif;
color: #73b304;
}

div.flash {
width: 375px;
margin: 10px 5px;
border-color: #D9E4FF;

-moz-border-radius-topleft : 5px;
-webkit-border-top-left-radius : 5px;
-moz-border-radius-topright : 5px;
-webkit-border-top-right-radius : 5px;
-moz-border-radius-bottomleft : 5px;
-webkit-border-bottom-left-radius : 5px;
-moz-border-radius-bottomright : 5px;
-webkit-border-bottom-right-radius : 5px;

}

button,
input,
select,
textarea {
border-width: 1px;
margin-bottom: 10px;
padding: 2px 3px;
}



input[disabled]{ border: 1px solid #ccc } /* FF 2 Fix */


label {
width: 150px;
text-align: right;
display:block;
margin-right: 5px;
}

#btnSubmit { margin: 0 0 0 155px ; }

0 comments on commit 8e309c7

Please sign in to comment.