Socket
Book a DemoInstallSign in
Socket

rails-blueimp-gallery

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails-blueimp-gallery

1.0.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

= Rails Blueimp Gallery

This is a rails implementation of the blueimp gallery. Available here: https://github.com/blueimp/Gallery

= Upgrading to 1.x.x

Starting with 1.0.0 we do not longer include the blueimp gallery js and css anymore.

You will have to load it from a cdn.

HAML:

# app/layouts/application.html.haml
/ Blueimp Gallery CSS
%link{:crossorigin => "anonymous", :href => "https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/css/blueimp-gallery.min.css", :integrity => "sha256-Xqlh2kNfwlaYIadGK+AV287kAwoqLxYd+MoOvCykFoc=", :rel => "stylesheet"}/
/ Blueimp Gallery JS
%script{:crossorigin => "anonymous", :integrity => "sha256-Iwpd2qB3c+LqT25lxnW2SI84aABYcOxdz8StYme/fx0=", :src => "https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/js/jquery.blueimp-gallery.min.js"}

ERB:

# app/layouts/application.html.erb
<!-- Blueimp Gallery CSS -->
<link crossorigin="anonymous" href="https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/css/blueimp-gallery.min.css" integrity="sha256-Xqlh2kNfwlaYIadGK+AV287kAwoqLxYd+MoOvCykFoc=" rel="stylesheet">/</link>
<!-- Blueimp Gallery JS -->
<script crossorigin="anonymous" integrity="sha256-Iwpd2qB3c+LqT25lxnW2SI84aABYcOxdz8StYme/fx0=" src="https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/js/jquery.blueimp-gallery.min.js"></script>

= Installation

Add it to you Gemfile:

# Gemfile
gem 'rails-blueimp-gallery'

Generate the initializer:

$ rails g blueimp:gallery:install

Add the javascripts to your assets:

# ./app/assets/javascripts/application.js
//= require blueimp-gallery

Add the stylesheets to your assets:

# ./app/assets/stylesheets/application.css
/*
 *= require blueimp-gallery
 */

Add the blueimp gallery JS/CSS from CDN:

HAML:

# app/layouts/application.html.haml
/ Blueimp Gallery CSS
%link{:crossorigin => "anonymous", :href => "https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/css/blueimp-gallery.min.css", :integrity => "sha256-Xqlh2kNfwlaYIadGK+AV287kAwoqLxYd+MoOvCykFoc=", :rel => "stylesheet"}/
/ Blueimp Gallery JS
%script{:crossorigin => "anonymous", :integrity => "sha256-Iwpd2qB3c+LqT25lxnW2SI84aABYcOxdz8StYme/fx0=", :src => "https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/js/jquery.blueimp-gallery.min.js"}

ERB:

# app/layouts/application.html.erb
<!-- Blueimp Gallery CSS -->
<link crossorigin="anonymous" href="https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/css/blueimp-gallery.min.css" integrity="sha256-Xqlh2kNfwlaYIadGK+AV287kAwoqLxYd+MoOvCykFoc=" rel="stylesheet">/</link>
<!-- Blueimp Gallery JS -->
<script crossorigin="anonymous" integrity="sha256-Iwpd2qB3c+LqT25lxnW2SI84aABYcOxdz8StYme/fx0=" src="https://cdnjs.cloudflare.com/ajax/libs/blueimp-gallery/2.44.0/js/jquery.blueimp-gallery.min.js"></script>

Add the helper to your ApplicationController:

# ./app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  view_helper Blueimp::Gallery::ApplicationViewHelper, as: :blueimp_gallery_helper
end

Add a call to the modal_gallery helper to your layout:

app/views/layouts/application.html.erb:

<%= blueimp_gallery_helper(self).prepare_modal %>

= License

This project rocks and uses MIT-LICENSE.

FAQs

Package last updated on 27 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.