Skip to content

Commit

Permalink
Changed path defined in Slide, added JS to default partial
Browse files Browse the repository at this point in the history
  • Loading branch information
daemonsy committed Jul 25, 2012
1 parent 83afb3d commit f00fd77
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/spree/slide.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Slide < ActiveRecord::Base
has_attached_file :image,
:styles=>{:thumb=> ["#{SpreeShowcase::Config.thumbnail_style}"],
:showcase=> ["#{SpreeShowcase::Config.showcase_style}"]},
:url => '/spree/taxons/:id/:style/:basename.:extension',
:path => ':rails_root/public/spree/taxons/:id/:style/:basename.:extension'
:url => '/spree/showcase/:id/:style/:basename.:extension',
:path => ':rails_root/public/spree/showcase/:id/:style/:basename.:extension'

# Add S3 and Heroku support
if Rails.env.production?
Expand Down
31 changes: 31 additions & 0 deletions app/views/spree/slides/_showcase.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,34 @@
</div>
</div>
</div>
<%= javascript_tag do %>
$(window).load(function() {
$('.flexslider').flexslider({
animation: "<%= SpreeShowcase::Config[:animation_type] %>", // String: Select your animation type, "fade" or "slide"
slideDirection: "horizontal", // String: Select the sliding direction, "horizontal" or "vertical"
slideshow: '<%= SpreeShowcase::Config[:slideshow] %>', // Boolean: Animate slider automatically
slideshowSpeed: '<%= SpreeShowcase::Config[:slideshow_speed] %>', // Integer: Set the speed of the slideshow cycling, in milliseconds
animationDuration: '<%= SpreeShowcase::Config[:animation_duration] %>', // Integer: Set the speed of animations, in milliseconds
directionNav: false, // Boolean: Create navigation for previous/next navigation? (true/false)
controlNav: true, // Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
keyboardNav: true, // Boolean: Allow slider navigating via keyboard left/right keys
mousewheel: false, // Boolean: Allow slider navigating via mousewheel
prevText: "Previous", // String: Set the text for the "previous" directionNav item
nextText: "Next", // String: Set the text for the "next" directionNav item
pausePlay: false, // Boolean: Create pause/play dynamic element
pauseText: 'Pause', // String: Set the text for the "pause" pausePlay item
playText: 'Play', // String: Set the text for the "play" pausePlay item
randomize: '<%= SpreeShowcase::Config[:randomize] %>', // Boolean: Randomize slide order
slideToStart: 0, // Integer: The slide that the slider should start on. Array notation (0 = first slide)
animationLoop: '<%= SpreeShowcase::Config[:animation_loop] %>', // Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
pauseOnAction: true, // Boolean: Pause the slideshow when interacting with control elements, highly recommended.
pauseOnHover: '<%= SpreeShowcase::Config[:pause_on_hover] %>', // Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
controlsContainer: '.flex-container', // Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.
manualControls: '.custom-controls li a', // Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
start: function(){}, // Callback: function(slider) - Fires when the slider loads the first slide
before: function(){}, // Callback: function(slider) - Fires asynchronously with each slider animation
after: function(){}, // Callback: function(slider) - Fires after each slider animation completes
end: function(){} // Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
});
});
<% end %>
Binary file added spree_showcase-0.5.3.gem
Binary file not shown.

0 comments on commit f00fd77

Please sign in to comment.