From fe1efec758193bb9f941eeb0963a48f1f31a4675 Mon Sep 17 00:00:00 2001 From: Gray Manley Date: Sun, 7 Oct 2012 19:02:31 -0500 Subject: [PATCH] Update bootstrap libraries. --- Gemfile | 2 +- Gemfile.lock | 9 +++++-- app/controllers/albums_controller.rb | 2 +- .../javascripts/bootstrap-image-gallery.js | 26 ++++++++++++------- ...y.css => bootstrap-image-gallery.css.scss} | 17 +++++++----- .../stylesheets/bootstrap-variables.css.scss | 2 ++ 6 files changed, 39 insertions(+), 19 deletions(-) rename vendor/assets/stylesheets/{bootstrap-image-gallery.css => bootstrap-image-gallery.css.scss} (91%) diff --git a/Gemfile b/Gemfile index 7a5d760..a609ef0 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'coffeebeans' group :assets do gem 'sass-rails', '~> 3.2' - gem 'bootstrap-sass', '~> 2.1.0.0' + gem 'bootstrap-sass', git: 'git://github.com/wndxlori/bootstrap-sass.git' gem 'coffee-rails', '~> 3.2' gem 'uglifier' gem 'haml_coffee_assets' diff --git a/Gemfile.lock b/Gemfile.lock index df2e1c3..3160b26 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,6 +24,12 @@ GIT mongoid (~> 3.0.0) mongoid-grid_fs (~> 1.3.1) +GIT + remote: git://github.com/wndxlori/bootstrap-sass.git + revision: 2803b00c1ddf2c981624eac9998c26d7347232c2 + specs: + bootstrap-sass (2.1.0.0) + GEM remote: http://rubygems.org/ specs: @@ -50,7 +56,6 @@ GEM archive-zip (0.5.0) io-like (>= 0.3.0) bcrypt-ruby (3.0.1) - bootstrap-sass (2.1.0.0) builder (3.0.3) cancan (1.6.8) capybara (1.1.2) @@ -282,7 +287,7 @@ DEPENDENCIES actionmailer actionpack (~> 3.2) archive-zip - bootstrap-sass (~> 2.1.0.0) + bootstrap-sass! cancan capybara carrierwave diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index b381948..0436c42 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -11,7 +11,7 @@ def index def show @album = Album.find_by_slug!(params[:id]) @children = @album.children.accessible_by(current_ability).cache - @images = @album.images.page(params[:page]).per(100) + @images = @album.images.page(params[:page]) authorize!(:show, @album) respond_with(@album) diff --git a/vendor/assets/javascripts/bootstrap-image-gallery.js b/vendor/assets/javascripts/bootstrap-image-gallery.js index 160194d..ee70de4 100644 --- a/vendor/assets/javascripts/bootstrap-image-gallery.js +++ b/vendor/assets/javascripts/bootstrap-image-gallery.js @@ -1,5 +1,5 @@ /* - * Bootstrap Image Gallery 2.8 + * Bootstrap Image Gallery 2.8.1 * https://github.com/blueimp/Bootstrap-Image-Gallery * * Copyright 2011, Sebastian Tschan @@ -167,17 +167,21 @@ height: img.height }); modal.find('.modal-title').css({ width: Math.max(img.width, 380) }); - if ($(window).width() > 480) { - if (transition) { - clone = modal.clone().hide().appendTo(document.body); - } + if (transition) { + clone = modal.clone().hide().appendTo(document.body); + } + if ($(window).width() > 767) { method.call(modal.stop(), { 'margin-top': -((clone || modal).outerHeight() / 2), 'margin-left': -((clone || modal).outerWidth() / 2) }); - if (clone) { - clone.remove(); - } + } else { + modal.css({ + top: ($(window).height() - (clone || modal).outerHeight()) / 2 + }); + } + if (clone) { + clone.remove(); } modalImage.append(img); forceReflow = img.offsetWidth; @@ -326,11 +330,15 @@ canvas: options.canvas }; } - if (windowWidth > 480) { + if (windowWidth > 767) { modal.css({ 'margin-top': -(modal.outerHeight() / 2), 'margin-left': -(modal.outerWidth() / 2) }); + } else { + modal.css({ + top: ($(window).height() - modal.outerHeight()) / 2 + }); } this.initGalleryEvents(); this.initLinks(); diff --git a/vendor/assets/stylesheets/bootstrap-image-gallery.css b/vendor/assets/stylesheets/bootstrap-image-gallery.css.scss similarity index 91% rename from vendor/assets/stylesheets/bootstrap-image-gallery.css rename to vendor/assets/stylesheets/bootstrap-image-gallery.css.scss index 6450576..dced06d 100644 --- a/vendor/assets/stylesheets/bootstrap-image-gallery.css +++ b/vendor/assets/stylesheets/bootstrap-image-gallery.css.scss @@ -1,6 +1,6 @@ @charset 'UTF-8'; /* - * Bootstrap Image Gallery CSS 2.5 + * Bootstrap Image Gallery CSS 2.5.2 * https://github.com/blueimp/Bootstrap-Image-Gallery * * Copyright 2011, Sebastian Tschan @@ -13,6 +13,7 @@ .modal-gallery { width: auto; max-height: none; + outline: none; } .modal-gallery .modal-body { max-height: none; @@ -32,7 +33,7 @@ } .modal-gallery .modal-image:hover:before, .modal-gallery .modal-image:hover:after { - content: '‹'; + content: '\2039'; position: absolute; top: 50%; left: 15px; @@ -54,7 +55,7 @@ z-index: 1; } .modal-gallery .modal-image:hover:after { - content: '›'; + content: '\203A'; left: auto; right: 15px; } @@ -63,7 +64,7 @@ display: none; } .modal-loading .modal-image { - background: url(/assets/loading.gif) center no-repeat; + background: image-url('loading.gif') center no-repeat; } .modal-gallery.fade .modal-image { -webkit-transition: width 0.15s ease, height 0.15s ease; @@ -127,15 +128,19 @@ .modal-fullscreen .close, .modal-fullscreen .modal-title { color: #fff; - text-shadow: 0 0 2px rgba(33, 33, 33, 0.8); + text-shadow: 0 0 2px rgba(33, 33, 33, 0.8); } .modal-fullscreen .modal-header:hover, .modal-fullscreen .modal-footer:hover { opacity: 1; } -@media (max-width: 480px) { +@media (max-width: 767px) { .modal-gallery .btn span { display: none; } + .modal-fullscreen { + right: 0; + left: 0; + } } diff --git a/vendor/assets/stylesheets/bootstrap-variables.css.scss b/vendor/assets/stylesheets/bootstrap-variables.css.scss index a35b873..5c5c4d0 100644 --- a/vendor/assets/stylesheets/bootstrap-variables.css.scss +++ b/vendor/assets/stylesheets/bootstrap-variables.css.scss @@ -2,3 +2,5 @@ $baseFontSize: 13px; $baseLineHeight: 18px; $navbarInverseBackground: #222; $navbarInverseBackgroundHighlight: #333; +$iconSpritePath: image-path('glyphicons-halflings.png'); +$iconWhiteSpritePath: image-path('glyphicons-halflings-white.png');