bootstrap-addons-rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/Gemfile +5 -3
- data/README.md +1 -1
- data/VERSION +1 -1
- data/bootstrap-addons-rails.gemspec +4 -3
- data/vendor/assets/javascripts/bootstrap/image-gallery.js +23 -11
- data/vendor/assets/javascripts/bootstrap/image-gallery.min.js +1 -1
- data/vendor/assets/stylesheets/bootstrap/image-gallery.css +11 -3
- data/vendor/assets/stylesheets/bootstrap/image-gallery.min.css +4 -3
- metadata +5 -4
data/CHANGELOG
ADDED
data/Gemfile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gem 'rails'
|
4
4
|
|
5
5
|
# Add dependencies to develop your gem here.
|
6
6
|
# Include everything needed to run rake, tests, features, etc.
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
gem "rspec", ">= 2.8.0", group: [:test, :development]
|
9
|
+
|
10
|
+
group :development do
|
9
11
|
gem "rdoc", ">= 3.12"
|
10
12
|
gem "bundler", ">= 1.0.0"
|
11
13
|
gem "jeweler", ">= 1.8.3"
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bootstrap-addons-rails"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-03-15"
|
13
13
|
s.description = "Adds nice Bootstrap addons to your Rails Twitter Bootstrap based app"
|
14
14
|
s.email = "kmandrup@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".rspec",
|
22
|
+
"CHANGELOG",
|
22
23
|
"Gemfile",
|
23
24
|
"Gemfile.lock",
|
24
25
|
"LICENSE.txt",
|
@@ -53,7 +54,7 @@ Gem::Specification.new do |s|
|
|
53
54
|
s.homepage = "http://github.com/kristianmandrup/bootstrap-addons-rails"
|
54
55
|
s.licenses = ["MIT"]
|
55
56
|
s.require_paths = ["lib"]
|
56
|
-
s.rubygems_version = "1.8.
|
57
|
+
s.rubygems_version = "1.8.25"
|
57
58
|
s.summary = "Twitter Bootstrap addons: Color- and Datepicker, Image gallery, ready for use with Rails asset pipeline"
|
58
59
|
|
59
60
|
if s.respond_to? :specification_version then
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Bootstrap Image Gallery 2.
|
2
|
+
* Bootstrap Image Gallery 2.10
|
3
3
|
* https://github.com/blueimp/Bootstrap-Image-Gallery
|
4
4
|
*
|
5
5
|
* Copyright 2011, Sebastian Tschan
|
@@ -80,6 +80,9 @@
|
|
80
80
|
getUrl: function (element) {
|
81
81
|
return element.href || $(element).data('href');
|
82
82
|
},
|
83
|
+
getDownloadUrl: function (element) {
|
84
|
+
return $(element).data('download');
|
85
|
+
},
|
83
86
|
startSlideShow: function () {
|
84
87
|
var $this = this;
|
85
88
|
if (this.options.slideshow) {
|
@@ -122,6 +125,7 @@
|
|
122
125
|
modal = this.$element,
|
123
126
|
index = this.options.index,
|
124
127
|
url = this.getUrl(this.$links[index]),
|
128
|
+
download = this.getDownloadUrl(this.$links[index]),
|
125
129
|
oldImg;
|
126
130
|
this.abortLoad();
|
127
131
|
this.stopSlideShow();
|
@@ -139,7 +143,7 @@
|
|
139
143
|
modal.find('.modal-title').text(this.$links[index].title);
|
140
144
|
modal.find('.modal-download').prop(
|
141
145
|
'href',
|
142
|
-
url
|
146
|
+
download || url
|
143
147
|
);
|
144
148
|
this._loadingImage = loadImage(
|
145
149
|
url,
|
@@ -167,17 +171,21 @@
|
|
167
171
|
height: img.height
|
168
172
|
});
|
169
173
|
modal.find('.modal-title').css({ width: Math.max(img.width, 380) });
|
170
|
-
if (
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
+
if (transition) {
|
175
|
+
clone = modal.clone().hide().appendTo(document.body);
|
176
|
+
}
|
177
|
+
if ($(window).width() > 767) {
|
174
178
|
method.call(modal.stop(), {
|
175
179
|
'margin-top': -((clone || modal).outerHeight() / 2),
|
176
180
|
'margin-left': -((clone || modal).outerWidth() / 2)
|
177
181
|
});
|
178
|
-
|
179
|
-
|
180
|
-
|
182
|
+
} else {
|
183
|
+
modal.css({
|
184
|
+
top: ($(window).height() - (clone || modal).outerHeight()) / 2
|
185
|
+
});
|
186
|
+
}
|
187
|
+
if (clone) {
|
188
|
+
clone.remove();
|
181
189
|
}
|
182
190
|
modalImage.append(img);
|
183
191
|
forceReflow = img.offsetWidth;
|
@@ -326,11 +334,15 @@
|
|
326
334
|
canvas: options.canvas
|
327
335
|
};
|
328
336
|
}
|
329
|
-
if (windowWidth >
|
337
|
+
if (windowWidth > 767) {
|
330
338
|
modal.css({
|
331
339
|
'margin-top': -(modal.outerHeight() / 2),
|
332
340
|
'margin-left': -(modal.outerWidth() / 2)
|
333
341
|
});
|
342
|
+
} else {
|
343
|
+
modal.css({
|
344
|
+
top: ($(window).height() - modal.outerHeight()) / 2
|
345
|
+
});
|
334
346
|
}
|
335
347
|
this.initGalleryEvents();
|
336
348
|
this.initLinks();
|
@@ -369,7 +381,7 @@
|
|
369
381
|
options = $.extend(modal.data(), options);
|
370
382
|
}
|
371
383
|
if (!options.selector) {
|
372
|
-
options.selector = 'a[
|
384
|
+
options.selector = 'a[data-gallery=gallery]';
|
373
385
|
}
|
374
386
|
link = $(e.target).closest(options.selector);
|
375
387
|
if (link.length && modal.length) {
|
@@ -1 +1 @@
|
|
1
|
-
(function(a){"use strict",typeof define=="function"&&define.amd?define(["jquery","load-image","bootstrap"],a):a(window.jQuery,window.loadImage)})(function(a,b){"use strict",a.extend(a.fn.modal.defaults,{delegate:document,selector:null,filter:"*",index:0,href:null,preloadRange:2,offsetWidth:100,offsetHeight:200,canvas:!1,slideshow:0,imageClickDivision:.5});var c=a.fn.modal.Constructor.prototype.show,d=a.fn.modal.Constructor.prototype.hide;a.extend(a.fn.modal.Constructor.prototype,{initLinks:function(){var b=this,c=this.options,d=c.selector||"a[data-target="+c.target+"]";this.$links=a(c.delegate).find(d).filter(c.filter).each(function(a){b.getUrl(this)===c.href&&(c.index=a)}),this.$links[c.index]||(c.index=0)},getUrl:function(b){return b.href||a(b).data("href")},startSlideShow:function(){var a=this;this.options.slideshow&&(this._slideShow=window.setTimeout(function(){a.next()},this.options.slideshow))},stopSlideShow:function(){window.clearTimeout(this._slideShow)},toggleSlideShow:function(){var a=this.$element.find(".modal-slideshow");this.options.slideshow?(this.options.slideshow=0,this.stopSlideShow()):(this.options.slideshow=a.data("slideshow")||5e3,this.startSlideShow()),a.find("i").toggleClass("icon-play icon-pause")},preloadImages:function(){var b=this.options,c=b.index+b.preloadRange+1,d,e;for(e=b.index-b.preloadRange;e<c;e+=1)d=this.$links[e],d&&e!==b.index&&a("<img>").prop("src",this.getUrl(d))},loadImage:function(){var a=this,c=this.$element,d=this.options.index,e=this.getUrl(this.$links[d]),f;this.abortLoad(),this.stopSlideShow(),c.trigger("beforeLoad"),this._loadingTimeout=window.setTimeout(function(){c.addClass("modal-loading")},100),
|
1
|
+
(function(a){"use strict",typeof define=="function"&&define.amd?define(["jquery","load-image","bootstrap"],a):a(window.jQuery,window.loadImage)})(function(a,b){"use strict",a.extend(a.fn.modal.defaults,{delegate:document,selector:null,filter:"*",index:0,href:null,preloadRange:2,offsetWidth:100,offsetHeight:200,canvas:!1,slideshow:0,imageClickDivision:.5});var c=a.fn.modal.Constructor.prototype.show,d=a.fn.modal.Constructor.prototype.hide;a.extend(a.fn.modal.Constructor.prototype,{initLinks:function(){var b=this,c=this.options,d=c.selector||"a[data-target="+c.target+"]";this.$links=a(c.delegate).find(d).filter(c.filter).each(function(a){b.getUrl(this)===c.href&&(c.index=a)}),this.$links[c.index]||(c.index=0)},getUrl:function(b){return b.href||a(b).data("href")},getDownloadUrl:function(b){return a(b).data("download")},startSlideShow:function(){var a=this;this.options.slideshow&&(this._slideShow=window.setTimeout(function(){a.next()},this.options.slideshow))},stopSlideShow:function(){window.clearTimeout(this._slideShow)},toggleSlideShow:function(){var a=this.$element.find(".modal-slideshow");this.options.slideshow?(this.options.slideshow=0,this.stopSlideShow()):(this.options.slideshow=a.data("slideshow")||5e3,this.startSlideShow()),a.find("i").toggleClass("icon-play icon-pause")},preloadImages:function(){var b=this.options,c=b.index+b.preloadRange+1,d,e;for(e=b.index-b.preloadRange;e<c;e+=1)d=this.$links[e],d&&e!==b.index&&a("<img>").prop("src",this.getUrl(d))},loadImage:function(){var a=this,c=this.$element,d=this.options.index,e=this.getUrl(this.$links[d]),f=this.getDownloadUrl(this.$links[d]),g;this.abortLoad(),this.stopSlideShow(),c.trigger("beforeLoad"),this._loadingTimeout=window.setTimeout(function(){c.addClass("modal-loading")},100),g=c.find(".modal-image").children().removeClass("in"),window.setTimeout(function(){g.remove()},3e3),c.find(".modal-title").text(this.$links[d].title),c.find(".modal-download").prop("href",f||e),this._loadingImage=b(e,function(b){a.img=b,window.clearTimeout(a._loadingTimeout),c.removeClass("modal-loading"),c.trigger("load"),a.showImage(b),a.startSlideShow()},this._loadImageOptions),this.preloadImages()},showImage:function(b){var c=this.$element,d=a.support.transition&&c.hasClass("fade"),e=d?c.animate:c.css,f=c.find(".modal-image"),g,h;f.css({width:b.width,height:b.height}),c.find(".modal-title").css({width:Math.max(b.width,380)}),d&&(g=c.clone().hide().appendTo(document.body)),a(window).width()>767?e.call(c.stop(),{"margin-top":-((g||c).outerHeight()/2),"margin-left":-((g||c).outerWidth()/2)}):c.css({top:(a(window).height()-(g||c).outerHeight())/2}),g&&g.remove(),f.append(b),h=b.offsetWidth,c.trigger("display"),d?c.is(":visible")?a(b).on(a.support.transition.end,function(d){d.target===b&&(a(b).off(a.support.transition.end),c.trigger("displayed"))}).addClass("in"):(a(b).addClass("in"),c.one("shown",function(){c.trigger("displayed")})):(a(b).addClass("in"),c.trigger("displayed"))},abortLoad:function(){this._loadingImage&&(this._loadingImage.onload=this._loadingImage.onerror=null),window.clearTimeout(this._loadingTimeout)},prev:function(){var a=this.options;a.index-=1,a.index<0&&(a.index=this.$links.length-1),this.loadImage()},next:function(){var a=this.options;a.index+=1,a.index>this.$links.length-1&&(a.index=0),this.loadImage()},keyHandler:function(a){switch(a.which){case 37:case 38:a.preventDefault(),this.prev();break;case 39:case 40:a.preventDefault(),this.next()}},wheelHandler:function(a){a.preventDefault(),a=a.originalEvent,this._wheelCounter=this._wheelCounter||0,this._wheelCounter+=a.wheelDelta||a.detail||0;if(a.wheelDelta&&this._wheelCounter>=120||!a.wheelDelta&&this._wheelCounter<0)this.prev(),this._wheelCounter=0;else if(a.wheelDelta&&this._wheelCounter<=-120||!a.wheelDelta&&this._wheelCounter>0)this.next(),this._wheelCounter=0},initGalleryEvents:function(){var b=this,c=this.$element;c.find(".modal-image").on("click.modal-gallery",function(c){var d=a(this);b.$links.length===1?b.hide():(c.pageX-d.offset().left)/d.width()<b.options.imageClickDivision?b.prev(c):b.next(c)}),c.find(".modal-prev").on("click.modal-gallery",function(a){b.prev(a)}),c.find(".modal-next").on("click.modal-gallery",function(a){b.next(a)}),c.find(".modal-slideshow").on("click.modal-gallery",function(a){b.toggleSlideShow(a)}),a(document).on("keydown.modal-gallery",function(a){b.keyHandler(a)}).on("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery",function(a){b.wheelHandler(a)})},destroyGalleryEvents:function(){var b=this.$element;this.abortLoad(),this.stopSlideShow(),b.find(".modal-image, .modal-prev, .modal-next, .modal-slideshow").off("click.modal-gallery"),a(document).off("keydown.modal-gallery").off("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery")},show:function(){if(!this.isShown&&this.$element.hasClass("modal-gallery")){var b=this.$element,d=this.options,e=a(window).width(),f=a(window).height();b.hasClass("modal-fullscreen")?(this._loadImageOptions={maxWidth:e,maxHeight:f,canvas:d.canvas},b.hasClass("modal-fullscreen-stretch")&&(this._loadImageOptions.minWidth=e,this._loadImageOptions.minHeight=f)):this._loadImageOptions={maxWidth:e-d.offsetWidth,maxHeight:f-d.offsetHeight,canvas:d.canvas},e>767?b.css({"margin-top":-(b.outerHeight()/2),"margin-left":-(b.outerWidth()/2)}):b.css({top:(a(window).height()-b.outerHeight())/2}),this.initGalleryEvents(),this.initLinks(),this.$links.length&&(b.find(".modal-slideshow, .modal-prev, .modal-next").toggle(this.$links.length!==1),b.toggleClass("modal-single",this.$links.length===1),this.loadImage())}c.apply(this,arguments)},hide:function(){this.isShown&&this.$element.hasClass("modal-gallery")&&(this.options.delegate=document,this.options.href=null,this.destroyGalleryEvents()),d.apply(this,arguments)}}),a(function(){a(document.body).on("click.modal-gallery.data-api",'[data-toggle="modal-gallery"]',function(b){var c=a(this),d=c.data(),e=a(d.target),f=e.data("modal"),g;f||(d=a.extend(e.data(),d)),d.selector||(d.selector="a[data-gallery=gallery]"),g=a(b.target).closest(d.selector),g.length&&e.length&&(b.preventDefault(),d.href=g.prop("href")||g.data("href"),d.delegate=g[0]!==this?this:document,f&&a.extend(f.options,d),e.modal(d))})})});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@charset 'UTF-8';
|
2
2
|
/*
|
3
|
-
* Bootstrap Image Gallery CSS 2.5
|
3
|
+
* Bootstrap Image Gallery CSS 2.5.3
|
4
4
|
* https://github.com/blueimp/Bootstrap-Image-Gallery
|
5
5
|
*
|
6
6
|
* Copyright 2011, Sebastian Tschan
|
@@ -13,6 +13,10 @@
|
|
13
13
|
.modal-gallery {
|
14
14
|
width: auto;
|
15
15
|
max-height: none;
|
16
|
+
outline: none;
|
17
|
+
}
|
18
|
+
.modal-gallery.fade.in {
|
19
|
+
top: 50%;
|
16
20
|
}
|
17
21
|
.modal-gallery .modal-body {
|
18
22
|
max-height: none;
|
@@ -63,7 +67,7 @@
|
|
63
67
|
display: none;
|
64
68
|
}
|
65
69
|
.modal-loading .modal-image {
|
66
|
-
background: url(/
|
70
|
+
background: url(../img/loading.gif) center no-repeat;
|
67
71
|
}
|
68
72
|
.modal-gallery.fade .modal-image {
|
69
73
|
-webkit-transition: width 0.15s ease, height 0.15s ease;
|
@@ -134,8 +138,12 @@
|
|
134
138
|
opacity: 1;
|
135
139
|
}
|
136
140
|
|
137
|
-
@media (max-width:
|
141
|
+
@media (max-width: 767px) {
|
138
142
|
.modal-gallery .btn span {
|
139
143
|
display: none;
|
140
144
|
}
|
145
|
+
.modal-fullscreen {
|
146
|
+
right: 0;
|
147
|
+
left: 0;
|
148
|
+
}
|
141
149
|
}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
@charset 'UTF-8';
|
2
|
-
.modal-gallery{width:auto;max-height:none;}
|
2
|
+
.modal-gallery{width:auto;max-height:none;outline:none;}
|
3
|
+
.modal-gallery.fade.in{top:50%;}
|
3
4
|
.modal-gallery .modal-body{max-height:none;}
|
4
5
|
.modal-gallery .modal-title{display:inline-block;max-height:54px;overflow:hidden;}
|
5
6
|
.modal-gallery .modal-image{position:relative;margin:auto;min-width:128px;min-height:128px;overflow:hidden;cursor:pointer;}
|
6
7
|
.modal-gallery .modal-image:hover:before,.modal-gallery .modal-image:hover:after{content:'\2039';position:absolute;top:50%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);z-index:1;}
|
7
8
|
.modal-gallery .modal-image:hover:after{content:'\203A';left:auto;right:15px;}
|
8
9
|
.modal-single .modal-image:hover:before,.modal-single .modal-image:hover:after{display:none;}
|
9
|
-
.modal-loading .modal-image{background:url(/
|
10
|
+
.modal-loading .modal-image{background:url(../img/loading.gif) center no-repeat;}
|
10
11
|
.modal-gallery.fade .modal-image{-webkit-transition:width 0.15s ease, height 0.15s ease;-moz-transition:width 0.15s ease, height 0.15s ease;-ms-transition:width 0.15s ease, height 0.15s ease;-o-transition:width 0.15s ease, height 0.15s ease;transition:width 0.15s ease, height 0.15s ease;}
|
11
12
|
.modal-gallery .modal-image *{position:absolute;top:0;opacity:0;filter:alpha(opacity=0);}
|
12
13
|
.modal-gallery.fade .modal-image *{-webkit-transition:opacity 0.5s linear;-moz-transition:opacity 0.5s linear;-ms-transition:opacity 0.5s linear;-o-transition:opacity 0.5s linear;transition:opacity 0.5s linear;}
|
@@ -18,4 +19,4 @@
|
|
18
19
|
.modal-fullscreen .modal-footer{top:auto;bottom:0;}
|
19
20
|
.modal-fullscreen .close,.modal-fullscreen .modal-title{color:#fff;text-shadow:0 0 2px rgba(33, 33, 33, 0.8);}
|
20
21
|
.modal-fullscreen .modal-header:hover,.modal-fullscreen .modal-footer:hover{opacity:1;}
|
21
|
-
@media (max-width:
|
22
|
+
@media (max-width:767px){.modal-gallery .btn span{display:none;} .modal-fullscreen{right:0;left:0;}}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-addons-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -117,6 +117,7 @@ extra_rdoc_files:
|
|
117
117
|
files:
|
118
118
|
- .document
|
119
119
|
- .rspec
|
120
|
+
- CHANGELOG
|
120
121
|
- Gemfile
|
121
122
|
- Gemfile.lock
|
122
123
|
- LICENSE.txt
|
@@ -162,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
163
|
version: '0'
|
163
164
|
segments:
|
164
165
|
- 0
|
165
|
-
hash: -
|
166
|
+
hash: -3817559982387885486
|
166
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
168
|
none: false
|
168
169
|
requirements:
|
@@ -171,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
172
|
version: '0'
|
172
173
|
requirements: []
|
173
174
|
rubyforge_project:
|
174
|
-
rubygems_version: 1.8.
|
175
|
+
rubygems_version: 1.8.25
|
175
176
|
signing_key:
|
176
177
|
specification_version: 3
|
177
178
|
summary: ! 'Twitter Bootstrap addons: Color- and Datepicker, Image gallery, ready
|