diff --git a/app/helpers/box_organizer_helper.rb b/app/helpers/box_organizer_helper.rb index 37fe93b..2a0ec4a 100644 --- a/app/helpers/box_organizer_helper.rb +++ b/app/helpers/box_organizer_helper.rb @@ -10,9 +10,9 @@ module BoxOrganizerHelper elsif plugin && File.exists?(File.join(Rails.root, 'public', plugin.public_path, 'images', block.icon_path)) image_path = File.join('/', plugin.public_path, 'images', block.icon_path) elsif File.exists?(File.join(Rails.root, 'public', 'images', block.icon_path)) - image_path = block.icon_path + image_path = File.join('images', block.icon_path) else - image_path = block.default_icon_path + image_path = File.join('images', block.default_icon_path) end image_tag(image_path, height: '48', width: '48', class: 'block-type-icon', alt: '' ) @@ -33,7 +33,7 @@ module BoxOrganizerHelper images_path = Dir.glob(File.join(Rails.root, 'public', 'images', block.preview_path, '*')) if images_path.empty? images_path = images_path.map{|path| path.gsub(File.join(Rails.root, 'public'), '') } unless images_path.empty? - images_path = 1.upto(3).map{block.default_preview_path} if images_path.empty? + images_path = 1.upto(3).map{File.join('images', block.default_preview_path)} if images_path.empty? content_tag(:ul, images_path.map do |preview| diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 7fd0def..e78aa11 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -28,7 +28,7 @@ module LayoutHelper end def noosfero_javascript - plugins_javascripts = @plugins.flat_map{ |plugin| plugin.js_files.map{ |js| plugin.class.public_path(js, true) } }.flatten + plugins_javascripts = @plugins.flat_map{ |plugin| Array.wrap(plugin.js_files).map{ |js| plugin.class.public_path(js, true) } }.flatten output = '' output += render 'layouts/javascript' diff --git a/public/javascripts/application.js b/public/javascripts/application.js index c8a5044..8ae18b5 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -27,6 +27,9 @@ *= require manage-products.js *= require catalog.js *= require autogrow.js +*= require slick.js +*= require select-or-die/_src/selectordie.js +*= require block-store.js */ // scope for noosfero stuff diff --git a/public/javascripts/block_store.js b/public/javascripts/block_store.js deleted file mode 100644 index 41bdfe1..0000000 --- a/public/javascripts/block_store.js +++ /dev/null @@ -1,51 +0,0 @@ -jQuery(document).ready(function () { - jQuery("#block-types-navigation a.previous").hide(); - jQuery('.block-types-group').first().show( 'slide', { direction : 'down' }, 1000, function() { - jQuery('.block-types-group').first().addClass('active'); - jQuery(".block-types-group.active + .block-types-group").addClass('next'); - jQuery('#block-types-navigation a.previous').click(PreviousSlide); - jQuery('#block-types-navigation a.next').click(NextSlide); - }); - - firstBlockTypesGroup = jQuery(".block-types-group").first(); - lastBlockTypesGroup = jQuery(".block-types-group").last(); -}); - -function NextSlide() { - activeBlockTypesGroup = jQuery(".block-types-group.active"); - nextBlockTypesGroup = jQuery(".block-types-group.next").first(); - - activeBlockTypesGroup.hide( 'slide', { direction : 'left' }, 1000); - nextBlockTypesGroup.show( 'slide', { direction : 'right' }, 1000, function() { - activeBlockTypesGroup.removeClass('active'); - activeBlockTypesGroup.addClass('prev'); - nextBlockTypesGroup.removeClass('next'); - nextBlockTypesGroup.addClass('active'); - jQuery(".block-types-group.active + .block-types-group").addClass('next'); - activeBlockTypesGroup = jQuery(".block-types-group.active"); - jQuery("#block-types-navigation a.previous").show(); - - if ( activeBlockTypesGroup.is( lastBlockTypesGroup ) ) { - jQuery("#block-types-navigation a.next").hide(); - } - }); -} - -function PreviousSlide() { - activeBlockTypesGroup = jQuery(".block-types-group.active"); - previousBlockTypesGroup = jQuery(".block-types-group.prev").last(); - - activeBlockTypesGroup.hide( 'slide', { direction : 'right' }, 1000 ); - previousBlockTypesGroup.show( 'slide', { direction : 'left' }, 1000, function() { - activeBlockTypesGroup.removeClass('active'); - activeBlockTypesGroup.addClass('next'); - previousBlockTypesGroup.removeClass('prev'); - previousBlockTypesGroup.addClass('active'); - activeBlockTypesGroup = jQuery(".block-types-group.active"); - jQuery("#block-types-navigation a.next").show(); - - if ( activeBlockTypesGroup.is( firstBlockTypesGroup ) ) { - jQuery("#block-types-navigation a.previous").hide(); - } - }); -} diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 31606c8..2caa6a9 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -14,6 +14,7 @@ * views specifics *= require chat *= require search + *= require block-store */ /* browser fixes */ -- libgit2 0.21.2