th_simple_blog 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Yjc3NTYyNDQ3YzUwMWM0OTE4ODZkZmRlODg2MmY4ZWQzMWM1MDZhOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWViNmZlNDIzMzkwN2ExNDg3MmI5NDE3MWRmN2ZlYTIyYjMyMGEwYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTMxZjkyNmYyZjQ0OGQ5MmRiMzFlMzE1OGI2NzI5MjVhODFhNDczMmZlMjM1
|
10
|
+
YjM5MmNjMTRlYmIwZjFlMzZiZjVhYjcxMDRlYmQxMzk5NGI3MDk2M2U0NmIx
|
11
|
+
N2M1MDcyMjNlNTQ5OWVjMDIyNTI0YjY3NjUyZDQ5NDg3NzdkZTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDI4NjZmYjUzZTFlNWY4MDUwZWE4MzI0YWRiYThhNmE0YmM4NDA2NTI1YzNi
|
14
|
+
ZDJkN2JjNDM5MWI2N2ViNjhmMTZlZDExMGMxMzdkNDcyYzlhYzUzNDYwNGI0
|
15
|
+
Zjg2Y2M1OWJiNTJiOWU4MjBmMGNjN2JmNGVkZmExZmU0NGIzZjg=
|
data/lib/simple_blog/version.rb
CHANGED
@@ -0,0 +1,263 @@
|
|
1
|
+
/*!
|
2
|
+
* bootstrap-lightbox.js v0.6.1
|
3
|
+
* Copyright 2013 Jason Butz
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
5
|
+
*/
|
6
|
+
!function ($) {
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
|
10
|
+
/* LIGHTBOX CLASS DEFINITION
|
11
|
+
* ========================= */
|
12
|
+
|
13
|
+
var Lightbox = function (element, options)
|
14
|
+
{
|
15
|
+
this.options = options;
|
16
|
+
this.$element = $(element)
|
17
|
+
.delegate('[data-dismiss="lightbox"]', 'click.dismiss.lightbox', $.proxy(this.hide, this));
|
18
|
+
|
19
|
+
this.options.remote && this.$element.find('.lightbox-body').load(this.options.remote);
|
20
|
+
|
21
|
+
}
|
22
|
+
|
23
|
+
// We depend upon Twitter Bootstrap's Modal library to simplify things here
|
24
|
+
Lightbox.prototype = $.extend({},$.fn.modal.Constructor.prototype);
|
25
|
+
|
26
|
+
Lightbox.prototype.constructor = Lightbox;
|
27
|
+
|
28
|
+
// We can't use Modal for this, it depends upon a class
|
29
|
+
Lightbox.prototype.enforceFocus = function ()
|
30
|
+
{
|
31
|
+
var that = this;
|
32
|
+
$(document).on('focusin.lightbox', function (e)
|
33
|
+
{
|
34
|
+
if (that.$element[0] !== e.target && !that.$element.has(e.target).length)
|
35
|
+
{
|
36
|
+
that.$element.focus();
|
37
|
+
}
|
38
|
+
});
|
39
|
+
};
|
40
|
+
|
41
|
+
// We have to have a copy of this since we are tweaking it a bit
|
42
|
+
Lightbox.prototype.show = function()
|
43
|
+
{
|
44
|
+
var that = this,
|
45
|
+
e = $.Event('show');
|
46
|
+
|
47
|
+
this.$element.trigger(e);
|
48
|
+
|
49
|
+
if (this.isShown || e.isDefaultPrevented()) return;
|
50
|
+
|
51
|
+
this.isShown = true;
|
52
|
+
|
53
|
+
|
54
|
+
this.escape();
|
55
|
+
|
56
|
+
// This bit is added since we don't display until we have the size
|
57
|
+
// which prevents image jumping
|
58
|
+
this.preloadSize(function()
|
59
|
+
{
|
60
|
+
that.backdrop(function ()
|
61
|
+
{
|
62
|
+
var transition = $.support.transition && that.$element.hasClass('fade');
|
63
|
+
|
64
|
+
if (!that.$element.parent().length)
|
65
|
+
{
|
66
|
+
that.$element.appendTo(document.body); //don't move modals dom position
|
67
|
+
}
|
68
|
+
|
69
|
+
that.$element.show();
|
70
|
+
|
71
|
+
if (transition)
|
72
|
+
{
|
73
|
+
that.$element[0].offsetWidth; // force reflow
|
74
|
+
}
|
75
|
+
|
76
|
+
that.$element
|
77
|
+
.addClass('in')
|
78
|
+
.attr('aria-hidden', false);
|
79
|
+
|
80
|
+
that.enforceFocus();
|
81
|
+
|
82
|
+
transition ?
|
83
|
+
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
|
84
|
+
that.$element.focus().trigger('shown');
|
85
|
+
});
|
86
|
+
});
|
87
|
+
};
|
88
|
+
|
89
|
+
// We have to have this because of a class in it
|
90
|
+
Lightbox.prototype.hide = function (e)
|
91
|
+
{
|
92
|
+
e && e.preventDefault();
|
93
|
+
|
94
|
+
var that = this;
|
95
|
+
|
96
|
+
e = $.Event('hide');
|
97
|
+
|
98
|
+
this.$element.trigger(e);
|
99
|
+
|
100
|
+
if (!this.isShown || e.isDefaultPrevented()) return;
|
101
|
+
|
102
|
+
this.isShown = false;
|
103
|
+
|
104
|
+
this.escape();
|
105
|
+
|
106
|
+
$(document).off('focusin.lightbox');
|
107
|
+
|
108
|
+
this.$element
|
109
|
+
.removeClass('in')
|
110
|
+
.attr('aria-hidden', true);
|
111
|
+
|
112
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
113
|
+
this.hideWithTransition() :
|
114
|
+
this.hideModal();
|
115
|
+
};
|
116
|
+
|
117
|
+
// This references a class as well
|
118
|
+
Lightbox.prototype.escape = function()
|
119
|
+
{
|
120
|
+
var that = this;
|
121
|
+
if (this.isShown && this.options.keyboard)
|
122
|
+
{
|
123
|
+
this.$element.on('keyup.dismiss.lightbox', function ( e )
|
124
|
+
{
|
125
|
+
e.which == 27 && that.hide();
|
126
|
+
});
|
127
|
+
}
|
128
|
+
else if (!this.isShown)
|
129
|
+
{
|
130
|
+
this.$element.off('keyup.dismiss.lightbox');
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
Lightbox.prototype.preloadSize = function(callback)
|
135
|
+
{
|
136
|
+
var callbacks = $.Callbacks();
|
137
|
+
if(callback) callbacks.add( callback );
|
138
|
+
var that = this;
|
139
|
+
|
140
|
+
var windowHeight,
|
141
|
+
windowWidth,
|
142
|
+
padTop,
|
143
|
+
padBottom,
|
144
|
+
padLeft,
|
145
|
+
padRight,
|
146
|
+
$image,
|
147
|
+
preloader,
|
148
|
+
originalWidth,
|
149
|
+
originalHeight;
|
150
|
+
// Get the window width and height.
|
151
|
+
windowHeight = $(window).height();
|
152
|
+
windowWidth = $(window).width();
|
153
|
+
|
154
|
+
// Get the top, bottom, right, and left padding
|
155
|
+
padTop = parseInt( that.$element.find('.lightbox-content').css('padding-top') , 10);
|
156
|
+
padBottom = parseInt( that.$element.find('.lightbox-content').css('padding-bottom') , 10);
|
157
|
+
padLeft = parseInt( that.$element.find('.lightbox-content').css('padding-left') , 10);
|
158
|
+
padRight = parseInt( that.$element.find('.lightbox-content').css('padding-right') , 10);
|
159
|
+
|
160
|
+
// Load the image, we have to do this because if the image isn't already loaded we get a bad size
|
161
|
+
$image = that.$element.find('.lightbox-content').find('img:first');
|
162
|
+
preloader = new Image();
|
163
|
+
preloader.onload = function()
|
164
|
+
{
|
165
|
+
//$image.width = preloader.width;
|
166
|
+
//$image.height = preloader.height;
|
167
|
+
//return _this.sizeContainer(preloader.width, preloader.height);
|
168
|
+
|
169
|
+
// The image could be bigger than the window, that is an issue.
|
170
|
+
if( (preloader.width + padLeft + padRight) >= windowWidth)
|
171
|
+
{
|
172
|
+
originalWidth = preloader.width;
|
173
|
+
originalHeight = preloader.height;
|
174
|
+
preloader.width = windowWidth - padLeft - padRight;
|
175
|
+
preloader.height = originalHeight / originalWidth * preloader.width;
|
176
|
+
}
|
177
|
+
|
178
|
+
if( (preloader.height + padTop + padBottom) >= windowHeight)
|
179
|
+
{
|
180
|
+
originalWidth = preloader.width;
|
181
|
+
originalHeight = preloader.height;
|
182
|
+
preloader.height = windowHeight - padTop - padBottom;
|
183
|
+
preloader.width = originalWidth / originalHeight * preloader.height;
|
184
|
+
}
|
185
|
+
|
186
|
+
that.$element.css({
|
187
|
+
'position': 'fixed',
|
188
|
+
'width': preloader.width + padLeft + padRight,
|
189
|
+
'height': preloader.height + padTop + padBottom,
|
190
|
+
'top' : (windowHeight / 2) - ( (preloader.height + padTop + padBottom) / 2),
|
191
|
+
'left' : '50%',
|
192
|
+
'margin-left' : -1 * (preloader.width + padLeft + padRight) / 2
|
193
|
+
});
|
194
|
+
that.$element.find('.lightbox-content').css({
|
195
|
+
'width': preloader.width,
|
196
|
+
'height': preloader.height
|
197
|
+
});
|
198
|
+
|
199
|
+
// We have everything sized!
|
200
|
+
callbacks.fire();
|
201
|
+
};
|
202
|
+
preloader.src = $image.attr('src');
|
203
|
+
};
|
204
|
+
|
205
|
+
/* LIGHTBOX PLUGIN DEFINITION
|
206
|
+
* ======================= */
|
207
|
+
|
208
|
+
var old = $.fn.lightbox;
|
209
|
+
|
210
|
+
$.fn.lightbox = function (option)
|
211
|
+
{
|
212
|
+
return this.each(function ()
|
213
|
+
{
|
214
|
+
var $this = $(this);
|
215
|
+
var data = $this.data('lightbox');
|
216
|
+
var options = $.extend({}, $.fn.lightbox.defaults, $this.data(), typeof option == 'object' && option);
|
217
|
+
if (!data) $this.data('lightbox', (data = new Lightbox(this, options)));
|
218
|
+
|
219
|
+
if (typeof option == 'string')
|
220
|
+
data[option]();
|
221
|
+
else if (options.show)
|
222
|
+
data.show();
|
223
|
+
});
|
224
|
+
};
|
225
|
+
|
226
|
+
$.fn.lightbox.defaults = {
|
227
|
+
backdrop: true,
|
228
|
+
keyboard: true,
|
229
|
+
show: true
|
230
|
+
};
|
231
|
+
|
232
|
+
$.fn.lightbox.Constructor = Lightbox;
|
233
|
+
|
234
|
+
/* LIGHTBOX NO CONFLICT
|
235
|
+
* ================= */
|
236
|
+
|
237
|
+
$.fn.lightbox.noConflict = function () {
|
238
|
+
$.fn.lightbox = old;
|
239
|
+
return this;
|
240
|
+
}
|
241
|
+
|
242
|
+
|
243
|
+
/* LIGHTBOX DATA-API
|
244
|
+
* ================== */
|
245
|
+
|
246
|
+
$(document).on('click.lightbox.data-api', '[data-toggle*="lightbox"]', function (e)
|
247
|
+
{
|
248
|
+
var $this = $(this);
|
249
|
+
var href = $this.attr('href');
|
250
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))); //strip for ie7
|
251
|
+
var option = $target.data('lightbox') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data());
|
252
|
+
|
253
|
+
e.preventDefault();
|
254
|
+
|
255
|
+
$target
|
256
|
+
.lightbox(option)
|
257
|
+
.one('hide', function ()
|
258
|
+
{
|
259
|
+
$this.focus();
|
260
|
+
});
|
261
|
+
})
|
262
|
+
|
263
|
+
}(window.jQuery);
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/*!
|
2
|
+
* bootstrap-lightbox.css v0.6.1
|
3
|
+
* Copyright 2013 Jason Butz
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
5
|
+
*/
|
6
|
+
.lightbox {
|
7
|
+
position: relative;
|
8
|
+
top: 70px;
|
9
|
+
z-index: 1050;
|
10
|
+
line-height: 0;
|
11
|
+
text-align: center;
|
12
|
+
background-color: transparent;
|
13
|
+
outline: none;
|
14
|
+
}
|
15
|
+
|
16
|
+
.lightbox .close {
|
17
|
+
opacity: 1;
|
18
|
+
position: absolute;
|
19
|
+
right: 0;
|
20
|
+
margin-right: -20px;
|
21
|
+
margin-top: -20px;
|
22
|
+
}
|
23
|
+
|
24
|
+
.lightbox .hide {
|
25
|
+
display: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
.lightbox .in {
|
29
|
+
display: block;
|
30
|
+
}
|
31
|
+
|
32
|
+
.lightbox-content {
|
33
|
+
display: inline-block;
|
34
|
+
padding: 10px;
|
35
|
+
background-color: #ffffff;
|
36
|
+
border: 1px solid #999;
|
37
|
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
38
|
+
*border: 1px solid #999;
|
39
|
+
/* IE6-7 */
|
40
|
+
|
41
|
+
-webkit-border-radius: 6px;
|
42
|
+
-moz-border-radius: 6px;
|
43
|
+
border-radius: 6px;
|
44
|
+
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
|
45
|
+
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
|
46
|
+
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
|
47
|
+
-webkit-background-clip: padding-box;
|
48
|
+
-moz-background-clip: padding-box;
|
49
|
+
background-clip: padding-box;
|
50
|
+
}
|
51
|
+
|
52
|
+
.lightbox-content .lightbox-caption {
|
53
|
+
position: absolute;
|
54
|
+
right: 12px;
|
55
|
+
bottom: 11px;
|
56
|
+
left: 11px;
|
57
|
+
padding: 2%;
|
58
|
+
font-size: 14px;
|
59
|
+
line-height: 18px;
|
60
|
+
color: white;
|
61
|
+
text-align: center;
|
62
|
+
text-shadow: 0 -1px 0 #000000;
|
63
|
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
64
|
+
background: #000;
|
65
|
+
background: rgba(0, 0, 0, 0.6);
|
66
|
+
}
|
67
|
+
|
68
|
+
.lightbox-header .close {
|
69
|
+
margin-top: -16px;
|
70
|
+
margin-right: -16px;
|
71
|
+
font-size: 2em;
|
72
|
+
color: white;
|
73
|
+
opacity: .8;
|
74
|
+
filter: alpha(opacity=80);
|
75
|
+
}
|
76
|
+
|
77
|
+
.lightbox-header .close :hover {
|
78
|
+
opacity: .4;
|
79
|
+
filter: alpha(opacity=40);
|
80
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: th_simple_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toby hinloopen
|
@@ -66,6 +66,8 @@ files:
|
|
66
66
|
- lib/simple_blog/version.rb
|
67
67
|
- lib/simple_blog.rb
|
68
68
|
- lib/tasks/simple_blog_tasks.rake
|
69
|
+
- vendor/assets/javascripts/bootstrap-lightbox.js
|
70
|
+
- vendor/assets/stylesheets/bootstrap-lightbox.css
|
69
71
|
- MIT-LICENSE
|
70
72
|
- Rakefile
|
71
73
|
- README.rdoc
|